/[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 316 by jsorg71, Sun Feb 9 17:17:37 2003 UTC revision 331 by astrand, Tue Feb 18 13:44:27 2003 UTC
# Line 32  extern BOOL grab_keyboard; Line 32  extern BOOL grab_keyboard;
32  extern BOOL hide_decorations;  extern BOOL hide_decorations;
33  extern char title[];  extern char title[];
34  extern int server_bpp;  extern int server_bpp;
35    extern int win_button_size;
36  BOOL enable_compose = False;  BOOL enable_compose = False;
37  BOOL focused;  BOOL focused;
38  BOOL mouse_in_wnd;  BOOL mouse_in_wnd;
# Line 122  static int rop2_map[] = { Line 123  static int rop2_map[] = {
123  #define SET_FUNCTION(rop2)      { if (rop2 != ROP2_COPY) XSetFunction(display, gc, rop2_map[rop2]); }  #define SET_FUNCTION(rop2)      { if (rop2 != ROP2_COPY) XSetFunction(display, gc, rop2_map[rop2]); }
124  #define RESET_FUNCTION(rop2)    { if (rop2 != ROP2_COPY) XSetFunction(display, gc, GXcopy); }  #define RESET_FUNCTION(rop2)    { if (rop2 != ROP2_COPY) XSetFunction(display, gc, GXcopy); }
125    
126  void  static void
127  mwm_hide_decorations(void)  mwm_hide_decorations(void)
128  {  {
129          PropMotifWmHints motif_hints;          PropMotifWmHints motif_hints;
# Line 144  mwm_hide_decorations(void) Line 145  mwm_hide_decorations(void)
145                          (unsigned char *) &motif_hints, PROP_MOTIF_WM_HINTS_ELEMENTS);                          (unsigned char *) &motif_hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
146  }  }
147    
148  PixelColour  static PixelColour
149  split_colour15(uint32 colour)  split_colour15(uint32 colour)
150  {  {
151          PixelColour rv;          PixelColour rv;
# Line 157  split_colour15(uint32 colour) Line 158  split_colour15(uint32 colour)
158          return rv;          return rv;
159  }  }
160    
161  PixelColour  static PixelColour
162  split_colour16(uint32 colour)  split_colour16(uint32 colour)
163  {  {
164          PixelColour rv;          PixelColour rv;
# Line 170  split_colour16(uint32 colour) Line 171  split_colour16(uint32 colour)
171          return rv;          return rv;
172  }  }
173    
174  PixelColour  static PixelColour
175  split_colour24(uint32 colour)  split_colour24(uint32 colour)
176  {  {
177          PixelColour rv;          PixelColour rv;
# Line 180  split_colour24(uint32 colour) Line 181  split_colour24(uint32 colour)
181          return rv;          return rv;
182  }  }
183    
184  uint32 make_colour16(PixelColour pc)  static uint32
185    make_colour16(PixelColour pc)
186  {  {
187          pc.red = (pc.red * 0x1f) / 0xff;          pc.red = (pc.red * 0x1f) / 0xff;
188          pc.green = (pc.green * 0x3f) / 0xff;          pc.green = (pc.green * 0x3f) / 0xff;
# Line 188  uint32 make_colour16(PixelColour pc) Line 190  uint32 make_colour16(PixelColour pc)
190          return (pc.red << 11) | (pc.green << 5) | pc.blue;          return (pc.red << 11) | (pc.green << 5) | pc.blue;
191  }  }
192    
193  uint32 make_colour24(PixelColour pc)  static uint32
194    make_colour24(PixelColour pc)
195  {  {
196          return (pc.red << 16) | (pc.green << 8) | pc.blue;          return (pc.red << 16) | (pc.green << 8) | pc.blue;
197  }  }
198    
199  uint32 make_colour32(PixelColour pc)  static uint32
200    make_colour32(PixelColour pc)
201  {  {
202          return (pc.red << 16) | (pc.green << 8) | pc.blue;          return (pc.red << 16) | (pc.green << 8) | pc.blue;
203  }  }
# Line 426  translate_image(int width, int height, u Line 430  translate_image(int width, int height, u
430                          switch (bpp)                          switch (bpp)
431                          {                          {
432                                  case 32:                                  case 32:
433                                          translate16to32((uint16 *) data, (uint32 *) out, (uint32 *) end);                                          translate16to32((uint16 *) data, (uint32 *) out,
434                                                            (uint32 *) end);
435                                          break;                                          break;
436                                  case 24:                                  case 24:
437                                          translate16to24((uint16 *) data, out, end);                                          translate16to24((uint16 *) data, out, end);
438                                          break;                                          break;
439                                  case 16:                                  case 16:
440                                          translate16to16((uint16 *) data, (uint16 *) out, (uint16 *) end);                                          translate16to16((uint16 *) data, (uint16 *) out,
441                                                            (uint16 *) end);
442                                          break;                                          break;
443                          }                          }
444                          break;                          break;
# Line 440  translate_image(int width, int height, u Line 446  translate_image(int width, int height, u
446                          switch (bpp)                          switch (bpp)
447                          {                          {
448                                  case 32:                                  case 32:
449                                          translate15to32((uint16 *) data, (uint32 *) out, (uint32 *) end);                                          translate15to32((uint16 *) data, (uint32 *) out,
450                                                            (uint32 *) end);
451                                          break;                                          break;
452                                  case 24:                                  case 24:
453                                          translate15to24((uint16 *) data, out, end);                                          translate15to24((uint16 *) data, out, end);
454                                          break;                                          break;
455                                  case 16:                                  case 16:
456                                          translate15to16((uint16 *) data, (uint16 *) out, (uint16 *) end);                                          translate15to16((uint16 *) data, (uint16 *) out,
457                                                            (uint16 *) end);
458                                          break;                                          break;
459                          }                          }
460                          break;                          break;
# Line 847  xwin_process_events(void) Line 855  xwin_process_events(void)
855                                  if (button == 0)                                  if (button == 0)
856                                          break;                                          break;
857    
858                                    /* If win_button_size is nonzero, enable single app mode */
859                                    if (xevent.xbutton.y < win_button_size)
860                                    {
861                                            if (xevent.xbutton.x < win_button_size)
862                                            {
863                                                    /* The system menu, do not send to server */
864                                                    break;
865                                            }
866                                            else if (xevent.xbutton.x >= width - win_button_size)
867                                            {
868                                                    /* The close button, continue */
869                                                    ;
870                                            }
871                                            else if (xevent.xbutton.x >= width - win_button_size * 2)
872                                            {
873                                                    /* The maximize/restore button. Do not send to
874                                                       server.  It might be a good idea to change the
875                                                       cursor or give some other visible indication
876                                                       that rdesktop inhibited this click */
877                                                    break;
878                                            }
879                                            else if (xevent.xbutton.x >= width - win_button_size * 3)
880                                            {
881                                                    /* The minimize button. Iconify window. */
882                                                    XIconifyWindow(display, wnd,
883                                                                   DefaultScreen(display));
884                                                    break;
885                                            }
886                                    }
887    
888                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,                                  rdp_send_input(time(NULL), RDP_INPUT_MOUSE,
889                                                 flags | button, xevent.xbutton.x, xevent.xbutton.y);                                                 flags | button, xevent.xbutton.x, xevent.xbutton.y);
890                                  break;                                  break;

Legend:
Removed from v.316  
changed lines
  Added in v.331

  ViewVC Help
Powered by ViewVC 1.1.26