| 1 | /* Pango |
| 2 | * pango-attributes.h: Attributed text |
| 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_ATTRIBUTES_H__ |
| 23 | #define __PANGO_ATTRIBUTES_H__ |
| 24 | |
| 25 | #include <pango/pango-font.h> |
| 26 | #include <glib-object.h> |
| 27 | |
| 28 | G_BEGIN_DECLS |
| 29 | |
| 30 | /* PangoColor */ |
| 31 | |
| 32 | typedef struct _PangoColor PangoColor; |
| 33 | |
| 34 | /** |
| 35 | * PangoColor: |
| 36 | * @red: value of red component |
| 37 | * @green: value of green component |
| 38 | * @blue: value of blue component |
| 39 | * |
| 40 | * The #PangoColor structure is used to |
| 41 | * represent a color in an uncalibrated RGB color-space. |
| 42 | */ |
| 43 | struct _PangoColor |
| 44 | { |
| 45 | guint16 red; |
| 46 | guint16 green; |
| 47 | guint16 blue; |
| 48 | }; |
| 49 | |
| 50 | /** |
| 51 | * PANGO_TYPE_COLOR: |
| 52 | * |
| 53 | * The #GObject type for #PangoColor. |
| 54 | */ |
| 55 | #define PANGO_TYPE_COLOR pango_color_get_type () |
| 56 | PANGO_AVAILABLE_IN_ALL |
| 57 | GType pango_color_get_type (void) G_GNUC_CONST; |
| 58 | |
| 59 | PANGO_AVAILABLE_IN_ALL |
| 60 | PangoColor *pango_color_copy (const PangoColor *src); |
| 61 | PANGO_AVAILABLE_IN_ALL |
| 62 | void pango_color_free (PangoColor *color); |
| 63 | PANGO_AVAILABLE_IN_ALL |
| 64 | gboolean pango_color_parse (PangoColor *color, |
| 65 | const char *spec); |
| 66 | PANGO_AVAILABLE_IN_1_16 |
| 67 | gchar *pango_color_to_string(const PangoColor *color); |
| 68 | |
| 69 | |
| 70 | /* Attributes */ |
| 71 | |
| 72 | typedef struct _PangoAttribute PangoAttribute; |
| 73 | typedef struct _PangoAttrClass PangoAttrClass; |
| 74 | |
| 75 | typedef struct _PangoAttrString PangoAttrString; |
| 76 | typedef struct _PangoAttrLanguage PangoAttrLanguage; |
| 77 | typedef struct _PangoAttrInt PangoAttrInt; |
| 78 | typedef struct _PangoAttrSize PangoAttrSize; |
| 79 | typedef struct _PangoAttrFloat PangoAttrFloat; |
| 80 | typedef struct _PangoAttrColor PangoAttrColor; |
| 81 | typedef struct _PangoAttrFontDesc PangoAttrFontDesc; |
| 82 | typedef struct _PangoAttrShape PangoAttrShape; |
| 83 | typedef struct _PangoAttrFontFeatures PangoAttrFontFeatures; |
| 84 | |
| 85 | /** |
| 86 | * PANGO_TYPE_ATTR_LIST: |
| 87 | * |
| 88 | * The #GObject type for #PangoAttrList. |
| 89 | */ |
| 90 | #define PANGO_TYPE_ATTR_LIST pango_attr_list_get_type () |
| 91 | /** |
| 92 | * PangoAttrIterator: |
| 93 | * |
| 94 | * The #PangoAttrIterator structure is used to represent an |
| 95 | * iterator through a #PangoAttrList. A new iterator is created |
| 96 | * with pango_attr_list_get_iterator(). Once the iterator |
| 97 | * is created, it can be advanced through the style changes |
| 98 | * in the text using pango_attr_iterator_next(). At each |
| 99 | * style change, the range of the current style segment and the |
| 100 | * attributes currently in effect can be queried. |
| 101 | */ |
| 102 | /** |
| 103 | * PangoAttrList: |
| 104 | * |
| 105 | * The #PangoAttrList structure represents a list of attributes |
| 106 | * that apply to a section of text. The attributes are, in general, |
| 107 | * allowed to overlap in an arbitrary fashion, however, if the |
| 108 | * attributes are manipulated only through pango_attr_list_change(), |
| 109 | * the overlap between properties will meet stricter criteria. |
| 110 | * |
| 111 | * Since the #PangoAttrList structure is stored as a linear list, |
| 112 | * it is not suitable for storing attributes for large amounts |
| 113 | * of text. In general, you should not use a single #PangoAttrList |
| 114 | * for more than one paragraph of text. |
| 115 | */ |
| 116 | typedef struct _PangoAttrList PangoAttrList; |
| 117 | typedef struct _PangoAttrIterator PangoAttrIterator; |
| 118 | |
| 119 | /** |
| 120 | * PangoAttrType: |
| 121 | * @PANGO_ATTR_INVALID: does not happen |
| 122 | * @PANGO_ATTR_LANGUAGE: language (#PangoAttrLanguage) |
| 123 | * @PANGO_ATTR_FAMILY: font family name list (#PangoAttrString) |
| 124 | * @PANGO_ATTR_STYLE: font slant style (#PangoAttrInt) |
| 125 | * @PANGO_ATTR_WEIGHT: font weight (#PangoAttrInt) |
| 126 | * @PANGO_ATTR_VARIANT: font variant (normal or small caps) (#PangoAttrInt) |
| 127 | * @PANGO_ATTR_STRETCH: font stretch (#PangoAttrInt) |
| 128 | * @PANGO_ATTR_SIZE: font size in points scaled by %PANGO_SCALE (#PangoAttrInt) |
| 129 | * @PANGO_ATTR_FONT_DESC: font description (#PangoAttrFontDesc) |
| 130 | * @PANGO_ATTR_FOREGROUND: foreground color (#PangoAttrColor) |
| 131 | * @PANGO_ATTR_BACKGROUND: background color (#PangoAttrColor) |
| 132 | * @PANGO_ATTR_UNDERLINE: whether the text has an underline (#PangoAttrInt) |
| 133 | * @PANGO_ATTR_STRIKETHROUGH: whether the text is struck-through (#PangoAttrInt) |
| 134 | * @PANGO_ATTR_RISE: baseline displacement (#PangoAttrInt) |
| 135 | * @PANGO_ATTR_SHAPE: shape (#PangoAttrShape) |
| 136 | * @PANGO_ATTR_SCALE: font size scale factor (#PangoAttrFloat) |
| 137 | * @PANGO_ATTR_FALLBACK: whether fallback is enabled (#PangoAttrInt) |
| 138 | * @PANGO_ATTR_LETTER_SPACING: letter spacing (#PangoAttrInt) |
| 139 | * @PANGO_ATTR_UNDERLINE_COLOR: underline color (#PangoAttrColor) |
| 140 | * @PANGO_ATTR_STRIKETHROUGH_COLOR: strikethrough color (#PangoAttrColor) |
| 141 | * @PANGO_ATTR_ABSOLUTE_SIZE: font size in pixels scaled by %PANGO_SCALE (#PangoAttrInt) |
| 142 | * @PANGO_ATTR_GRAVITY: base text gravity (#PangoAttrInt) |
| 143 | * @PANGO_ATTR_GRAVITY_HINT: gravity hint (#PangoAttrInt) |
| 144 | * @PANGO_ATTR_FONT_FEATURES: OpenType font features (#PangoAttrString). Since 1.38 |
| 145 | * @PANGO_ATTR_FOREGROUND_ALPHA: foreground alpha (#PangoAttrInt). Since 1.38 |
| 146 | * @PANGO_ATTR_BACKGROUND_ALPHA: background alpha (#PangoAttrInt). Since 1.38 |
| 147 | * |
| 148 | * The #PangoAttrType |
| 149 | * distinguishes between different types of attributes. Along with the |
| 150 | * predefined values, it is possible to allocate additional values |
| 151 | * for custom attributes using pango_attr_type_register(). The predefined |
| 152 | * values are given below. The type of structure used to store the |
| 153 | * attribute is listed in parentheses after the description. |
| 154 | */ |
| 155 | typedef enum |
| 156 | { |
| 157 | PANGO_ATTR_INVALID, /* 0 is an invalid attribute type */ |
| 158 | PANGO_ATTR_LANGUAGE, /* PangoAttrLanguage */ |
| 159 | PANGO_ATTR_FAMILY, /* PangoAttrString */ |
| 160 | PANGO_ATTR_STYLE, /* PangoAttrInt */ |
| 161 | PANGO_ATTR_WEIGHT, /* PangoAttrInt */ |
| 162 | PANGO_ATTR_VARIANT, /* PangoAttrInt */ |
| 163 | PANGO_ATTR_STRETCH, /* PangoAttrInt */ |
| 164 | PANGO_ATTR_SIZE, /* PangoAttrSize */ |
| 165 | PANGO_ATTR_FONT_DESC, /* PangoAttrFontDesc */ |
| 166 | PANGO_ATTR_FOREGROUND, /* PangoAttrColor */ |
| 167 | PANGO_ATTR_BACKGROUND, /* PangoAttrColor */ |
| 168 | PANGO_ATTR_UNDERLINE, /* PangoAttrInt */ |
| 169 | PANGO_ATTR_STRIKETHROUGH, /* PangoAttrInt */ |
| 170 | PANGO_ATTR_RISE, /* PangoAttrInt */ |
| 171 | PANGO_ATTR_SHAPE, /* PangoAttrShape */ |
| 172 | PANGO_ATTR_SCALE, /* PangoAttrFloat */ |
| 173 | PANGO_ATTR_FALLBACK, /* PangoAttrInt */ |
| 174 | PANGO_ATTR_LETTER_SPACING, /* PangoAttrInt */ |
| 175 | PANGO_ATTR_UNDERLINE_COLOR, /* PangoAttrColor */ |
| 176 | PANGO_ATTR_STRIKETHROUGH_COLOR,/* PangoAttrColor */ |
| 177 | PANGO_ATTR_ABSOLUTE_SIZE, /* PangoAttrSize */ |
| 178 | PANGO_ATTR_GRAVITY, /* PangoAttrInt */ |
| 179 | PANGO_ATTR_GRAVITY_HINT, /* PangoAttrInt */ |
| 180 | PANGO_ATTR_FONT_FEATURES, /* PangoAttrString */ |
| 181 | PANGO_ATTR_FOREGROUND_ALPHA, /* PangoAttrInt */ |
| 182 | PANGO_ATTR_BACKGROUND_ALPHA /* PangoAttrInt */ |
| 183 | } PangoAttrType; |
| 184 | |
| 185 | /** |
| 186 | * PangoUnderline: |
| 187 | * @PANGO_UNDERLINE_NONE: no underline should be drawn |
| 188 | * @PANGO_UNDERLINE_SINGLE: a single underline should be drawn |
| 189 | * @PANGO_UNDERLINE_DOUBLE: a double underline should be drawn |
| 190 | * @PANGO_UNDERLINE_LOW: a single underline should be drawn at a position |
| 191 | * beneath the ink extents of the text being |
| 192 | * underlined. This should be used only for underlining |
| 193 | * single characters, such as for keyboard |
| 194 | * accelerators. %PANGO_UNDERLINE_SINGLE should |
| 195 | * be used for extended portions of text. |
| 196 | * @PANGO_UNDERLINE_ERROR: a wavy underline should be drawn below. |
| 197 | * This underline is typically used to indicate |
| 198 | * an error such as a possilble mispelling; in some |
| 199 | * cases a contrasting color may automatically |
| 200 | * be used. This type of underlining is available since Pango 1.4. |
| 201 | * |
| 202 | * The #PangoUnderline enumeration is used to specify |
| 203 | * whether text should be underlined, and if so, the type |
| 204 | * of underlining. |
| 205 | */ |
| 206 | typedef enum { |
| 207 | PANGO_UNDERLINE_NONE, |
| 208 | PANGO_UNDERLINE_SINGLE, |
| 209 | PANGO_UNDERLINE_DOUBLE, |
| 210 | PANGO_UNDERLINE_LOW, |
| 211 | PANGO_UNDERLINE_ERROR |
| 212 | } PangoUnderline; |
| 213 | |
| 214 | /** |
| 215 | * PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING: |
| 216 | * |
| 217 | * This value can be used to set the start_index member of a #PangoAttribute |
| 218 | * such that the attribute covers from the beginning of the text. |
| 219 | * |
| 220 | * Since: 1.24 |
| 221 | */ |
| 222 | /** |
| 223 | * PANGO_ATTR_INDEX_TO_TEXT_END: |
| 224 | * |
| 225 | * This value can be used to set the end_index member of a #PangoAttribute |
| 226 | * such that the attribute covers to the end of the text. |
| 227 | * |
| 228 | * Since: 1.24 |
| 229 | */ |
| 230 | #define PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING 0 |
| 231 | #define PANGO_ATTR_INDEX_TO_TEXT_END G_MAXUINT |
| 232 | |
| 233 | /** |
| 234 | * PangoAttribute: |
| 235 | * @klass: the class structure holding information about the type of the attribute |
| 236 | * @start_index: the start index of the range (in bytes). |
| 237 | * @end_index: end index of the range (in bytes). The character at this index |
| 238 | * is not included in the range. |
| 239 | * |
| 240 | * The #PangoAttribute structure represents the common portions of all |
| 241 | * attributes. Particular types of attributes include this structure |
| 242 | * as their initial portion. The common portion of the attribute holds |
| 243 | * the range to which the value in the type-specific part of the attribute |
| 244 | * applies and should be initialized using pango_attribute_init(). |
| 245 | * By default an attribute will have an all-inclusive range of [0,%G_MAXUINT]. |
| 246 | */ |
| 247 | struct _PangoAttribute |
| 248 | { |
| 249 | const PangoAttrClass *klass; |
| 250 | guint start_index; /* in bytes */ |
| 251 | guint end_index; /* in bytes. The character at this index is not included */ |
| 252 | }; |
| 253 | |
| 254 | /** |
| 255 | * PangoAttrFilterFunc: |
| 256 | * @attribute: a Pango attribute |
| 257 | * @user_data: user data passed to the function |
| 258 | * |
| 259 | * Type of a function filtering a list of attributes. |
| 260 | * |
| 261 | * Return value: %TRUE if the attribute should be selected for |
| 262 | * filtering, %FALSE otherwise. |
| 263 | **/ |
| 264 | typedef gboolean (*PangoAttrFilterFunc) (PangoAttribute *attribute, |
| 265 | gpointer user_data); |
| 266 | |
| 267 | /** |
| 268 | * PangoAttrDataCopyFunc: |
| 269 | * @user_data: user data to copy |
| 270 | * |
| 271 | * Type of a function that can duplicate user data for an attribute. |
| 272 | * |
| 273 | * Return value: new copy of @user_data. |
| 274 | **/ |
| 275 | typedef gpointer (*PangoAttrDataCopyFunc) (gconstpointer user_data); |
| 276 | |
| 277 | /** |
| 278 | * PangoAttrClass: |
| 279 | * @type: the type ID for this attribute |
| 280 | * @copy: function to duplicate an attribute of this type (see pango_attribute_copy()) |
| 281 | * @destroy: function to free an attribute of this type (see pango_attribute_destroy()) |
| 282 | * @equal: function to check two attributes of this type for equality (see pango_attribute_equal()) |
| 283 | * |
| 284 | * The #PangoAttrClass structure stores the type and operations for |
| 285 | * a particular type of attribute. The functions in this structure should |
| 286 | * not be called directly. Instead, one should use the wrapper functions |
| 287 | * provided for #PangoAttribute. |
| 288 | */ |
| 289 | struct _PangoAttrClass |
| 290 | { |
| 291 | /*< public >*/ |
| 292 | PangoAttrType type; |
| 293 | PangoAttribute * (*copy) (const PangoAttribute *attr); |
| 294 | void (*destroy) (PangoAttribute *attr); |
| 295 | gboolean (*equal) (const PangoAttribute *attr1, const PangoAttribute *attr2); |
| 296 | }; |
| 297 | |
| 298 | /** |
| 299 | * PangoAttrString: |
| 300 | * @attr: the common portion of the attribute |
| 301 | * @value: the string which is the value of the attribute |
| 302 | * |
| 303 | * The #PangoAttrString structure is used to represent attributes with |
| 304 | * a string value. |
| 305 | */ |
| 306 | struct _PangoAttrString |
| 307 | { |
| 308 | PangoAttribute attr; |
| 309 | char *value; |
| 310 | }; |
| 311 | /** |
| 312 | * PangoAttrLanguage: |
| 313 | * @attr: the common portion of the attribute |
| 314 | * @value: the #PangoLanguage which is the value of the attribute |
| 315 | * |
| 316 | * The #PangoAttrLanguage structure is used to represent attributes that |
| 317 | * are languages. |
| 318 | */ |
| 319 | struct _PangoAttrLanguage |
| 320 | { |
| 321 | PangoAttribute attr; |
| 322 | PangoLanguage *value; |
| 323 | }; |
| 324 | /** |
| 325 | * PangoAttrInt: |
| 326 | * @attr: the common portion of the attribute |
| 327 | * @value: the value of the attribute |
| 328 | * |
| 329 | * The #PangoAttrInt structure is used to represent attributes with |
| 330 | * an integer or enumeration value. |
| 331 | */ |
| 332 | struct _PangoAttrInt |
| 333 | { |
| 334 | PangoAttribute attr; |
| 335 | int value; |
| 336 | }; |
| 337 | /** |
| 338 | * PangoAttrFloat: |
| 339 | * @attr: the common portion of the attribute |
| 340 | * @value: the value of the attribute |
| 341 | * |
| 342 | * The #PangoAttrFloat structure is used to represent attributes with |
| 343 | * a float or double value. |
| 344 | */ |
| 345 | struct _PangoAttrFloat |
| 346 | { |
| 347 | PangoAttribute attr; |
| 348 | double value; |
| 349 | }; |
| 350 | /** |
| 351 | * PangoAttrColor: |
| 352 | * @attr: the common portion of the attribute |
| 353 | * @color: the #PangoColor which is the value of the attribute |
| 354 | * |
| 355 | * The #PangoAttrColor structure is used to represent attributes that |
| 356 | * are colors. |
| 357 | */ |
| 358 | struct _PangoAttrColor |
| 359 | { |
| 360 | PangoAttribute attr; |
| 361 | PangoColor color; |
| 362 | }; |
| 363 | |
| 364 | /** |
| 365 | * PangoAttrSize: |
| 366 | * @attr: the common portion of the attribute |
| 367 | * @size: size of font, in units of 1/%PANGO_SCALE of a point (for |
| 368 | * %PANGO_ATTR_SIZE) or of a device uni (for %PANGO_ATTR_ABSOLUTE_SIZE) |
| 369 | * @absolute: whether the font size is in device units or points. |
| 370 | * This field is only present for compatibility with Pango-1.8.0 |
| 371 | * (%PANGO_ATTR_ABSOLUTE_SIZE was added in 1.8.1); and always will |
| 372 | * be %FALSE for %PANGO_ATTR_SIZE and %TRUE for %PANGO_ATTR_ABSOLUTE_SIZE. |
| 373 | * |
| 374 | * The #PangoAttrSize structure is used to represent attributes which |
| 375 | * set font size. |
| 376 | */ |
| 377 | struct _PangoAttrSize |
| 378 | { |
| 379 | PangoAttribute attr; |
| 380 | int size; |
| 381 | guint absolute : 1; |
| 382 | }; |
| 383 | |
| 384 | /** |
| 385 | * PangoAttrShape: |
| 386 | * @attr: the common portion of the attribute |
| 387 | * @ink_rect: the ink rectangle to restrict to |
| 388 | * @logical_rect: the logical rectangle to restrict to |
| 389 | * @data: user data set (see pango_attr_shape_new_with_data()) |
| 390 | * @copy_func: copy function for the user data |
| 391 | * @destroy_func: destroy function for the user data |
| 392 | * |
| 393 | * The #PangoAttrShape structure is used to represent attributes which |
| 394 | * impose shape restrictions. |
| 395 | */ |
| 396 | struct _PangoAttrShape |
| 397 | { |
| 398 | PangoAttribute attr; |
| 399 | PangoRectangle ink_rect; |
| 400 | PangoRectangle logical_rect; |
| 401 | |
| 402 | gpointer data; |
| 403 | PangoAttrDataCopyFunc copy_func; |
| 404 | GDestroyNotify destroy_func; |
| 405 | }; |
| 406 | |
| 407 | /** |
| 408 | * PangoAttrFontDesc: |
| 409 | * @attr: the common portion of the attribute |
| 410 | * @desc: the font description which is the value of this attribute |
| 411 | * |
| 412 | * The #PangoAttrFontDesc structure is used to store an attribute that |
| 413 | * sets all aspects of the font description at once. |
| 414 | */ |
| 415 | struct _PangoAttrFontDesc |
| 416 | { |
| 417 | PangoAttribute attr; |
| 418 | PangoFontDescription *desc; |
| 419 | }; |
| 420 | |
| 421 | /** |
| 422 | * PangoAttrFontFeatures: |
| 423 | * @attr: the common portion of the attribute |
| 424 | * @features: the featues, as a string in CSS syntax |
| 425 | * |
| 426 | * The #PangoAttrFontFeatures structure is used to represent OpenType |
| 427 | * font features as an attribute. |
| 428 | * |
| 429 | * Since: 1.38 |
| 430 | */ |
| 431 | struct _PangoAttrFontFeatures |
| 432 | { |
| 433 | PangoAttribute attr; |
| 434 | gchar *features; |
| 435 | }; |
| 436 | |
| 437 | PANGO_AVAILABLE_IN_ALL |
| 438 | PangoAttrType pango_attr_type_register (const gchar *name); |
| 439 | PANGO_AVAILABLE_IN_1_22 |
| 440 | const char * pango_attr_type_get_name (PangoAttrType type) G_GNUC_CONST; |
| 441 | |
| 442 | PANGO_AVAILABLE_IN_1_20 |
| 443 | void pango_attribute_init (PangoAttribute *attr, |
| 444 | const PangoAttrClass *klass); |
| 445 | PANGO_AVAILABLE_IN_ALL |
| 446 | PangoAttribute * pango_attribute_copy (const PangoAttribute *attr); |
| 447 | PANGO_AVAILABLE_IN_ALL |
| 448 | void pango_attribute_destroy (PangoAttribute *attr); |
| 449 | PANGO_AVAILABLE_IN_ALL |
| 450 | gboolean pango_attribute_equal (const PangoAttribute *attr1, |
| 451 | const PangoAttribute *attr2) G_GNUC_PURE; |
| 452 | |
| 453 | PANGO_AVAILABLE_IN_ALL |
| 454 | PangoAttribute *pango_attr_language_new (PangoLanguage *language); |
| 455 | PANGO_AVAILABLE_IN_ALL |
| 456 | PangoAttribute *pango_attr_family_new (const char *family); |
| 457 | PANGO_AVAILABLE_IN_ALL |
| 458 | PangoAttribute *pango_attr_foreground_new (guint16 red, |
| 459 | guint16 green, |
| 460 | guint16 blue); |
| 461 | PANGO_AVAILABLE_IN_ALL |
| 462 | PangoAttribute *pango_attr_background_new (guint16 red, |
| 463 | guint16 green, |
| 464 | guint16 blue); |
| 465 | PANGO_AVAILABLE_IN_ALL |
| 466 | PangoAttribute *pango_attr_size_new (int size); |
| 467 | PANGO_AVAILABLE_IN_1_8 |
| 468 | PangoAttribute *pango_attr_size_new_absolute (int size); |
| 469 | PANGO_AVAILABLE_IN_ALL |
| 470 | PangoAttribute *pango_attr_style_new (PangoStyle style); |
| 471 | PANGO_AVAILABLE_IN_ALL |
| 472 | PangoAttribute *pango_attr_weight_new (PangoWeight weight); |
| 473 | PANGO_AVAILABLE_IN_ALL |
| 474 | PangoAttribute *pango_attr_variant_new (PangoVariant variant); |
| 475 | PANGO_AVAILABLE_IN_ALL |
| 476 | PangoAttribute *pango_attr_stretch_new (PangoStretch stretch); |
| 477 | PANGO_AVAILABLE_IN_ALL |
| 478 | PangoAttribute *pango_attr_font_desc_new (const PangoFontDescription *desc); |
| 479 | |
| 480 | PANGO_AVAILABLE_IN_ALL |
| 481 | PangoAttribute *pango_attr_underline_new (PangoUnderline underline); |
| 482 | PANGO_AVAILABLE_IN_1_8 |
| 483 | PangoAttribute *pango_attr_underline_color_new (guint16 red, |
| 484 | guint16 green, |
| 485 | guint16 blue); |
| 486 | PANGO_AVAILABLE_IN_ALL |
| 487 | PangoAttribute *pango_attr_strikethrough_new (gboolean strikethrough); |
| 488 | PANGO_AVAILABLE_IN_1_8 |
| 489 | PangoAttribute *pango_attr_strikethrough_color_new (guint16 red, |
| 490 | guint16 green, |
| 491 | guint16 blue); |
| 492 | |
| 493 | PANGO_AVAILABLE_IN_ALL |
| 494 | PangoAttribute *pango_attr_rise_new (int rise); |
| 495 | PANGO_AVAILABLE_IN_ALL |
| 496 | PangoAttribute *pango_attr_scale_new (double scale_factor); |
| 497 | PANGO_AVAILABLE_IN_1_4 |
| 498 | PangoAttribute *pango_attr_fallback_new (gboolean enable_fallback); |
| 499 | PANGO_AVAILABLE_IN_1_6 |
| 500 | PangoAttribute *pango_attr_letter_spacing_new (int letter_spacing); |
| 501 | |
| 502 | PANGO_AVAILABLE_IN_ALL |
| 503 | PangoAttribute *pango_attr_shape_new (const PangoRectangle *ink_rect, |
| 504 | const PangoRectangle *logical_rect); |
| 505 | PANGO_AVAILABLE_IN_1_8 |
| 506 | PangoAttribute *pango_attr_shape_new_with_data (const PangoRectangle *ink_rect, |
| 507 | const PangoRectangle *logical_rect, |
| 508 | gpointer data, |
| 509 | PangoAttrDataCopyFunc copy_func, |
| 510 | GDestroyNotify destroy_func); |
| 511 | |
| 512 | PANGO_AVAILABLE_IN_1_16 |
| 513 | PangoAttribute *pango_attr_gravity_new (PangoGravity gravity); |
| 514 | PANGO_AVAILABLE_IN_1_16 |
| 515 | PangoAttribute *pango_attr_gravity_hint_new (PangoGravityHint hint); |
| 516 | PANGO_AVAILABLE_IN_1_38 |
| 517 | PangoAttribute *pango_attr_font_features_new (const gchar *features); |
| 518 | PANGO_AVAILABLE_IN_1_38 |
| 519 | PangoAttribute *pango_attr_foreground_alpha_new (guint16 alpha); |
| 520 | PANGO_AVAILABLE_IN_1_38 |
| 521 | PangoAttribute *pango_attr_background_alpha_new (guint16 alpha); |
| 522 | |
| 523 | PANGO_AVAILABLE_IN_ALL |
| 524 | GType pango_attr_list_get_type (void) G_GNUC_CONST; |
| 525 | PANGO_AVAILABLE_IN_ALL |
| 526 | PangoAttrList * pango_attr_list_new (void); |
| 527 | PANGO_AVAILABLE_IN_1_10 |
| 528 | PangoAttrList * pango_attr_list_ref (PangoAttrList *list); |
| 529 | PANGO_AVAILABLE_IN_ALL |
| 530 | void pango_attr_list_unref (PangoAttrList *list); |
| 531 | PANGO_AVAILABLE_IN_ALL |
| 532 | PangoAttrList * pango_attr_list_copy (PangoAttrList *list); |
| 533 | PANGO_AVAILABLE_IN_ALL |
| 534 | void pango_attr_list_insert (PangoAttrList *list, |
| 535 | PangoAttribute *attr); |
| 536 | PANGO_AVAILABLE_IN_ALL |
| 537 | void pango_attr_list_insert_before (PangoAttrList *list, |
| 538 | PangoAttribute *attr); |
| 539 | PANGO_AVAILABLE_IN_ALL |
| 540 | void pango_attr_list_change (PangoAttrList *list, |
| 541 | PangoAttribute *attr); |
| 542 | PANGO_AVAILABLE_IN_ALL |
| 543 | void pango_attr_list_splice (PangoAttrList *list, |
| 544 | PangoAttrList *other, |
| 545 | gint pos, |
| 546 | gint len); |
| 547 | |
| 548 | PANGO_AVAILABLE_IN_1_2 |
| 549 | PangoAttrList *pango_attr_list_filter (PangoAttrList *list, |
| 550 | PangoAttrFilterFunc func, |
| 551 | gpointer data); |
| 552 | |
| 553 | PANGO_AVAILABLE_IN_ALL |
| 554 | PangoAttrIterator *pango_attr_list_get_iterator (PangoAttrList *list); |
| 555 | |
| 556 | PANGO_AVAILABLE_IN_ALL |
| 557 | void pango_attr_iterator_range (PangoAttrIterator *iterator, |
| 558 | gint *start, |
| 559 | gint *end); |
| 560 | PANGO_AVAILABLE_IN_ALL |
| 561 | gboolean pango_attr_iterator_next (PangoAttrIterator *iterator); |
| 562 | PANGO_AVAILABLE_IN_ALL |
| 563 | PangoAttrIterator *pango_attr_iterator_copy (PangoAttrIterator *iterator); |
| 564 | PANGO_AVAILABLE_IN_ALL |
| 565 | void pango_attr_iterator_destroy (PangoAttrIterator *iterator); |
| 566 | PANGO_AVAILABLE_IN_ALL |
| 567 | PangoAttribute * pango_attr_iterator_get (PangoAttrIterator *iterator, |
| 568 | PangoAttrType type); |
| 569 | PANGO_AVAILABLE_IN_ALL |
| 570 | void pango_attr_iterator_get_font (PangoAttrIterator *iterator, |
| 571 | PangoFontDescription *desc, |
| 572 | PangoLanguage **language, |
| 573 | GSList **); |
| 574 | PANGO_AVAILABLE_IN_1_2 |
| 575 | GSList * pango_attr_iterator_get_attrs (PangoAttrIterator *iterator); |
| 576 | |
| 577 | |
| 578 | PANGO_AVAILABLE_IN_ALL |
| 579 | gboolean pango_parse_markup (const char *markup_text, |
| 580 | int length, |
| 581 | gunichar accel_marker, |
| 582 | PangoAttrList **attr_list, |
| 583 | char **text, |
| 584 | gunichar *accel_char, |
| 585 | GError **error); |
| 586 | |
| 587 | PANGO_AVAILABLE_IN_1_32 |
| 588 | GMarkupParseContext * pango_markup_parser_new (gunichar accel_marker); |
| 589 | PANGO_AVAILABLE_IN_1_32 |
| 590 | gboolean pango_markup_parser_finish (GMarkupParseContext *context, |
| 591 | PangoAttrList **attr_list, |
| 592 | char **text, |
| 593 | gunichar *accel_char, |
| 594 | GError **error); |
| 595 | |
| 596 | G_END_DECLS |
| 597 | |
| 598 | #endif /* __PANGO_ATTRIBUTES_H__ */ |
| 599 | |