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