1 #ifndef __TEST_DISPLAY_BASE_H__
2 #define __TEST_DISPLAY_BASE_H__
6 #include "basic_event_loop.h"
9 #define COUNT(x) ((sizeof(x)/sizeof(x[0])))
12 * simple queue for commands.
13 * each command can have up to two parameters (grow as needed)
15 * TODO: switch to gtk main loop. Then add gobject-introspection. then
16 * write tests in python/guile/whatever.
20 SIMPLE_CREATE_SURFACE
,
25 SIMPLE_DESTROY_SURFACE
,
32 typedef struct CommandCreatePrimary
{
35 } CommandCreatePrimary
;
37 typedef struct CommandCreateSurface
{
43 } CommandCreateSurface
;
45 typedef struct CommandDrawBitmap
{
49 uint32_t num_clip_rects
;
53 typedef struct CommandDrawSolid
{
59 typedef struct CommandSleep
{
63 typedef struct Command Command
;
64 typedef struct Test Test
;
68 void (*cb
)(Test
*test
, Command
*command
);
71 CommandCreatePrimary create_primary
;
72 CommandDrawBitmap bitmap
;
73 CommandDrawSolid solid
;
75 CommandCreateSurface create_surface
;
79 #define MAX_HEIGHT 2048
80 #define MAX_WIDTH 2048
82 #define SURF_WIDTH 320
83 #define SURF_HEIGHT 240
86 SpiceCoreInterface
*core
;
89 QXLInstance qxl_instance
;
90 QXLWorker
*qxl_worker
;
92 uint8_t primary_surface
[MAX_HEIGHT
* MAX_WIDTH
* 4];
96 SpiceTimer
*wakeup_timer
;
101 uint8_t secondary_surface
[SURF_WIDTH
* SURF_HEIGHT
* 4];
104 // Current mode (set by create_primary)
108 // qxl scripted rendering commands and io
116 void (*on_client_connected
)(Test
*test
);
117 void (*on_client_disconnected
)(Test
*test
);
120 void test_set_simple_command_list(Test
*test
, int *command
, int num_commands
);
121 void test_set_command_list(Test
*test
, Command
*command
, int num_commands
);
122 void test_add_display_interface(Test
*test
);
123 void test_add_agent_interface(SpiceServer
*server
); // TODO - Test *test
124 Test
* test_new(SpiceCoreInterface
* core
);
126 uint32_t test_get_width(void);
127 uint32_t test_get_height(void);
129 void spice_test_config_parse_args(int argc
, char **argv
);
131 #endif /* __TEST_DISPLAY_BASE_H__ */