/[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 651 by astrand, Thu Apr 15 20:12:42 2004 UTC revision 680 by jsorg71, Mon Apr 26 23:14:07 2004 UTC
# Line 229  translate_colour(uint32 colour) Line 229  translate_colour(uint32 colour)
229          return make_colour(pc);          return make_colour(pc);
230  }  }
231    
232    #define UNROLL8(stm) { stm stm stm stm stm stm stm stm }
233    #define REPEAT(stm) \
234    { \
235            while (out <= end - 8 * 4) \
236                    UNROLL8(stm) \
237            while (out < end) \
238                    { stm } \
239    }
240    
241  static void  static void
242  translate8to8(uint8 * data, uint8 * out, uint8 * end)  translate8to8(uint8 * data, uint8 * out, uint8 * end)
243  {  {
# Line 241  translate8to16(uint8 * data, uint8 * out Line 250  translate8to16(uint8 * data, uint8 * out
250  {  {
251          uint16 value;          uint16 value;
252    
253          if (g_xserver_be)          if (g_arch_match)
254                    REPEAT(*(((uint16*)out)++) = g_colmap[*(data++)];)
255            else if (g_xserver_be)
256          {          {
257                  while (out < end)                  while (out < end)
258                  {                  {
# Line 294  translate8to32(uint8 * data, uint8 * out Line 305  translate8to32(uint8 * data, uint8 * out
305  {  {
306          uint32 value;          uint32 value;
307    
308          if (g_xserver_be)          if (g_arch_match)
309                    REPEAT(*(((uint32*)out)++) = g_colmap[*(data++)];)
310            else if (g_xserver_be)
311          {          {
312                  while (out < end)                  while (out < end)
313                  {                  {
# Line 1009  ui_create_window(void) Line 1022  ui_create_window(void)
1022  }  }
1023    
1024  void  void
1025    ui_resize_window()
1026    {
1027            XSizeHints *sizehints;
1028    
1029            sizehints = XAllocSizeHints();
1030            if (sizehints)
1031            {
1032                    sizehints->flags = PMinSize | PMaxSize;
1033                    sizehints->min_width = sizehints->max_width = g_width;
1034                    sizehints->min_height = sizehints->max_height = g_height;
1035                    XSetWMNormalHints(g_display, g_wnd, sizehints);
1036                    XFree(sizehints);
1037            }
1038    
1039            if (!(g_fullscreen || g_embed_wnd))
1040            {
1041                    XResizeWindow(g_display, g_wnd, g_width, g_height);
1042            }
1043    }
1044    
1045    void
1046  ui_destroy_window(void)  ui_destroy_window(void)
1047  {  {
1048          if (g_IC != NULL)          if (g_IC != NULL)
# Line 1765  ui_patblt(uint8 opcode, Line 1799  ui_patblt(uint8 opcode,
1799          {          {
1800                  case 0: /* Solid */                  case 0: /* Solid */
1801                          SET_FOREGROUND(fgcolour);                          SET_FOREGROUND(fgcolour);
1802                          FILL_RECTANGLE(x, y, cx, cy);                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
1803                          break;                          break;
1804    
1805                  case 2: /* Hatch */                  case 2: /* Hatch */
# Line 1776  ui_patblt(uint8 opcode, Line 1810  ui_patblt(uint8 opcode,
1810                          XSetFillStyle(g_display, g_gc, FillOpaqueStippled);                          XSetFillStyle(g_display, g_gc, FillOpaqueStippled);
1811                          XSetStipple(g_display, g_gc, fill);                          XSetStipple(g_display, g_gc, fill);
1812                          XSetTSOrigin(g_display, g_gc, brush->xorigin, brush->yorigin);                          XSetTSOrigin(g_display, g_gc, brush->xorigin, brush->yorigin);
1813                          FILL_RECTANGLE(x, y, cx, cy);                          FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
1814                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
1815                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
1816                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((HGLYPH) fill);
# Line 1786  ui_patblt(uint8 opcode, Line 1820  ui_patblt(uint8 opcode,
1820                          for (i = 0; i != 8; i++)                          for (i = 0; i != 8; i++)
1821                                  ipattern[7 - i] = brush->pattern[i];                                  ipattern[7 - i] = brush->pattern[i];
1822                          fill = (Pixmap) ui_create_glyph(8, 8, ipattern);                          fill = (Pixmap) ui_create_glyph(8, 8, ipattern);
   
1823                          SET_FOREGROUND(bgcolour);                          SET_FOREGROUND(bgcolour);
1824                          SET_BACKGROUND(fgcolour);                          SET_BACKGROUND(fgcolour);
1825                          XSetFillStyle(g_display, g_gc, FillOpaqueStippled);                          XSetFillStyle(g_display, g_gc, FillOpaqueStippled);
1826                          XSetStipple(g_display, g_gc, fill);                          XSetStipple(g_display, g_gc, fill);
1827                          XSetTSOrigin(g_display, g_gc, brush->xorigin, brush->yorigin);                          XSetTSOrigin(g_display, g_gc, brush->xorigin, brush->yorigin);
1828                            FILL_RECTANGLE_BACKSTORE(x, y, cx, cy);
                         FILL_RECTANGLE(x, y, cx, cy);  
   
1829                          XSetFillStyle(g_display, g_gc, FillSolid);                          XSetFillStyle(g_display, g_gc, FillSolid);
1830                          XSetTSOrigin(g_display, g_gc, 0, 0);                          XSetTSOrigin(g_display, g_gc, 0, 0);
1831                          ui_destroy_glyph((HGLYPH) fill);                          ui_destroy_glyph((HGLYPH) fill);
# Line 1805  ui_patblt(uint8 opcode, Line 1836  ui_patblt(uint8 opcode,
1836          }          }
1837    
1838          RESET_FUNCTION(opcode);          RESET_FUNCTION(opcode);
1839    
1840            if (g_ownbackstore)
1841                    XCopyArea(g_display, g_backstore, g_wnd, g_gc, x, y, cx, cy, x, y);
1842  }  }
1843    
1844  void  void

Legend:
Removed from v.651  
changed lines
  Added in v.680

  ViewVC Help
Powered by ViewVC 1.1.26