]> git.proxmox.com Git - spiceterm.git/blame - test_display_base.h
move include directive to correct place
[spiceterm.git] / test_display_base.h
CommitLineData
cc04455b
DM
1#ifndef __TEST_DISPLAY_BASE_H__
2#define __TEST_DISPLAY_BASE_H__
3
4#include <glib.h>
5#include <spice.h>
abc13312 6
22e5ba02
DM
7typedef struct TextAttributes {
8 unsigned int fgcol:4;
9 unsigned int bgcol:4;
10 unsigned int bold:1;
11 unsigned int uline:1;
12 unsigned int blink:1;
13 unsigned int invers:1;
14 unsigned int unvisible:1;
15} TextAttributes;
16
cc04455b
DM
17#define COUNT(x) ((sizeof(x)/sizeof(x[0])))
18
cc04455b
DM
19typedef struct Test Test;
20
63a34f43
DM
21#define COMMANDS_SIZE 1024
22
cc04455b
DM
23#define MAX_HEIGHT 2048
24#define MAX_WIDTH 2048
25
cc04455b
DM
26struct Test {
27 SpiceCoreInterface *core;
28 SpiceServer *server;
29
30 QXLInstance qxl_instance;
31 QXLWorker *qxl_worker;
32
8a22eb4f
DM
33 SpiceKbdInstance keyboard_sin;
34
cc04455b
DM
35 uint8_t primary_surface[MAX_HEIGHT * MAX_WIDTH * 4];
36 int primary_height;
37 int primary_width;
38
f6cb554c 39 SpiceTimer *conn_timeout_timer;
22e5ba02 40 SpiceWatch *mwatch; /* watch master pty */
f6cb554c 41
cc04455b
DM
42 int cursor_notify;
43
cc04455b
DM
44 // Current mode (set by create_primary)
45 int width;
46 int height;
47
cc04455b
DM
48 int target_surface;
49
63a34f43
DM
50 GCond* command_cond;
51 GMutex* command_mutex;
52
53 int commands_end;
54 int commands_start;
55 struct QXLCommandExt* commands[COMMANDS_SIZE];
56
cc04455b
DM
57 // callbacks
58 void (*on_client_connected)(Test *test);
59 void (*on_client_disconnected)(Test *test);
60};
61
cc04455b
DM
62void test_add_display_interface(Test *test);
63void test_add_agent_interface(SpiceServer *server); // TODO - Test *test
8a22eb4f 64void test_add_keyboard_interface(Test *test);
cc04455b
DM
65Test* test_new(SpiceCoreInterface* core);
66
abc13312 67void test_draw_update_char(Test *test, int x, int y, gunichar ch, TextAttributes attrib);
7b4a7650
DM
68void test_spice_scroll(Test *test, int x1, int y1, int x2, int y2, int src_x, int src_y);
69void test_spice_clear(Test *test, int x1, int y1, int x2, int y2);
70
22e5ba02 71
cc04455b
DM
72uint32_t test_get_width(void);
73uint32_t test_get_height(void);
74
75void spice_test_config_parse_args(int argc, char **argv);
76
77#endif /* __TEST_DISPLAY_BASE_H__ */