VSF Documented
vsf_fbcon.h
Go to the documentation of this file.
1#ifndef __VSF_FBCON_H__
2#define __VSF_FBCON_H__
3
4/*============================ INCLUDES ======================================*/
5
7
8#if VSF_USE_UI == ENABLED
9
12
13#if defined(__VSF_FBCON_CLASS_IMPLEMENT)
14# define __VSF_CLASS_IMPLEMENT__
15#elif defined(__VSF_FBCON_CLASS_INHERIT__)
16# define __VSF_CLASS_INHERIT__
17#endif
18
19#include "utilities/ooc_class.h"
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*============================ MACROS ========================================*/
26
27#ifndef VSF_FBCON_CFG_FONT_WIDTH
28# define VSF_FBCON_CFG_FONT_WIDTH 8
29#endif
30#ifndef VSF_FBCON_CFG_FONT_HEIGHT
31# define VSF_FBCON_CFG_FONT_HEIGHT 16
32#endif
33
34#ifndef VSF_FBCON_CFG_TAB_WIDTH
35# define VSF_FBCON_CFG_TAB_WIDTH 8
36#endif
37
38// Maximum rows supported by the dirty-row bitmask (uint32_t)
39#define VSF_FBCON_MAX_ROWS 32
40
41/*============================ TYPES =========================================*/
42
69 public_member(
70 vk_disp_t *disp; // display device, MUST be set before init
71 vsf_stream_t *stream; // input byte stream, MUST be set before init
72 )
73 private_member(
74 bool disp_ready;
75 volatile bool refresh_busy;
76 uint32_t dirty_rows; // bitmask of rows that need refresh
77
78 void *line_buf; // one-text-row pixel buffer
79
80 int cols, rows;
81 int cursor_x, cursor_y;
82
83 uint8_t ansi_state;
84 uint8_t ansi_buf[16];
85 uint8_t ansi_idx;
86 uint8_t ansi_params[4];
87 uint8_t ansi_param_count;
88
89 uint8_t cur_fg; // palette index (0-15)
90 uint8_t cur_bg; // palette index (0-15)
91 bool cur_bold;
92 bool cur_reverse;
93
94 uint32_t palette[16]; // format-specific pixel values
95
96 struct {
97 uint8_t ch;
98 uint8_t fg; // palette index
99 uint8_t bg; // palette index
100 } *char_grid;
102};
103
104/*============================ GLOBAL VARIABLES ==============================*/
105
106/*============================ PROTOTYPES ====================================*/
107
121
129extern void vsf_fbcon_fini(vsf_fbcon_t *fbcon);
130
131#ifdef __cplusplus
132}
133#endif
134
135#endif // VSF_USE_UI
136#endif // __VSF_FBCON_H__
vsf_err_t
Definition __type.h:42
Definition vsf_disp.h:181
Definition vsf_fbcon.h:68
Definition vsf_simple_stream.h:254
#define vsf_class(__name)
Definition ooc_class.h:52
unsigned uint32_t
Definition stdint.h:9
unsigned char uint8_t
Definition stdint.h:5
void vsf_fbcon_fini(vsf_fbcon_t *fbcon)
Definition vsf_fbcon.c:593
vsf_err_t vsf_fbcon_init(vsf_fbcon_t *fbcon)
Definition vsf_fbcon.c:515
vsf simple stream
Generated from commit: vsfteam/vsf@c3767bf