00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #if ! ( defined(_Xutf8_h) || defined(FL_DOXYGEN) )
00018 #define _Xutf8_h
00019
00020 # ifdef __cplusplus
00021 extern "C" {
00022 # endif
00023
00024 #include <X11/X.h>
00025 #include <X11/Xlib.h>
00026 #include <X11/Xlocale.h>
00027 #include <X11/Xutil.h>
00028 #include <FL/Fl_Export.H>
00029
00030 typedef struct {
00031 int nb_font;
00032 char **font_name_list;
00033 int *encodings;
00034 XFontStruct **fonts;
00035 Font fid;
00036 int ascent;
00037 int descent;
00038 int *ranges;
00039 } XUtf8FontStruct;
00040
00041 XUtf8FontStruct *
00042 XCreateUtf8FontStruct (
00043 Display *dpy,
00044 const char *base_font_name_list);
00045
00046 void
00047 XUtf8DrawString(
00048 Display *display,
00049 Drawable d,
00050 XUtf8FontStruct *font_set,
00051 GC gc,
00052 int x,
00053 int y,
00054 const char *string,
00055 int num_bytes);
00056
00057 void
00058 XUtf8_measure_extents(
00059 Display *display,
00060 Drawable d,
00061 XUtf8FontStruct *font_set,
00062 GC gc,
00063 int *xx,
00064 int *yy,
00065 int *ww,
00066 int *hh,
00067 const char *string,
00068 int num_bytes);
00069
00070 void
00071 XUtf8DrawRtlString(
00072 Display *display,
00073 Drawable d,
00074 XUtf8FontStruct *font_set,
00075 GC gc,
00076 int x,
00077 int y,
00078 const char *string,
00079 int num_bytes);
00080
00081 void
00082 XUtf8DrawImageString(
00083 Display *display,
00084 Drawable d,
00085 XUtf8FontStruct *font_set,
00086 GC gc,
00087 int x,
00088 int y,
00089 const char *string,
00090 int num_bytes);
00091
00092 int
00093 XUtf8TextWidth(
00094 XUtf8FontStruct *font_set,
00095 const char *string,
00096 int num_bytes);
00097 int
00098 XUtf8UcsWidth(
00099 XUtf8FontStruct *font_set,
00100 unsigned int ucs);
00101
00102 FL_EXPORT int
00103 fl_XGetUtf8FontAndGlyph(
00104 XUtf8FontStruct *font_set,
00105 unsigned int ucs,
00106 XFontStruct **fnt,
00107 unsigned short *id);
00108
00109 void
00110 XFreeUtf8FontStruct(
00111 Display *dpy,
00112 XUtf8FontStruct *font_set);
00113
00114
00115 int
00116 XConvertUtf8ToUcs(
00117 const unsigned char *buf,
00118 int len,
00119 unsigned int *ucs);
00120
00121 int
00122 XConvertUcsToUtf8(
00123 unsigned int ucs,
00124 char *buf);
00125
00126 int
00127 XUtf8CharByteLen(
00128 const unsigned char *buf,
00129 int len);
00130
00131 int
00132 XCountUtf8Char(
00133 const unsigned char *buf,
00134 int len);
00135
00136 int
00137 XFastConvertUtf8ToUcs(
00138 const unsigned char *buf,
00139 int len,
00140 unsigned int *ucs);
00141
00142 long
00143 XKeysymToUcs(
00144 KeySym keysym);
00145
00146 #ifdef X_HAVE_UTF8_STRING
00147 #define XUtf8LookupString Xutf8LookupString
00148 #else
00149 int
00150 XUtf8LookupString(
00151 XIC ic,
00152 XKeyPressedEvent* event,
00153 char* buffer_return,
00154 int bytes_buffer,
00155 KeySym* keysym,
00156 Status* status_return);
00157 #endif
00158
00159 unsigned short
00160 XUtf8IsNonSpacing(
00161 unsigned int ucs);
00162
00163 unsigned short
00164 XUtf8IsRightToLeft(
00165 unsigned int ucs);
00166
00167
00168 int
00169 XUtf8Tolower(
00170 int ucs);
00171
00172 int
00173 XUtf8Toupper(
00174 int ucs);
00175
00176
00177 # ifdef __cplusplus
00178 }
00179 # endif
00180
00181 #endif
00182
00183
00184
00185