Xutf8.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /* "$Id: Xutf8.h 9958 2013-09-02 15:05:58Z manolo $"
  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. #if ! ( defined(_Xutf8_h) || defined(FL_DOXYGEN) )
  17. #define _Xutf8_h
  18. # ifdef __cplusplus
  19. extern "C" {
  20. # endif
  21. #include <X11/X.h>
  22. #include <X11/Xlib.h>
  23. #include <X11/Xlocale.h>
  24. #include <X11/Xutil.h>
  25. typedef struct {
  26. int nb_font;
  27. char **font_name_list;
  28. int *encodings;
  29. XFontStruct **fonts;
  30. Font fid;
  31. int ascent;
  32. int descent;
  33. int *ranges;
  34. } XUtf8FontStruct;
  35. XUtf8FontStruct *
  36. XCreateUtf8FontStruct (
  37. Display *dpy,
  38. const char *base_font_name_list);
  39. void
  40. XUtf8DrawString(
  41. Display *display,
  42. Drawable d,
  43. XUtf8FontStruct *font_set,
  44. GC gc,
  45. int x,
  46. int y,
  47. const char *string,
  48. int num_bytes);
  49. void
  50. XUtf8_measure_extents(
  51. Display *display,
  52. Drawable d,
  53. XUtf8FontStruct *font_set,
  54. GC gc,
  55. int *xx,
  56. int *yy,
  57. int *ww,
  58. int *hh,
  59. const char *string,
  60. int num_bytes);
  61. void
  62. XUtf8DrawRtlString(
  63. Display *display,
  64. Drawable d,
  65. XUtf8FontStruct *font_set,
  66. GC gc,
  67. int x,
  68. int y,
  69. const char *string,
  70. int num_bytes);
  71. void
  72. XUtf8DrawImageString(
  73. Display *display,
  74. Drawable d,
  75. XUtf8FontStruct *font_set,
  76. GC gc,
  77. int x,
  78. int y,
  79. const char *string,
  80. int num_bytes);
  81. int
  82. XUtf8TextWidth(
  83. XUtf8FontStruct *font_set,
  84. const char *string,
  85. int num_bytes);
  86. int
  87. XUtf8UcsWidth(
  88. XUtf8FontStruct *font_set,
  89. unsigned int ucs);
  90. int
  91. XGetUtf8FontAndGlyph(
  92. XUtf8FontStruct *font_set,
  93. unsigned int ucs,
  94. XFontStruct **fnt,
  95. unsigned short *id);
  96. void
  97. XFreeUtf8FontStruct(
  98. Display *dpy,
  99. XUtf8FontStruct *font_set);
  100. int
  101. XConvertUtf8ToUcs(
  102. const unsigned char *buf,
  103. int len,
  104. unsigned int *ucs);
  105. int
  106. XConvertUcsToUtf8(
  107. unsigned int ucs,
  108. char *buf);
  109. int
  110. XUtf8CharByteLen(
  111. const unsigned char *buf,
  112. int len);
  113. int
  114. XCountUtf8Char(
  115. const unsigned char *buf,
  116. int len);
  117. int
  118. XFastConvertUtf8ToUcs(
  119. const unsigned char *buf,
  120. int len,
  121. unsigned int *ucs);
  122. long
  123. XKeysymToUcs(
  124. KeySym keysym);
  125. int
  126. XUtf8LookupString(
  127. XIC ic,
  128. XKeyPressedEvent* event,
  129. char* buffer_return,
  130. int bytes_buffer,
  131. KeySym* keysym,
  132. Status* status_return);
  133. unsigned short
  134. XUtf8IsNonSpacing(
  135. unsigned int ucs);
  136. unsigned short
  137. XUtf8IsRightToLeft(
  138. unsigned int ucs);
  139. int
  140. XUtf8Tolower(
  141. int ucs);
  142. int
  143. XUtf8Toupper(
  144. int ucs);
  145. # ifdef __cplusplus
  146. }
  147. # endif
  148. #endif
  149. /*
  150. * End of "$Id: Xutf8.h 9958 2013-09-02 15:05:58Z manolo $".
  151. */