diff options
author | Joursoir <chat@joursoir.net> | 2021-10-24 20:43:39 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-10-24 20:43:39 +0000 |
commit | 249b0f92ba53a2fe0d1d17c90c99d934769ca4e5 (patch) | |
tree | 0a0d6e104d1e95aec70a77e5be526e54a0729b51 /lib/tbi/win.h | |
parent | f6603e4d0f0f689cbeafd09ab07dc34c6e889efd (diff) | |
download | ufm-249b0f92ba53a2fe0d1d17c90c99d934769ca4e5.tar.gz ufm-249b0f92ba53a2fe0d1d17c90c99d934769ca4e5.tar.bz2 ufm-249b0f92ba53a2fe0d1d17c90c99d934769ca4e5.zip |
implement a window entity
Diffstat (limited to 'lib/tbi/win.h')
-rw-r--r-- | lib/tbi/win.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/lib/tbi/win.h b/lib/tbi/win.h new file mode 100644 index 0000000..2de5310 --- /dev/null +++ b/lib/tbi/win.h @@ -0,0 +1,57 @@ +#ifndef UFM_TBI_WINDOW_H +#define UFM_TBI_WINDOW_H + +/* + Window - rectangular area of the screen with which you can work as a separate + screen (display text, clear, etc). The output should be carried out only in + the specified rectangular area of the screen + + NOTE: SimpleTextOut.h has defined box-drawing character ("BOXDRAW_*", for + example BOXDRAW_VERTICAL) +*/ + +#include <Uefi.h> + +struct screen; + +struct window { + struct screen *scr; // parent screen + + INT32 curx, cury; // current cursor position + INT32 begx, begy; // screen coords of upper left corner + INT32 width, height; // window size + + CHAR16 **text; // the actual text of whole screen + /* ATTRIBUTES: + Bits 0..3 are the foreground color. + Bits 4..6 are the background color. + ALl other bits are undefined and must be zero */ + INT32 **attr; + + INT32 cur_attr; +}; + +/* + * Creates a window with given parameters + * + * s: the information of the screen + * ncols: the number of columns + * nlines: the number of lines + * begin_x: the column coordinate (starts from 0) of upper left corner of the window + * begin_y: the line coordinate (starts from 0) of upper left corner of the window + * + * return: A pointer to the allocated structure or NULL if allocation fails +*/ +struct window *newwin(struct screen *s, + INT32 ncols, INT32 nlines, INT32 begin_x, INT32 begin_y); + +/* + * Deletes the window, frees the structure + * + * w: the window on which to operate + * + * return: VOID +*/ +VOID delwin(struct window *w); + +#endif /* UFM_TBI_WINDOW_H */ |