/[rdesktop]/sourceforge.net/trunk/rdesktop/xwin.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/xwin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 66 by astrand, Thu Jul 18 18:28:12 2002 UTC revision 73 by astrand, Mon Jul 29 19:21:51 2002 UTC
# Line 62  static uint32 *colmap; Line 62  static uint32 *colmap;
62  static XIM IM = NULL;  static XIM IM = NULL;
63  static XIC IC = NULL;  static XIC IC = NULL;
64    
65    /* Compose support */
66    BOOL enable_compose = False;
67    
68  #define TRANSLATE(col)          ( owncolmap ? col : translate_colour(colmap[col]) )  #define TRANSLATE(col)          ( owncolmap ? col : translate_colour(colmap[col]) )
69  #define SET_FOREGROUND(col)     XSetForeground(display, gc, TRANSLATE(col));  #define SET_FOREGROUND(col)     XSetForeground(display, gc, TRANSLATE(col));
70  #define SET_BACKGROUND(col)     XSetBackground(display, gc, TRANSLATE(col));  #define SET_BACKGROUND(col)     XSetBackground(display, gc, TRANSLATE(col));
# Line 185  translate_colour(uint32 colour) Line 188  translate_colour(uint32 colour)
188  static unsigned long  static unsigned long
189  init_inputmethod(void)  init_inputmethod(void)
190  {  {
191          unsigned long filtered_events;          unsigned long filtered_events = 0;
192    
193          IM = XOpenIM(display, NULL, NULL, NULL);          IM = XOpenIM(display, NULL, NULL, NULL);
194          if (IM == NULL)          if (IM == NULL)
# Line 248  ui_create_window(char *title) Line 251  ui_create_window(char *title)
251          Screen *screen;          Screen *screen;
252          uint16 test;          uint16 test;
253          int i;          int i;
         unsigned long filtered_events;  
254    
255          display = XOpenDisplay(NULL);          display = XOpenDisplay(NULL);
256    
# Line 352  ui_create_window(char *title) Line 354  ui_create_window(char *title)
354          if (ownbackstore)          if (ownbackstore)
355                  input_mask |= ExposureMask;                  input_mask |= ExposureMask;
356    
357          filtered_events = init_inputmethod();          if (enable_compose)
358                    input_mask |= init_inputmethod();
359    
360          XSelectInput(display, wnd, input_mask | filtered_events);          XSelectInput(display, wnd, input_mask);
361    
362          gc = XCreateGC(display, wnd, 0, NULL);          gc = XCreateGC(display, wnd, 0, NULL);
363    
# Line 405  xwin_process_events() Line 408  xwin_process_events()
408    
409          while (XCheckMaskEvent(display, ~0, &xevent))          while (XCheckMaskEvent(display, ~0, &xevent))
410          {          {
411                  if (XFilterEvent(&xevent, None) == True)                  if (enable_compose && (XFilterEvent(&xevent, None) == True))
412                  {                  {
413                          DEBUG_KBD("Filtering event\n");                          DEBUG_KBD("Filtering event\n");
414                          continue;                          continue;
# Line 456  xwin_process_events() Line 459  xwin_process_events()
459    
460                                  tr = xkeymap_translate_key(keysym,                                  tr = xkeymap_translate_key(keysym,
461                                                             xevent.xkey.                                                             xevent.xkey.
462                                                             keycode);                                                             keycode,
463                                                               xevent.xkey.state);
464    
465                                  ensure_remote_modifiers(ev_time, tr);                                  ensure_remote_modifiers(ev_time, tr);
466    
467                                  if (tr.scancode == 0)                                  if (tr.scancode == 0)
# Line 479  xwin_process_events() Line 484  xwin_process_events()
484    
485                                  tr = xkeymap_translate_key(keysym,                                  tr = xkeymap_translate_key(keysym,
486                                                             xevent.xkey.                                                             xevent.xkey.
487                                                             keycode);                                                             keycode,
488                                                               xevent.xkey.state);
489    
490                                  if (tr.scancode == 0)                                  if (tr.scancode == 0)
491                                          break;                                          break;
# Line 583  ui_create_bitmap(int width, int height, Line 589  ui_create_bitmap(int width, int height,
589    
590          tdata = (owncolmap ? data : translate_image(width, height, data));          tdata = (owncolmap ? data : translate_image(width, height, data));
591          bitmap = XCreatePixmap(display, wnd, width, height, depth);          bitmap = XCreatePixmap(display, wnd, width, height, depth);
592          image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width,          image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata,
593                               height, 8, 0);                               width, height, 8, 0);
594    
595          XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height);          XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height);
596    
# Line 602  ui_paint_bitmap(int x, int y, int cx, in Line 608  ui_paint_bitmap(int x, int y, int cx, in
608          uint8 *tdata;          uint8 *tdata;
609    
610          tdata = (owncolmap ? data : translate_image(width, height, data));          tdata = (owncolmap ? data : translate_image(width, height, data));
611          image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width,          image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata,
612                               height, 8, 0);                               width, height, 8, 0);
613    
614          if (ownbackstore)          if (ownbackstore)
615          {          {
# Line 639  ui_create_glyph(int width, int height, u Line 645  ui_create_glyph(int width, int height, u
645          bitmap = XCreatePixmap(display, wnd, width, height, 1);          bitmap = XCreatePixmap(display, wnd, width, height, 1);
646          gc = XCreateGC(display, bitmap, 0, NULL);          gc = XCreateGC(display, bitmap, 0, NULL);
647    
648          image = XCreateImage(display, visual, 1, ZPixmap, 0, data, width,          image = XCreateImage(display, visual, 1, ZPixmap, 0, (char *)data,
649                               height, 8, scanline);                               width, height, 8, scanline);
650          image->byte_order = MSBFirst;          image->byte_order = MSBFirst;
651          image->bitmap_bit_order = MSBFirst;          image->bitmap_bit_order = MSBFirst;
652          XInitImage(image);          XInitImage(image);
# Line 1010  ui_draw_glyph(int mixmode, Line 1016  ui_draw_glyph(int mixmode,
1016        if ((xyoffset & 0x80))\        if ((xyoffset & 0x80))\
1017          {\          {\
1018            if (flags & TEXT2_VERTICAL) \            if (flags & TEXT2_VERTICAL) \
1019              y += ttext[++idx] | (ttext[++idx] << 8);\              y += ttext[idx+1] | (ttext[idx+2] << 8);\
1020            else\            else\
1021              x += ttext[++idx] | (ttext[++idx] << 8);\              x += ttext[idx+1] | (ttext[idx+2] << 8);\
1022              idx += 2;\
1023          }\          }\
1024        else\        else\
1025          {\          {\
# Line 1150  ui_desktop_restore(uint32 offset, int x, Line 1157  ui_desktop_restore(uint32 offset, int x,
1157          if (data == NULL)          if (data == NULL)
1158                  return;                  return;
1159    
1160          image = XCreateImage(display, visual, depth, ZPixmap, 0, data, cx, cy,          image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)data,
1161                               BitmapPad(display), cx * bpp / 8);                               cx, cy, BitmapPad(display), cx * bpp / 8);
1162    
1163          if (ownbackstore)          if (ownbackstore)
1164          {          {

Legend:
Removed from v.66  
changed lines
  Added in v.73

  ViewVC Help
Powered by ViewVC 1.1.26