Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-18 10:28:14

0001 /* Pango
0002  * pango-attributes.h: Attributed text
0003  *
0004  * Copyright (C) 2000 Red Hat Software
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public
0017  * License along with this library; if not, write to the
0018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0019  * Boston, MA 02111-1307, USA.
0020  */
0021 
0022 #ifndef __PANGO_ATTRIBUTES_H__
0023 #define __PANGO_ATTRIBUTES_H__
0024 
0025 #include <pango/pango-font.h>
0026 #include <pango/pango-color.h>
0027 #include <glib-object.h>
0028 
0029 G_BEGIN_DECLS
0030 
0031 
0032 typedef struct _PangoAttribute        PangoAttribute;
0033 typedef struct _PangoAttrClass        PangoAttrClass;
0034 
0035 typedef struct _PangoAttrString       PangoAttrString;
0036 typedef struct _PangoAttrLanguage     PangoAttrLanguage;
0037 typedef struct _PangoAttrInt          PangoAttrInt;
0038 typedef struct _PangoAttrSize         PangoAttrSize;
0039 typedef struct _PangoAttrFloat        PangoAttrFloat;
0040 typedef struct _PangoAttrColor        PangoAttrColor;
0041 typedef struct _PangoAttrFontDesc     PangoAttrFontDesc;
0042 typedef struct _PangoAttrShape        PangoAttrShape;
0043 typedef struct _PangoAttrFontFeatures PangoAttrFontFeatures;
0044 
0045 /**
0046  * PangoAttrType:
0047  * @PANGO_ATTR_INVALID: does not happen
0048  * @PANGO_ATTR_LANGUAGE: language ([struct@Pango.AttrLanguage])
0049  * @PANGO_ATTR_FAMILY: font family name list ([struct@Pango.AttrString])
0050  * @PANGO_ATTR_STYLE: font slant style ([struct@Pango.AttrInt])
0051  * @PANGO_ATTR_WEIGHT: font weight ([struct@Pango.AttrInt])
0052  * @PANGO_ATTR_VARIANT: font variant (normal or small caps) ([struct@Pango.AttrInt])
0053  * @PANGO_ATTR_STRETCH: font stretch ([struct@Pango.AttrInt])
0054  * @PANGO_ATTR_SIZE: font size in points scaled by %PANGO_SCALE ([struct@Pango.AttrInt])
0055  * @PANGO_ATTR_FONT_DESC: font description ([struct@Pango.AttrFontDesc])
0056  * @PANGO_ATTR_FOREGROUND: foreground color ([struct@Pango.AttrColor])
0057  * @PANGO_ATTR_BACKGROUND: background color ([struct@Pango.AttrColor])
0058  * @PANGO_ATTR_UNDERLINE: whether the text has an underline ([struct@Pango.AttrInt])
0059  * @PANGO_ATTR_STRIKETHROUGH: whether the text is struck-through ([struct@Pango.AttrInt])
0060  * @PANGO_ATTR_RISE: baseline displacement ([struct@Pango.AttrInt])
0061  * @PANGO_ATTR_SHAPE: shape ([struct@Pango.AttrShape])
0062  * @PANGO_ATTR_SCALE: font size scale factor ([struct@Pango.AttrFloat])
0063  * @PANGO_ATTR_FALLBACK: whether fallback is enabled ([struct@Pango.AttrInt])
0064  * @PANGO_ATTR_LETTER_SPACING: letter spacing ([struct@PangoAttrInt])
0065  * @PANGO_ATTR_UNDERLINE_COLOR: underline color ([struct@Pango.AttrColor])
0066  * @PANGO_ATTR_STRIKETHROUGH_COLOR: strikethrough color ([struct@Pango.AttrColor])
0067  * @PANGO_ATTR_ABSOLUTE_SIZE: font size in pixels scaled by %PANGO_SCALE ([struct@Pango.AttrInt])
0068  * @PANGO_ATTR_GRAVITY: base text gravity ([struct@Pango.AttrInt])
0069  * @PANGO_ATTR_GRAVITY_HINT: gravity hint ([struct@Pango.AttrInt])
0070  * @PANGO_ATTR_FONT_FEATURES: OpenType font features ([struct@Pango.AttrFontFeatures]). Since 1.38
0071  * @PANGO_ATTR_FOREGROUND_ALPHA: foreground alpha ([struct@Pango.AttrInt]). Since 1.38
0072  * @PANGO_ATTR_BACKGROUND_ALPHA: background alpha ([struct@Pango.AttrInt]). Since 1.38
0073  * @PANGO_ATTR_ALLOW_BREAKS: whether breaks are allowed ([struct@Pango.AttrInt]). Since 1.44
0074  * @PANGO_ATTR_SHOW: how to render invisible characters ([struct@Pango.AttrInt]). Since 1.44
0075  * @PANGO_ATTR_INSERT_HYPHENS: whether to insert hyphens at intra-word line breaks ([struct@Pango.AttrInt]). Since 1.44
0076  * @PANGO_ATTR_OVERLINE: whether the text has an overline ([struct@Pango.AttrInt]). Since 1.46
0077  * @PANGO_ATTR_OVERLINE_COLOR: overline color ([struct@Pango.AttrColor]). Since 1.46
0078  * @PANGO_ATTR_LINE_HEIGHT: line height factor ([struct@Pango.AttrFloat]). Since: 1.50
0079  * @PANGO_ATTR_ABSOLUTE_LINE_HEIGHT: line height ([struct@Pango.AttrInt]). Since: 1.50
0080  * @PANGO_ATTR_WORD: override segmentation to classify the range of the attribute as a single word ([struct@Pango.AttrInt]). Since 1.50
0081  * @PANGO_ATTR_SENTENCE: override segmentation to classify the range of the attribute as a single sentence ([struct@Pango.AttrInt]). Since 1.50
0082  * @PANGO_ATTR_BASELINE_SHIFT: baseline displacement ([struct@Pango.AttrInt]). Since 1.50
0083  * @PANGO_ATTR_FONT_SCALE: font-relative size change ([struct@Pango.AttrInt]). Since 1.50
0084  *
0085  * The `PangoAttrType` distinguishes between different types of attributes.
0086  *
0087  * Along with the predefined values, it is possible to allocate additional
0088  * values for custom attributes using [func@AttrType.register]. The predefined
0089  * values are given below. The type of structure used to store the attribute is
0090  * listed in parentheses after the description.
0091  */
0092 typedef enum
0093 {
0094   PANGO_ATTR_INVALID,           /* 0 is an invalid attribute type */
0095   PANGO_ATTR_LANGUAGE,          /* PangoAttrLanguage */
0096   PANGO_ATTR_FAMILY,            /* PangoAttrString */
0097   PANGO_ATTR_STYLE,             /* PangoAttrInt */
0098   PANGO_ATTR_WEIGHT,            /* PangoAttrInt */
0099   PANGO_ATTR_VARIANT,           /* PangoAttrInt */
0100   PANGO_ATTR_STRETCH,           /* PangoAttrInt */
0101   PANGO_ATTR_SIZE,              /* PangoAttrSize */
0102   PANGO_ATTR_FONT_DESC,         /* PangoAttrFontDesc */
0103   PANGO_ATTR_FOREGROUND,        /* PangoAttrColor */
0104   PANGO_ATTR_BACKGROUND,        /* PangoAttrColor */
0105   PANGO_ATTR_UNDERLINE,         /* PangoAttrInt */
0106   PANGO_ATTR_STRIKETHROUGH,     /* PangoAttrInt */
0107   PANGO_ATTR_RISE,              /* PangoAttrInt */
0108   PANGO_ATTR_SHAPE,             /* PangoAttrShape */
0109   PANGO_ATTR_SCALE,             /* PangoAttrFloat */
0110   PANGO_ATTR_FALLBACK,          /* PangoAttrInt */
0111   PANGO_ATTR_LETTER_SPACING,    /* PangoAttrInt */
0112   PANGO_ATTR_UNDERLINE_COLOR,   /* PangoAttrColor */
0113   PANGO_ATTR_STRIKETHROUGH_COLOR,/* PangoAttrColor */
0114   PANGO_ATTR_ABSOLUTE_SIZE,     /* PangoAttrSize */
0115   PANGO_ATTR_GRAVITY,           /* PangoAttrInt */
0116   PANGO_ATTR_GRAVITY_HINT,      /* PangoAttrInt */
0117   PANGO_ATTR_FONT_FEATURES,     /* PangoAttrFontFeatures */
0118   PANGO_ATTR_FOREGROUND_ALPHA,  /* PangoAttrInt */
0119   PANGO_ATTR_BACKGROUND_ALPHA,  /* PangoAttrInt */
0120   PANGO_ATTR_ALLOW_BREAKS,      /* PangoAttrInt */
0121   PANGO_ATTR_SHOW,              /* PangoAttrInt */
0122   PANGO_ATTR_INSERT_HYPHENS,    /* PangoAttrInt */
0123   PANGO_ATTR_OVERLINE,          /* PangoAttrInt */
0124   PANGO_ATTR_OVERLINE_COLOR,    /* PangoAttrColor */
0125   PANGO_ATTR_LINE_HEIGHT,       /* PangoAttrFloat */
0126   PANGO_ATTR_ABSOLUTE_LINE_HEIGHT, /* PangoAttrInt */
0127   PANGO_ATTR_TEXT_TRANSFORM,    /* PangoAttrInt */
0128   PANGO_ATTR_WORD,              /* PangoAttrInt */
0129   PANGO_ATTR_SENTENCE,          /* PangoAttrInt */
0130   PANGO_ATTR_BASELINE_SHIFT,    /* PangoAttrSize */
0131   PANGO_ATTR_FONT_SCALE,        /* PangoAttrInt */
0132 } PangoAttrType;
0133 
0134 /**
0135  * PangoUnderline:
0136  * @PANGO_UNDERLINE_NONE: no underline should be drawn
0137  * @PANGO_UNDERLINE_SINGLE: a single underline should be drawn
0138  * @PANGO_UNDERLINE_DOUBLE: a double underline should be drawn
0139  * @PANGO_UNDERLINE_LOW: a single underline should be drawn at a
0140  *   position beneath the ink extents of the text being
0141  *   underlined. This should be used only for underlining
0142  *   single characters, such as for keyboard accelerators.
0143  *   %PANGO_UNDERLINE_SINGLE should be used for extended
0144  *   portions of text.
0145  * @PANGO_UNDERLINE_ERROR: an underline indicating an error should
0146  *   be drawn below. The exact style of rendering is up to the
0147  *   `PangoRenderer` in use, but typical styles include wavy
0148  *   or dotted lines.
0149  *   This underline is typically used to indicate an error such
0150  *   as a possible mispelling; in some cases a contrasting color
0151  *   may automatically be used. This type of underlining is
0152  *   available since Pango 1.4.
0153  * @PANGO_UNDERLINE_SINGLE_LINE: Like @PANGO_UNDERLINE_SINGLE, but
0154  *   drawn continuously across multiple runs. This type
0155  *   of underlining is available since Pango 1.46.
0156  * @PANGO_UNDERLINE_DOUBLE_LINE: Like @PANGO_UNDERLINE_DOUBLE, but
0157  *   drawn continuously across multiple runs. This type
0158  *   of underlining is available since Pango 1.46.
0159  * @PANGO_UNDERLINE_ERROR_LINE: Like @PANGO_UNDERLINE_ERROR, but
0160  *   drawn continuously across multiple runs. This type
0161  *   of underlining is available since Pango 1.46.
0162  *
0163  * The `PangoUnderline` enumeration is used to specify whether text
0164  * should be underlined, and if so, the type of underlining.
0165  */
0166 typedef enum {
0167   PANGO_UNDERLINE_NONE,
0168   PANGO_UNDERLINE_SINGLE,
0169   PANGO_UNDERLINE_DOUBLE,
0170   PANGO_UNDERLINE_LOW,
0171   PANGO_UNDERLINE_ERROR,
0172   PANGO_UNDERLINE_SINGLE_LINE,
0173   PANGO_UNDERLINE_DOUBLE_LINE,
0174   PANGO_UNDERLINE_ERROR_LINE
0175 } PangoUnderline;
0176 
0177 
0178 /**
0179  * PangoOverline:
0180  * @PANGO_OVERLINE_NONE: no overline should be drawn
0181  * @PANGO_OVERLINE_SINGLE: Draw a single line above the ink
0182  *   extents of the text being underlined.
0183  *
0184  * The `PangoOverline` enumeration is used to specify whether text
0185  * should be overlined, and if so, the type of line.
0186  *
0187  * Since: 1.46
0188  */
0189 typedef enum {
0190   PANGO_OVERLINE_NONE,
0191   PANGO_OVERLINE_SINGLE
0192 } PangoOverline;
0193 
0194 /**
0195  * PangoShowFlags:
0196  * @PANGO_SHOW_NONE: No special treatment for invisible characters
0197  * @PANGO_SHOW_SPACES: Render spaces, tabs and newlines visibly
0198  * @PANGO_SHOW_LINE_BREAKS: Render line breaks visibly
0199  * @PANGO_SHOW_IGNORABLES: Render default-ignorable Unicode
0200  *   characters visibly
0201  *
0202  * These flags affect how Pango treats characters that are normally
0203  * not visible in the output.
0204  *
0205  * Since: 1.44
0206  */
0207 typedef enum {
0208   PANGO_SHOW_NONE        = 0,
0209   PANGO_SHOW_SPACES      = 1 << 0,
0210   PANGO_SHOW_LINE_BREAKS = 1 << 1,
0211   PANGO_SHOW_IGNORABLES  = 1 << 2
0212 } PangoShowFlags;
0213 
0214 /**
0215  * PangoTextTransform:
0216  * @PANGO_TEXT_TRANSFORM_NONE: Leave text unchanged
0217  * @PANGO_TEXT_TRANSFORM_LOWERCASE: Display letters and numbers as lowercase
0218  * @PANGO_TEXT_TRANSFORM_UPPERCASE: Display letters and numbers as uppercase
0219  * @PANGO_TEXT_TRANSFORM_CAPITALIZE: Display the first character of a word
0220  *   in titlecase
0221  *
0222  * An enumeration that affects how Pango treats characters during shaping.
0223  *
0224  * Since: 1.50
0225  */
0226 typedef enum {
0227   PANGO_TEXT_TRANSFORM_NONE,
0228   PANGO_TEXT_TRANSFORM_LOWERCASE,
0229   PANGO_TEXT_TRANSFORM_UPPERCASE,
0230   PANGO_TEXT_TRANSFORM_CAPITALIZE,
0231 } PangoTextTransform;
0232 
0233 /**
0234  * PangoBaselineShift:
0235  * @PANGO_BASELINE_SHIFT_NONE: Leave the baseline unchanged
0236  * @PANGO_BASELINE_SHIFT_SUPERSCRIPT: Shift the baseline to the superscript position,
0237  *   relative to the previous run
0238  * @PANGO_BASELINE_SHIFT_SUBSCRIPT: Shift the baseline to the subscript position,
0239  *   relative to the previous run
0240  *
0241  * An enumeration that affects baseline shifts between runs.
0242  *
0243  * Since: 1.50
0244  */
0245 typedef enum {
0246   PANGO_BASELINE_SHIFT_NONE,
0247   PANGO_BASELINE_SHIFT_SUPERSCRIPT,
0248   PANGO_BASELINE_SHIFT_SUBSCRIPT,
0249 } PangoBaselineShift;
0250 
0251 /**
0252  * PangoFontScale:
0253  * @PANGO_FONT_SCALE_NONE: Leave the font size unchanged
0254  * @PANGO_FONT_SCALE_SUPERSCRIPT: Change the font to a size suitable for superscripts
0255  * @PANGO_FONT_SCALE_SUBSCRIPT: Change the font to a size suitable for subscripts
0256  * @PANGO_FONT_SCALE_SMALL_CAPS: Change the font to a size suitable for Small Caps
0257  *
0258  * An enumeration that affects font sizes for superscript
0259  * and subscript positioning and for (emulated) Small Caps.
0260  *
0261  * Since: 1.50
0262  */
0263 typedef enum {
0264   PANGO_FONT_SCALE_NONE,
0265   PANGO_FONT_SCALE_SUPERSCRIPT,
0266   PANGO_FONT_SCALE_SUBSCRIPT,
0267   PANGO_FONT_SCALE_SMALL_CAPS,
0268 } PangoFontScale;
0269 
0270 /**
0271  * PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING:
0272  *
0273  * Value for @start_index in `PangoAttribute` that indicates
0274  * the beginning of the text.
0275  *
0276  * Since: 1.24
0277  */
0278 #define PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING ((guint)0)
0279 
0280 /**
0281  * PANGO_ATTR_INDEX_TO_TEXT_END: (value 4294967295)
0282  *
0283  * Value for @end_index in `PangoAttribute` that indicates
0284  * the end of the text.
0285  *
0286  * Since: 1.24
0287  */
0288 #define PANGO_ATTR_INDEX_TO_TEXT_END ((guint)(G_MAXUINT + 0))
0289 
0290 /**
0291  * PangoAttribute:
0292  * @klass: the class structure holding information about the type of the attribute
0293  * @start_index: the start index of the range (in bytes).
0294  * @end_index: end index of the range (in bytes). The character at this index
0295  *   is not included in the range.
0296  *
0297  * The `PangoAttribute` structure represents the common portions of all
0298  * attributes.
0299  *
0300  * Particular types of attributes include this structure as their initial
0301  * portion. The common portion of the attribute holds the range to which
0302  * the value in the type-specific part of the attribute applies and should
0303  * be initialized using [method@Pango.Attribute.init]. By default, an attribute
0304  * will have an all-inclusive range of [0,%G_MAXUINT].
0305  */
0306 struct _PangoAttribute
0307 {
0308   const PangoAttrClass *klass;
0309   guint start_index;
0310   guint end_index;
0311 };
0312 
0313 /**
0314  * PangoAttrFilterFunc:
0315  * @attribute: a Pango attribute
0316  * @user_data: user data passed to the function
0317  *
0318  * Type of a function filtering a list of attributes.
0319  *
0320  * Return value: %TRUE if the attribute should be selected for
0321  *   filtering, %FALSE otherwise.
0322  */
0323 typedef gboolean (*PangoAttrFilterFunc) (PangoAttribute *attribute,
0324                                          gpointer        user_data);
0325 
0326 /**
0327  * PangoAttrDataCopyFunc:
0328  * @user_data: user data to copy
0329  *
0330  * Type of a function that can duplicate user data for an attribute.
0331  *
0332  * Return value: new copy of @user_data.
0333  **/
0334 typedef gpointer (*PangoAttrDataCopyFunc) (gconstpointer user_data);
0335 
0336 /**
0337  * PangoAttrClass:
0338  * @type: the type ID for this attribute
0339  * @copy: function to duplicate an attribute of this type
0340  *   (see [method@Pango.Attribute.copy])
0341  * @destroy: function to free an attribute of this type
0342  *   (see [method@Pango.Attribute.destroy])
0343  * @equal: function to check two attributes of this type for equality
0344  *   (see [method@Pango.Attribute.equal])
0345  *
0346  * The `PangoAttrClass` structure stores the type and operations for
0347  * a particular type of attribute.
0348  *
0349  * The functions in this structure should not be called directly. Instead,
0350  * one should use the wrapper functions provided for `PangoAttribute`.
0351  */
0352 struct _PangoAttrClass
0353 {
0354   /*< public >*/
0355   PangoAttrType type;
0356   PangoAttribute * (*copy) (const PangoAttribute *attr);
0357   void             (*destroy) (PangoAttribute *attr);
0358   gboolean         (*equal) (const PangoAttribute *attr1, const PangoAttribute *attr2);
0359 };
0360 
0361 /**
0362  * PangoAttrString:
0363  * @attr: the common portion of the attribute
0364  * @value: the string which is the value of the attribute
0365  *
0366  * The `PangoAttrString` structure is used to represent attributes with
0367  * a string value.
0368  */
0369 struct _PangoAttrString
0370 {
0371   PangoAttribute attr;
0372   char *value;
0373 };
0374 /**
0375  * PangoAttrLanguage:
0376  * @attr: the common portion of the attribute
0377  * @value: the `PangoLanguage` which is the value of the attribute
0378  *
0379  * The `PangoAttrLanguage` structure is used to represent attributes that
0380  * are languages.
0381  */
0382 struct _PangoAttrLanguage
0383 {
0384   PangoAttribute attr;
0385   PangoLanguage *value;
0386 };
0387 /**
0388  * PangoAttrInt:
0389  * @attr: the common portion of the attribute
0390  * @value: the value of the attribute
0391  *
0392  * The `PangoAttrInt` structure is used to represent attributes with
0393  * an integer or enumeration value.
0394  */
0395 struct _PangoAttrInt
0396 {
0397   PangoAttribute attr;
0398   int value;
0399 };
0400 /**
0401  * PangoAttrFloat:
0402  * @attr: the common portion of the attribute
0403  * @value: the value of the attribute
0404  *
0405  * The `PangoAttrFloat` structure is used to represent attributes with
0406  * a float or double value.
0407  */
0408 struct _PangoAttrFloat
0409 {
0410   PangoAttribute attr;
0411   double value;
0412 };
0413 /**
0414  * PangoAttrColor:
0415  * @attr: the common portion of the attribute
0416  * @color: the `PangoColor` which is the value of the attribute
0417  *
0418  * The `PangoAttrColor` structure is used to represent attributes that
0419  * are colors.
0420  */
0421 struct _PangoAttrColor
0422 {
0423   PangoAttribute attr;
0424   PangoColor color;
0425 };
0426 
0427 /**
0428  * PangoAttrSize:
0429  * @attr: the common portion of the attribute
0430  * @size: size of font, in units of 1/%PANGO_SCALE of a point (for
0431  *   %PANGO_ATTR_SIZE) or of a device unit (for %PANGO_ATTR_ABSOLUTE_SIZE)
0432  * @absolute: whether the font size is in device units or points.
0433  *   This field is only present for compatibility with Pango-1.8.0
0434  *   (%PANGO_ATTR_ABSOLUTE_SIZE was added in 1.8.1); and always will
0435  *   be %FALSE for %PANGO_ATTR_SIZE and %TRUE for %PANGO_ATTR_ABSOLUTE_SIZE.
0436  *
0437  * The `PangoAttrSize` structure is used to represent attributes which
0438  * set font size.
0439  */
0440 struct _PangoAttrSize
0441 {
0442   PangoAttribute attr;
0443   int size;
0444   guint absolute : 1;
0445 };
0446 
0447 /**
0448  * PangoAttrShape:
0449  * @attr: the common portion of the attribute
0450  * @ink_rect: the ink rectangle to restrict to
0451  * @logical_rect: the logical rectangle to restrict to
0452  * @data: user data set (see [func@Pango.AttrShape.new_with_data])
0453  * @copy_func: copy function for the user data
0454  * @destroy_func: destroy function for the user data
0455  *
0456  * The `PangoAttrShape` structure is used to represent attributes which
0457  * impose shape restrictions.
0458  */
0459 struct _PangoAttrShape
0460 {
0461   PangoAttribute attr;
0462   PangoRectangle ink_rect;
0463   PangoRectangle logical_rect;
0464 
0465   gpointer              data;
0466   PangoAttrDataCopyFunc copy_func;
0467   GDestroyNotify        destroy_func;
0468 };
0469 
0470 /**
0471  * PangoAttrFontDesc:
0472  * @attr: the common portion of the attribute
0473  * @desc: the font description which is the value of this attribute
0474  *
0475  * The `PangoAttrFontDesc` structure is used to store an attribute that
0476  * sets all aspects of the font description at once.
0477  */
0478 struct _PangoAttrFontDesc
0479 {
0480   PangoAttribute attr;
0481   PangoFontDescription *desc;
0482 };
0483 
0484 /**
0485  * PangoAttrFontFeatures:
0486  * @attr: the common portion of the attribute
0487  * @features: the features, as a string in CSS syntax
0488  *
0489  * The `PangoAttrFontFeatures` structure is used to represent OpenType
0490  * font features as an attribute.
0491  *
0492  * Since: 1.38
0493  */
0494 struct _PangoAttrFontFeatures
0495 {
0496   PangoAttribute attr;
0497   gchar *features;
0498 };
0499 
0500 PANGO_AVAILABLE_IN_ALL
0501 GType                   pango_attribute_get_type                (void) G_GNUC_CONST;
0502 
0503 PANGO_AVAILABLE_IN_ALL
0504 PangoAttrType           pango_attr_type_register                (const char                 *name);
0505 PANGO_AVAILABLE_IN_1_22
0506 const char *            pango_attr_type_get_name                (PangoAttrType               type) G_GNUC_CONST;
0507 PANGO_AVAILABLE_IN_1_20
0508 void                    pango_attribute_init                    (PangoAttribute             *attr,
0509                                                                  const PangoAttrClass       *klass);
0510 PANGO_AVAILABLE_IN_ALL
0511 PangoAttribute *        pango_attribute_copy                    (const PangoAttribute       *attr);
0512 PANGO_AVAILABLE_IN_ALL
0513 void                    pango_attribute_destroy                 (PangoAttribute             *attr);
0514 PANGO_AVAILABLE_IN_ALL
0515 gboolean                pango_attribute_equal                   (const PangoAttribute       *attr1,
0516                                                                  const PangoAttribute       *attr2) G_GNUC_PURE;
0517 
0518 PANGO_AVAILABLE_IN_ALL
0519 PangoAttribute *        pango_attr_language_new                 (PangoLanguage              *language);
0520 PANGO_AVAILABLE_IN_ALL
0521 PangoAttribute *        pango_attr_family_new                   (const char                 *family);
0522 PANGO_AVAILABLE_IN_ALL
0523 PangoAttribute *        pango_attr_foreground_new               (guint16                     red,
0524                                                                  guint16                     green,
0525                                                                  guint16                     blue);
0526 PANGO_AVAILABLE_IN_ALL
0527 PangoAttribute *        pango_attr_background_new               (guint16                     red,
0528                                                                  guint16                     green,
0529                                                                  guint16                     blue);
0530 PANGO_AVAILABLE_IN_ALL
0531 PangoAttribute *        pango_attr_size_new                     (int                         size);
0532 PANGO_AVAILABLE_IN_1_8
0533 PangoAttribute *        pango_attr_size_new_absolute            (int                         size);
0534 PANGO_AVAILABLE_IN_ALL
0535 PangoAttribute *        pango_attr_style_new                    (PangoStyle                  style);
0536 PANGO_AVAILABLE_IN_ALL
0537 PangoAttribute *        pango_attr_weight_new                   (PangoWeight                 weight);
0538 PANGO_AVAILABLE_IN_ALL
0539 PangoAttribute *        pango_attr_variant_new                  (PangoVariant                variant);
0540 PANGO_AVAILABLE_IN_ALL
0541 PangoAttribute *        pango_attr_stretch_new                  (PangoStretch                stretch);
0542 PANGO_AVAILABLE_IN_ALL
0543 PangoAttribute *        pango_attr_font_desc_new                (const PangoFontDescription *desc);
0544 
0545 PANGO_AVAILABLE_IN_ALL
0546 PangoAttribute *        pango_attr_underline_new                (PangoUnderline              underline);
0547 PANGO_AVAILABLE_IN_1_8
0548 PangoAttribute *        pango_attr_underline_color_new          (guint16                     red,
0549                                                                  guint16                     green,
0550                                                                  guint16                     blue);
0551 PANGO_AVAILABLE_IN_ALL
0552 PangoAttribute *        pango_attr_strikethrough_new            (gboolean                    strikethrough);
0553 PANGO_AVAILABLE_IN_1_8
0554 PangoAttribute *        pango_attr_strikethrough_color_new      (guint16                     red,
0555                                                                  guint16                     green,
0556                                                                  guint16                     blue);
0557 PANGO_AVAILABLE_IN_ALL
0558 PangoAttribute *        pango_attr_rise_new                     (int                         rise);
0559 PANGO_AVAILABLE_IN_1_50
0560 PangoAttribute *        pango_attr_baseline_shift_new           (int                         shift);
0561 PANGO_AVAILABLE_IN_1_50
0562 PangoAttribute *        pango_attr_font_scale_new               (PangoFontScale              scale);
0563 PANGO_AVAILABLE_IN_ALL
0564 PangoAttribute *        pango_attr_scale_new                    (double                      scale_factor);
0565 PANGO_AVAILABLE_IN_1_4
0566 PangoAttribute *        pango_attr_fallback_new                 (gboolean                    enable_fallback);
0567 PANGO_AVAILABLE_IN_1_6
0568 PangoAttribute *        pango_attr_letter_spacing_new           (int                         letter_spacing);
0569 PANGO_AVAILABLE_IN_ALL
0570 PangoAttribute *        pango_attr_shape_new                    (const PangoRectangle        *ink_rect,
0571                                                                  const PangoRectangle        *logical_rect);
0572 PANGO_AVAILABLE_IN_1_8
0573 PangoAttribute *        pango_attr_shape_new_with_data          (const PangoRectangle        *ink_rect,
0574                                                                  const PangoRectangle        *logical_rect,
0575                                                                  gpointer                     data,
0576                                                                  PangoAttrDataCopyFunc        copy_func,
0577                                                                  GDestroyNotify               destroy_func);
0578 PANGO_AVAILABLE_IN_1_16
0579 PangoAttribute *        pango_attr_gravity_new                  (PangoGravity                 gravity);
0580 PANGO_AVAILABLE_IN_1_16
0581 PangoAttribute *        pango_attr_gravity_hint_new             (PangoGravityHint             hint);
0582 PANGO_AVAILABLE_IN_1_38
0583 PangoAttribute *        pango_attr_font_features_new            (const char                  *features);
0584 PANGO_AVAILABLE_IN_1_38
0585 PangoAttribute *        pango_attr_foreground_alpha_new         (guint16                      alpha);
0586 PANGO_AVAILABLE_IN_1_38
0587 PangoAttribute *        pango_attr_background_alpha_new         (guint16                      alpha);
0588 PANGO_AVAILABLE_IN_1_44
0589 PangoAttribute *        pango_attr_allow_breaks_new             (gboolean                     allow_breaks);
0590 
0591 PANGO_AVAILABLE_IN_1_50
0592 PangoAttribute *        pango_attr_word_new                     (void);
0593 PANGO_AVAILABLE_IN_1_50
0594 PangoAttribute *        pango_attr_sentence_new                 (void);
0595 
0596 PANGO_AVAILABLE_IN_1_44
0597 PangoAttribute *        pango_attr_insert_hyphens_new           (gboolean                     insert_hyphens);
0598 PANGO_AVAILABLE_IN_1_46
0599 PangoAttribute *        pango_attr_overline_new                 (PangoOverline                overline);
0600 PANGO_AVAILABLE_IN_1_46
0601 PangoAttribute *        pango_attr_overline_color_new           (guint16                      red,
0602                                                                  guint16                      green,
0603                                                                  guint16                      blue);
0604 PANGO_AVAILABLE_IN_1_44
0605 PangoAttribute *        pango_attr_show_new                     (PangoShowFlags               flags);
0606 PANGO_AVAILABLE_IN_1_50
0607 PangoAttribute *        pango_attr_line_height_new              (double                       factor);
0608 PANGO_AVAILABLE_IN_1_50
0609 PangoAttribute *        pango_attr_line_height_new_absolute     (int                          height);
0610 PANGO_AVAILABLE_IN_1_50
0611 PangoAttribute *        pango_attr_text_transform_new           (PangoTextTransform transform);
0612 
0613 PANGO_AVAILABLE_IN_1_50
0614 PangoAttrString       * pango_attribute_as_string               (PangoAttribute              *attr);
0615 PANGO_AVAILABLE_IN_1_50
0616 PangoAttrLanguage     * pango_attribute_as_language             (PangoAttribute              *attr);
0617 PANGO_AVAILABLE_IN_1_50
0618 PangoAttrInt          * pango_attribute_as_int                  (PangoAttribute              *attr);
0619 PANGO_AVAILABLE_IN_1_50
0620 PangoAttrSize         * pango_attribute_as_size                 (PangoAttribute              *attr);
0621 PANGO_AVAILABLE_IN_1_50
0622 PangoAttrFloat        * pango_attribute_as_float                (PangoAttribute              *attr);
0623 PANGO_AVAILABLE_IN_1_50
0624 PangoAttrColor        * pango_attribute_as_color                (PangoAttribute              *attr);
0625 PANGO_AVAILABLE_IN_1_50
0626 PangoAttrFontDesc     * pango_attribute_as_font_desc            (PangoAttribute              *attr);
0627 PANGO_AVAILABLE_IN_1_50
0628 PangoAttrShape        * pango_attribute_as_shape                (PangoAttribute              *attr);
0629 PANGO_AVAILABLE_IN_1_50
0630 PangoAttrFontFeatures * pango_attribute_as_font_features        (PangoAttribute              *attr);
0631 
0632 /* Attribute lists */
0633 
0634 typedef struct _PangoAttrList     PangoAttrList;
0635 typedef struct _PangoAttrIterator PangoAttrIterator;
0636 
0637 #define PANGO_TYPE_ATTR_LIST pango_attr_list_get_type ()
0638 
0639 /**
0640  * PangoAttrIterator:
0641  *
0642  * A `PangoAttrIterator` is used to iterate through a `PangoAttrList`.
0643  *
0644  * A new iterator is created with [method@Pango.AttrList.get_iterator].
0645  * Once the iterator is created, it can be advanced through the style
0646  * changes in the text using [method@Pango.AttrIterator.next]. At each
0647  * style change, the range of the current style segment and the attributes
0648  * currently in effect can be queried.
0649  */
0650 
0651 /**
0652  * PangoAttrList:
0653  *
0654  * A `PangoAttrList` represents a list of attributes that apply to a section
0655  * of text.
0656  *
0657  * The attributes in a `PangoAttrList` are, in general, allowed to overlap in
0658  * an arbitrary fashion. However, if the attributes are manipulated only through
0659  * [method@Pango.AttrList.change], the overlap between properties will meet
0660  * stricter criteria.
0661  *
0662  * Since the `PangoAttrList` structure is stored as a linear list, it is not
0663  * suitable for storing attributes for large amounts of text. In general, you
0664  * should not use a single `PangoAttrList` for more than one paragraph of text.
0665  */
0666 
0667 PANGO_AVAILABLE_IN_ALL
0668 GType                   pango_attr_list_get_type        (void) G_GNUC_CONST;
0669 
0670 PANGO_AVAILABLE_IN_ALL
0671 PangoAttrList *         pango_attr_list_new             (void);
0672 PANGO_AVAILABLE_IN_1_10
0673 PangoAttrList *         pango_attr_list_ref             (PangoAttrList         *list);
0674 PANGO_AVAILABLE_IN_ALL
0675 void                    pango_attr_list_unref           (PangoAttrList         *list);
0676 PANGO_AVAILABLE_IN_ALL
0677 PangoAttrList *         pango_attr_list_copy            (PangoAttrList         *list);
0678 PANGO_AVAILABLE_IN_ALL
0679 void                    pango_attr_list_insert          (PangoAttrList         *list,
0680                                                          PangoAttribute        *attr);
0681 PANGO_AVAILABLE_IN_ALL
0682 void                    pango_attr_list_insert_before   (PangoAttrList         *list,
0683                                                          PangoAttribute        *attr);
0684 PANGO_AVAILABLE_IN_ALL
0685 void                    pango_attr_list_change          (PangoAttrList         *list,
0686                                                          PangoAttribute        *attr);
0687 PANGO_AVAILABLE_IN_ALL
0688 void                    pango_attr_list_splice          (PangoAttrList         *list,
0689                                                          PangoAttrList         *other,
0690                                                          int                    pos,
0691                                                          int                    len);
0692 PANGO_AVAILABLE_IN_1_44
0693 void                    pango_attr_list_update          (PangoAttrList         *list,
0694                                                          int                    pos,
0695                                                          int                    remove,
0696                                                          int                    add);
0697 
0698 PANGO_AVAILABLE_IN_1_2
0699 PangoAttrList *         pango_attr_list_filter          (PangoAttrList         *list,
0700                                                          PangoAttrFilterFunc    func,
0701                                                          gpointer               data);
0702 
0703 PANGO_AVAILABLE_IN_1_44
0704 GSList *                pango_attr_list_get_attributes  (PangoAttrList         *list);
0705 
0706 PANGO_AVAILABLE_IN_1_46
0707 gboolean                pango_attr_list_equal           (PangoAttrList         *list,
0708                                                          PangoAttrList         *other_list);
0709 
0710 PANGO_AVAILABLE_IN_1_50
0711 char *                  pango_attr_list_to_string       (PangoAttrList         *list);
0712 PANGO_AVAILABLE_IN_1_50
0713 PangoAttrList *         pango_attr_list_from_string     (const char            *text);
0714 
0715 PANGO_AVAILABLE_IN_1_44
0716 GType                   pango_attr_iterator_get_type    (void) G_GNUC_CONST;
0717 
0718 PANGO_AVAILABLE_IN_ALL
0719 PangoAttrIterator *     pango_attr_list_get_iterator    (PangoAttrList         *list);
0720 
0721 PANGO_AVAILABLE_IN_ALL
0722 void                    pango_attr_iterator_range       (PangoAttrIterator     *iterator,
0723                                                          int                   *start,
0724                                                          int                   *end);
0725 PANGO_AVAILABLE_IN_ALL
0726 gboolean                pango_attr_iterator_next        (PangoAttrIterator     *iterator);
0727 PANGO_AVAILABLE_IN_ALL
0728 PangoAttrIterator *     pango_attr_iterator_copy        (PangoAttrIterator     *iterator);
0729 PANGO_AVAILABLE_IN_ALL
0730 void                    pango_attr_iterator_destroy     (PangoAttrIterator     *iterator);
0731 PANGO_AVAILABLE_IN_ALL
0732 PangoAttribute *        pango_attr_iterator_get         (PangoAttrIterator     *iterator,
0733                                                          PangoAttrType          type);
0734 PANGO_AVAILABLE_IN_ALL
0735 void                    pango_attr_iterator_get_font    (PangoAttrIterator     *iterator,
0736                                                          PangoFontDescription  *desc,
0737                                                          PangoLanguage        **language,
0738                                                          GSList               **extra_attrs);
0739 PANGO_AVAILABLE_IN_1_2
0740 GSList *                pango_attr_iterator_get_attrs   (PangoAttrIterator     *iterator);
0741 
0742 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoAttribute, pango_attribute_destroy)
0743 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoAttrList, pango_attr_list_unref)
0744 G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoAttrIterator, pango_attr_iterator_destroy)
0745 
0746 G_END_DECLS
0747 
0748 #endif /* __PANGO_ATTRIBUTES_H__ */