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