pango-context.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* Pango
  2. * pango-context.h: Rendering contexts
  3. *
  4. * Copyright (C) 2000 Red Hat Software
  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
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #ifndef __PANGO_CONTEXT_H__
  22. #define __PANGO_CONTEXT_H__
  23. #include <pango/pango-font.h>
  24. #include <pango/pango-fontmap.h>
  25. #include <pango/pango-attributes.h>
  26. G_BEGIN_DECLS
  27. /* Sort of like a GC - application set information about how
  28. * to handle scripts
  29. */
  30. /* PangoContext typedefed in pango-fontmap.h */
  31. typedef struct _PangoContextClass PangoContextClass;
  32. #define PANGO_TYPE_CONTEXT (pango_context_get_type ())
  33. #define PANGO_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_CONTEXT, PangoContext))
  34. #define PANGO_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_CONTEXT, PangoContextClass))
  35. #define PANGO_IS_CONTEXT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_CONTEXT))
  36. #define PANGO_IS_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_CONTEXT))
  37. #define PANGO_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_CONTEXT, PangoContextClass))
  38. /* The PangoContext and PangoContextClass structs are private; if you
  39. * need to create a subclass of these, file a bug.
  40. */
  41. PANGO_AVAILABLE_IN_ALL
  42. GType pango_context_get_type (void) G_GNUC_CONST;
  43. PANGO_AVAILABLE_IN_ALL
  44. PangoContext *pango_context_new (void);
  45. PANGO_AVAILABLE_IN_1_32
  46. void pango_context_changed (PangoContext *context);
  47. PANGO_AVAILABLE_IN_ALL
  48. void pango_context_set_font_map (PangoContext *context,
  49. PangoFontMap *font_map);
  50. PANGO_AVAILABLE_IN_1_6
  51. PangoFontMap *pango_context_get_font_map (PangoContext *context);
  52. PANGO_AVAILABLE_IN_1_32
  53. guint pango_context_get_serial (PangoContext *context);
  54. PANGO_AVAILABLE_IN_ALL
  55. void pango_context_list_families (PangoContext *context,
  56. PangoFontFamily ***families,
  57. int *n_families);
  58. PANGO_AVAILABLE_IN_ALL
  59. PangoFont * pango_context_load_font (PangoContext *context,
  60. const PangoFontDescription *desc);
  61. PANGO_AVAILABLE_IN_ALL
  62. PangoFontset *pango_context_load_fontset (PangoContext *context,
  63. const PangoFontDescription *desc,
  64. PangoLanguage *language);
  65. PANGO_AVAILABLE_IN_ALL
  66. PangoFontMetrics *pango_context_get_metrics (PangoContext *context,
  67. const PangoFontDescription *desc,
  68. PangoLanguage *language);
  69. PANGO_AVAILABLE_IN_ALL
  70. void pango_context_set_font_description (PangoContext *context,
  71. const PangoFontDescription *desc);
  72. PANGO_AVAILABLE_IN_ALL
  73. PangoFontDescription * pango_context_get_font_description (PangoContext *context);
  74. PANGO_AVAILABLE_IN_ALL
  75. PangoLanguage *pango_context_get_language (PangoContext *context);
  76. PANGO_AVAILABLE_IN_ALL
  77. void pango_context_set_language (PangoContext *context,
  78. PangoLanguage *language);
  79. PANGO_AVAILABLE_IN_ALL
  80. void pango_context_set_base_dir (PangoContext *context,
  81. PangoDirection direction);
  82. PANGO_AVAILABLE_IN_ALL
  83. PangoDirection pango_context_get_base_dir (PangoContext *context);
  84. PANGO_AVAILABLE_IN_1_16
  85. void pango_context_set_base_gravity (PangoContext *context,
  86. PangoGravity gravity);
  87. PANGO_AVAILABLE_IN_1_16
  88. PangoGravity pango_context_get_base_gravity (PangoContext *context);
  89. PANGO_AVAILABLE_IN_1_16
  90. PangoGravity pango_context_get_gravity (PangoContext *context);
  91. PANGO_AVAILABLE_IN_1_16
  92. void pango_context_set_gravity_hint (PangoContext *context,
  93. PangoGravityHint hint);
  94. PANGO_AVAILABLE_IN_1_16
  95. PangoGravityHint pango_context_get_gravity_hint (PangoContext *context);
  96. PANGO_AVAILABLE_IN_1_6
  97. void pango_context_set_matrix (PangoContext *context,
  98. const PangoMatrix *matrix);
  99. PANGO_AVAILABLE_IN_1_6
  100. const PangoMatrix * pango_context_get_matrix (PangoContext *context);
  101. /* Break a string of Unicode characters into segments with
  102. * consistent shaping/language engine and bidrectional level.
  103. * Returns a #GList of #PangoItem's
  104. */
  105. PANGO_AVAILABLE_IN_ALL
  106. GList *pango_itemize (PangoContext *context,
  107. const char *text,
  108. int start_index,
  109. int length,
  110. PangoAttrList *attrs,
  111. PangoAttrIterator *cached_iter);
  112. PANGO_AVAILABLE_IN_1_4
  113. GList *pango_itemize_with_base_dir (PangoContext *context,
  114. PangoDirection base_dir,
  115. const char *text,
  116. int start_index,
  117. int length,
  118. PangoAttrList *attrs,
  119. PangoAttrIterator *cached_iter);
  120. G_END_DECLS
  121. #endif /* __PANGO_CONTEXT_H__ */