/[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 42 by matthewc, Sun Apr 7 09:42:54 2002 UTC revision 49 by mmihalik, Fri Apr 19 12:06:08 2002 UTC
# Line 863  ui_draw_glyph(int mixmode, Line 863  ui_draw_glyph(int mixmode,
863          XSetFillStyle(display, gc, FillSolid);          XSetFillStyle(display, gc, FillSolid);
864  }  }
865    
866    #define DO_GLYPH(ttext,idx) \
867    {\
868      glyph = cache_get_font (font, ttext[idx]);\
869      if (!(flags & TEXT2_IMPLICIT_X))\
870        {\
871          xyoffset = ttext[++idx];\
872          if ((xyoffset & 0x80))\
873            {\
874              if (flags & TEXT2_VERTICAL) \
875                y += ttext[++idx] | (ttext[++idx] << 8);\
876              else\
877                x += ttext[++idx] | (ttext[++idx] << 8);\
878            }\
879          else\
880            {\
881              if (flags & TEXT2_VERTICAL) \
882                y += xyoffset;\
883              else\
884                x += xyoffset;\
885            }\
886        }\
887      if (glyph != NULL)\
888        {\
889          ui_draw_glyph (mixmode, x + (short) glyph->offset,\
890                         y + (short) glyph->baseline,\
891                         glyph->width, glyph->height,\
892                         glyph->pixmap, 0, 0, bgcolour, fgcolour);\
893          if (flags & TEXT2_IMPLICIT_X)\
894            x += glyph->width;\
895        }\
896    }
897    
898  void  void
899  ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y,  ui_draw_text(uint8 font, uint8 flags, int mixmode, int x, int y,
900               int clipx, int clipy, int clipcx, int clipcy,               int clipx, int clipy, int clipcx, int clipcy, int boxx,
901               int boxx, int boxy, int boxcx, int boxcy,               int boxy, int boxcx, int boxcy, int bgcolour,
902               int bgcolour, int fgcolour, uint8 *text, uint8 length)               int fgcolour, uint8 * text, uint8 length)
903  {  {
904          FONTGLYPH *glyph;          FONTGLYPH *glyph;
905          int i, offset;          int i, j, xyoffset;
906            DATABLOB *entry;
907    
908          SET_FOREGROUND(bgcolour);          SET_FOREGROUND(bgcolour);
909    
# Line 884  ui_draw_text(uint8 font, uint8 flags, in Line 917  ui_draw_text(uint8 font, uint8 flags, in
917          }          }
918    
919          /* Paint text, character by character */          /* Paint text, character by character */
920          for (i = 0; i < length; i++)          for (i = 0; i < length;) {
921          {                  switch (text[i]) {
922                  glyph = cache_get_font(font, text[i]);                  case 0xff:
923                            if (i + 2 < length)
924                  if (!(flags & TEXT2_IMPLICIT_X))                                  cache_put_text(text[i + 1], text, text[i + 2]);
925                  {                          else {
926                          offset = text[++i];                                  error("this shouldn't be happening\n");
927                          if (offset & 0x80)                                  break;
928                                  offset = ((offset & 0x7f) << 8) | text[++i];                          }
929                            /* this will move pointer from start to first character after FF command */
930                          if (flags & TEXT2_VERTICAL)                          length -= i + 3;
931                                  y += offset;                          text = &(text[i + 3]);
932                          else                          i = 0;
933                                  x += offset;                          break;
934    
935                    case 0xfe:
936                            entry = cache_get_text(text[i + 1]);
937                            if (entry != NULL) {
938                                    if ((((uint8 *) (entry->data))[1] == 0)
939                                        && (!(flags & TEXT2_IMPLICIT_X))) {
940                                            if (flags & TEXT2_VERTICAL)      
941                                                    y += text[i + 2];
942                                            else
943                                                    x += text[i + 2];
944                                    }
945                                    if (i + 2 < length)
946                                            i += 3;
947                                    else
948                                            i += 2;
949                                    length -= i;  
950                                    /* this will move pointer from start to first character after FE command */
951                                    text = &(text[i]);
952                                    i = 0;
953                                    for (j = 0; j < entry->size; j++)
954                                            DO_GLYPH(((uint8 *) (entry->data)), j);
955                            }
956                            break;
957    
958                    default:
959                            DO_GLYPH(text, i);
960                            i++;
961                            break;
962                  }                  }
963            }
964    
                 if (glyph != NULL)  
                 {  
                         ui_draw_glyph(mixmode, x + (short) glyph->offset,  
                                       y + (short) glyph->baseline,  
                                       glyph->width, glyph->height,  
                                       glyph->pixmap, 0, 0,  
                                       bgcolour, fgcolour);  
965    
                         if (flags & TEXT2_IMPLICIT_X)  
                                 x += glyph->width;  
                 }  
         }  
966  }  }
967    
968  void  void

Legend:
Removed from v.42  
changed lines
  Added in v.49

  ViewVC Help
Powered by ViewVC 1.1.26