]> git.proxmox.com Git - spiceterm.git/blobdiff - spiceterm.h
use kvm keymap files
[spiceterm.git] / spiceterm.h
index b2c764c7922cb6b505a8d0d8b92a4980ec6f70f8..678fa050db99bd365c4ff06cc33f762e49504059 100644 (file)
@@ -20,10 +20,19 @@ typedef struct TextCell {
     TextAttributes attrib;
 } TextCell;
 
-#define COMMANDS_SIZE (1024*10)
+#define COMMANDS_SIZE (1024)
 #define MAX_HEIGHT 1440
 #define MAX_WIDTH 2560
 
+typedef struct SpiceTermOptions {
+    guint timeout;
+    int port;
+    char *addr;
+    char *keymap;
+    gboolean noauth;
+    gboolean sasl;
+} SpiceTermOptions;
+
 typedef struct SpiceScreen SpiceScreen;
 
 typedef struct CachedImage {
@@ -66,7 +75,7 @@ struct SpiceScreen {
     void (*on_client_disconnected)(SpiceScreen *spice_screen);
 };
 
-SpiceScreen* spice_screen_new(SpiceCoreInterface* core, uint32_t width, uint32_t height, guint timeout);
+SpiceScreen* spice_screen_new(SpiceCoreInterface* core, uint32_t width, uint32_t height, SpiceTermOptions *opts);
 
 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);
@@ -88,7 +97,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;
@@ -138,3 +147,27 @@ 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 *spiceterm_create(uint32_t width, uint32_t height, SpiceTermOptions *opts);
+
+gboolean vdagent_owns_clipboard(spiceTerm *vt);
+void vdagent_request_clipboard(spiceTerm *vt);
+void vdagent_grab_clipboard(spiceTerm *vt);
+
+int pve_auth_verify(const char *clientip, const char *username, const char *passwd);
+void pve_auth_set_path(char *path);
+void pve_auth_set_permissions(char *perm);
+