1 #ifndef __SPICETERM_H__
2 #define __SPICETERM_H__
8 #define MAX_ESC_PARAMS 16
10 typedef unsigned short unicode
; // fixme
12 typedef struct TextAttributes
{
18 unsigned int invers
:1;
19 unsigned int unvisible
:1;
22 typedef struct TextCell
{
24 TextAttributes attrib
;
27 #define COMMANDS_SIZE 1024
28 #define MAX_HEIGHT 2048
29 #define MAX_WIDTH 2048
31 typedef struct Test Test
;
34 SpiceCoreInterface
*core
;
37 QXLInstance qxl_instance
;
38 QXLWorker
*qxl_worker
;
40 SpiceKbdInstance keyboard_sin
;
42 uint8_t primary_surface
[MAX_HEIGHT
* MAX_WIDTH
* 4];
46 SpiceTimer
*conn_timeout_timer
;
47 SpiceWatch
*mwatch
; /* watch master pty */
51 // Current mode (set by create_primary)
58 GMutex
* command_mutex
;
62 struct QXLCommandExt
* commands
[COMMANDS_SIZE
];
65 void (*on_client_connected
)(Test
*test
);
66 void (*on_client_disconnected
)(Test
*test
);
69 void test_add_display_interface(Test
*test
);
70 void test_add_agent_interface(SpiceServer
*server
); // TODO - Test *test
71 void test_add_keyboard_interface(Test
*test
);
72 Test
* test_new(SpiceCoreInterface
* core
);
74 void test_draw_update_char(Test
*test
, int x
, int y
, gunichar ch
, TextAttributes attrib
);
75 void test_spice_scroll(Test
*test
, int x1
, int y1
, int x2
, int y2
, int src_x
, int src_y
);
76 void test_spice_clear(Test
*test
, int x1
, int y1
, int x2
, int y2
);
79 uint32_t test_get_width(void);
80 uint32_t test_get_height(void);
82 void spice_test_config_parse_args(int argc
, char **argv
);
84 typedef struct spiceTerm
{
97 unsigned int utf8
:1; // utf8 mode
98 long utf_char
; // used by utf8 parser
99 int utf_count
; // used by utf8 parser
102 TextAttributes default_attrib
;
108 SpiceKbdInstance keyboard_sin
;
111 TextAttributes cur_attrib
;
112 TextAttributes cur_attrib_saved
;
113 int tty_state
; // 0 - normal, 1 - ESC, 2 - CSI
114 int cx
; // cursor x position
115 int cy
; // cursor y position
116 int cx_saved
; // saved cursor x position
117 int cy_saved
; // saved cursor y position
118 int esc_buf
[MAX_ESC_PARAMS
];
122 char osc_textbuf
[4096];
127 unsigned int charset
:1; // G0 or G1
128 unsigned int charset_saved
:1; // G0 or G1
129 unsigned int g0enc
:2;
130 unsigned int g0enc_saved
:2;
131 unsigned int g1enc
:2;
132 unsigned int g1enc_saved
:2;
133 unsigned int cur_enc
:2;
134 unsigned int cur_enc_saved
:2;
143 unsigned int mark_active
:1;
145 unsigned int report_mouse
:1;
149 #endif /* __SPICETERM_H__ */