]> git.proxmox.com Git - spiceterm.git/blobdiff - spiceterm.h
start mouse support
[spiceterm.git] / spiceterm.h
index 0473712e201949ee8382b21016528128966e1892..d7a22a795151bbee70a920111dc5f8466a2e8fb4 100644 (file)
@@ -7,8 +7,6 @@
 #define IBUFSIZE 1024
 #define MAX_ESC_PARAMS 16
 
-typedef unsigned short unicode; // fixme
-
 typedef struct TextAttributes {
   unsigned int fgcol:4;
   unsigned int bgcol:4;
@@ -20,7 +18,7 @@ typedef struct TextAttributes {
 } TextAttributes;
 
 typedef struct TextCell {
-  unicode ch;
+  gunichar2 ch;
   TextAttributes attrib;
 } TextCell;
 
@@ -28,17 +26,15 @@ typedef struct TextCell {
 #define MAX_HEIGHT 2048
 #define MAX_WIDTH 2048
 
-typedef struct Test Test;
+typedef struct SpiceScreen SpiceScreen;
 
-struct Test {
+struct SpiceScreen {
     SpiceCoreInterface *core;
     SpiceServer *server;
 
     QXLInstance qxl_instance;
     QXLWorker *qxl_worker;
 
-    SpiceKbdInstance keyboard_sin;
-
     uint8_t primary_surface[MAX_HEIGHT * MAX_WIDTH * 4];
     int primary_height;
     int primary_width;
@@ -52,8 +48,6 @@ struct Test {
     int width;
     int height;
 
-    int target_surface;
-
     GCond* command_cond;
     GMutex* command_mutex;
 
@@ -62,24 +56,19 @@ struct Test {
     struct QXLCommandExt* commands[COMMANDS_SIZE];
 
     // callbacks
-    void (*on_client_connected)(Test *test);
-    void (*on_client_disconnected)(Test *test);
+    void (*on_client_connected)(SpiceScreen *spice_screen);
+    void (*on_client_disconnected)(SpiceScreen *spice_screen);
 };
 
-void test_add_display_interface(Test *test);
-void test_add_agent_interface(SpiceServer *server); // TODO - Test *test
-void test_add_keyboard_interface(Test *test);
-Test* test_new(SpiceCoreInterface* core);
+SpiceScreen* spice_screen_new(SpiceCoreInterface* core, guint timeout);
 
-void test_draw_update_char(Test *test, int x, int y, gunichar ch, TextAttributes attrib);
-void test_spice_scroll(Test *test, int x1, int y1, int x2, int y2, int src_x, int src_y);
-void test_spice_clear(Test *test, int x1, int y1, int x2, int y2);
+void spice_screen_draw_char(SpiceScreen *spice_screen, int x, int y, gunichar2 ch, TextAttributes attrib);
+void spice_screen_scroll(SpiceScreen *spice_screen, int x1, int y1, int x2, int y2, int src_x, int src_y);
+void spice_screen_clear(SpiceScreen *spice_screen, int x1, int y1, int x2, int y2);
 
 
-uint32_t test_get_width(void);
-uint32_t test_get_height(void);
-
-void spice_test_config_parse_args(int argc, char **argv);
+uint32_t spice_screen_get_width(void);
+uint32_t spice_screen_get_height(void);
 
 typedef struct spiceTerm {
   int maxx;
@@ -98,14 +87,14 @@ typedef struct spiceTerm {
   long utf_char;       // used by utf8 parser
   int utf_count;       // used by utf8 parser
 
-
   TextAttributes default_attrib;
 
   TextCell *cells;
   TextCell *altcells;
 
-  Test *screen;
+  SpiceScreen *screen;
   SpiceKbdInstance keyboard_sin;
+  SpiceCharDeviceInstance vdagent_sin;
 
   // cursor
   TextAttributes cur_attrib;
@@ -137,7 +126,7 @@ typedef struct spiceTerm {
   char ibuf[IBUFSIZE];
   int ibuf_count;
 
-  unicode *selection;
+  gunichar2 *selection;
   int selection_len;
 
   unsigned int mark_active:1;