|
PatchworkOS
|
Terminal Program. More...
Modules | |
| ANSI | |
| ANSI. | |
Data Structures | |
| struct | uevent_terminal_data_t |
| Terminal data event structure. struct uevent_terminal_data_t. More... | |
| struct | terminal_char_t |
| Terminal character. More... | |
| struct | terminal_t |
| Terminal structure. More... | |
| struct | terminal_init_ctx_t |
| Terminal initialization context. More... | |
Macros | |
| #define | TERMINAL_BLINK_INTERVAL (CLOCKS_PER_SEC / 2) |
| Terminal blink rate. | |
| #define | TERMINAL_COLUMNS 80 |
| Terminal columns. | |
| #define | TERMINAL_ROWS 30 |
| Terminal rows. | |
| #define | UEVENT_TERMINAL_DATA (UEVENT_START + 0) |
| Event sent from the terminals io thread to the main thread when there is data available. | |
| #define | TERMINAL_MAX_INPUT 64 |
| Maximum terminal input length. | |
Enumerations | |
| enum | terminal_flags_t { TERMINAL_NONE = 0 , TERMINAL_BOLD = (1 << 0) , TERMINAL_DIM = (1 << 1) , TERMINAL_ITALIC = (1 << 2) , TERMINAL_UNDERLINE = (1 << 3) , TERMINAL_BLINK = (1 << 4) , TERMINAL_INVERSE = (1 << 5) , TERMINAL_HIDDEN = (1 << 6) , TERMINAL_STRIKETHROUGH = (1 << 7) } |
| Terminal flags. More... | |
Functions | |
| window_t * | terminal_new (display_t *disp) |
| Create a new terminal window. | |
| void | terminal_loop (window_t *win) |
| Terminal main loop. | |
Terminal Program.
A simple terminal emulator program.
The terminal always acts in raw mode, meaning that it does not process any input itself, instead it just sends all input directly to the shell program running inside it.
| #define TERMINAL_BLINK_INTERVAL (CLOCKS_PER_SEC / 2) |
Terminal blink rate.
Definition at line 30 of file terminal.h.
| #define TERMINAL_COLUMNS 80 |
Terminal columns.
Definition at line 35 of file terminal.h.
| #define TERMINAL_MAX_INPUT 64 |
Maximum terminal input length.
Definition at line 50 of file terminal.h.
| #define TERMINAL_ROWS 30 |
Terminal rows.
Definition at line 40 of file terminal.h.
| #define UEVENT_TERMINAL_DATA (UEVENT_START + 0) |
Event sent from the terminals io thread to the main thread when there is data available.
Definition at line 45 of file terminal.h.
| enum terminal_flags_t |
Terminal flags.
Used for the ANSI state machine and character attributes.
| Enumerator | |
|---|---|
| TERMINAL_NONE | |
| TERMINAL_BOLD | |
| TERMINAL_DIM | |
| TERMINAL_ITALIC | |
| TERMINAL_UNDERLINE | |
| TERMINAL_BLINK | |
| TERMINAL_INVERSE | |
| TERMINAL_HIDDEN | |
| TERMINAL_STRIKETHROUGH | |
Definition at line 70 of file terminal.h.
| void terminal_loop | ( | window_t * | win | ) |
Terminal main loop.
| win | The terminal window. |
Definition at line 702 of file terminal.c.
References uevent_terminal_data_t::buffer, CLOCKS_NEVER, display_dispatch(), display_next(), display_poll(), display_push(), element_get_private(), ERR, pollfd_t::fd, uevent_terminal_data_t::length, MIN, PIPE_READ, POLLIN, read(), terminal_t::stdout, TERMINAL_MAX_INPUT, UEVENT_TERMINAL_DATA, window_get_client_element(), window_get_display(), and window_get_id().
Referenced by main().
Create a new terminal window.
| disp | The display to create the window on. |
NULL and errno is set. Definition at line 674 of file terminal.c.
References ERR, terminal_init_ctx_t::font, font_free(), font_new(), NULL, RECT_INIT_DIM, SURFACE_WINDOW, terminal_pixel_height(), terminal_pixel_width(), terminal_procedure(), WINDOW_DECO, window_free(), window_new(), and window_set_visible().
Referenced by main().