5 #define MAX_ESC_PARAMS 16
7 typedef struct TextAttributes
{
13 unsigned int invers
:1;
14 unsigned int unvisible
:1;
17 typedef struct TextCell
{
19 TextAttributes attrib
;
22 #define COMMANDS_SIZE 1024
23 #define MAX_HEIGHT 2048
24 #define MAX_WIDTH 2048
26 typedef struct SpiceScreen SpiceScreen
;
29 SpiceCoreInterface
*core
;
32 QXLInstance qxl_instance
;
33 QXLWorker
*qxl_worker
;
35 uint8_t primary_surface
[MAX_HEIGHT
* MAX_WIDTH
* 4];
39 SpiceTimer
*conn_timeout_timer
;
40 SpiceWatch
*mwatch
; /* watch master pty */
44 // Current mode (set by create_primary)
49 GMutex
* command_mutex
;
53 struct QXLCommandExt
* commands
[COMMANDS_SIZE
];
56 void (*on_client_connected
)(SpiceScreen
*spice_screen
);
57 void (*on_client_disconnected
)(SpiceScreen
*spice_screen
);
60 SpiceScreen
* spice_screen_new(SpiceCoreInterface
* core
, guint timeout
);
62 void spice_screen_draw_char(SpiceScreen
*spice_screen
, int x
, int y
, gunichar2 ch
, TextAttributes attrib
);
63 void spice_screen_scroll(SpiceScreen
*spice_screen
, int x1
, int y1
, int x2
, int y2
, int src_x
, int src_y
);
64 void spice_screen_clear(SpiceScreen
*spice_screen
, int x1
, int y1
, int x2
, int y2
);
65 uint32_t spice_screen_get_width(void);
66 uint32_t spice_screen_get_height(void);
68 typedef struct spiceTerm
{
81 unsigned int utf8
:1; // utf8 mode
82 long utf_char
; // used by utf8 parser
83 int utf_count
; // used by utf8 parser
85 TextAttributes default_attrib
;
91 SpiceKbdInstance keyboard_sin
;
92 SpiceCharDeviceInstance vdagent_sin
;
95 TextAttributes cur_attrib
;
96 TextAttributes cur_attrib_saved
;
97 int tty_state
; // 0 - normal, 1 - ESC, 2 - CSI
98 int cx
; // cursor x position
99 int cy
; // cursor y position
100 int cx_saved
; // saved cursor x position
101 int cy_saved
; // saved cursor y position
102 int esc_buf
[MAX_ESC_PARAMS
];
106 char osc_textbuf
[4096];
111 unsigned int charset
:1; // G0 or G1
112 unsigned int charset_saved
:1; // G0 or G1
113 unsigned int g0enc
:2;
114 unsigned int g0enc_saved
:2;
115 unsigned int g1enc
:2;
116 unsigned int g1enc_saved
:2;
117 unsigned int cur_enc
:2;
118 unsigned int cur_enc_saved
:2;
124 gunichar2
*selection
;
127 unsigned int mark_active
:1;
129 unsigned int report_mouse
:1;