/[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 1346 by ossman_, Thu Dec 7 15:23:45 2006 UTC revision 1407 by astrand, Mon May 14 12:11:15 2007 UTC
# Line 1  Line 1 
1  /* -*- c-basic-offset: 8 -*-  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     User interface services - X Window System     User interface services - X Window System
4     Copyright (C) Matthew Chapman 1999-2005     Copyright (C) Matthew Chapman 1999-2007
5    
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 20  Line 20 
20    
21  #include <X11/Xlib.h>  #include <X11/Xlib.h>
22  #include <X11/Xutil.h>  #include <X11/Xutil.h>
23    #include <X11/Xproto.h>
24  #include <unistd.h>  #include <unistd.h>
25  #include <sys/time.h>  #include <sys/time.h>
26  #include <time.h>  #include <time.h>
# Line 28  Line 29 
29  #include "rdesktop.h"  #include "rdesktop.h"
30  #include "xproto.h"  #include "xproto.h"
31    
 /* We can't include Xproto.h because of conflicting defines for BOOL */  
 #define X_ConfigureWindow              12  
   
32  extern int g_width;  extern int g_width;
33  extern int g_height;  extern int g_height;
34  extern int g_xpos;  extern int g_xpos;
35  extern int g_ypos;  extern int g_ypos;
36  extern int g_pos;  extern int g_pos;
37  extern BOOL g_sendmotion;  extern RD_BOOL g_sendmotion;
38  extern BOOL g_fullscreen;  extern RD_BOOL g_fullscreen;
39  extern BOOL g_grab_keyboard;  extern RD_BOOL g_grab_keyboard;
40  extern BOOL g_hide_decorations;  extern RD_BOOL g_hide_decorations;
41  extern char g_title[];  extern char g_title[];
42  /* Color depth of the RDP session.  /* Color depth of the RDP session.
43     As of RDP 5.1, it may be 8, 15, 16 or 24. */     As of RDP 5.1, it may be 8, 15, 16 or 24. */
# Line 71  typedef struct _seamless_window Line 69  typedef struct _seamless_window
69          unsigned int desktop;          unsigned int desktop;
70          struct timeval *position_timer;          struct timeval *position_timer;
71    
72          BOOL outstanding_position;          RD_BOOL outstanding_position;
73          unsigned int outpos_serial;          unsigned int outpos_serial;
74          int outpos_xoffset, outpos_yoffset;          int outpos_xoffset, outpos_yoffset;
75          int outpos_width, outpos_height;          int outpos_width, outpos_height;
# Line 80  typedef struct _seamless_window Line 78  typedef struct _seamless_window
78  } seamless_window;  } seamless_window;
79  static seamless_window *g_seamless_windows = NULL;  static seamless_window *g_seamless_windows = NULL;
80  static unsigned long g_seamless_focused = 0;  static unsigned long g_seamless_focused = 0;
81  static BOOL g_seamless_started = False; /* Server end is up and running */  static RD_BOOL g_seamless_started = False;      /* Server end is up and running */
82  static BOOL g_seamless_active = False;  /* We are currently in seamless mode */  static RD_BOOL g_seamless_active = False;       /* We are currently in seamless mode */
83  static BOOL g_seamless_hidden = False;  /* Desktop is hidden on server */  static RD_BOOL g_seamless_hidden = False;       /* Desktop is hidden on server */
84  extern BOOL g_seamless_rdp;  extern RD_BOOL g_seamless_rdp;
85    
86  extern uint32 g_embed_wnd;  extern uint32 g_embed_wnd;
87  BOOL g_enable_compose = False;  RD_BOOL g_enable_compose = False;
88  BOOL g_Unobscured;              /* used for screenblt */  RD_BOOL g_Unobscured;           /* used for screenblt */
89  static GC g_gc = NULL;  static GC g_gc = NULL;
90  static GC g_create_bitmap_gc = NULL;  static GC g_create_bitmap_gc = NULL;
91  static GC g_create_glyph_gc = NULL;  static GC g_create_glyph_gc = NULL;
# Line 104  static int g_bpp; Line 102  static int g_bpp;
102  static XIM g_IM;  static XIM g_IM;
103  static XIC g_IC;  static XIC g_IC;
104  static XModifierKeymap *g_mod_map;  static XModifierKeymap *g_mod_map;
105    /* Maps logical (xmodmap -pp) pointing device buttons (0-based) back
106       to physical (1-based) indices. */
107    static unsigned char g_pointer_log_to_phys_map[16];
108  static Cursor g_current_cursor;  static Cursor g_current_cursor;
109  static HCURSOR g_null_cursor = NULL;  static RD_HCURSOR g_null_cursor = NULL;
110  static Atom g_protocol_atom, g_kill_atom;  static Atom g_protocol_atom, g_kill_atom;
111  extern Atom g_net_wm_state_atom;  extern Atom g_net_wm_state_atom;
112  extern Atom g_net_wm_desktop_atom;  extern Atom g_net_wm_desktop_atom;
113  static BOOL g_focused;  static RD_BOOL g_focused;
114  static BOOL g_mouse_in_wnd;  static RD_BOOL g_mouse_in_wnd;
115  /* Indicates that:  /* Indicates that:
116     1) visual has 15, 16 or 24 depth and the same color channel masks     1) visual has 15, 16 or 24 depth and the same color channel masks
117        as its RDP equivalent (implies X server is LE),        as its RDP equivalent (implies X server is LE),
118     2) host is LE     2) host is LE
119     This will trigger an optimization whose real value is questionable.     This will trigger an optimization whose real value is questionable.
120  */  */
121  static BOOL g_compatible_arch;  static RD_BOOL g_compatible_arch;
122  /* Indicates whether RDP's bitmaps and our XImages have the same  /* Indicates whether RDP's bitmaps and our XImages have the same
123     binary format. If so, we can avoid an expensive translation.     binary format. If so, we can avoid an expensive translation.
124     Note that this can be true when g_compatible_arch is false,     Note that this can be true when g_compatible_arch is false,
# Line 128  static BOOL g_compatible_arch; Line 129  static BOOL g_compatible_arch;
129     ('host' is the machine running rdesktop; the host simply memcpy's     ('host' is the machine running rdesktop; the host simply memcpy's
130      so its endianess doesn't matter)      so its endianess doesn't matter)
131   */   */
132  static BOOL g_no_translate_image = False;  static RD_BOOL g_no_translate_image = False;
133    
134  /* endianness */  /* endianness */
135  static BOOL g_host_be;  static RD_BOOL g_host_be;
136  static BOOL g_xserver_be;  static RD_BOOL g_xserver_be;
137  static int g_red_shift_r, g_blue_shift_r, g_green_shift_r;  static int g_red_shift_r, g_blue_shift_r, g_green_shift_r;
138  static int g_red_shift_l, g_blue_shift_l, g_green_shift_l;  static int g_red_shift_l, g_blue_shift_l, g_green_shift_l;
139    
140  /* software backing store */  /* software backing store */
141  extern BOOL g_ownbackstore;  extern RD_BOOL g_ownbackstore;
142  static Pixmap g_backstore = 0;  static Pixmap g_backstore = 0;
143    
144  /* Moving in single app mode */  /* Moving in single app mode */
145  static BOOL g_moving_wnd;  static RD_BOOL g_moving_wnd;
146  static int g_move_x_offset = 0;  static int g_move_x_offset = 0;
147  static int g_move_y_offset = 0;  static int g_move_y_offset = 0;
148  static BOOL g_using_full_workarea = False;  static RD_BOOL g_using_full_workarea = False;
149    
150  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
151  extern BOOL g_rdpsnd;  extern RD_BOOL g_rdpsnd;
152  #endif  #endif
153    
154  /* MWM decorations */  /* MWM decorations */
# Line 248  seamless_XDrawLines(Drawable d, XPoint * Line 249  seamless_XDrawLines(Drawable d, XPoint *
249  }  }
250    
251  /* colour maps */  /* colour maps */
252  extern BOOL g_owncolmap;  extern RD_BOOL g_owncolmap;
253  static Colormap g_xcolmap;  static Colormap g_xcolmap;
254  static uint32 *g_colmap = NULL;  static uint32 *g_colmap = NULL;
255    
# Line 472  sw_handle_restack(seamless_window * sw) Line 473  sw_handle_restack(seamless_window * sw)
473    
474    
475  static seamless_group *  static seamless_group *
476  sw_find_group(unsigned long id, BOOL dont_create)  sw_find_group(unsigned long id, RD_BOOL dont_create)
477  {  {
478          seamless_window *sw;          seamless_window *sw;
479          seamless_group *sg;          seamless_group *sg;
# Line 1262  translate_image(int width, int height, u Line 1263  translate_image(int width, int height, u
1263          return out;          return out;
1264  }  }
1265    
1266  BOOL  static void
1267    xwin_refresh_pointer_map(void)
1268    {
1269            unsigned char phys_to_log_map[sizeof(g_pointer_log_to_phys_map)];
1270            int i, pointer_buttons;
1271    
1272            pointer_buttons = XGetPointerMapping(g_display, phys_to_log_map, sizeof(phys_to_log_map));
1273            for (i = 0; i < pointer_buttons; ++i)
1274            {
1275                    /* This might produce multiple logical buttons mapping
1276                       to a single physical one, but hey, that's
1277                       life... */
1278                    g_pointer_log_to_phys_map[phys_to_log_map[i] - 1] = i + 1;
1279            }
1280    }
1281    
1282    RD_BOOL
1283  get_key_state(unsigned int state, uint32 keysym)  get_key_state(unsigned int state, uint32 keysym)
1284  {  {
1285          int modifierpos, key, keysymMask = 0;          int modifierpos, key, keysymMask = 0;
# Line 1310  calculate_mask_weight(uint32 mask) Line 1327  calculate_mask_weight(uint32 mask)
1327          return weight;          return weight;
1328  }  }
1329    
1330  static BOOL  static RD_BOOL
1331  select_visual(int screen_num)  select_visual(int screen_num)
1332  {  {
1333          XPixmapFormatValues *pfm;          XPixmapFormatValues *pfm;
# Line 1349  select_visual(int screen_num) Line 1366  select_visual(int screen_num)
1366                  for (i = 0; i < visuals_count; ++i)                  for (i = 0; i < visuals_count; ++i)
1367                  {                  {
1368                          XVisualInfo *visual_info = &vmatches[i];                          XVisualInfo *visual_info = &vmatches[i];
1369                          BOOL can_translate_to_bpp = False;                          RD_BOOL can_translate_to_bpp = False;
1370                          int j;                          int j;
1371    
1372                          /* Try to find a no-translation visual that'll                          /* Try to find a no-translation visual that'll
# Line 1521  error_handler(Display * dpy, XErrorEvent Line 1538  error_handler(Display * dpy, XErrorEvent
1538          return g_old_error_handler(dpy, eev);          return g_old_error_handler(dpy, eev);
1539  }  }
1540    
1541  BOOL  RD_BOOL
1542  ui_init(void)  ui_init(void)
1543  {  {
1544          int screen_num;          int screen_num;
# Line 1535  ui_init(void) Line 1552  ui_init(void)
1552    
1553          {          {
1554                  uint16 endianess_test = 1;                  uint16 endianess_test = 1;
1555                  g_host_be = !(BOOL) (*(uint8 *) (&endianess_test));                  g_host_be = !(RD_BOOL) (*(uint8 *) (&endianess_test));
1556          }          }
1557    
1558          g_old_error_handler = XSetErrorHandler(error_handler);          g_old_error_handler = XSetErrorHandler(error_handler);
# Line 1616  ui_init(void) Line 1633  ui_init(void)
1633          g_width = (g_width + 3) & ~3;          g_width = (g_width + 3) & ~3;
1634    
1635          g_mod_map = XGetModifierMapping(g_display);          g_mod_map = XGetModifierMapping(g_display);
1636            xwin_refresh_pointer_map();
1637    
1638          xkeymap_init();          xkeymap_init();
1639    
# Line 1687  get_input_mask(long *input_mask) Line 1705  get_input_mask(long *input_mask)
1705                  *input_mask |= LeaveWindowMask;                  *input_mask |= LeaveWindowMask;
1706  }  }
1707    
1708  BOOL  RD_BOOL
1709  ui_create_window(void)  ui_create_window(void)
1710  {  {
1711          uint8 null_pointer_mask[1] = { 0x80 };          uint8 null_pointer_mask[1] = { 0x80 };
# Line 1735  ui_create_window(void) Line 1753  ui_create_window(void)
1753          }          }
1754    
1755          XStoreName(g_display, g_wnd, g_title);          XStoreName(g_display, g_wnd, g_title);
1756            ewmh_set_wm_name(g_wnd, g_title);
1757    
1758          if (g_hide_decorations)          if (g_hide_decorations)
1759                  mwm_hide_decorations(g_wnd);                  mwm_hide_decorations(g_wnd);
# Line 1874  xwin_toggle_fullscreen(void) Line 1893  xwin_toggle_fullscreen(void)
1893  }  }
1894    
1895  static void  static void
1896  handle_button_event(XEvent xevent, BOOL down)  handle_button_event(XEvent xevent, RD_BOOL down)
1897  {  {
1898          uint16 button, flags = 0;          uint16 button, flags = 0;
1899          g_last_gesturetime = xevent.xbutton.time;          g_last_gesturetime = xevent.xbutton.time;
1900            /* Reverse the pointer button mapping, e.g. in the case of
1901               "left-handed mouse mode"; the RDP session expects to
1902               receive physical buttons (true in mstsc as well) and
1903               logical button behavior depends on the remote desktop's own
1904               mouse settings */
1905            xevent.xbutton.button = g_pointer_log_to_phys_map[xevent.xbutton.button - 1];
1906          button = xkeymap_translate_button(xevent.xbutton.button);          button = xkeymap_translate_button(xevent.xbutton.button);
1907          if (button == 0)          if (button == 0)
1908                  return;                  return;
# Line 2165  xwin_process_events(void) Line 2190  xwin_process_events(void)
2190                                          XFreeModifiermap(g_mod_map);                                          XFreeModifiermap(g_mod_map);
2191                                          g_mod_map = XGetModifierMapping(g_display);                                          g_mod_map = XGetModifierMapping(g_display);
2192                                  }                                  }
2193    
2194                                    if (xevent.xmapping.request == MappingPointer)
2195                                    {
2196                                            xwin_refresh_pointer_map();
2197                                    }
2198    
2199                                  break;                                  break;
2200    
2201                                  /* clipboard stuff */                                  /* clipboard stuff */
# Line 2248  ui_select(int rdp_socket) Line 2279  ui_select(int rdp_socket)
2279          int n;          int n;
2280          fd_set rfds, wfds;          fd_set rfds, wfds;
2281          struct timeval tv;          struct timeval tv;
2282          BOOL s_timeout = False;          RD_BOOL s_timeout = False;
2283    
2284          while (True)          while (True)
2285          {          {
# Line 2292  ui_select(int rdp_socket) Line 2323  ui_select(int rdp_socket)
2323    
2324                                  /* Abort serial read calls */                                  /* Abort serial read calls */
2325                                  if (s_timeout)                                  if (s_timeout)
2326                                          rdpdr_check_fds(&rfds, &wfds, (BOOL) True);                                          rdpdr_check_fds(&rfds, &wfds, (RD_BOOL) True);
2327                                  continue;                                  continue;
2328                  }                  }
2329    
# Line 2300  ui_select(int rdp_socket) Line 2331  ui_select(int rdp_socket)
2331                  rdpsnd_check_fds(&rfds, &wfds);                  rdpsnd_check_fds(&rfds, &wfds);
2332  #endif  #endif
2333    
2334                  rdpdr_check_fds(&rfds, &wfds, (BOOL) False);                  rdpdr_check_fds(&rfds, &wfds, (RD_BOOL) False);
2335    
2336                  if (FD_ISSET(rdp_socket, &rfds))                  if (FD_ISSET(rdp_socket, &rfds))
2337                          return 1;                          return 1;
# Line 2314  ui_move_pointer(int x, int y) Line 2345  ui_move_pointer(int x, int y)
2345          XWarpPointer(g_display, g_wnd, g_wnd, 0, 0, 0, 0, x, y);          XWarpPointer(g_display, g_wnd, g_wnd, 0, 0, 0, 0, x, y);
2346  }  }
2347    
2348  HBITMAP  RD_HBITMAP
2349  ui_create_bitmap(int width, int height, uint8 * data)  ui_create_bitmap(int width, int height, uint8 * data)
2350  {  {
2351          XImage *image;          XImage *image;
# Line 2344  ui_create_bitmap(int width, int height, Line 2375  ui_create_bitmap(int width, int height,
2375          XFree(image);          XFree(image);
2376          if (tdata != data)          if (tdata != data)
2377                  xfree(tdata);                  xfree(tdata);
2378          return (HBITMAP) bitmap;          return (RD_HBITMAP) bitmap;
2379  }  }
2380    
2381  void  void
# Line 2392  ui_paint_bitmap(int x, int y, int cx, in Line 2423  ui_paint_bitmap(int x, int y, int cx, in
2423  }  }
2424    
2425  void  void
2426  ui_destroy_bitmap(HBITMAP bmp)  ui_destroy_bitmap(RD_HBITMAP bmp)
2427  {  {
2428          XFreePixmap(g_display, (Pixmap) bmp);          XFreePixmap(g_display, (Pixmap) bmp);
2429  }  }
2430    
2431  HGLYPH  RD_HGLYPH
2432  ui_create_glyph(int width, int height, uint8 * data)  ui_create_glyph(int width, int height, uint8 * data)
2433  {  {
2434          XImage *image;          XImage *image;
# Line 2419  ui_create_glyph(int width, int height, u Line 2450  ui_create_glyph(int width, int height, u
2450          XPutImage(g_display, bitmap, g_create_glyph_gc, image, 0, 0, 0, 0, width, height);          XPutImage(g_display, bitmap, g_create_glyph_gc, image, 0, 0, 0, 0, width, height);
2451    
2452          XFree(image);          XFree(image);
2453          return (HGLYPH) bitmap;          return (RD_HGLYPH) bitmap;
2454  }  }
2455    
2456  void  void
2457  ui_destroy_glyph(HGLYPH glyph)  ui_destroy_glyph(RD_HGLYPH glyph)
2458  {  {
2459          XFreePixmap(g_display, (Pixmap) glyph);          XFreePixmap(g_display, (Pixmap) glyph);
2460  }  }
2461    
2462  HCURSOR  RD_HCURSOR
2463  ui_create_cursor(unsigned int x, unsigned int y, int width, int height,  ui_create_cursor(unsigned int x, unsigned int y, int width, int height,
2464                   uint8 * andmask, uint8 * xormask)                   uint8 * andmask, uint8 * xormask)
2465  {  {
2466          HGLYPH maskglyph, cursorglyph;          RD_HGLYPH maskglyph, cursorglyph;
2467          XColor bg, fg;          XColor bg, fg;
2468          Cursor xcursor;          Cursor xcursor;
2469          uint8 *cursor, *pcursor;          uint8 *cursor, *pcursor;
# Line 2496  ui_create_cursor(unsigned int x, unsigne Line 2527  ui_create_cursor(unsigned int x, unsigne
2527          ui_destroy_glyph(cursorglyph);          ui_destroy_glyph(cursorglyph);
2528          xfree(mask);          xfree(mask);
2529          xfree(cursor);          xfree(cursor);
2530          return (HCURSOR) xcursor;          return (RD_HCURSOR) xcursor;
2531  }  }
2532    
2533  void  void
2534  ui_set_cursor(HCURSOR cursor)  ui_set_cursor(RD_HCURSOR cursor)
2535  {  {
2536          g_current_cursor = (Cursor) cursor;          g_current_cursor = (Cursor) cursor;
2537          XDefineCursor(g_display, g_wnd, g_current_cursor);          XDefineCursor(g_display, g_wnd, g_current_cursor);
# Line 2508  ui_set_cursor(HCURSOR cursor) Line 2539  ui_set_cursor(HCURSOR cursor)
2539  }  }
2540    
2541  void  void
2542  ui_destroy_cursor(HCURSOR cursor)  ui_destroy_cursor(RD_HCURSOR cursor)
2543  {  {
2544          XFreeCursor(g_display, (Cursor) cursor);          XFreeCursor(g_display, (Cursor) cursor);
2545  }  }
# Line 2526  ui_set_null_cursor(void) Line 2557  ui_set_null_cursor(void)
2557                  (xc)->flags = DoRed | DoGreen | DoBlue;                  (xc)->flags = DoRed | DoGreen | DoBlue;
2558    
2559    
2560  HCOLOURMAP  RD_HCOLOURMAP
2561  ui_create_colourmap(COLOURMAP * colours)  ui_create_colourmap(COLOURMAP * colours)
2562  {  {
2563          COLOURENTRY *entry;          COLOURENTRY *entry;
# Line 2622  ui_create_colourmap(COLOURMAP * colours) Line 2653  ui_create_colourmap(COLOURMAP * colours)
2653                  XStoreColors(g_display, map, xcolours, ncolours);                  XStoreColors(g_display, map, xcolours, ncolours);
2654    
2655                  xfree(xcolours);                  xfree(xcolours);
2656                  return (HCOLOURMAP) map;                  return (RD_HCOLOURMAP) map;
2657          }          }
2658  }  }
2659    
2660  void  void
2661  ui_destroy_colourmap(HCOLOURMAP map)  ui_destroy_colourmap(RD_HCOLOURMAP map)
2662  {  {
2663          if (!g_owncolmap)          if (!g_owncolmap)
2664                  xfree(map);                  xfree(map);
# Line 2636  ui_destroy_colourmap(HCOLOURMAP map) Line 2667  ui_destroy_colourmap(HCOLOURMAP map)
2667  }  }
2668    
2669  void  void
2670  ui_set_colourmap(HCOLOURMAP map)  ui_set_colourmap(RD_HCOLOURMAP map)
2671  {  {
2672          if (!g_owncolmap)          if (!g_owncolmap)
2673          {          {
# Line 2724  ui_patblt(uint8 opcode, Line 2755  ui_patblt(uint8 opcode,
2755                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
2756                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2757                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2758                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2759                          break;                          break;
2760    
2761                  case 3: /* Pattern */                  case 3: /* Pattern */
# Line 2739  ui_patblt(uint8 opcode, Line 2770  ui_patblt(uint8 opcode,
2770                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
2771                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2772                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2773                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2774                          break;                          break;
2775    
2776                  default:                  default:
# Line 2782  ui_screenblt(uint8 opcode, Line 2813  ui_screenblt(uint8 opcode,
2813  void  void
2814  ui_memblt(uint8 opcode,  ui_memblt(uint8 opcode,
2815            /* dest */ int x, int y, int cx, int cy,            /* dest */ int x, int y, int cx, int cy,
2816            /* src */ HBITMAP src, int srcx, int srcy)            /* src */ RD_HBITMAP src, int srcx, int srcy)
2817  {  {
2818          SET_FUNCTION(opcode);          SET_FUNCTION(opcode);
2819          XCopyArea(g_display, (Pixmap) src, g_wnd, g_gc, srcx, srcy, cx, cy, x, y);          XCopyArea(g_display, (Pixmap) src, g_wnd, g_gc, srcx, srcy, cx, cy, x, y);
# Line 2797  ui_memblt(uint8 opcode, Line 2828  ui_memblt(uint8 opcode,
2828  void  void
2829  ui_triblt(uint8 opcode,  ui_triblt(uint8 opcode,
2830            /* dest */ int x, int y, int cx, int cy,            /* dest */ int x, int y, int cx, int cy,
2831            /* src */ HBITMAP src, int srcx, int srcy,            /* src */ RD_HBITMAP src, int srcx, int srcy,
2832            /* brush */ BRUSH * brush, int bgcolour, int fgcolour)            /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
2833  {  {
2834          /* This is potentially difficult to do in general. Until someone          /* This is potentially difficult to do in general. Until someone
# Line 2855  ui_rect( Line 2886  ui_rect(
2886  void  void
2887  ui_polygon(uint8 opcode,  ui_polygon(uint8 opcode,
2888             /* mode */ uint8 fillmode,             /* mode */ uint8 fillmode,
2889             /* dest */ POINT * point, int npoints,             /* dest */ RD_POINT * point, int npoints,
2890             /* brush */ BRUSH * brush, int bgcolour, int fgcolour)             /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
2891  {  {
2892          uint8 style, i, ipattern[8];          uint8 style, i, ipattern[8];
# Line 2898  ui_polygon(uint8 opcode, Line 2929  ui_polygon(uint8 opcode,
2929                          FILL_POLYGON((XPoint *) point, npoints);                          FILL_POLYGON((XPoint *) point, npoints);
2930                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2931                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2932                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2933                          break;                          break;
2934    
2935                  case 3: /* Pattern */                  case 3: /* Pattern */
# Line 2913  ui_polygon(uint8 opcode, Line 2944  ui_polygon(uint8 opcode,
2944                          FILL_POLYGON((XPoint *) point, npoints);                          FILL_POLYGON((XPoint *) point, npoints);
2945                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2946                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2947                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2948                          break;                          break;
2949    
2950                  default:                  default:
# Line 2925  ui_polygon(uint8 opcode, Line 2956  ui_polygon(uint8 opcode,
2956    
2957  void  void
2958  ui_polyline(uint8 opcode,  ui_polyline(uint8 opcode,
2959              /* dest */ POINT * points, int npoints,              /* dest */ RD_POINT * points, int npoints,
2960              /* pen */ PEN * pen)              /* pen */ PEN * pen)
2961  {  {
2962          /* TODO: set join style */          /* TODO: set join style */
# Line 2976  ui_ellipse(uint8 opcode, Line 3007  ui_ellipse(uint8 opcode,
3007                          DRAW_ELLIPSE(x, y, cx, cy, fillmode);                          DRAW_ELLIPSE(x, y, cx, cy, fillmode);
3008                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
3009                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
3010                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
3011                          break;                          break;
3012    
3013                  case 3: /* Pattern */                  case 3: /* Pattern */
# Line 2991  ui_ellipse(uint8 opcode, Line 3022  ui_ellipse(uint8 opcode,
3022                          DRAW_ELLIPSE(x, y, cx, cy, fillmode);                          DRAW_ELLIPSE(x, y, cx, cy, fillmode);
3023                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
3024                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
3025                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
3026                          break;                          break;
3027    
3028                  default:                  default:
# Line 3005  ui_ellipse(uint8 opcode, Line 3036  ui_ellipse(uint8 opcode,
3036  void  void
3037  ui_draw_glyph(int mixmode,  ui_draw_glyph(int mixmode,
3038                /* dest */ int x, int y, int cx, int cy,                /* dest */ int x, int y, int cx, int cy,
3039                /* src */ HGLYPH glyph, int srcx, int srcy,                /* src */ RD_HGLYPH glyph, int srcx, int srcy,
3040                int bgcolour, int fgcolour)                int bgcolour, int fgcolour)
3041  {  {
3042          SET_FOREGROUND(fgcolour);          SET_FOREGROUND(fgcolour);
# Line 3219  ui_desktop_restore(uint32 offset, int x, Line 3250  ui_desktop_restore(uint32 offset, int x,
3250                  return;                  return;
3251    
3252          image = XCreateImage(g_display, g_visual, g_depth, ZPixmap, 0,          image = XCreateImage(g_display, g_visual, g_depth, ZPixmap, 0,
3253                               (char *) data, cx, cy, BitmapPad(g_display), cx * g_bpp / 8);                               (char *) data, cx, cy, g_bpp, 0);
3254    
3255          if (g_ownbackstore)          if (g_ownbackstore)
3256          {          {
# Line 3253  ui_end_update(void) Line 3284  ui_end_update(void)
3284    
3285    
3286  void  void
3287  ui_seamless_begin(BOOL hidden)  ui_seamless_begin(RD_BOOL hidden)
3288  {  {
3289          if (!g_seamless_rdp)          if (!g_seamless_rdp)
3290                  return;                  return;

Legend:
Removed from v.1346  
changed lines
  Added in v.1407

  ViewVC Help
Powered by ViewVC 1.1.26