/[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 70 by astrand, Sat Jul 27 23:09:32 2002 UTC revision 76 by astrand, Mon Jul 29 20:16:22 2002 UTC
# Line 25  Line 25 
25  #define XK_MISCELLANY  #define XK_MISCELLANY
26  #include <X11/keysymdef.h>  #include <X11/keysymdef.h>
27  #include "rdesktop.h"  #include "rdesktop.h"
28    #include "scancodes.h"
29    
30  extern int width;  extern int width;
31  extern int height;  extern int height;
32  extern BOOL sendmotion;  extern BOOL sendmotion;
33  extern BOOL fullscreen;  extern BOOL fullscreen;
34    extern BOOL grab_keyboard;
35    
36  Display *display = NULL;  Display *display = NULL;
37  static int x_socket;  static int x_socket;
# Line 347  ui_create_window(char *title) Line 349  ui_create_window(char *title)
349    
350          input_mask =          input_mask =
351                  KeyPressMask | KeyReleaseMask | ButtonPressMask |                  KeyPressMask | KeyReleaseMask | ButtonPressMask |
352                  ButtonReleaseMask | EnterWindowMask | LeaveWindowMask;                  ButtonReleaseMask;
353            if (grab_keyboard)
354                    input_mask |= EnterWindowMask | LeaveWindowMask;
355          if (sendmotion)          if (sendmotion)
356                  input_mask |= PointerMotionMask;                  input_mask |= PointerMotionMask;
357    
# Line 518  xwin_process_events() Line 522  xwin_process_events()
522                                                 xevent.xmotion.y);                                                 xevent.xmotion.y);
523                                  break;                                  break;
524    
525                            case FocusIn:
526                                    /* fall through */
527                          case EnterNotify:                          case EnterNotify:
528                                  XGrabKeyboard(display, wnd, True,                                  if (grab_keyboard)
529                                                GrabModeAsync, GrabModeAsync,                                          XGrabKeyboard(display, wnd, True,
530                                                CurrentTime);                                                        GrabModeAsync, GrabModeAsync,
531                                                          CurrentTime);
532                                  break;                                  break;
533    
534                            case FocusOut:
535                                    /* reset keys */
536                                    rdp_send_input(ev_time, RDP_INPUT_SCANCODE,
537                                                   KBD_FLAG_DOWN | KBD_FLAG_UP,
538                                                   SCANCODE_CHAR_LCTRL, 0);
539                                    rdp_send_input(ev_time, RDP_INPUT_SCANCODE,
540                                                   KBD_FLAG_DOWN | KBD_FLAG_UP,
541                                                   SCANCODE_CHAR_LALT, 0);
542                                    /* fall through */
543                          case LeaveNotify:                          case LeaveNotify:
544                                  XUngrabKeyboard(display, CurrentTime);                                  if (grab_keyboard)
545                                            XUngrabKeyboard(display, CurrentTime);
546                                  break;                                  break;
547    
548                          case Expose:                          case Expose:
# Line 589  ui_create_bitmap(int width, int height, Line 606  ui_create_bitmap(int width, int height,
606    
607          tdata = (owncolmap ? data : translate_image(width, height, data));          tdata = (owncolmap ? data : translate_image(width, height, data));
608          bitmap = XCreatePixmap(display, wnd, width, height, depth);          bitmap = XCreatePixmap(display, wnd, width, height, depth);
609          image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width,          image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata,
610                               height, 8, 0);                               width, height, 8, 0);
611    
612          XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height);          XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height);
613    
# Line 608  ui_paint_bitmap(int x, int y, int cx, in Line 625  ui_paint_bitmap(int x, int y, int cx, in
625          uint8 *tdata;          uint8 *tdata;
626    
627          tdata = (owncolmap ? data : translate_image(width, height, data));          tdata = (owncolmap ? data : translate_image(width, height, data));
628          image = XCreateImage(display, visual, depth, ZPixmap, 0, tdata, width,          image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata,
629                               height, 8, 0);                               width, height, 8, 0);
630    
631          if (ownbackstore)          if (ownbackstore)
632          {          {
# Line 645  ui_create_glyph(int width, int height, u Line 662  ui_create_glyph(int width, int height, u
662          bitmap = XCreatePixmap(display, wnd, width, height, 1);          bitmap = XCreatePixmap(display, wnd, width, height, 1);
663          gc = XCreateGC(display, bitmap, 0, NULL);          gc = XCreateGC(display, bitmap, 0, NULL);
664    
665          image = XCreateImage(display, visual, 1, ZPixmap, 0, data, width,          image = XCreateImage(display, visual, 1, ZPixmap, 0, (char *)data,
666                               height, 8, scanline);                               width, height, 8, scanline);
667          image->byte_order = MSBFirst;          image->byte_order = MSBFirst;
668          image->bitmap_bit_order = MSBFirst;          image->bitmap_bit_order = MSBFirst;
669          XInitImage(image);          XInitImage(image);
# Line 1016  ui_draw_glyph(int mixmode, Line 1033  ui_draw_glyph(int mixmode,
1033        if ((xyoffset & 0x80))\        if ((xyoffset & 0x80))\
1034          {\          {\
1035            if (flags & TEXT2_VERTICAL) \            if (flags & TEXT2_VERTICAL) \
1036              y += ttext[++idx] | (ttext[++idx] << 8);\              y += ttext[idx+1] | (ttext[idx+2] << 8);\
1037            else\            else\
1038              x += ttext[++idx] | (ttext[++idx] << 8);\              x += ttext[idx+1] | (ttext[idx+2] << 8);\
1039              idx += 2;\
1040          }\          }\
1041        else\        else\
1042          {\          {\
# Line 1156  ui_desktop_restore(uint32 offset, int x, Line 1174  ui_desktop_restore(uint32 offset, int x,
1174          if (data == NULL)          if (data == NULL)
1175                  return;                  return;
1176    
1177          image = XCreateImage(display, visual, depth, ZPixmap, 0, data, cx, cy,          image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)data,
1178                               BitmapPad(display), cx * bpp / 8);                               cx, cy, BitmapPad(display), cx * bpp / 8);
1179    
1180          if (ownbackstore)          if (ownbackstore)
1181          {          {

Legend:
Removed from v.70  
changed lines
  Added in v.76

  ViewVC Help
Powered by ViewVC 1.1.26