MiniDevil
As beautiful as a shell
UI main loop: draws interface, reads input, handles resize. More...
#include "minishell_ui.h"
Include dependency graph for ui_main.c:UI main loop: draws interface, reads input, handles resize.
Definition in file ui_main.c.
Functions | |
| static void | init_ui (t_shell *shell) |
| Allocate and initialize the t_ui struct and attach it to shell. More... | |
| static void | check_resize (t_shell *shell) |
| Handle a SIGWINCH signal (get new terminal dimensions and redraw) More... | |
| static void | ui_loop (t_shell *shell) |
| Run the main loop. More... | |
| void | run_ui_mode (t_shell *shell) |
| Entry point for UI mode. More... | |
|
static |
Allocate and initialize the t_ui struct and attach it to shell.
Calls init_term and setup_ui_signals after allocation
| shell | Shell state (receives the new UI pointer) |
Definition at line 23 of file ui_main.c.
References init_term(), t_ui::running, setup_ui_signals(), and t_shell::ui.
Referenced by run_ui_mode().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Handle a SIGWINCH signal (get new terminal dimensions and redraw)
| shell | Shell state |
Definition at line 44 of file ui_main.c.
References draw_ui(), g_signal, get_term_size(), and t_shell::ui.
Referenced by ui_loop().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Run the main loop.
| shell | Shell state |
Definition at line 63 of file ui_main.c.
References add_welcome_msg(), check_resize(), CURSOR_HIDE, draw_ui(), draw_welcome(), ft_msleep(), handle_key(), KEY_DOWN, KEY_ENTER, KEY_UP, read_key(), redraw_cmd_only(), and t_shell::ui.
Referenced by run_ui_mode().
Here is the call graph for this function:
Here is the caller graph for this function:| void run_ui_mode | ( | t_shell * | shell | ) |
Entry point for UI mode.
Return silently if shell is NULL, not a tty or terminal is too small
| shell | Shell state |
Definition at line 91 of file ui_main.c.
References cleanup_term(), init_ui(), MIN_HEIGHT, MIN_WIDTH, print_goodbye(), t_shell::ui, ui_loop(), and t_shell::ui_mode.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function: