/[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 10 by matty, Tue Aug 15 10:23:24 2000 UTC revision 17 by matty, Thu Sep 28 15:54:11 2000 UTC
# Line 419  void ui_triblt(uint8 opcode, Line 419  void ui_triblt(uint8 opcode,
419    
420          switch (opcode)          switch (opcode)
421          {          {
422                    case 0x69: /* PDSxxn */
423                            ui_memblt(ROP2_XOR, x, y, cx, cy, src, srcx, srcy);
424                            ui_patblt(ROP2_NXOR, x, y, cx, cy,
425                                            brush, bgcolour, fgcolour);
426                            break;
427    
428                  case 0xb8: /* PSDPxax */                  case 0xb8: /* PSDPxax */
429                          ui_patblt(ROP2_XOR, x, y, cx, cy,                          ui_patblt(ROP2_XOR, x, y, cx, cy,
430                                          brush, bgcolour, fgcolour);                                          brush, bgcolour, fgcolour);
431                          ui_memblt(ROP2_AND, x, y, cx, cy,                          ui_memblt(ROP2_AND, x, y, cx, cy, src, srcx, srcy);
                                         src, srcx, srcy);  
432                          ui_patblt(ROP2_XOR, x, y, cx, cy,                          ui_patblt(ROP2_XOR, x, y, cx, cy,
433                                          brush, bgcolour, fgcolour);                                          brush, bgcolour, fgcolour);
434                          break;                          break;
435    
436                  default:                  default:
437                          NOTIMP("triblt 0x%x\n", opcode);                          NOTIMP("triblt 0x%x\n", opcode);
438                          ui_memblt(ROP2_COPY, x, y, cx, cy,                          ui_memblt(ROP2_COPY, x, y, cx, cy, src, srcx, srcy);
                                         brush, bgcolour, fgcolour);  
439          }          }
440  }  }
441    
# Line 487  void ui_draw_glyph(int mixmode, Line 491  void ui_draw_glyph(int mixmode,
491          }          }
492  }  }
493    
494  void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x,  void ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y,
495                          int y, int boxx, int boxy, int boxcx, int boxcy,                          int clipx, int clipy, int clipcx, int clipcy,
496                            int boxx, int boxy, int boxcx, int boxcy,
497                          int bgcolour, int fgcolour, uint8 *text, uint8 length)                          int bgcolour, int fgcolour, uint8 *text, uint8 length)
498  {  {
499          FONTGLYPH *glyph;          FONTGLYPH *glyph;
# Line 498  void ui_draw_text(uint8 font, uint8 flag Line 503  void ui_draw_text(uint8 font, uint8 flag
503          {          {
504                  ui_rect(boxx, boxy, boxcx, boxcy, bgcolour);                  ui_rect(boxx, boxy, boxcx, boxcy, bgcolour);
505          }          }
506            else if (mixmode == MIX_OPAQUE)
507            {
508                    ui_rect(clipx, clipy, clipcx, clipcy, bgcolour);
509            }
510    
511          /* Paint text, character by character */          /* Paint text, character by character */
512          for (i = 0; i < length; i++)          for (i = 0; i < length; i++)
513          {          {
514                  glyph = cache_get_font(font, text[i]);                  glyph = cache_get_font(font, text[i]);
515    
516                    if (!(flags & TEXT2_IMPLICIT_X))
517                            x += text[++i];
518    
519                  if (glyph != NULL)                  if (glyph != NULL)
520                  {                  {
521                          ui_draw_glyph(mixmode, x,                          ui_draw_glyph(mixmode, x,
# Line 514  void ui_draw_text(uint8 font, uint8 flag Line 526  void ui_draw_text(uint8 font, uint8 flag
526    
527                          if (flags & TEXT2_IMPLICIT_X)                          if (flags & TEXT2_IMPLICIT_X)
528                                  x += glyph->width;                                  x += glyph->width;
                         else  
                                 x += text[++i];  
529                  }                  }
530          }          }
531  }  }
# Line 523  void ui_draw_text(uint8 font, uint8 flag Line 533  void ui_draw_text(uint8 font, uint8 flag
533  void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)  void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
534  {  {
535          XImage *image;          XImage *image;
         int scanline;  
536    
         scanline = (cx + 3) & ~3;  
         STATUS("XGetImage(%p,%x,%d,%d,%d,%d,%x,%d)\n", display, wnd, x, y,  
                 cx, cy, 0xffffffff, ZPixmap);  
537          image = XGetImage(display, wnd, x, y, cx, cy, 0xffffffff, ZPixmap);          image = XGetImage(display, wnd, x, y, cx, cy, 0xffffffff, ZPixmap);
538          cache_put_desktop(offset, scanline*cy, image->data);          cache_put_desktop(offset, cx, cy, image->bytes_per_line, image->data);
539          XFree(image->data);          XFree(image->data);
540          XFree(image);          XFree(image);
541  }  }
# Line 537  void ui_desktop_save(uint32 offset, int Line 543  void ui_desktop_save(uint32 offset, int
543  void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)  void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
544  {  {
545          XImage *image;          XImage *image;
         int scanline;  
546          uint8 *data;          uint8 *data;
547    
548          scanline = (cx + 3) & ~3;          data = cache_get_desktop(offset, cx, cy);
         data = cache_get_desktop(offset, scanline*cy);  
549          if (data == NULL)          if (data == NULL)
550                  return;                  return;
551    
552          image = XCreateImage(display, visual, 8, ZPixmap, 0,          image = XCreateImage(display, visual, 8, ZPixmap, 0,
553                                  data, cx, cy, 32, scanline);                                  data, cx, cy, 32, cx);
554          XSetFunction(display, gc, GXcopy);          XSetFunction(display, gc, GXcopy);
555          XPutImage(display, wnd, gc, image, 0, 0, x, y, cx, cy);          XPutImage(display, wnd, gc, image, 0, 0, x, y, cx, cy);
556          XFree(image);          XFree(image);

Legend:
Removed from v.10  
changed lines
  Added in v.17

  ViewVC Help
Powered by ViewVC 1.1.26