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 SpiceScreen SpiceScreen
;
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
)(SpiceScreen
*spice_screen
);
66 void (*on_client_disconnected
)(SpiceScreen
*spice_screen
);
69 SpiceScreen
* spice_screen_new(SpiceCoreInterface
* core
);
71 void spice_screen_add_display_interface(SpiceScreen
*spice_screen
);
72 void spice_screen_add_agent_interface(SpiceServer
*server
);
73 void spice_screen_draw_char(SpiceScreen
*spice_screen
, int x
, int y
, gunichar ch
, TextAttributes attrib
);
74 void spice_screen_scroll(SpiceScreen
*spice_screen
, int x1
, int y1
, int x2
, int y2
, int src_x
, int src_y
);
75 void spice_screen_clear(SpiceScreen
*spice_screen
, int x1
, int y1
, int x2
, int y2
);
78 uint32_t spice_screen_get_width(void);
79 uint32_t spice_screen_get_height(void);
81 typedef struct spiceTerm
{
94 unsigned int utf8
:1; // utf8 mode
95 long utf_char
; // used by utf8 parser
96 int utf_count
; // used by utf8 parser
99 TextAttributes default_attrib
;
105 SpiceKbdInstance keyboard_sin
;
108 TextAttributes cur_attrib
;
109 TextAttributes cur_attrib_saved
;
110 int tty_state
; // 0 - normal, 1 - ESC, 2 - CSI
111 int cx
; // cursor x position
112 int cy
; // cursor y position
113 int cx_saved
; // saved cursor x position
114 int cy_saved
; // saved cursor y position
115 int esc_buf
[MAX_ESC_PARAMS
];
119 char osc_textbuf
[4096];
124 unsigned int charset
:1; // G0 or G1
125 unsigned int charset_saved
:1; // G0 or G1
126 unsigned int g0enc
:2;
127 unsigned int g0enc_saved
:2;
128 unsigned int g1enc
:2;
129 unsigned int g1enc_saved
:2;
130 unsigned int cur_enc
:2;
131 unsigned int cur_enc_saved
:2;
140 unsigned int mark_active
:1;
142 unsigned int report_mouse
:1;
146 #endif /* __SPICETERM_H__ */