MiniDevil
As beautiful as a shell
Welcome utilities. More...
#include "welcome_ui.h"
Include dependency graph for welcome_utils.c:Welcome utilities.
Definition in file welcome_utils.c.
Functions | |
| void | ft_msleep (int ms) |
| Sleep for approximately ms millisecondes using a little trick. 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... | |
| void ft_msleep | ( | int | ms | ) |
Sleep for approximately ms millisecondes using a little trick.
| ms | Milliseconds to sleep |
Definition at line 28 of file welcome_utils.c.
Referenced by animate_demon(), animate_loading(), animate_quote(), animate_title(), cleanup_screen(), draw_border_effect(), draw_welcome(), flash_demon_eyes(), print_quote_lines(), and ui_loop().
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: