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*10)
24 #define MAX_HEIGHT 1440
25 #define MAX_WIDTH 2560
27 typedef struct SpiceScreen SpiceScreen
;
29 typedef struct CachedImage
{
35 SpiceCoreInterface
*core
;
38 QXLInstance qxl_instance
;
39 QXLWorker
*qxl_worker
;
41 uint8_t primary_surface
[MAX_HEIGHT
* MAX_WIDTH
* 4];
45 SpiceTimer
*conn_timeout_timer
;
46 SpiceWatch
*mwatch
; /* watch master pty */
48 // Current mode (set by create_primary)
53 GMutex
* command_mutex
;
57 struct QXLCommandExt
* commands
[COMMANDS_SIZE
];
59 //cache for glyphs bitmaps
60 GHashTable
*image_cache
;
65 void (*on_client_connected
)(SpiceScreen
*spice_screen
);
66 void (*on_client_disconnected
)(SpiceScreen
*spice_screen
);
69 SpiceScreen
* spice_screen_new(SpiceCoreInterface
* core
, uint32_t width
, uint32_t height
, guint timeout
);
71 void spice_screen_resize(SpiceScreen
*spice_screen
, uint32_t width
, uint32_t height
);
72 void spice_screen_draw_char(SpiceScreen
*spice_screen
, int x
, int y
, gunichar2 ch
, TextAttributes attrib
);
73 void spice_screen_scroll(SpiceScreen
*spice_screen
, int x1
, int y1
, int x2
, int y2
, int src_x
, int src_y
);
74 void spice_screen_clear(SpiceScreen
*spice_screen
, int x1
, int y1
, int x2
, int y2
);
75 uint32_t spice_screen_get_width(void);
76 uint32_t spice_screen_get_height(void);
78 typedef struct spiceTerm
{
79 int pty
; // pty file descriptor
90 unsigned int utf8
:1; // utf8 mode
91 long utf_char
; // used by utf8 parser
92 int utf_count
; // used by utf8 parser
94 TextAttributes default_attrib
;
100 SpiceKbdInstance keyboard_sin
;
101 SpiceCharDeviceInstance vdagent_sin
;
104 TextAttributes cur_attrib
;
105 TextAttributes cur_attrib_saved
;
106 int tty_state
; // 0 - normal, 1 - ESC, 2 - CSI
107 int cx
; // cursor x position
108 int cy
; // cursor y position
109 int cx_saved
; // saved cursor x position
110 int cy_saved
; // saved cursor y position
111 int esc_buf
[MAX_ESC_PARAMS
];
115 char osc_textbuf
[4096];
120 unsigned int charset
:1; // G0 or G1
121 unsigned int charset_saved
:1; // G0 or G1
122 unsigned int g0enc
:2;
123 unsigned int g0enc_saved
:2;
124 unsigned int g1enc
:2;
125 unsigned int g1enc_saved
:2;
126 unsigned int cur_enc
:2;
127 unsigned int cur_enc_saved
:2;
133 gunichar2
*selection
;
136 unsigned int mark_active
:1;
138 unsigned int report_mouse
:1;