]> git.proxmox.com Git - spiceterm.git/blobdiff - spiceterm.h
resize: discard pending commands
[spiceterm.git] / spiceterm.h
index 3de1a0a81f2ac5650ff882cd7f93d9d2d73ba782..6657186717d27a31179ffae4dd4255a6a020fce7 100644 (file)
@@ -12,6 +12,7 @@ typedef struct TextAttributes {
     unsigned int blink:1;
     unsigned int invers:1;
     unsigned int unvisible:1;
+    unsigned int selected:1;
 } TextAttributes;
 
 typedef struct TextCell {
@@ -19,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;
@@ -39,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;
@@ -52,13 +56,19 @@ 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);
 };
 
-SpiceScreen* spice_screen_new(SpiceCoreInterface* core, guint timeout);
+SpiceScreen* spice_screen_new(SpiceCoreInterface* core, uint32_t width, uint32_t height, guint timeout);
 
+void spice_screen_resize(SpiceScreen *spice_screen, uint32_t width, uint32_t height);
 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);
@@ -66,8 +76,7 @@ uint32_t spice_screen_get_width(void);
 uint32_t spice_screen_get_height(void);
 
 typedef struct spiceTerm {
-    int maxx;
-    int maxy;
+    int pty; // pty file descriptor
 
     int width;
     int height;