/[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 16 by matty, Thu Sep 28 07:04:14 2000 UTC revision 23 by matty, Tue Oct 17 08:24:09 2000 UTC
# Line 41  BOOL ui_create_window(char *title) Line 41  BOOL ui_create_window(char *title)
41    
42          display = XOpenDisplay(NULL);          display = XOpenDisplay(NULL);
43          if (display == NULL)          if (display == NULL)
44            {
45                    ERROR("Failed to open display\n");
46                  return False;                  return False;
47            }
48    
49          /* Check the screen supports 8-bit depth. */          /* Check the screen supports 8-bit depth. */
50          screen = DefaultScreenOfDisplay(display);          screen = DefaultScreenOfDisplay(display);
# Line 245  HGLYPH ui_create_glyph(int width, int he Line 248  HGLYPH ui_create_glyph(int width, int he
248    
249          image = XCreateImage(display, visual, 1, ZPixmap, 0,          image = XCreateImage(display, visual, 1, ZPixmap, 0,
250                                  data, width, height, 8, scanline);                                  data, width, height, 8, scanline);
251            image->byte_order = MSBFirst;
252            image->bitmap_bit_order = MSBFirst;
253            XInitImage(image);
254    
255          XSetFunction(display, gc, GXcopy);          XSetFunction(display, gc, GXcopy);
256          XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height);          XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height);
257          XFree(image);          XFree(image);
# Line 491  void ui_draw_glyph(int mixmode, Line 498  void ui_draw_glyph(int mixmode,
498          }          }
499  }  }
500    
501  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,
502                          int y, int boxx, int boxy, int boxcx, int boxcy,                          int clipx, int clipy, int clipcx, int clipcy,
503                            int boxx, int boxy, int boxcx, int boxcy,
504                          int bgcolour, int fgcolour, uint8 *text, uint8 length)                          int bgcolour, int fgcolour, uint8 *text, uint8 length)
505  {  {
506          FONTGLYPH *glyph;          FONTGLYPH *glyph;
# Line 502  void ui_draw_text(uint8 font, uint8 flag Line 510  void ui_draw_text(uint8 font, uint8 flag
510          {          {
511                  ui_rect(boxx, boxy, boxcx, boxcy, bgcolour);                  ui_rect(boxx, boxy, boxcx, boxcy, bgcolour);
512          }          }
513            else if (mixmode == MIX_OPAQUE)
514            {
515                    ui_rect(clipx, clipy, clipcx, clipcy, bgcolour);
516            }
517    
518          /* Paint text, character by character */          /* Paint text, character by character */
519          for (i = 0; i < length; i++)          for (i = 0; i < length; i++)
520          {          {
521                  glyph = cache_get_font(font, text[i]);                  glyph = cache_get_font(font, text[i]);
522    
523                    if (!(flags & TEXT2_IMPLICIT_X))
524                            x += text[++i];
525    
526                  if (glyph != NULL)                  if (glyph != NULL)
527                  {                  {
528                          ui_draw_glyph(mixmode, x,                          ui_draw_glyph(mixmode, x + (short)glyph->offset,
529                                          y + (short)glyph->baseline,                                          y + (short)glyph->baseline,
530                                          glyph->width, glyph->height,                                          glyph->width, glyph->height,
531                                          glyph->pixmap, 0, 0,                                          glyph->pixmap, 0, 0,
# Line 518  void ui_draw_text(uint8 font, uint8 flag Line 533  void ui_draw_text(uint8 font, uint8 flag
533    
534                          if (flags & TEXT2_IMPLICIT_X)                          if (flags & TEXT2_IMPLICIT_X)
535                                  x += glyph->width;                                  x += glyph->width;
                         else  
                                 x += text[++i];  
536                  }                  }
537          }          }
538  }  }

Legend:
Removed from v.16  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26