pango-context.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. GType pango_context_get_type (void) G_GNUC_CONST;
  42. PangoContext *pango_context_new (void);
  43. void pango_context_changed (PangoContext *context);
  44. void pango_context_set_font_map (PangoContext *context,
  45. PangoFontMap *font_map);
  46. PangoFontMap *pango_context_get_font_map (PangoContext *context);
  47. guint pango_context_get_serial (PangoContext *context);
  48. void pango_context_list_families (PangoContext *context,
  49. PangoFontFamily ***families,
  50. int *n_families);
  51. PangoFont * pango_context_load_font (PangoContext *context,
  52. const PangoFontDescription *desc);
  53. PangoFontset *pango_context_load_fontset (PangoContext *context,
  54. const PangoFontDescription *desc,
  55. PangoLanguage *language);
  56. PangoFontMetrics *pango_context_get_metrics (PangoContext *context,
  57. const PangoFontDescription *desc,
  58. PangoLanguage *language);
  59. void pango_context_set_font_description (PangoContext *context,
  60. const PangoFontDescription *desc);
  61. PangoFontDescription * pango_context_get_font_description (PangoContext *context);
  62. PangoLanguage *pango_context_get_language (PangoContext *context);
  63. void pango_context_set_language (PangoContext *context,
  64. PangoLanguage *language);
  65. void pango_context_set_base_dir (PangoContext *context,
  66. PangoDirection direction);
  67. PangoDirection pango_context_get_base_dir (PangoContext *context);
  68. void pango_context_set_base_gravity (PangoContext *context,
  69. PangoGravity gravity);
  70. PangoGravity pango_context_get_base_gravity (PangoContext *context);
  71. PangoGravity pango_context_get_gravity (PangoContext *context);
  72. void pango_context_set_gravity_hint (PangoContext *context,
  73. PangoGravityHint hint);
  74. PangoGravityHint pango_context_get_gravity_hint (PangoContext *context);
  75. void pango_context_set_matrix (PangoContext *context,
  76. const PangoMatrix *matrix);
  77. const PangoMatrix * pango_context_get_matrix (PangoContext *context);
  78. /* Break a string of Unicode characters into segments with
  79. * consistent shaping/language engine and bidrectional level.
  80. * Returns a #GList of #PangoItem's
  81. */
  82. GList *pango_itemize (PangoContext *context,
  83. const char *text,
  84. int start_index,
  85. int length,
  86. PangoAttrList *attrs,
  87. PangoAttrIterator *cached_iter);
  88. GList *pango_itemize_with_base_dir (PangoContext *context,
  89. PangoDirection base_dir,
  90. const char *text,
  91. int start_index,
  92. int length,
  93. PangoAttrList *attrs,
  94. PangoAttrIterator *cached_iter);
  95. G_END_DECLS
  96. #endif /* __PANGO_CONTEXT_H__ */