FLTK 1.3.9
Loading...
Searching...
No Matches
Xutf8.h
1/* "$Id$"
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#if ! ( defined(_Xutf8_h) || defined(FL_DOXYGEN) )
18#define _Xutf8_h
19
20# ifdef __cplusplus
21extern "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#include <FL/Fl_Export.H>
29
30typedef struct {
31 int nb_font;
32 char **font_name_list;
33 int *encodings;
34 XFontStruct **fonts;
35 Font fid;
36 int ascent;
37 int descent;
38 int *ranges;
39} XUtf8FontStruct;
40
41XUtf8FontStruct *
42XCreateUtf8FontStruct (
43 Display *dpy,
44 const char *base_font_name_list);
45
46void
47XUtf8DrawString(
48 Display *display,
49 Drawable d,
50 XUtf8FontStruct *font_set,
51 GC gc,
52 int x,
53 int y,
54 const char *string,
55 int num_bytes);
56
57void
58XUtf8_measure_extents(
59 Display *display,
60 Drawable d,
61 XUtf8FontStruct *font_set,
62 GC gc,
63 int *xx,
64 int *yy,
65 int *ww,
66 int *hh,
67 const char *string,
68 int num_bytes);
69
70void
71XUtf8DrawRtlString(
72 Display *display,
73 Drawable d,
74 XUtf8FontStruct *font_set,
75 GC gc,
76 int x,
77 int y,
78 const char *string,
79 int num_bytes);
80
81void
82XUtf8DrawImageString(
83 Display *display,
84 Drawable d,
85 XUtf8FontStruct *font_set,
86 GC gc,
87 int x,
88 int y,
89 const char *string,
90 int num_bytes);
91
92int
93XUtf8TextWidth(
94 XUtf8FontStruct *font_set,
95 const char *string,
96 int num_bytes);
97int
98XUtf8UcsWidth(
99 XUtf8FontStruct *font_set,
100 unsigned int ucs);
101
102FL_EXPORT int
103fl_XGetUtf8FontAndGlyph(
104 XUtf8FontStruct *font_set,
105 unsigned int ucs,
106 XFontStruct **fnt,
107 unsigned short *id);
108
109void
110XFreeUtf8FontStruct(
111 Display *dpy,
112 XUtf8FontStruct *font_set);
113
114
115int
116XConvertUtf8ToUcs(
117 const unsigned char *buf,
118 int len,
119 unsigned int *ucs);
120
121int
122XConvertUcsToUtf8(
123 unsigned int ucs,
124 char *buf);
125
126int
127XUtf8CharByteLen(
128 const unsigned char *buf,
129 int len);
130
131int
132XCountUtf8Char(
133 const unsigned char *buf,
134 int len);
135
136int
137XFastConvertUtf8ToUcs(
138 const unsigned char *buf,
139 int len,
140 unsigned int *ucs);
141
142long
143XKeysymToUcs(
144 KeySym keysym);
145
146#ifdef X_HAVE_UTF8_STRING
147#define XUtf8LookupString Xutf8LookupString
148#else
149int
150XUtf8LookupString(
151 XIC ic,
152 XKeyPressedEvent* event,
153 char* buffer_return,
154 int bytes_buffer,
155 KeySym* keysym,
156 Status* status_return);
157#endif
158
159unsigned short
160XUtf8IsNonSpacing(
161 unsigned int ucs);
162
163unsigned short
164XUtf8IsRightToLeft(
165 unsigned int ucs);
166
167
168int
169XUtf8Tolower(
170 int ucs);
171
172int
173XUtf8Toupper(
174 int ucs);
175
176
177# ifdef __cplusplus
178}
179# endif
180
181#endif
182
183/*
184 * End of "$Id$".
185 */