Xutf8.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /* "$Id: Xutf8.h 7904 2010-11-28 21:12:59Z matt $"
  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. XUtf8DrawRtlString(
  60. Display *display,
  61. Drawable d,
  62. XUtf8FontStruct *font_set,
  63. GC gc,
  64. int x,
  65. int y,
  66. const char *string,
  67. int num_bytes);
  68. void
  69. XUtf8DrawImageString(
  70. Display *display,
  71. Drawable d,
  72. XUtf8FontStruct *font_set,
  73. GC gc,
  74. int x,
  75. int y,
  76. const char *string,
  77. int num_bytes);
  78. int
  79. XUtf8TextWidth(
  80. XUtf8FontStruct *font_set,
  81. const char *string,
  82. int num_bytes);
  83. int
  84. XUtf8UcsWidth(
  85. XUtf8FontStruct *font_set,
  86. unsigned int ucs);
  87. int
  88. XGetUtf8FontAndGlyph(
  89. XUtf8FontStruct *font_set,
  90. unsigned int ucs,
  91. XFontStruct **fnt,
  92. unsigned short *id);
  93. void
  94. XFreeUtf8FontStruct(
  95. Display *dpy,
  96. XUtf8FontStruct *font_set);
  97. int
  98. XConvertUtf8ToUcs(
  99. const unsigned char *buf,
  100. int len,
  101. unsigned int *ucs);
  102. int
  103. XConvertUcsToUtf8(
  104. unsigned int ucs,
  105. char *buf);
  106. int
  107. XUtf8CharByteLen(
  108. const unsigned char *buf,
  109. int len);
  110. int
  111. XCountUtf8Char(
  112. const unsigned char *buf,
  113. int len);
  114. int
  115. XFastConvertUtf8ToUcs(
  116. const unsigned char *buf,
  117. int len,
  118. unsigned int *ucs);
  119. long
  120. XKeysymToUcs(
  121. KeySym keysym);
  122. int
  123. XUtf8LookupString(
  124. XIC ic,
  125. XKeyPressedEvent* event,
  126. char* buffer_return,
  127. int bytes_buffer,
  128. KeySym* keysym,
  129. Status* status_return);
  130. unsigned short
  131. XUtf8IsNonSpacing(
  132. unsigned int ucs);
  133. unsigned short
  134. XUtf8IsRightToLeft(
  135. unsigned int ucs);
  136. int
  137. XUtf8Tolower(
  138. int ucs);
  139. int
  140. XUtf8Toupper(
  141. int ucs);
  142. # ifdef __cplusplus
  143. }
  144. # endif
  145. #endif
  146. /*
  147. * End of "$Id: Xutf8.h 7904 2010-11-28 21:12:59Z matt $".
  148. */