XenevaOS
Loading...
Searching...
No Matches
term.h
Go to the documentation of this file.
1
30#ifndef __TERMINAL_H__
31#define __TERMINAL_H__
32
33#include <stdint.h>
34
35#define TERMINAL_MAX_COLS 256
36#define TERMINAL_MAX_ROWS 128
37
38#define TERMINAL_HISTORY_MAX 100
39
40#define TERMINAL_SCROLLBACK_MAX 1000
41
42/* Cell flag bits. 0x1 marks a cell TerminalFlush should repaint, 0x2 is the
43 * blinking cursor block, and 0x4 is a selected cell. Selection is a flag
44 * rather than swapped colours because new output can land under a live
45 * highlight, and swapping in place would corrupt the cell's real colours. */
46#define TERMINAL_CELL_SELECTED 0x4
47
54
61
62typedef struct {
64 int cols, rows;
65 int cursorX, cursorY;
66 int lastCursorX, lastCursorY;
67 int inputStartX, inputStartY;
68 int savedCursorX, savedCursorY;
69 int cellW, cellH;
71 int originX, originY;
77 char inputBuffer[256];
78 char inputSaved[256];
82 /* Mouse selection. lastCellXClicked/YClicked doubles as the anchor,
83 * selEndX/Y is the corner being dragged to, and selPaintX0..Y1 is the
84 * rectangle currently highlighted so shrinking a selection repaints
85 * only the rows it is leaving. */
94 volatile bool blink_visible;
98 int sbHead;
101} Terminal;
102
103#endif
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
Definition term.h:62
bool cursor_hide
Definition term.h:96
TermCell * sb
Definition term.h:97
int selEndX
Definition term.h:86
int selPaintY0
Definition term.h:91
TerminalHistory history
Definition term.h:76
volatile bool blink_visible
Definition term.h:94
int lastCursorX
Definition term.h:66
bool selActive
Definition term.h:88
int lastButtonState
Definition term.h:89
int selPaintX1
Definition term.h:92
int cursorX
Definition term.h:65
int cols
Definition term.h:64
int baseine
Definition term.h:70
uint32_t defaultBG
Definition term.h:73
int lastCellXClicked
Definition term.h:80
int scrollTop
Definition term.h:74
int selPaintY1
Definition term.h:93
int originX
Definition term.h:71
int viewOffset
Definition term.h:100
uint32_t defaultFg
Definition term.h:72
int cellH
Definition term.h:69
int sbCount
Definition term.h:99
int selEndY
Definition term.h:87
int sbHead
Definition term.h:98
int selPaintX0
Definition term.h:90
int savedCursorX
Definition term.h:68
int inputStartX
Definition term.h:67
int lastCellYClicked
Definition term.h:81
int intputLen
Definition term.h:79
bool scrolling
Definition term.h:95
int scrollBot
Definition term.h:75
Definition term.h:48
uint32_t fg
Definition term.h:51
uint8_t flags
Definition term.h:52
uint8_t c
Definition term.h:49
uint32_t bg
Definition term.h:50
Definition term.h:55
int count
Definition term.h:57
int browse
Definition term.h:59
char entries[TERMINAL_HISTORY_MAX][256]
Definition term.h:56
int head
Definition term.h:58
#define TERMINAL_HISTORY_MAX
Definition term.h:38
#define TERMINAL_MAX_COLS
Definition term.h:35
struct _term_history_ TerminalHistory
struct _cell_ TermCell
#define TERMINAL_MAX_ROWS
Definition term.h:36
__virtio16 rows
Definition virtio_console.h:3