diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-02-15 07:11:45 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-02-15 07:11:45 +0000 |
commit | 4f335d6e4a3f5b4e6ddd1cd78f919aa80c990262 (patch) | |
tree | 58a31ae23e609367d0bc27537f87e663a3c7bef2 /pango/pango-attributes.h | |
parent | dacd0541b9430958e43610621e117d1be2f3bdb8 (diff) | |
download | pango-4f335d6e4a3f5b4e6ddd1cd78f919aa80c990262.tar.gz |
Add documentation for attributes.
Tue Feb 15 02:35:56 2000 Owen Taylor <otaylor@redhat.com>
* docs/**: Add documentation for attributes.
* Makefile.am libpango/pango-attributes.[ch]: Finish initial
implementation of attributes APIs.
Diffstat (limited to 'pango/pango-attributes.h')
-rw-r--r-- | pango/pango-attributes.h | 152 |
1 files changed, 50 insertions, 102 deletions
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h index 795a820b..322c5c75 100644 --- a/pango/pango-attributes.h +++ b/pango/pango-attributes.h @@ -28,134 +28,82 @@ extern "C" { #endif /* __cplusplus */ -typedef struct _PangoAttribute PangoAttribute; -typedef struct _PangoAttrClass PangoAttrClass; - -typedef struct _PangoAttrLang PangoAttrLang; -typedef struct _PangoAttrStyle PangoAttrStyle; -typedef struct _PangoAttrWeight PangoAttrWeight; -typedef struct _PangoAttrVariant PangoAttrVariant; -typedef struct _PangoAttrStretch PangoAttrStretch; -typedef struct _PangoAttrSize PangoAttrSize; -typedef struct _PangoAttrColor PangoAttrColor; -typedef struct _PangoAttrUnderline PangoAttrUnderline; -typedef struct _PangoAttrStrikethrough PangoAttrStrikethrough; -typedef struct _PangoAttrRise PangoAttrRise; - -typedef struct _PangoAttrList PangoAttribute; -typedef struct _PangoAttrIterator PangoAttrClass; - -typedef guint PangoAttributeType; +typedef struct _PangoAttribute PangoAttribute; +typedef struct _PangoAttrClass PangoAttrClass; + +typedef struct _PangoAttrString PangoAttrString; +typedef struct _PangoAttrInt PangoAttrInt; +typedef struct _PangoAttrColor PangoAttrColor; + +typedef struct _PangoAttrList PangoAttrList; +typedef struct _PangoAttrIterator PangoAttrIterator; typedef enum { - PANGO_ATTR_LANG, - PANGO_ATTR_FAMILY, - PANGO_ATTR_STYLE, - PANGO_ATTR_WEIGHT, - PANGO_ATTR_VARIANT, - PANGO_ATTR_STRETCH, - PANGO_ATTR_SIZE, - PANGO_ATTR_FOREGROUND, - PANGO_ATTR_BACKGROUND, - PANGO_ATTR_UNDERLINE, - PANGO_ATTR_STRIKETHROUGH, - PANGO_ATTR_RISE + PANGO_ATTR_LANG, /* PangoAttrString */ + PANGO_ATTR_FAMILY, /* PangoAttrString */ + PANGO_ATTR_STYLE, /* PangoAttrInt */ + PANGO_ATTR_WEIGHT, /* PangoAttrInt */ + PANGO_ATTR_VARIANT, /* PangoAttrInt */ + PANGO_ATTR_STRETCH, /* PangoAttrInt */ + PANGO_ATTR_SIZE, /* PangoAttrSize */ + PANGO_ATTR_FOREGROUND, /* PangoAttrColor */ + PANGO_ATTR_BACKGROUND, /* PangoAttrColor */ + PANGO_ATTR_UNDERLINE, /* PangoAttrInt */ + PANGO_ATTR_STRIKETHROUGH, /* PangoAttrInt */ + PANGO_ATTR_RISE /* PangoAttrInt */ } PangoAttrType; struct _PangoAttribute { - PangoAttrClass *klass; + const PangoAttrClass *klass; guint start_index; guint end_index; }; struct _PangoAttrClass { - PangoAttributeType type; + PangoAttrType type; PangoAttribute * (*copy) (const PangoAttribute *attr); void (*destroy) (PangoAttribute *attr); gboolean (*compare) (const PangoAttribute *attr1, const PangoAttribute *attr2); }; -struct _PangoAttrLang -{ - PangoAttribute attr; - char *lang; -}; - -struct _PangoAttrFamily -{ - PangoAttribute attr; - char *family_list; -}; - -struct _PangoAttrStyle -{ - PangoAttribute attr; - PangoStyle style; -}; - -struct _PangoAttrWeight -{ - PangoAttribute attr; - PangoWeight weight; -}; - -struct _PangoAttrVariant -{ - PangoAttribute attr; - PangoVariant variant; -}; - -struct _PangoAttrStretch +struct _PangoAttrString { PangoAttribute attr; - PangoStretch stretch; + char *value; }; -struct _PangoAttrSize +struct _PangoAttrInt { PangoAttribute attr; - double size; + int value; }; struct _PangoAttrColor { PangoAttribute attr; - guint16 r; - guint16 g; - guint16 b; -}; - -struct _PangoAttrUnderline -{ - PangoAttribute attr; - gboolean underline; + guint16 red; + guint16 green; + guint16 blue; }; -struct _PangoAttrStrikethrough -{ - PangoAttribute attr; - gboolean strikethrough; -}; +PangoAttrType pango_attr_type_register (const gchar *name); -struct _PangoAttrRise -{ - PangoAttribute attr; - int rise; -}; - -PangoAttributeType pango_attribute_register_type (const gchar *name); -PangoAttribute * pango_attribute_copy (const PangoAttribute *attr); -PangoAttribute * pango_attribute_destroy (PangoAttribute *attr); -gboolean pango_attribute_compare (const PangoAttribute *attr1, - const PangoAttribute *attr2); +PangoAttribute * pango_attribute_copy (const PangoAttribute *attr); +void pango_attribute_destroy (PangoAttribute *attr); +gboolean pango_attribute_compare (const PangoAttribute *attr1, + const PangoAttribute *attr2); PangoAttribute *pango_attr_lang_new (const char *lang); -PangoAttribute *pango_attr_color_new (guint16 red, +PangoAttribute *pango_attr_family_new (const char *family); +PangoAttribute *pango_attr_foreground_new (guint16 red, + guint16 green, + guint16 blue); +PangoAttribute *pango_attr_background_new (guint16 red, guint16 green, guint16 blue); -PangoAttribute *pango_attr_size_new (double size); +PangoAttribute *pango_attr_size_new (int size); PangoAttribute *pango_attr_style_new (PangoStyle style); PangoAttribute *pango_attr_weight_new (PangoWeight weight); PangoAttribute *pango_attr_variant_new (PangoVariant variant); @@ -164,20 +112,20 @@ PangoAttribute *pango_attr_underline_new (gboolean underline); PangoAttribute *pango_attr_strikethrough_new (gboolean strikethrough); PangoAttribute *pango_attr_rise_new (int rise); -PangoAttrList * pango_attr_list_new (void); -PangoAttrList * pango_attr_list_ref (PangoAttrList *list); -PangoAttrList * pango_attr_list_unref (PangoAttrList *list); -PangoAttrList * pango_attr_list_append (PangoAttrList *list, - PangoAttribute *attr); -PangoAttrList * pango_attr_list_change (PangoAttrList *list, - PangoAttribute *attr); -PangoAttrIterator *pango_attr_list_get_iterator (PangoAttrList *list); +PangoAttrList * pango_attr_list_new (void); +void pango_attr_list_ref (PangoAttrList *list); +void pango_attr_list_unref (PangoAttrList *list); +void pango_attr_list_insert (PangoAttrList *list, + PangoAttribute *attr); +void pango_attr_list_change (PangoAttrList *list, + PangoAttribute *attr); +PangoAttrIterator * pango_attr_list_get_iterator (PangoAttrList *list); int pango_attr_iterator_next (PangoAttrIterator *iterator); void pango_attr_iterator_destroy (PangoAttrIterator *iterator); PangoAttribute *pango_attr_iterator_get (PangoAttrIterator *iterator, PangoAttrType type); -void *pango_attr_iterator_get_font (PangoAttrIterator *iterator, +void pango_attr_iterator_get_font (PangoAttrIterator *iterator, PangoFontDescription *base, PangoFontDescription *current); |