FLTK 1.3.2
Xutf8.h
1 /* "$Id: Xutf8.h 8864 2011-07-19 04:49:30Z greg.ercolano $"
2  *
3  * Author: Jean-Marc Lienher ( http://oksid.ch )
4  * Copyright 2000-2010 by O'ksi'D.
5  *
6  * This library is free software. Distribution and use rights are outlined in
7  * the file "COPYING" which should have been included with this file. If this
8  * file is missing or damaged, see the license at:
9  *
10  * http://www.fltk.org/COPYING.php
11  *
12  * Please report all bugs and problems on the following page:
13  *
14  * http://www.fltk.org/str.php
15  */
16 
17 #ifndef _Xutf8_h
18 #define _Xutf8_h
19 
20 # ifdef __cplusplus
21 extern "C" {
22 # endif
23 
24 #include <X11/X.h>
25 #include <X11/Xlib.h>
26 #include <X11/Xlocale.h>
27 #include <X11/Xutil.h>
28 
29 typedef struct {
30  int nb_font;
31  char **font_name_list;
32  int *encodings;
33  XFontStruct **fonts;
34  Font fid;
35  int ascent;
36  int descent;
37  int *ranges;
39 
41 XCreateUtf8FontStruct (
42  Display *dpy,
43  const char *base_font_name_list);
44 
45 void
46 XUtf8DrawString(
47  Display *display,
48  Drawable d,
49  XUtf8FontStruct *font_set,
50  GC gc,
51  int x,
52  int y,
53  const char *string,
54  int num_bytes);
55 
56 void
57 XUtf8_measure_extents(
58  Display *display,
59  Drawable d,
60  XUtf8FontStruct *font_set,
61  GC gc,
62  int *xx,
63  int *yy,
64  int *ww,
65  int *hh,
66  const char *string,
67  int num_bytes);
68 
69 void
70 XUtf8DrawRtlString(
71  Display *display,
72  Drawable d,
73  XUtf8FontStruct *font_set,
74  GC gc,
75  int x,
76  int y,
77  const char *string,
78  int num_bytes);
79 
80 void
81 XUtf8DrawImageString(
82  Display *display,
83  Drawable d,
84  XUtf8FontStruct *font_set,
85  GC gc,
86  int x,
87  int y,
88  const char *string,
89  int num_bytes);
90 
91 int
92 XUtf8TextWidth(
93  XUtf8FontStruct *font_set,
94  const char *string,
95  int num_bytes);
96 int
97 XUtf8UcsWidth(
98  XUtf8FontStruct *font_set,
99  unsigned int ucs);
100 
101 int
102 XGetUtf8FontAndGlyph(
103  XUtf8FontStruct *font_set,
104  unsigned int ucs,
105  XFontStruct **fnt,
106  unsigned short *id);
107 
108 void
109 XFreeUtf8FontStruct(
110  Display *dpy,
111  XUtf8FontStruct *font_set);
112 
113 
114 int
115 XConvertUtf8ToUcs(
116  const unsigned char *buf,
117  int len,
118  unsigned int *ucs);
119 
120 int
121 XConvertUcsToUtf8(
122  unsigned int ucs,
123  char *buf);
124 
125 int
126 XUtf8CharByteLen(
127  const unsigned char *buf,
128  int len);
129 
130 int
131 XCountUtf8Char(
132  const unsigned char *buf,
133  int len);
134 
135 int
136 XFastConvertUtf8ToUcs(
137  const unsigned char *buf,
138  int len,
139  unsigned int *ucs);
140 
141 long
142 XKeysymToUcs(
143  KeySym keysym);
144 
145 int
146 XUtf8LookupString(
147  XIC ic,
148  XKeyPressedEvent* event,
149  char* buffer_return,
150  int bytes_buffer,
151  KeySym* keysym,
152  Status* status_return);
153 
154 unsigned short
155 XUtf8IsNonSpacing(
156  unsigned int ucs);
157 
158 unsigned short
159 XUtf8IsRightToLeft(
160  unsigned int ucs);
161 
162 
163 int
164 XUtf8Tolower(
165  int ucs);
166 
167 int
168 XUtf8Toupper(
169  int ucs);
170 
171 
172 # ifdef __cplusplus
173 }
174 # endif
175 
176 #endif
177 
178 /*
179  * End of "$Id: Xutf8.h 8864 2011-07-19 04:49:30Z greg.ercolano $".
180  */
Definition: Xutf8.h:29