MiniDevil
As beautiful as a shell
Welcome screen structures & prototypes. More...
#include "minishell_ui.h"
Include dependency graph for welcome_ui.h:
This graph shows which files directly or indirectly include this file:Welcome screen structures & prototypes.
Definition in file welcome_ui.h.
Macros | |
| #define | HIDE_CURSOR "\033[?25l" |
| #define | SHOW_CURSOR "\033[?25h" |
| #define | C_AURA1 "\033[38;5;52m" |
| #define | C_AURA2 "\033[38;5;88m" |
| #define | C_AURA3 "\033[38;5;124m" |
| #define | C_AURA4 "\033[38;5;160m" |
| #define | C_AURA5 "\033[38;5;196m" |
| #define | C_M1 "\033[38;5;196m" |
| #define | C_M2 "\033[38;5;202m" |
| #define | C_M3 "\033[38;5;208m" |
| #define | C_M4 "\033[38;5;214m" |
| #define | C_M5 "\033[38;5;220m" |
| #define | DEMON_WIDTH 60 |
| #define | DEMON_HEIGHT 16 |
| #define | DEMON_LINES 16 |
Functions | |
| void | draw_welcome (void) |
| Draw complete welcome animation sequence and clean up. More... | |
| void | animate_title (t_welcome_term *t) |
| Animate the title appearing character by character. More... | |
| void | animate_quote (t_welcome_term *t) |
| Draw the quote inside a decorative box. More... | |
| void | animate_credits (t_welcome_term *t) |
| Print the credits line centered on the screen. More... | |
| void | animate_loading (t_welcome_term *t) |
| Animate a progress bar. More... | |
| void | animate_demon (t_welcome_term *t) |
| Animate the Demon art with 100ms delay. More... | |
| void | flash_demon_eyes (t_welcome_term *t) |
| Animate the demon's eyes blinking. More... | |
| const char * | get_demon_art_line (int line) |
| Return 1 line of the ASCII Demon art by index. More... | |
| void | get_welcome_term_size (t_welcome_term *t) |
| Get the terminal size and calculate centre coordinates. More... | |
| void | print_at_pos (int row, int col, const char *str) |
| Move the terminal cursor to [row, col] and print str. More... | |
| void | print_centered (t_welcome_term *t, int row, const char *str, int len) |
| Print string centered on the given row. More... | |
| #define HIDE_CURSOR "\033[?25l" |
Definition at line 24 of file welcome_ui.h.
| #define SHOW_CURSOR "\033[?25h" |
Definition at line 25 of file welcome_ui.h.
| #define C_AURA1 "\033[38;5;52m" |
Definition at line 28 of file welcome_ui.h.
| #define C_AURA2 "\033[38;5;88m" |
Definition at line 29 of file welcome_ui.h.
| #define C_AURA3 "\033[38;5;124m" |
Definition at line 30 of file welcome_ui.h.
| #define C_AURA4 "\033[38;5;160m" |
Definition at line 31 of file welcome_ui.h.
| #define C_AURA5 "\033[38;5;196m" |
Definition at line 32 of file welcome_ui.h.
| #define C_M1 "\033[38;5;196m" |
Definition at line 35 of file welcome_ui.h.
| #define C_M2 "\033[38;5;202m" |
Definition at line 36 of file welcome_ui.h.
| #define C_M3 "\033[38;5;208m" |
Definition at line 37 of file welcome_ui.h.
| #define C_M4 "\033[38;5;214m" |
Definition at line 38 of file welcome_ui.h.
| #define C_M5 "\033[38;5;220m" |
Definition at line 39 of file welcome_ui.h.
| #define DEMON_WIDTH 60 |
Definition at line 60 of file welcome_ui.h.
| #define DEMON_HEIGHT 16 |
Definition at line 61 of file welcome_ui.h.
| #define DEMON_LINES 16 |
Definition at line 62 of file welcome_ui.h.
| void draw_welcome | ( | void | ) |
Draw complete welcome animation sequence and clean up.
Definition at line 68 of file welcome.c.
References animate_credits(), animate_demon(), animate_loading(), animate_quote(), animate_title(), cleanup_screen(), draw_border_effect(), flash_demon_eyes(), ft_msleep(), get_welcome_term_size(), and init_screen().
Referenced by ui_loop().
Here is the call graph for this function:
Here is the caller graph for this function:| void animate_title | ( | t_welcome_term * | t | ) |
Animate the title appearing character by character.
| t | Terminal dimensions |
Definition at line 33 of file welcome_effects.c.
References C_AURA3, C_AURA5, t_welcome_term::center_y, ft_msleep(), print_at_pos(), print_mystic_char(), RESET, and t_welcome_term::width.
Referenced by draw_welcome().
Here is the call graph for this function:
Here is the caller graph for this function:| void animate_quote | ( | t_welcome_term * | t | ) |
Draw the quote inside a decorative box.
| t | Terminal dimensions (to center the box) |
Definition at line 92 of file welcome_effects.c.
References C_AURA3, t_welcome_term::center_y, ft_msleep(), print_centered(), print_quote_lines(), and RESET.
Referenced by draw_welcome().
Here is the call graph for this function:
Here is the caller graph for this function:| void animate_credits | ( | t_welcome_term * | t | ) |
Print the credits line centered on the screen.
| t | Terminal dimensions |
Definition at line 20 of file welcome_loading.c.
References C_AURA4, C_M3, t_welcome_term::center_y, DIM, print_at_pos(), print_centered(), RESET, and t_welcome_term::width.
Referenced by draw_welcome().
Here is the call graph for this function:
Here is the caller graph for this function:| void animate_loading | ( | t_welcome_term * | t | ) |
Animate a progress bar.
| t | Terminal dimensions |
Definition at line 37 of file welcome_loading.c.
References C_AURA2, C_M3, t_welcome_term::center_y, ft_msleep(), print_at_pos(), print_centered(), RESET, and t_welcome_term::width.
Referenced by draw_welcome().
Here is the call graph for this function:
Here is the caller graph for this function:| void animate_demon | ( | t_welcome_term * | t | ) |
Animate the Demon art with 100ms delay.
| t | Terminal dimensions for centering and row calculations |
Definition at line 99 of file welcome_demon.c.
References t_welcome_term::center_y, DEMON_LINES, ft_msleep(), and print_demon_line().
Referenced by draw_welcome().
Here is the call graph for this function:
Here is the caller graph for this function:| void flash_demon_eyes | ( | t_welcome_term * | t | ) |
Animate the demon's eyes blinking.
| t | Terminal dimensions to calculate the eye positions |
Definition at line 118 of file welcome_demon.c.
References BOLD, C_M1, C_M5, t_welcome_term::center_y, DEMON_WIDTH, ft_msleep(), print_at_pos(), RESET, and t_welcome_term::width.
Referenced by draw_welcome().
Here is the call graph for this function:
Here is the caller graph for this function:| const char* get_demon_art_line | ( | int | line | ) |
Return 1 line of the ASCII Demon art by index.
| line | Line index (0 to DEMON_LINES - 1) |
Definition at line 21 of file welcome_demon.c.
References DEMON_LINES.
Referenced by print_demon_line().
Here is the caller graph for this function:| void get_welcome_term_size | ( | t_welcome_term * | t | ) |
Get the terminal size and calculate centre coordinates.
Falls back to 80x24 if ioctl fails
| t | Welcome terminal structure to fill |
Definition at line 52 of file welcome_utils.c.
References t_welcome_term::center_x, t_welcome_term::center_y, t_welcome_term::height, and t_welcome_term::width.
Referenced by draw_welcome().
Here is the caller graph for this function:| void print_at_pos | ( | int | row, |
| int | col, | ||
| const char * | str | ||
| ) |
Move the terminal cursor to [row, col] and print str.
| row | Target row (starting at 1) |
| col | Target column (starting at 1) |
| str | String to print at the given position |
Definition at line 77 of file welcome_utils.c.
Referenced by animate_credits(), animate_loading(), animate_title(), cleanup_screen(), draw_border_effect(), flash_demon_eyes(), print_centered(), print_demon_line(), and print_quote_lines().
Here is the caller graph for this function:| void print_centered | ( | t_welcome_term * | t, |
| int | row, | ||
| const char * | str, | ||
| int | len | ||
| ) |
Print string centered on the given row.
| t | Terminal dimensions |
| row | Row to print on |
| str | String to print (ANSI supported) |
| len | Visible character count of str (used for centering) |
Definition at line 90 of file welcome_utils.c.
References print_at_pos(), and t_welcome_term::width.
Referenced by animate_credits(), animate_loading(), animate_quote(), and print_quote_lines().
Here is the call graph for this function:
Here is the caller graph for this function: