1 #ifndef __TEST_DISPLAY_BASE_H__
2 #define __TEST_DISPLAY_BASE_H__
6 #include "basic_event_loop.h"
9 typedef struct TextAttributes
{
15 unsigned int invers
:1;
16 unsigned int unvisible
:1;
19 #define COUNT(x) ((sizeof(x)/sizeof(x[0])))
22 * simple queue for commands.
23 * each command can have up to two parameters (grow as needed)
25 * TODO: switch to gtk main loop. Then add gobject-introspection. then
26 * write tests in python/guile/whatever.
30 SIMPLE_CREATE_SURFACE
,
35 SIMPLE_DESTROY_SURFACE
,
42 typedef struct CommandCreatePrimary
{
45 } CommandCreatePrimary
;
47 typedef struct CommandCreateSurface
{
53 } CommandCreateSurface
;
55 typedef struct CommandDrawBitmap
{
59 uint32_t num_clip_rects
;
63 typedef struct CommandDrawSolid
{
69 typedef struct CommandSleep
{
73 typedef struct Command Command
;
74 typedef struct Test Test
;
78 void (*cb
)(Test
*test
, Command
*command
);
81 CommandCreatePrimary create_primary
;
82 CommandDrawBitmap bitmap
;
83 CommandDrawSolid solid
;
85 CommandCreateSurface create_surface
;
89 #define MAX_HEIGHT 2048
90 #define MAX_WIDTH 2048
92 #define SURF_WIDTH 320
93 #define SURF_HEIGHT 240
96 SpiceCoreInterface
*core
;
99 QXLInstance qxl_instance
;
100 QXLWorker
*qxl_worker
;
102 SpiceKbdInstance keyboard_sin
;
104 uint8_t primary_surface
[MAX_HEIGHT
* MAX_WIDTH
* 4];
108 SpiceTimer
*conn_timeout_timer
;
109 SpiceWatch
*mwatch
; /* watch master pty */
113 uint8_t secondary_surface
[SURF_WIDTH
* SURF_HEIGHT
* 4];
116 // Current mode (set by create_primary)
123 void (*on_client_connected
)(Test
*test
);
124 void (*on_client_disconnected
)(Test
*test
);
127 void test_add_display_interface(Test
*test
);
128 void test_add_agent_interface(SpiceServer
*server
); // TODO - Test *test
129 void test_add_keyboard_interface(Test
*test
);
130 Test
* test_new(SpiceCoreInterface
* core
);
132 void test_draw_update_char(Test
*test
, int x
, int y
, int c
, TextAttributes attrib
);
134 uint32_t test_get_width(void);
135 uint32_t test_get_height(void);
137 void spice_test_config_parse_args(int argc
, char **argv
);
139 #endif /* __TEST_DISPLAY_BASE_H__ */