]> git.proxmox.com Git - spiceterm.git/commitdiff
use gunichar2
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Sep 2013 11:15:53 +0000 (13:15 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Sep 2013 11:15:53 +0000 (13:15 +0200)
screen.c
spiceterm.c
spiceterm.h

index 1dbbedba89b4591837c1506e13c0ea9731e7b498..b0b4444a0a284e80f7607ab722e2207f404ab48b 100644 (file)
--- a/screen.c
+++ b/screen.c
@@ -672,7 +672,7 @@ spice_screen_add_agent_interface(SpiceServer *server)
 }
 
 void 
-spice_screen_draw_char(SpiceScreen *spice_screen, int x, int y, gunichar ch, TextAttributes attrib)
+spice_screen_draw_char(SpiceScreen *spice_screen, int x, int y, gunichar2 ch, TextAttributes attrib)
 {
     int fg, bg;
 
index 66958372c01eec298bc3380cde8583fd2d80b7c9..6a09e402bc4eb8818f753dc86a46c938ab692784 100644 (file)
@@ -89,7 +89,7 @@ print_usage (const char *msg)
 /* Convert UCS2 to UTF8 sequence, trailing zero */
 /*
 static int
-ucs2_to_utf8 (unicode c, char *out)
+ucs2_to_utf8 (gunichar2 c, char *out)
 {
   if (c < 0x80) {
     out[0] = c;                        //  0*******
@@ -113,7 +113,7 @@ ucs2_to_utf8 (unicode c, char *out)
 */
 
 static void
-draw_char_at (spiceTerm *vt, int x, int y, unicode ch, TextAttributes attrib)
+draw_char_at (spiceTerm *vt, int x, int y, gunichar2 ch, TextAttributes attrib)
 {
     if (x < 0 || y < 0 || x >= vt->width || y >= vt->height) {
         return;
@@ -617,7 +617,7 @@ enum { ESnormal, ESesc, ESsquare, ESgetpars, ESgotpars, ESfunckey,
        ESpalette, ESidquery, ESosc1, ESosc2};
 
 static void
-spiceterm_putchar (spiceTerm *vt, unicode ch)
+spiceterm_putchar (spiceTerm *vt, gunichar2 ch)
 {
   int x, y, i, c;
 
@@ -1179,7 +1179,7 @@ spiceterm_putchar (spiceTerm *vt, unicode ch)
 static int
 spiceterm_puts (spiceTerm *vt, const char *buf, int len)
 {
-    unicode tc;
+    gunichar2 tc;
 
     spiceterm_show_cursor (vt, 0);
 
@@ -1257,7 +1257,7 @@ spiceterm_set_xcut_text (char* str, int len, struct _rfbClientRec* cl)
 
   // seems str is Latin-1 encoded
   if (vt->selection) free (vt->selection);
-  vt->selection = (unicode *)malloc (len*sizeof (unicode));
+  vt->selection = (gunichar2 *)malloc (len*sizeof (gunichar2));
   int i;
   for (i = 0; i < len; i++) {
     vt->selection[i] = str[i] & 0xff;
@@ -1407,7 +1407,7 @@ spiceterm_pointer_event (int buttonMask, int x, int y, rfbClientPtr cl)
     int len = sel_end_pos - sel_start_pos + 1;
 
     if (vt->selection) free (vt->selection);
-    vt->selection = (unicode *)malloc (len*sizeof (unicode));
+    vt->selection = (gunichar2 *)malloc (len*sizeof (gunichar2));
     vt->selection_len = len;
     char *sel_latin1 = (char *)malloc (len + 1);
 
index 679267dfcdcf7d3ae4718c2e9bae7f91add2dfc2..0f0165348b921c1cc0ef159e5555f41da357d076 100644 (file)
@@ -7,7 +7,7 @@
 #define IBUFSIZE 1024
 #define MAX_ESC_PARAMS 16
 
-typedef unsigned short unicode; // fixme
+//typedef unsigned short unicode; // fixme
 
 typedef struct TextAttributes {
   unsigned int fgcol:4;
@@ -20,7 +20,7 @@ typedef struct TextAttributes {
 } TextAttributes;
 
 typedef struct TextCell {
-  unicode ch;
+  gunichar2 ch;
   TextAttributes attrib;
 } TextCell;
 
@@ -70,7 +70,7 @@ SpiceScreen* spice_screen_new(SpiceCoreInterface* core);
 
 void spice_screen_add_display_interface(SpiceScreen *spice_screen);
 void spice_screen_add_agent_interface(SpiceServer *server);
-void spice_screen_draw_char(SpiceScreen *spice_screen, int x, int y, gunichar ch, TextAttributes attrib);
+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);
 
@@ -134,7 +134,7 @@ typedef struct spiceTerm {
   char ibuf[IBUFSIZE];
   int ibuf_count;
 
-  unicode *selection;
+  gunichar2 *selection;
   int selection_len;
 
   unsigned int mark_active:1;