]> git.proxmox.com Git - spiceterm.git/blobdiff - spiceterm.h
use gunichar instead of long
[spiceterm.git] / spiceterm.h
index 0fb3f3c7ae7f11d8b1cedc67750ff179ab7f0041..cfa9428d587a563249556a7909ce335fd5c3ad9e 100644 (file)
@@ -20,12 +20,17 @@ typedef struct TextCell {
     TextAttributes attrib;
 } TextCell;
 
-#define COMMANDS_SIZE 1024
-#define MAX_HEIGHT 2048
-#define MAX_WIDTH 2048
+#define COMMANDS_SIZE (1024)
+#define MAX_HEIGHT 1440
+#define MAX_WIDTH 2560
 
 typedef struct SpiceScreen SpiceScreen;
 
+typedef struct CachedImage {
+    uint8_t *bitmap;
+    int cache_id;
+} CachedImage;
+
 struct SpiceScreen {
     SpiceCoreInterface *core;
     SpiceServer *server;
@@ -40,8 +45,6 @@ struct SpiceScreen {
     SpiceTimer *conn_timeout_timer;
     SpiceWatch *mwatch; /* watch master pty */
 
-    int cursor_notify;
-
     // Current mode (set by create_primary)
     int width;
     int height;
@@ -53,6 +56,11 @@ struct SpiceScreen {
     int commands_start;
     struct QXLCommandExt* commands[COMMANDS_SIZE];
 
+    //cache for glyphs bitmaps
+    GHashTable *image_cache;
+    
+    gboolean cursor_set;
+
     // callbacks
     void (*on_client_connected)(SpiceScreen *spice_screen);
     void (*on_client_disconnected)(SpiceScreen *spice_screen);
@@ -80,7 +88,7 @@ typedef struct spiceTerm {
     int altbuf:1;
 
     unsigned int utf8:1; // utf8 mode
-    long utf_char;       // used by utf8 parser
+    gunichar utf_char;   // used by utf8 parser
     int utf_count;       // used by utf8 parser
 
     TextAttributes default_attrib;
@@ -130,3 +138,25 @@ typedef struct spiceTerm {
     unsigned int report_mouse:1;
 
 } spiceTerm;
+
+void init_spiceterm(spiceTerm *vt, uint32_t width, uint32_t height);
+void spiceterm_refresh(spiceTerm *vt);
+
+void spiceterm_resize(spiceTerm *vt, uint32_t width, uint32_t height);
+void spiceterm_virtual_scroll(spiceTerm *vt, int lines);
+void spiceterm_clear_selection(spiceTerm *vt);
+void spiceterm_motion_event(spiceTerm *vt, uint32_t x, uint32_t y, 
+                            uint32_t buttons);
+
+void spiceterm_respond_esc(spiceTerm *vt, const char *esc);
+void spiceterm_respond_data(spiceTerm *vt, int len, uint8_t *data);
+void spiceterm_update_watch_mask(spiceTerm *vt, gboolean writable);
+
+spiceTerm *create_spiceterm(int argc, char** argv, uint32_t maxx, 
+                            uint32_t maxy, guint timeout);
+
+gboolean vdagent_owns_clipboard(spiceTerm *vt);
+void vdagent_request_clipboard(spiceTerm *vt);
+void vdagent_grab_clipboard(spiceTerm *vt);
+
+