/[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 1250 by astrand, Mon Aug 7 11:46:28 2006 UTC revision 1372 by jsorg71, Mon Jan 8 04:47:06 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 105  static XIM g_IM; Line 103  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  static Cursor g_current_cursor;  static Cursor g_current_cursor;
106  static HCURSOR g_null_cursor = NULL;  static RD_HCURSOR g_null_cursor = NULL;
107  static Atom g_protocol_atom, g_kill_atom;  static Atom g_protocol_atom, g_kill_atom;
108  extern Atom g_net_wm_state_atom;  extern Atom g_net_wm_state_atom;
109  extern Atom g_net_wm_desktop_atom;  extern Atom g_net_wm_desktop_atom;
110  static BOOL g_focused;  static RD_BOOL g_focused;
111  static BOOL g_mouse_in_wnd;  static RD_BOOL g_mouse_in_wnd;
112  /* Indicates that:  /* Indicates that:
113     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
114        as its RDP equivalent (implies X server is LE),        as its RDP equivalent (implies X server is LE),
115     2) host is LE     2) host is LE
116     This will trigger an optimization whose real value is questionable.     This will trigger an optimization whose real value is questionable.
117  */  */
118  static BOOL g_compatible_arch;  static RD_BOOL g_compatible_arch;
119  /* Indicates whether RDP's bitmaps and our XImages have the same  /* Indicates whether RDP's bitmaps and our XImages have the same
120     binary format. If so, we can avoid an expensive translation.     binary format. If so, we can avoid an expensive translation.
121     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 126  static BOOL g_compatible_arch;
126     ('host' is the machine running rdesktop; the host simply memcpy's     ('host' is the machine running rdesktop; the host simply memcpy's
127      so its endianess doesn't matter)      so its endianess doesn't matter)
128   */   */
129  static BOOL g_no_translate_image = False;  static RD_BOOL g_no_translate_image = False;
130    
131  /* endianness */  /* endianness */
132  static BOOL g_host_be;  static RD_BOOL g_host_be;
133  static BOOL g_xserver_be;  static RD_BOOL g_xserver_be;
134  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;
135  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;
136    
137  /* software backing store */  /* software backing store */
138  extern BOOL g_ownbackstore;  extern RD_BOOL g_ownbackstore;
139  static Pixmap g_backstore = 0;  static Pixmap g_backstore = 0;
140    
141  /* Moving in single app mode */  /* Moving in single app mode */
142  static BOOL g_moving_wnd;  static RD_BOOL g_moving_wnd;
143  static int g_move_x_offset = 0;  static int g_move_x_offset = 0;
144  static int g_move_y_offset = 0;  static int g_move_y_offset = 0;
145  static BOOL g_using_full_workarea = False;  static RD_BOOL g_using_full_workarea = False;
146    
147  #ifdef WITH_RDPSND  #ifdef WITH_RDPSND
148  extern int g_dsp_fd;  extern RD_BOOL g_rdpsnd;
 extern BOOL g_dsp_busy;  
 extern BOOL g_rdpsnd;  
149  #endif  #endif
150    
151  /* MWM decorations */  /* MWM decorations */
# Line 250  seamless_XDrawLines(Drawable d, XPoint * Line 246  seamless_XDrawLines(Drawable d, XPoint *
246  }  }
247    
248  /* colour maps */  /* colour maps */
249  extern BOOL g_owncolmap;  extern RD_BOOL g_owncolmap;
250  static Colormap g_xcolmap;  static Colormap g_xcolmap;
251  static uint32 *g_colmap = NULL;  static uint32 *g_colmap = NULL;
252    
# Line 474  sw_handle_restack(seamless_window * sw) Line 470  sw_handle_restack(seamless_window * sw)
470    
471    
472  static seamless_group *  static seamless_group *
473  sw_find_group(unsigned long id, BOOL dont_create)  sw_find_group(unsigned long id, RD_BOOL dont_create)
474  {  {
475          seamless_window *sw;          seamless_window *sw;
476          seamless_group *sg;          seamless_group *sg;
# Line 1264  translate_image(int width, int height, u Line 1260  translate_image(int width, int height, u
1260          return out;          return out;
1261  }  }
1262    
1263  BOOL  RD_BOOL
1264  get_key_state(unsigned int state, uint32 keysym)  get_key_state(unsigned int state, uint32 keysym)
1265  {  {
1266          int modifierpos, key, keysymMask = 0;          int modifierpos, key, keysymMask = 0;
# Line 1312  calculate_mask_weight(uint32 mask) Line 1308  calculate_mask_weight(uint32 mask)
1308          return weight;          return weight;
1309  }  }
1310    
1311  static BOOL  static RD_BOOL
1312  select_visual(int screen_num)  select_visual(int screen_num)
1313  {  {
1314          XPixmapFormatValues *pfm;          XPixmapFormatValues *pfm;
# Line 1351  select_visual(int screen_num) Line 1347  select_visual(int screen_num)
1347                  for (i = 0; i < visuals_count; ++i)                  for (i = 0; i < visuals_count; ++i)
1348                  {                  {
1349                          XVisualInfo *visual_info = &vmatches[i];                          XVisualInfo *visual_info = &vmatches[i];
1350                          BOOL can_translate_to_bpp = False;                          RD_BOOL can_translate_to_bpp = False;
1351                          int j;                          int j;
1352    
1353                          /* Try to find a no-translation visual that'll                          /* Try to find a no-translation visual that'll
# Line 1523  error_handler(Display * dpy, XErrorEvent Line 1519  error_handler(Display * dpy, XErrorEvent
1519          return g_old_error_handler(dpy, eev);          return g_old_error_handler(dpy, eev);
1520  }  }
1521    
1522  BOOL  RD_BOOL
1523  ui_init(void)  ui_init(void)
1524  {  {
1525          int screen_num;          int screen_num;
# Line 1537  ui_init(void) Line 1533  ui_init(void)
1533    
1534          {          {
1535                  uint16 endianess_test = 1;                  uint16 endianess_test = 1;
1536                  g_host_be = !(BOOL) (*(uint8 *) (&endianess_test));                  g_host_be = !(RD_BOOL) (*(uint8 *) (&endianess_test));
1537          }          }
1538    
1539          g_old_error_handler = XSetErrorHandler(error_handler);          g_old_error_handler = XSetErrorHandler(error_handler);
# Line 1689  get_input_mask(long *input_mask) Line 1685  get_input_mask(long *input_mask)
1685                  *input_mask |= LeaveWindowMask;                  *input_mask |= LeaveWindowMask;
1686  }  }
1687    
1688  BOOL  RD_BOOL
1689  ui_create_window(void)  ui_create_window(void)
1690  {  {
1691          uint8 null_pointer_mask[1] = { 0x80 };          uint8 null_pointer_mask[1] = { 0x80 };
# Line 1876  xwin_toggle_fullscreen(void) Line 1872  xwin_toggle_fullscreen(void)
1872  }  }
1873    
1874  static void  static void
1875  handle_button_event(XEvent xevent, BOOL down)  handle_button_event(XEvent xevent, RD_BOOL down)
1876  {  {
1877          uint16 button, flags = 0;          uint16 button, flags = 0;
1878          g_last_gesturetime = xevent.xbutton.time;          g_last_gesturetime = xevent.xbutton.time;
# Line 2250  ui_select(int rdp_socket) Line 2246  ui_select(int rdp_socket)
2246          int n;          int n;
2247          fd_set rfds, wfds;          fd_set rfds, wfds;
2248          struct timeval tv;          struct timeval tv;
2249          BOOL s_timeout = False;          RD_BOOL s_timeout = False;
2250    
2251          while (True)          while (True)
2252          {          {
# Line 2268  ui_select(int rdp_socket) Line 2264  ui_select(int rdp_socket)
2264                  FD_SET(rdp_socket, &rfds);                  FD_SET(rdp_socket, &rfds);
2265                  FD_SET(g_x_socket, &rfds);                  FD_SET(g_x_socket, &rfds);
2266    
 #ifdef WITH_RDPSND  
                 /* FIXME: there should be an API for registering fds */  
                 if (g_dsp_busy)  
                 {  
                         FD_SET(g_dsp_fd, &wfds);  
                         n = (g_dsp_fd > n) ? g_dsp_fd : n;  
                 }  
 #endif  
2267                  /* default timeout */                  /* default timeout */
2268                  tv.tv_sec = 60;                  tv.tv_sec = 60;
2269                  tv.tv_usec = 0;                  tv.tv_usec = 0;
2270    
2271    #ifdef WITH_RDPSND
2272                    rdpsnd_add_fds(&n, &rfds, &wfds, &tv);
2273    #endif
2274    
2275                  /* add redirection handles */                  /* add redirection handles */
2276                  rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout);                  rdpdr_add_fds(&n, &rfds, &wfds, &tv, &s_timeout);
2277                  seamless_select_timeout(&tv);                  seamless_select_timeout(&tv);
# Line 2292  ui_select(int rdp_socket) Line 2284  ui_select(int rdp_socket)
2284                                  error("select: %s\n", strerror(errno));                                  error("select: %s\n", strerror(errno));
2285    
2286                          case 0:                          case 0:
2287    #ifdef WITH_RDPSND
2288                                    rdpsnd_check_fds(&rfds, &wfds);
2289    #endif
2290    
2291                                  /* Abort serial read calls */                                  /* Abort serial read calls */
2292                                  if (s_timeout)                                  if (s_timeout)
2293                                          rdpdr_check_fds(&rfds, &wfds, (BOOL) True);                                          rdpdr_check_fds(&rfds, &wfds, (RD_BOOL) True);
2294                                  continue;                                  continue;
2295                  }                  }
2296    
2297                  rdpdr_check_fds(&rfds, &wfds, (BOOL) False);  #ifdef WITH_RDPSND
2298                    rdpsnd_check_fds(&rfds, &wfds);
2299    #endif
2300    
2301                    rdpdr_check_fds(&rfds, &wfds, (RD_BOOL) False);
2302    
2303                  if (FD_ISSET(rdp_socket, &rfds))                  if (FD_ISSET(rdp_socket, &rfds))
2304                          return 1;                          return 1;
2305    
 #ifdef WITH_RDPSND  
                 if (g_dsp_busy && FD_ISSET(g_dsp_fd, &wfds))  
                         wave_out_play();  
 #endif  
2306          }          }
2307  }  }
2308    
# Line 2316  ui_move_pointer(int x, int y) Line 2312  ui_move_pointer(int x, int y)
2312          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);
2313  }  }
2314    
2315  HBITMAP  RD_HBITMAP
2316  ui_create_bitmap(int width, int height, uint8 * data)  ui_create_bitmap(int width, int height, uint8 * data)
2317  {  {
2318          XImage *image;          XImage *image;
# Line 2346  ui_create_bitmap(int width, int height, Line 2342  ui_create_bitmap(int width, int height,
2342          XFree(image);          XFree(image);
2343          if (tdata != data)          if (tdata != data)
2344                  xfree(tdata);                  xfree(tdata);
2345          return (HBITMAP) bitmap;          return (RD_HBITMAP) bitmap;
2346  }  }
2347    
2348  void  void
# Line 2394  ui_paint_bitmap(int x, int y, int cx, in Line 2390  ui_paint_bitmap(int x, int y, int cx, in
2390  }  }
2391    
2392  void  void
2393  ui_destroy_bitmap(HBITMAP bmp)  ui_destroy_bitmap(RD_HBITMAP bmp)
2394  {  {
2395          XFreePixmap(g_display, (Pixmap) bmp);          XFreePixmap(g_display, (Pixmap) bmp);
2396  }  }
2397    
2398  HGLYPH  RD_HGLYPH
2399  ui_create_glyph(int width, int height, uint8 * data)  ui_create_glyph(int width, int height, uint8 * data)
2400  {  {
2401          XImage *image;          XImage *image;
# Line 2421  ui_create_glyph(int width, int height, u Line 2417  ui_create_glyph(int width, int height, u
2417          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);
2418    
2419          XFree(image);          XFree(image);
2420          return (HGLYPH) bitmap;          return (RD_HGLYPH) bitmap;
2421  }  }
2422    
2423  void  void
2424  ui_destroy_glyph(HGLYPH glyph)  ui_destroy_glyph(RD_HGLYPH glyph)
2425  {  {
2426          XFreePixmap(g_display, (Pixmap) glyph);          XFreePixmap(g_display, (Pixmap) glyph);
2427  }  }
2428    
2429  HCURSOR  RD_HCURSOR
2430  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,
2431                   uint8 * andmask, uint8 * xormask)                   uint8 * andmask, uint8 * xormask)
2432  {  {
2433          HGLYPH maskglyph, cursorglyph;          RD_HGLYPH maskglyph, cursorglyph;
2434          XColor bg, fg;          XColor bg, fg;
2435          Cursor xcursor;          Cursor xcursor;
2436          uint8 *cursor, *pcursor;          uint8 *cursor, *pcursor;
# Line 2498  ui_create_cursor(unsigned int x, unsigne Line 2494  ui_create_cursor(unsigned int x, unsigne
2494          ui_destroy_glyph(cursorglyph);          ui_destroy_glyph(cursorglyph);
2495          xfree(mask);          xfree(mask);
2496          xfree(cursor);          xfree(cursor);
2497          return (HCURSOR) xcursor;          return (RD_HCURSOR) xcursor;
2498  }  }
2499    
2500  void  void
2501  ui_set_cursor(HCURSOR cursor)  ui_set_cursor(RD_HCURSOR cursor)
2502  {  {
2503          g_current_cursor = (Cursor) cursor;          g_current_cursor = (Cursor) cursor;
2504          XDefineCursor(g_display, g_wnd, g_current_cursor);          XDefineCursor(g_display, g_wnd, g_current_cursor);
# Line 2510  ui_set_cursor(HCURSOR cursor) Line 2506  ui_set_cursor(HCURSOR cursor)
2506  }  }
2507    
2508  void  void
2509  ui_destroy_cursor(HCURSOR cursor)  ui_destroy_cursor(RD_HCURSOR cursor)
2510  {  {
2511          XFreeCursor(g_display, (Cursor) cursor);          XFreeCursor(g_display, (Cursor) cursor);
2512  }  }
# Line 2528  ui_set_null_cursor(void) Line 2524  ui_set_null_cursor(void)
2524                  (xc)->flags = DoRed | DoGreen | DoBlue;                  (xc)->flags = DoRed | DoGreen | DoBlue;
2525    
2526    
2527  HCOLOURMAP  RD_HCOLOURMAP
2528  ui_create_colourmap(COLOURMAP * colours)  ui_create_colourmap(COLOURMAP * colours)
2529  {  {
2530          COLOURENTRY *entry;          COLOURENTRY *entry;
# Line 2624  ui_create_colourmap(COLOURMAP * colours) Line 2620  ui_create_colourmap(COLOURMAP * colours)
2620                  XStoreColors(g_display, map, xcolours, ncolours);                  XStoreColors(g_display, map, xcolours, ncolours);
2621    
2622                  xfree(xcolours);                  xfree(xcolours);
2623                  return (HCOLOURMAP) map;                  return (RD_HCOLOURMAP) map;
2624          }          }
2625  }  }
2626    
2627  void  void
2628  ui_destroy_colourmap(HCOLOURMAP map)  ui_destroy_colourmap(RD_HCOLOURMAP map)
2629  {  {
2630          if (!g_owncolmap)          if (!g_owncolmap)
2631                  xfree(map);                  xfree(map);
# Line 2638  ui_destroy_colourmap(HCOLOURMAP map) Line 2634  ui_destroy_colourmap(HCOLOURMAP map)
2634  }  }
2635    
2636  void  void
2637  ui_set_colourmap(HCOLOURMAP map)  ui_set_colourmap(RD_HCOLOURMAP map)
2638  {  {
2639          if (!g_owncolmap)          if (!g_owncolmap)
2640          {          {
# Line 2726  ui_patblt(uint8 opcode, Line 2722  ui_patblt(uint8 opcode,
2722                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
2723                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2724                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2725                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2726                          break;                          break;
2727    
2728                  case 3: /* Pattern */                  case 3: /* Pattern */
# Line 2741  ui_patblt(uint8 opcode, Line 2737  ui_patblt(uint8 opcode,
2737                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
2738                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2739                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2740                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2741                          break;                          break;
2742    
2743                  default:                  default:
# Line 2784  ui_screenblt(uint8 opcode, Line 2780  ui_screenblt(uint8 opcode,
2780  void  void
2781  ui_memblt(uint8 opcode,  ui_memblt(uint8 opcode,
2782            /* dest */ int x, int y, int cx, int cy,            /* dest */ int x, int y, int cx, int cy,
2783            /* src */ HBITMAP src, int srcx, int srcy)            /* src */ RD_HBITMAP src, int srcx, int srcy)
2784  {  {
2785          SET_FUNCTION(opcode);          SET_FUNCTION(opcode);
2786          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 2799  ui_memblt(uint8 opcode, Line 2795  ui_memblt(uint8 opcode,
2795  void  void
2796  ui_triblt(uint8 opcode,  ui_triblt(uint8 opcode,
2797            /* dest */ int x, int y, int cx, int cy,            /* dest */ int x, int y, int cx, int cy,
2798            /* src */ HBITMAP src, int srcx, int srcy,            /* src */ RD_HBITMAP src, int srcx, int srcy,
2799            /* brush */ BRUSH * brush, int bgcolour, int fgcolour)            /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
2800  {  {
2801          /* This is potentially difficult to do in general. Until someone          /* This is potentially difficult to do in general. Until someone
# Line 2857  ui_rect( Line 2853  ui_rect(
2853  void  void
2854  ui_polygon(uint8 opcode,  ui_polygon(uint8 opcode,
2855             /* mode */ uint8 fillmode,             /* mode */ uint8 fillmode,
2856             /* dest */ POINT * point, int npoints,             /* dest */ RD_POINT * point, int npoints,
2857             /* brush */ BRUSH * brush, int bgcolour, int fgcolour)             /* brush */ BRUSH * brush, int bgcolour, int fgcolour)
2858  {  {
2859          uint8 style, i, ipattern[8];          uint8 style, i, ipattern[8];
# Line 2900  ui_polygon(uint8 opcode, Line 2896  ui_polygon(uint8 opcode,
2896                          FILL_POLYGON((XPoint *) point, npoints);                          FILL_POLYGON((XPoint *) point, npoints);
2897                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2898                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2899                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2900                          break;                          break;
2901    
2902                  case 3: /* Pattern */                  case 3: /* Pattern */
# Line 2915  ui_polygon(uint8 opcode, Line 2911  ui_polygon(uint8 opcode,
2911                          FILL_POLYGON((XPoint *) point, npoints);                          FILL_POLYGON((XPoint *) point, npoints);
2912                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2913                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2914                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2915                          break;                          break;
2916    
2917                  default:                  default:
# Line 2927  ui_polygon(uint8 opcode, Line 2923  ui_polygon(uint8 opcode,
2923    
2924  void  void
2925  ui_polyline(uint8 opcode,  ui_polyline(uint8 opcode,
2926              /* dest */ POINT * points, int npoints,              /* dest */ RD_POINT * points, int npoints,
2927              /* pen */ PEN * pen)              /* pen */ PEN * pen)
2928  {  {
2929          /* TODO: set join style */          /* TODO: set join style */
# Line 2978  ui_ellipse(uint8 opcode, Line 2974  ui_ellipse(uint8 opcode,
2974                          DRAW_ELLIPSE(x, y, cx, cy, fillmode);                          DRAW_ELLIPSE(x, y, cx, cy, fillmode);
2975                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2976                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2977                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2978                          break;                          break;
2979    
2980                  case 3: /* Pattern */                  case 3: /* Pattern */
# Line 2993  ui_ellipse(uint8 opcode, Line 2989  ui_ellipse(uint8 opcode,
2989                          DRAW_ELLIPSE(x, y, cx, cy, fillmode);                          DRAW_ELLIPSE(x, y, cx, cy, fillmode);
2990                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
2991                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
2992                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((RD_HGLYPH) fill);
2993                          break;                          break;
2994    
2995                  default:                  default:
# Line 3007  ui_ellipse(uint8 opcode, Line 3003  ui_ellipse(uint8 opcode,
3003  void  void
3004  ui_draw_glyph(int mixmode,  ui_draw_glyph(int mixmode,
3005                /* dest */ int x, int y, int cx, int cy,                /* dest */ int x, int y, int cx, int cy,
3006                /* src */ HGLYPH glyph, int srcx, int srcy,                /* src */ RD_HGLYPH glyph, int srcx, int srcy,
3007                int bgcolour, int fgcolour)                int bgcolour, int fgcolour)
3008  {  {
3009          SET_FOREGROUND(fgcolour);          SET_FOREGROUND(fgcolour);
# Line 3192  ui_desktop_save(uint32 offset, int x, in Line 3188  ui_desktop_save(uint32 offset, int x, in
3188          if (g_ownbackstore)          if (g_ownbackstore)
3189          {          {
3190                  image = XGetImage(g_display, g_backstore, x, y, cx, cy, AllPlanes, ZPixmap);                  image = XGetImage(g_display, g_backstore, x, y, cx, cy, AllPlanes, ZPixmap);
3191                    exit_if_null(image);
3192          }          }
3193          else          else
3194          {          {
3195                  pix = XCreatePixmap(g_display, g_wnd, cx, cy, g_depth);                  pix = XCreatePixmap(g_display, g_wnd, cx, cy, g_depth);
3196                  XCopyArea(g_display, g_wnd, pix, g_gc, x, y, cx, cy, 0, 0);                  XCopyArea(g_display, g_wnd, pix, g_gc, x, y, cx, cy, 0, 0);
3197                  image = XGetImage(g_display, pix, 0, 0, cx, cy, AllPlanes, ZPixmap);                  image = XGetImage(g_display, pix, 0, 0, cx, cy, AllPlanes, ZPixmap);
3198                    exit_if_null(image);
3199                  XFreePixmap(g_display, pix);                  XFreePixmap(g_display, pix);
3200          }          }
3201    
# Line 3253  ui_end_update(void) Line 3251  ui_end_update(void)
3251    
3252    
3253  void  void
3254  ui_seamless_begin(BOOL hidden)  ui_seamless_begin(RD_BOOL hidden)
3255  {  {
3256          if (!g_seamless_rdp)          if (!g_seamless_rdp)
3257                  return;                  return;

Legend:
Removed from v.1250  
changed lines
  Added in v.1372

  ViewVC Help
Powered by ViewVC 1.1.26