You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
3.9KB

  1. /* "$Id: Xutf8.h 8399 2011-02-07 22:22:16Z ianmacarthur $"
  2. *
  3. * Author: Jean-Marc Lienher ( http://oksid.ch )
  4. * Copyright 2000-2010 by O'ksi'D.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  19. * USA.
  20. *
  21. * Please report all bugs and problems on the following page:
  22. *
  23. * http://www.fltk.org/str.php
  24. */
  25. #ifndef _Xutf8_h
  26. #define _Xutf8_h
  27. # ifdef __cplusplus
  28. extern "C" {
  29. # endif
  30. #include <X11/X.h>
  31. #include <X11/Xlib.h>
  32. #include <X11/Xlocale.h>
  33. #include <X11/Xutil.h>
  34. typedef struct {
  35. int nb_font;
  36. char **font_name_list;
  37. int *encodings;
  38. XFontStruct **fonts;
  39. Font fid;
  40. int ascent;
  41. int descent;
  42. int *ranges;
  43. } XUtf8FontStruct;
  44. XUtf8FontStruct *
  45. XCreateUtf8FontStruct (
  46. Display *dpy,
  47. const char *base_font_name_list);
  48. void
  49. XUtf8DrawString(
  50. Display *display,
  51. Drawable d,
  52. XUtf8FontStruct *font_set,
  53. GC gc,
  54. int x,
  55. int y,
  56. const char *string,
  57. int num_bytes);
  58. void
  59. XUtf8_measure_extents(
  60. Display *display,
  61. Drawable d,
  62. XUtf8FontStruct *font_set,
  63. GC gc,
  64. int *xx,
  65. int *yy,
  66. int *ww,
  67. int *hh,
  68. const char *string,
  69. int num_bytes);
  70. void
  71. XUtf8DrawRtlString(
  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. 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. int
  91. XUtf8TextWidth(
  92. XUtf8FontStruct *font_set,
  93. const char *string,
  94. int num_bytes);
  95. int
  96. XUtf8UcsWidth(
  97. XUtf8FontStruct *font_set,
  98. unsigned int ucs);
  99. int
  100. XGetUtf8FontAndGlyph(
  101. XUtf8FontStruct *font_set,
  102. unsigned int ucs,
  103. XFontStruct **fnt,
  104. unsigned short *id);
  105. void
  106. XFreeUtf8FontStruct(
  107. Display *dpy,
  108. XUtf8FontStruct *font_set);
  109. int
  110. XConvertUtf8ToUcs(
  111. const unsigned char *buf,
  112. int len,
  113. unsigned int *ucs);
  114. int
  115. XConvertUcsToUtf8(
  116. unsigned int ucs,
  117. char *buf);
  118. int
  119. XUtf8CharByteLen(
  120. const unsigned char *buf,
  121. int len);
  122. int
  123. XCountUtf8Char(
  124. const unsigned char *buf,
  125. int len);
  126. int
  127. XFastConvertUtf8ToUcs(
  128. const unsigned char *buf,
  129. int len,
  130. unsigned int *ucs);
  131. long
  132. XKeysymToUcs(
  133. KeySym keysym);
  134. int
  135. XUtf8LookupString(
  136. XIC ic,
  137. XKeyPressedEvent* event,
  138. char* buffer_return,
  139. int bytes_buffer,
  140. KeySym* keysym,
  141. Status* status_return);
  142. unsigned short
  143. XUtf8IsNonSpacing(
  144. unsigned int ucs);
  145. unsigned short
  146. XUtf8IsRightToLeft(
  147. unsigned int ucs);
  148. int
  149. XUtf8Tolower(
  150. int ucs);
  151. int
  152. XUtf8Toupper(
  153. int ucs);
  154. # ifdef __cplusplus
  155. }
  156. # endif
  157. #endif
  158. /*
  159. * End of "$Id: Xutf8.h 8399 2011-02-07 22:22:16Z ianmacarthur $".
  160. */