/[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 609 by stargo, Mon Feb 16 20:28:09 2004 UTC revision 643 by jsorg71, Wed Mar 24 18:16:58 2004 UTC
# Line 43  Time g_last_gesturetime; Line 43  Time g_last_gesturetime;
43  static int g_x_socket;  static int g_x_socket;
44  static Screen *g_screen;  static Screen *g_screen;
45  Window g_wnd;  Window g_wnd;
46    uint32 g_embed_wnd;
47  BOOL g_enable_compose = False;  BOOL g_enable_compose = False;
48  static GC g_gc = NULL;  static GC g_gc = NULL;
49  static Visual *g_visual;  static Visual *g_visual;
# Line 169  static PixelColour Line 170  static PixelColour
170  split_colour15(uint32 colour)  split_colour15(uint32 colour)
171  {  {
172          PixelColour rv;          PixelColour rv;
173          rv.red = (colour & 0x7c00) >> 10;          rv.red = (colour & 0x7c00) >> 7;
174          rv.red = (rv.red * 0xff) / 0x1f;          rv.green = (colour & 0x03e0) >> 2;
175          rv.green = (colour & 0x03e0) >> 5;          rv.blue = (colour & 0x001f) << 3;
         rv.green = (rv.green * 0xff) / 0x1f;  
         rv.blue = (colour & 0x1f);  
         rv.blue = (rv.blue * 0xff) / 0x1f;  
176          return rv;          return rv;
177  }  }
178    
# Line 182  static PixelColour Line 180  static PixelColour
180  split_colour16(uint32 colour)  split_colour16(uint32 colour)
181  {  {
182          PixelColour rv;          PixelColour rv;
183          rv.red = (colour & 0xf800) >> 11;          rv.red = (colour & 0xf800) >> 8;
184          rv.red = (rv.red * 0xff) / 0x1f;          rv.green = (colour & 0x07e0) >> 3;
185          rv.green = (colour & 0x07e0) >> 5;          rv.blue = (colour & 0x001f) << 3;
         rv.green = (rv.green * 0xff) / 0x3f;  
         rv.blue = (colour & 0x001f);  
         rv.blue = (rv.blue * 0xff) / 0x1f;  
186          return rv;          return rv;
187  }  }
188    
# Line 196  split_colour24(uint32 colour) Line 191  split_colour24(uint32 colour)
191  {  {
192          PixelColour rv;          PixelColour rv;
193          rv.blue = (colour & 0xff0000) >> 16;          rv.blue = (colour & 0xff0000) >> 16;
194          rv.green = (colour & 0xff00) >> 8;          rv.green = (colour & 0x00ff00) >> 8;
195          rv.red = (colour & 0xff);          rv.red = (colour & 0x0000ff);
196          return rv;          return rv;
197  }  }
198    
# Line 245  translate8to16(uint8 * data, uint8 * out Line 240  translate8to16(uint8 * data, uint8 * out
240  {  {
241          uint16 value;          uint16 value;
242    
243          while (out < end)          if (g_xserver_be)
244          {          {
245                  value = (uint16) g_colmap[*(data++)];                  while (out < end)
   
                 if (g_xserver_be)  
246                  {                  {
247                            value = (uint16) g_colmap[*(data++)];
248                          *(out++) = value >> 8;                          *(out++) = value >> 8;
249                          *(out++) = value;                          *(out++) = value;
250                  }                  }
251                  else          }
252            else
253            {
254                    while (out < end)
255                  {                  {
256                            value = (uint16) g_colmap[*(data++)];
257                          *(out++) = value;                          *(out++) = value;
258                          *(out++) = value >> 8;                          *(out++) = value >> 8;
259                  }                  }
# Line 268  translate8to24(uint8 * data, uint8 * out Line 266  translate8to24(uint8 * data, uint8 * out
266  {  {
267          uint32 value;          uint32 value;
268    
269          while (out < end)          if (g_xserver_be)
270          {          {
271                  value = g_colmap[*(data++)];                  while (out < end)
   
                 if (g_xserver_be)  
272                  {                  {
273                            value = g_colmap[*(data++)];
274                          *(out++) = value >> 16;                          *(out++) = value >> 16;
275                          *(out++) = value >> 8;                          *(out++) = value >> 8;
276                          *(out++) = value;                          *(out++) = value;
277                  }                  }
278                  else          }
279            else
280            {
281                    while (out < end)
282                  {                  {
283                            value = g_colmap[*(data++)];
284                          *(out++) = value;                          *(out++) = value;
285                          *(out++) = value >> 8;                          *(out++) = value >> 8;
286                          *(out++) = value >> 16;                          *(out++) = value >> 16;
# Line 292  translate8to32(uint8 * data, uint8 * out Line 293  translate8to32(uint8 * data, uint8 * out
293  {  {
294          uint32 value;          uint32 value;
295    
296          while (out < end)          if (g_xserver_be)
297          {          {
298                  value = g_colmap[*(data++)];                  while (out < end)
   
                 if (g_xserver_be)  
299                  {                  {
300                            value = g_colmap[*(data++)];
301                          *(out++) = value >> 24;                          *(out++) = value >> 24;
302                          *(out++) = value >> 16;                          *(out++) = value >> 16;
303                          *(out++) = value >> 8;                          *(out++) = value >> 8;
304                          *(out++) = value;                          *(out++) = value;
305                  }                  }
306                  else          }
307            else
308            {
309                    while (out < end)
310                  {                  {
311                            value = g_colmap[*(data++)];
312                          *(out++) = value;                          *(out++) = value;
313                          *(out++) = value >> 8;                          *(out++) = value >> 8;
314                          *(out++) = value >> 16;                          *(out++) = value >> 16;
# Line 931  ui_create_window(void) Line 935  ui_create_window(void)
935                  XFree(sizehints);                  XFree(sizehints);
936          }          }
937    
938            if ( g_embed_wnd )
939            {
940                    XReparentWindow(g_display, g_wnd, (Window)g_embed_wnd, 0, 0);
941            }
942    
943          input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |          input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask |
944                  VisibilityChangeMask | FocusChangeMask;                  VisibilityChangeMask | FocusChangeMask;
945    
# Line 1928  ui_draw_text(uint8 font, uint8 flags, in Line 1937  ui_draw_text(uint8 font, uint8 flags, in
1937    
1938          SET_FOREGROUND(bgcolour);          SET_FOREGROUND(bgcolour);
1939    
1940            /* Sometimes, the boxcx value is something really large, like
1941               32691. This makes XCopyArea fail with Xvnc. The code below
1942               is a quick fix. */
1943            if (boxx + boxcx > g_width)
1944                    boxcx = g_width - boxx;
1945    
1946          if (boxcx > 1)          if (boxcx > 1)
1947          {          {
1948                  FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy);                  FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy);

Legend:
Removed from v.609  
changed lines
  Added in v.643

  ViewVC Help
Powered by ViewVC 1.1.26