5 #define MAX_ESC_PARAMS 16
7 typedef struct TextAttributes
{
13 unsigned int invers
:1;
14 unsigned int unvisible
:1;
15 unsigned int selected
:1;
18 typedef struct TextCell
{
20 TextAttributes attrib
;
23 #define COMMANDS_SIZE 1024
24 #define MAX_HEIGHT 2048
25 #define MAX_WIDTH 2048
27 typedef struct SpiceScreen SpiceScreen
;
30 SpiceCoreInterface
*core
;
33 QXLInstance qxl_instance
;
34 QXLWorker
*qxl_worker
;
36 uint8_t primary_surface
[MAX_HEIGHT
* MAX_WIDTH
* 4];
40 SpiceTimer
*conn_timeout_timer
;
41 SpiceWatch
*mwatch
; /* watch master pty */
45 // Current mode (set by create_primary)
50 GMutex
* command_mutex
;
54 struct QXLCommandExt
* commands
[COMMANDS_SIZE
];
57 void (*on_client_connected
)(SpiceScreen
*spice_screen
);
58 void (*on_client_disconnected
)(SpiceScreen
*spice_screen
);
61 SpiceScreen
* spice_screen_new(SpiceCoreInterface
* core
, uint32_t width
, uint32_t height
, guint timeout
);
63 void spice_screen_resize(SpiceScreen
*spice_screen
, uint32_t width
, uint32_t height
);
64 void spice_screen_draw_char(SpiceScreen
*spice_screen
, int x
, int y
, gunichar2 ch
, TextAttributes attrib
);
65 void spice_screen_scroll(SpiceScreen
*spice_screen
, int x1
, int y1
, int x2
, int y2
, int src_x
, int src_y
);
66 void spice_screen_clear(SpiceScreen
*spice_screen
, int x1
, int y1
, int x2
, int y2
);
67 uint32_t spice_screen_get_width(void);
68 uint32_t spice_screen_get_height(void);
70 typedef struct spiceTerm
{
71 int pty
; // pty file descriptor
82 unsigned int utf8
:1; // utf8 mode
83 long utf_char
; // used by utf8 parser
84 int utf_count
; // used by utf8 parser
86 TextAttributes default_attrib
;
92 SpiceKbdInstance keyboard_sin
;
93 SpiceCharDeviceInstance vdagent_sin
;
96 TextAttributes cur_attrib
;
97 TextAttributes cur_attrib_saved
;
98 int tty_state
; // 0 - normal, 1 - ESC, 2 - CSI
99 int cx
; // cursor x position
100 int cy
; // cursor y position
101 int cx_saved
; // saved cursor x position
102 int cy_saved
; // saved cursor y position
103 int esc_buf
[MAX_ESC_PARAMS
];
107 char osc_textbuf
[4096];
112 unsigned int charset
:1; // G0 or G1
113 unsigned int charset_saved
:1; // G0 or G1
114 unsigned int g0enc
:2;
115 unsigned int g0enc_saved
:2;
116 unsigned int g1enc
:2;
117 unsigned int g1enc_saved
:2;
118 unsigned int cur_enc
:2;
119 unsigned int cur_enc_saved
:2;
125 gunichar2
*selection
;
128 unsigned int mark_active
:1;
130 unsigned int report_mouse
:1;