00001 00002 #ifndef _GDISPLAY_STRING_H_ 00003 #define _GDISPLAY_STRING_H_ 00004 00005 #ifdef LINUX 00006 namespace Pango 00007 { 00008 #include "pango/pango.h" 00009 #include "pango/pangocairo.h" 00010 } 00011 #endif 00012 00027 class LgiClass GDisplayString 00028 { 00029 GSurface *pDC; 00030 OsChar *Str; 00031 GFont *Font; 00032 int x, y, len, TabOrigin; 00033 int Blocks; 00034 class CharInfo *Info; 00035 uint8 Flags; 00036 00037 #if defined MAC 00038 00039 ATSUTextLayout Hnd; 00040 ATSUTextMeasurement fAscent; 00041 ATSUTextMeasurement fDescent; 00042 00043 #elif defined __GTK_H__ 00044 00045 Gtk::PangoLayout *Hnd; 00046 00047 #endif 00048 00049 void Layout(); 00050 00051 public: 00053 GDisplayString 00054 ( 00056 GFont *f, 00058 const char *s, 00060 int l = -1, 00061 GSurface *pdc = 0, 00062 int tabOrigin = 0 00063 ); 00065 GDisplayString 00066 ( 00068 GFont *f, 00070 const char16 *s, 00072 int l = -1, 00073 GSurface *pdc = 0, 00074 int tabOrigin = 0 00075 ); 00076 virtual ~GDisplayString(); 00077 00080 bool ShowVisibleTab(); 00083 void ShowVisibleTab(bool i); 00084 00086 GFont *GetFont() { return Font; }; 00087 00089 void TruncateWithDots 00090 ( 00092 int Width 00093 ); 00095 bool IsTruncated(); 00096 00098 int Length(); 00100 void Length(int NewLen); 00101 00103 operator const OsChar*() { return Str; } 00104 00106 int X(); 00108 int Y(); 00110 void Size(int *x, int *y); 00112 int CharAt(int x); 00113 00115 void Draw 00116 ( 00118 GSurface *pDC, 00120 int x, 00122 int y, 00124 GRect *r = 0 00125 ); 00126 }; 00127 00128 #endif