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) && (VSF_USE_FBCON == 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
70 public_member(
71 vk_disp_t *disp; // display device, MUST be set before init
72 vsf_stream_t *stream; // input byte stream, MUST be set before init
73 )
74 private_member(
75 bool disp_ready;
76 bool paused;
77 bool is_disp_fb;
78 volatile bool refresh_busy;
79 uint32_t dirty_rows; // bitmask of rows that need refresh
80
81 void *line_buf; // one-text-row buffer for non-FB displays
82
83 int cols, rows;
84 int cursor_x, cursor_y;
85
86 uint8_t ansi_state;
87 uint8_t ansi_buf[16];
88 uint8_t ansi_idx;
89 uint8_t ansi_params[4];
90 uint8_t ansi_param_count;
91
92 uint8_t cur_fg; // palette index (0-15)
93 uint8_t cur_bg; // palette index (0-15)
94 bool cur_bold;
95 bool cur_reverse;
96
97 uint32_t palette[16]; // format-specific pixel values
98
99 struct {
100 uint8_t ch;
101 uint8_t fg; // palette index
102 uint8_t bg; // palette index
103 } *char_grid;
105};
106
107/*============================ GLOBAL VARIABLES ==============================*/
108
109/*============================ PROTOTYPES ====================================*/
110
124
125// Pause/resume display refreshes while retaining incoming console text.
126// Resume after a paused interval marks all rows dirty and redraws them.
127extern void vsf_fbcon_pause(vsf_fbcon_t *fbcon);
128extern void vsf_fbcon_resume(vsf_fbcon_t *fbcon);
129
137extern void vsf_fbcon_fini(vsf_fbcon_t *fbcon);
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif // VSF_USE_UI && VSF_USE_FBCON
144#endif // __VSF_FBCON_H__
vsf_err_t
Definition __type.h:42
Definition vsf_disp.h:184
Definition vsf_fbcon.h:69
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:662
void vsf_fbcon_resume(vsf_fbcon_t *fbcon)
Definition vsf_fbcon.c:557
void vsf_fbcon_pause(vsf_fbcon_t *fbcon)
Definition vsf_fbcon.c:550
vsf_err_t vsf_fbcon_init(vsf_fbcon_t *fbcon)
Definition vsf_fbcon.c:571
vsf simple stream
Generated from commit: vsfteam/vsf@2a137b0