/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/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/branches/seamlessrdp-branch/rdesktop/xwin.c

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

revision 1042 by astrand, Tue Jan 24 12:40:24 2006 UTC revision 1049 by astrand, Wed Mar 1 13:54:19 2006 UTC
# Line 71  static HCURSOR g_null_cursor = NULL; Line 71  static HCURSOR g_null_cursor = NULL;
71  static Atom g_protocol_atom, g_kill_atom;  static Atom g_protocol_atom, g_kill_atom;
72  static BOOL g_focused;  static BOOL g_focused;
73  static BOOL g_mouse_in_wnd;  static BOOL g_mouse_in_wnd;
74  /* Indicates the visual is has 15, 16 or 24 depth  /* Indicates that:
75     and the same color channel masks as its RDP equivalent. */     1) visual has 15, 16 or 24 depth and the same color channel masks
76  static BOOL g_compatible_depth;        as its RDP equivalent (implies X server is LE),
77       2) host is LE
78       This will trigger an optimization whose real value is questionable.
79    */
80    static BOOL g_compatible_arch;
81  /* Indicates whether RDP's bitmaps and our XImages have the same  /* Indicates whether RDP's bitmaps and our XImages have the same
82     binary format. If so, we can avoid an expensive translation.     binary format. If so, we can avoid an expensive translation.
83     If this is True, so is g_compatible_depth. */     Note that this can be true when g_compatible_arch is false,
84       e.g.:
85      
86         RDP(LE) <-> host(BE) <-> X-Server(LE)
87        
88       ('host' is the machine running rdesktop; the host simply memcpy's
89        so its endianess doesn't matter)
90     */
91  static BOOL g_no_translate_image = False;  static BOOL g_no_translate_image = False;
92    
93  /* endianness */  /* endianness */
# Line 243  mwm_hide_decorations(void) Line 254  mwm_hide_decorations(void)
254  #define BSWAP32(x) { x = (((x & 0xff00ff) << 8) | ((x >> 8) & 0xff00ff)); \  #define BSWAP32(x) { x = (((x & 0xff00ff) << 8) | ((x >> 8) & 0xff00ff)); \
255                          x = (x << 16) | (x >> 16); }                          x = (x << 16) | (x >> 16); }
256    
257    /* The following macros output the same octet sequences
258       on both BE and LE hosts: */
259    
260  #define BOUT16(o, x) { *(o++) = x >> 8; *(o++) = x; }  #define BOUT16(o, x) { *(o++) = x >> 8; *(o++) = x; }
261  #define BOUT24(o, x) { *(o++) = x >> 16; *(o++) = x >> 8; *(o++) = x; }  #define BOUT24(o, x) { *(o++) = x >> 16; *(o++) = x >> 8; *(o++) = x; }
262  #define BOUT32(o, x) { *(o++) = x >> 24; *(o++) = x >> 16; *(o++) = x >> 8; *(o++) = x; }  #define BOUT32(o, x) { *(o++) = x >> 24; *(o++) = x >> 16; *(o++) = x >> 8; *(o++) = x; }
# Line 322  translate8to16(const uint8 * data, uint8 Line 336  translate8to16(const uint8 * data, uint8
336  {  {
337          uint16 value;          uint16 value;
338    
339          if (g_compatible_depth)          if (g_compatible_arch)
340          {          {
341                  /* *INDENT-OFF* */                  /* *INDENT-OFF* */
342                  REPEAT2                  REPEAT2
# Line 356  translate8to24(const uint8 * data, uint8 Line 370  translate8to24(const uint8 * data, uint8
370  {  {
371          uint32 value;          uint32 value;
372    
373          if (g_compatible_depth)          if (g_compatible_arch)
374          {          {
375                  while (out < end)                  while (out < end)
376                  {                  {
# Line 379  translate8to32(const uint8 * data, uint8 Line 393  translate8to32(const uint8 * data, uint8
393  {  {
394          uint32 value;          uint32 value;
395    
396          if (g_compatible_depth)          if (g_compatible_arch)
397          {          {
398                  /* *INDENT-OFF* */                  /* *INDENT-OFF* */
399                  REPEAT4                  REPEAT4
# Line 451  translate15to24(const uint16 * data, uin Line 465  translate15to24(const uint16 * data, uin
465          uint16 pixel;          uint16 pixel;
466          PixelColour pc;          PixelColour pc;
467    
468          if (g_compatible_depth)          if (g_compatible_arch)
469          {          {
470                  /* *INDENT-OFF* */                  /* *INDENT-OFF* */
471                  REPEAT3                  REPEAT3
# Line 501  translate15to32(const uint16 * data, uin Line 515  translate15to32(const uint16 * data, uin
515          uint32 value;          uint32 value;
516          PixelColour pc;          PixelColour pc;
517    
518          if (g_compatible_depth)          if (g_compatible_arch)
519          {          {
520                  /* *INDENT-OFF* */                  /* *INDENT-OFF* */
521                  REPEAT4                  REPEAT4
# Line 609  translate16to24(const uint16 * data, uin Line 623  translate16to24(const uint16 * data, uin
623          uint16 pixel;          uint16 pixel;
624          PixelColour pc;          PixelColour pc;
625    
626          if (g_compatible_depth)          if (g_compatible_arch)
627          {          {
628                  /* *INDENT-OFF* */                  /* *INDENT-OFF* */
629                  REPEAT3                  REPEAT3
# Line 679  translate16to32(const uint16 * data, uin Line 693  translate16to32(const uint16 * data, uin
693          uint32 value;          uint32 value;
694          PixelColour pc;          PixelColour pc;
695    
696          if (g_compatible_depth)          if (g_compatible_arch)
697          {          {
698                  /* *INDENT-OFF* */                  /* *INDENT-OFF* */
699                  REPEAT4                  REPEAT4
# Line 808  translate24to32(const uint8 * data, uint Line 822  translate24to32(const uint8 * data, uint
822          uint32 value;          uint32 value;
823          PixelColour pc;          PixelColour pc;
824    
825          if (g_compatible_depth)          if (g_compatible_arch)
826          {          {
827                  /* *INDENT-OFF* */                  /* *INDENT-OFF* */
828  #ifdef NEED_ALIGN  #ifdef NEED_ALIGN
# Line 1021  select_visual() Line 1035  select_visual()
1035          vmatches = XGetVisualInfo(g_display, VisualClassMask, &template, &visuals_count);          vmatches = XGetVisualInfo(g_display, VisualClassMask, &template, &visuals_count);
1036          g_visual = NULL;          g_visual = NULL;
1037          g_no_translate_image = False;          g_no_translate_image = False;
1038          g_compatible_depth = False;          g_compatible_arch = False;
1039          if (vmatches != NULL)          if (vmatches != NULL)
1040          {          {
1041                  for (i = 0; i < visuals_count; ++i)                  for (i = 0; i < visuals_count; ++i)
# Line 1048  select_visual() Line 1062  select_visual()
1062                          {                          {
1063                                  g_visual = visual_info->visual;                                  g_visual = visual_info->visual;
1064                                  g_depth = visual_info->depth;                                  g_depth = visual_info->depth;
1065                                  g_compatible_depth = True;                                  g_compatible_arch = !g_host_be;
1066                                  g_no_translate_image = (visual_info->depth == g_server_depth);                                  g_no_translate_image = (visual_info->depth == g_server_depth);
1067                                  if (g_no_translate_image)                                  if (g_no_translate_image)
1068                                          /* We found the best visual */                                          /* We found the best visual */
# Line 1056  select_visual() Line 1070  select_visual()
1070                          }                          }
1071                          else                          else
1072                          {                          {
1073                                  g_compatible_depth = False;                                  g_compatible_arch = False;
1074                          }                          }
1075    
1076                          if (visual_info->depth > 24)                          if (visual_info->depth > 24)

Legend:
Removed from v.1042  
changed lines
  Added in v.1049

  ViewVC Help
Powered by ViewVC 1.1.26