2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = pango-Text-Attributes.html
27 * outFile = PgAttribute
28 * strct = PangoAttribute
50 * - pango.PgFontDescription
51 * - pango.PgFontMetrics
52 * - pango.PgFontFamily
55 * - pango.PgFontsetSimple
56 * - pango.PgAttributeList
60 * - pango.PgLayoutIter
61 * - pango.PgScriptIter
64 * - PangoAttributeList* -> PgAttributeList
65 * - PangoContext* -> PgContext
66 * - PangoFontDescription* -> PgFontDescription
67 * - PangoFontFace* -> PgFontFace
68 * - PangoFontFamily* -> PgFontFamily
69 * - PangoFontMap* -> PgFontMap
70 * - PangoFontMetrics* -> PgFontMetrics
71 * - PangoFontsetSimple* -> PgFontsetSimple
72 * - PangoItem* -> PgItem
73 * - PangoLanguage* -> PgLanguage
74 * - PangoLayout* -> PgLayout
75 * - PangoLayoutIter* -> PgLayoutIter
76 * - PangoScriptIter* -> PgScriptIter
77 * - PangoTabArray* -> PgTabArray
82 module pango
.PgAttribute
;
88 import tango
.io
.Stdout
; // use the tango loging?
92 private import gtkc
.pangotypes
;
94 private import gtkc
.pango
;
97 private import glib
.ListSG
;
98 private import glib
.Str
;
99 private import pango
.PgContext
;
100 private import pango
.PgItem
;
101 private import pango
.PgLayout
;
102 private import pango
.PgFontDescription
;
103 private import pango
.PgFontMetrics
;
104 private import pango
.PgFontFamily
;
105 private import pango
.PgFontFace
;
106 private import pango
.PgFontMap
;
107 private import pango
.PgFontsetSimple
;
108 private import pango
.PgAttributeList
;
109 private import pango
.PgLanguage
;
110 private import pango
.PgTabArray
;
111 private import pango
.PgLayout
;
112 private import pango
.PgLayoutIter
;
113 private import pango
.PgScriptIter
;
120 * Attributed text is used in a number of places in Pango. It
121 * is used as the input to the itemization process and also when
122 * creating a PangoLayout. The data types and functions in
123 * this section are used to represent and manipulate sets
124 * of attributes applied to a portion of text.
126 public class PgAttribute
129 /** the main Gtk struct */
130 protected PangoAttribute
* pangoAttribute
;
133 public PangoAttribute
* getPgAttributeStruct()
135 return pangoAttribute
;
139 /** the main Gtk struct as a void* */
140 protected void* getStruct()
142 return cast(void*)pangoAttribute
;
146 * Sets our main struct and passes it to the parent class
148 public this (PangoAttribute
* pangoAttribute
)
152 if ( pangoAttribute
is null )
157 Stdout("struct pangoAttribute is null on constructor").newline
;
161 printf("struct pangoAttribute is null on constructor");
168 assert(pangoAttribute
!is null, "struct pangoAttribute is null on constructor");
170 this.pangoAttribute
= pangoAttribute
;
189 * Parses marked-up text (see
190 * markup format) to create
191 * a plain-text string and an attribute list.
192 * If accel_marker is nonzero, the given character will mark the
193 * character following it as an accelerator. For example, accel_marker
194 * might be an ampersand or underscore. All characters marked
195 * as an accelerator will receive a PANGO_UNDERLINE_LOW attribute,
196 * and the first character so marked will be returned in accel_char.
197 * Two accel_marker characters following each other produce a single
198 * literal accel_marker character.
200 * markup to parse (see markup format)
202 * length of markup_text, or -1 if nul-terminated
204 * character that precedes an accelerator, or 0 for none
206 * address of return location for a PangoAttrList, or NULL
208 * address of return location for text with tags stripped, or NULL
210 * address of return location for accelerator char, or NULL
212 * address of return location for errors, or NULL
214 * FALSE if error is set, otherwise TRUE
216 public static int pangoParseMarkup(char[] markupText
, int length
, gunichar accelMarker
, PangoAttrList
** attrList
, char** text
, gunichar
* accelChar
, GError
** error
)
218 // gboolean pango_parse_markup (const char *markup_text, int length, gunichar accel_marker, PangoAttrList **attr_list, char **text, gunichar *accel_char, GError **error);
219 return pango_parse_markup(Str
.toStringz(markupText
), length
, accelMarker
, attrList
, text
, accelChar
, error
);
223 * Allocate a new attribute type ID.
225 * an identifier for the type (currently unused.)
229 public static PangoAttrType
typeRegister(char[] name
)
231 // PangoAttrType pango_attr_type_register (const gchar *name);
232 return pango_attr_type_register(Str
.toStringz(name
));
236 * Make a copy of an attribute.
240 * the newly allocated PangoAttribute, which should be
241 * freed with pango_attribute_destroy().
243 public PangoAttribute
* pangoAttributeCopy()
245 // PangoAttribute* pango_attribute_copy (const PangoAttribute *attr);
246 return pango_attribute_copy(pangoAttribute
);
250 * Compare two attributes for equality. This compares only the
251 * actual value of the two attributes and not the ranges that the
252 * attributes apply to.
256 * another PangoAttribute
258 * TRUE if the two attributes have the same value.
260 public int pangoAttributeEqual(PangoAttribute
* attr2
)
262 // gboolean pango_attribute_equal (const PangoAttribute *attr1, const PangoAttribute *attr2);
263 return pango_attribute_equal(pangoAttribute
, attr2
);
267 * Destroy a PangoAttribute and free all associated memory.
271 public void pangoAttributeDestroy()
273 // void pango_attribute_destroy (PangoAttribute *attr);
274 pango_attribute_destroy(pangoAttribute
);
278 * Create a new language tag attribute.
282 * the newly allocated PangoAttribute, which should be
283 * freed with pango_attribute_destroy().
285 public static PangoAttribute
* languageNew(PgLanguage language
)
287 // PangoAttribute* pango_attr_language_new (PangoLanguage *language);
288 return pango_attr_language_new((language
is null) ?
null : language
.getPgLanguageStruct());
292 * Create a new font family attribute.
294 * the family or comma separated list of families
296 * the newly allocated PangoAttribute, which should be
297 * freed with pango_attribute_destroy().
299 public static PangoAttribute
* familyNew(char[] family
)
301 // PangoAttribute* pango_attr_family_new (const char *family);
302 return pango_attr_family_new(Str
.toStringz(family
));
306 * Create a new font slant style attribute.
310 * the newly allocated PangoAttribute, which should be
311 * freed with pango_attribute_destroy().
313 public static PangoAttribute
* styleNew(PangoStyle style
)
315 // PangoAttribute* pango_attr_style_new (PangoStyle style);
316 return pango_attr_style_new(style
);
320 * Create a new font variant attribute (normal or small caps)
324 * the newly allocated PangoAttribute, which should be
325 * freed with pango_attribute_destroy().
327 public static PangoAttribute
* variantNew(PangoVariant variant
)
329 // PangoAttribute* pango_attr_variant_new (PangoVariant variant);
330 return pango_attr_variant_new(variant
);
334 * Create a new font stretch attribute
338 * the newly allocated PangoAttribute, which should be
339 * freed with pango_attribute_destroy().
341 public static PangoAttribute
* stretchNew(PangoStretch stretch
)
343 // PangoAttribute* pango_attr_stretch_new (PangoStretch stretch);
344 return pango_attr_stretch_new(stretch
);
348 * Create a new font weight attribute.
352 * the newly allocated PangoAttribute, which should be
353 * freed with pango_attribute_destroy().
355 public static PangoAttribute
* weightNew(PangoWeight weight
)
357 // PangoAttribute* pango_attr_weight_new (PangoWeight weight);
358 return pango_attr_weight_new(weight
);
362 * Create a new font-size attribute in fractional points.
364 * the font size, in PANGO_SCALEths of a point.
366 * the newly allocated PangoAttribute, which should be
367 * freed with pango_attribute_destroy().
369 public static PangoAttribute
* sizeNew(int size
)
371 // PangoAttribute* pango_attr_size_new (int size);
372 return pango_attr_size_new(size
);
376 * Create a new font-size attribute in device units.
378 * the font size, in PANGO_SCALEths of a device unit.
380 * the newly allocated PangoAttribute, which should be
381 * freed with pango_attribute_destroy().
384 public static PangoAttribute
* sizeNewAbsolute(int size
)
386 // PangoAttribute* pango_attr_size_new_absolute (int size);
387 return pango_attr_size_new_absolute(size
);
391 * Create a new font description attribute. This attribute
392 * allows setting family, style, weight, variant, stretch,
393 * and size simultaneously.
395 * the font description
397 * the newly allocated PangoAttribute, which should be
398 * freed with pango_attribute_destroy().
400 public static PangoAttribute
* fontDescNew(PgFontDescription desc
)
402 // PangoAttribute* pango_attr_font_desc_new (const PangoFontDescription *desc);
403 return pango_attr_font_desc_new((desc
is null) ?
null : desc
.getPgFontDescriptionStruct());
407 * Create a new foreground color attribute.
409 * the red value (ranging from 0 to 65535)
415 * the newly allocated PangoAttribute, which should be
416 * freed with pango_attribute_destroy().
418 public static PangoAttribute
* foregroundNew(ushort red
, ushort green
, ushort blue
)
420 // PangoAttribute* pango_attr_foreground_new (guint16 red, guint16 green, guint16 blue);
421 return pango_attr_foreground_new(red
, green
, blue
);
425 * Create a new background color attribute.
427 * the red value (ranging from 0 to 65535)
433 * the newly allocated PangoAttribute, which should be
434 * freed with pango_attribute_destroy().
436 public static PangoAttribute
* backgroundNew(ushort red
, ushort green
, ushort blue
)
438 // PangoAttribute* pango_attr_background_new (guint16 red, guint16 green, guint16 blue);
439 return pango_attr_background_new(red
, green
, blue
);
443 * Create a new strike-through attribute.
445 * TRUE if the text should be struck-through.
447 * the newly allocated PangoAttribute, which should be
448 * freed with pango_attribute_destroy().
450 public static PangoAttribute
* strikethroughNew(int strikethrough
)
452 // PangoAttribute* pango_attr_strikethrough_new (gboolean strikethrough);
453 return pango_attr_strikethrough_new(strikethrough
);
457 * Create a new strikethrough color attribute. This attribute
458 * modifies the color of strikethrough lines. If not set, strikethrough
459 * lines will use the foreground color.
461 * the red value (ranging from 0 to 65535)
467 * the newly allocated PangoAttribute, which should be
468 * freed with pango_attribute_destroy().
471 public static PangoAttribute
* strikethroughColorNew(ushort red
, ushort green
, ushort blue
)
473 // PangoAttribute* pango_attr_strikethrough_color_new (guint16 red, guint16 green, guint16 blue);
474 return pango_attr_strikethrough_color_new(red
, green
, blue
);
478 * Create a new underline-style attribute.
480 * the underline style.
482 * the newly allocated PangoAttribute, which should be
483 * freed with pango_attribute_destroy().
485 public static PangoAttribute
* underlineNew(PangoUnderline underline
)
487 // PangoAttribute* pango_attr_underline_new (PangoUnderline underline);
488 return pango_attr_underline_new(underline
);
492 * Create a new underline color attribute. This attribute
493 * modifies the color of underlines. If not set, underlines
494 * will use the foreground color.
496 * the red value (ranging from 0 to 65535)
502 * the newly allocated PangoAttribute, which should be
503 * freed with pango_attribute_destroy().
506 public static PangoAttribute
* underlineColorNew(ushort red
, ushort green
, ushort blue
)
508 // PangoAttribute* pango_attr_underline_color_new (guint16 red, guint16 green, guint16 blue);
509 return pango_attr_underline_color_new(red
, green
, blue
);
515 * Create a new shape attribute. A shape is used to impose a
516 * particular ink and logical rectangle on the result of shaping a
517 * particular glyph. This might be used, for instance, for
518 * embedding a picture or a widget inside a PangoLayout.
520 * ink rectangle to assign to each character
522 * logical rectangle to assign to each character
524 * the newly allocated PangoAttribute, which should be
525 * freed with pango_attribute_destroy().
527 public static PangoAttribute
* shapeNew(PangoRectangle
* inkRect
, PangoRectangle
* logicalRect
)
529 // PangoAttribute* pango_attr_shape_new (const PangoRectangle *ink_rect, const PangoRectangle *logical_rect);
530 return pango_attr_shape_new(inkRect
, logicalRect
);
534 * Like pango_attr_shape_new(), but a user data pointer is also
535 * provided; this pointer can be accessed when later
536 * rendering the glyph.
538 * ink rectangle to assign to each character
540 * logical rectangle to assign to each character
544 * function to copy data when the attribute
545 * is copied. If NULL, data is simply copied
548 * function to free data when the attribute
551 * the newly allocated PangoAttribute, which should be
552 * freed with pango_attribute_destroy().
555 public static PangoAttribute
* shapeNewWithData(PangoRectangle
* inkRect
, PangoRectangle
* logicalRect
, void* data
, PangoAttrDataCopyFunc copyFunc
, GDestroyNotify destroyFunc
)
557 // PangoAttribute* pango_attr_shape_new_with_data (const PangoRectangle *ink_rect, const PangoRectangle *logical_rect, gpointer data, PangoAttrDataCopyFunc copy_func, GDestroyNotify destroy_func);
558 return pango_attr_shape_new_with_data(inkRect
, logicalRect
, data
, copyFunc
, destroyFunc
);
563 * Create a new font size scale attribute. The base font for the
564 * affected text will have its size multiplied by scale_factor.
566 * factor to scale the font
568 * the newly allocated PangoAttribute, which should be
569 * freed with pango_attribute_destroy().
571 public static PangoAttribute
* scaleNew(double scaleFactor
)
573 // PangoAttribute* pango_attr_scale_new (double scale_factor);
574 return pango_attr_scale_new(scaleFactor
);
585 * Create a new baseline displacement attribute.
587 * the amount that the text should be displaced vertically,
588 * in Pango units. Positive values displace the text upwards.
590 * the newly allocated PangoAttribute, which should be
591 * freed with pango_attribute_destroy().
593 public static PangoAttribute
* riseNew(int rise
)
595 // PangoAttribute* pango_attr_rise_new (int rise);
596 return pango_attr_rise_new(rise
);
600 * Create a new letter-spacing attribute.
602 * amount of extra space to add between graphemes
603 * of the text, in Pango units.
605 * the newly allocated PangoAttribute, which should be
606 * freed with pango_attribute_destroy().
609 public static PangoAttribute
* letterSpacingNew(int letterSpacing
)
611 // PangoAttribute* pango_attr_letter_spacing_new (int letter_spacing);
612 return pango_attr_letter_spacing_new(letterSpacing
);
616 * Create a new font fallback attribute.
617 * If fallback is disabled, characters will only be used from the
618 * closest matching font on the system. No fallback will be done to
619 * other fonts on the system that might contain the characters in the
622 * TRUE if we should fall back on other fonts
623 * for characters the active font is missing.
625 * the newly allocated PangoAttribute, which should be
626 * freed with pango_attribute_destroy().
629 public static PangoAttribute
* fallbackNew(int enableFallback
)
631 // PangoAttribute* pango_attr_fallback_new (gboolean enable_fallback);
632 return pango_attr_fallback_new(enableFallback
);
636 * Create a new gravity attribute.
638 * the gravity value; should not be PANGO_GRAVITY_AUTO.
640 * the newly allocated PangoAttribute, which should be
641 * freed with pango_attribute_destroy().
644 public static PangoAttribute
* gravityNew(PangoGravity gravity
)
646 // PangoAttribute* pango_attr_gravity_new (PangoGravity gravity);
647 return pango_attr_gravity_new(gravity
);
651 * Create a new gravity hint attribute.
653 * the gravity hint value.
655 * the newly allocated PangoAttribute, which should be
656 * freed with pango_attribute_destroy().
659 public static PangoAttribute
* gravityHintNew(PangoGravityHint hint
)
661 // PangoAttribute* pango_attr_gravity_hint_new (PangoGravityHint hint);
662 return pango_attr_gravity_hint_new(hint
);
668 * Fill in the fields of a color from a string specification. The
669 * string can either one of a large set of standard names. (Taken
670 * from the X11 rgb.txt file), or it can be a hex value in the
671 * form '#rgb' '#rrggbb' '#rrrgggbbb' or '#rrrrggggbbbb' where
672 * 'r', 'g' and 'b' are hex digits of the red, green, and blue
673 * components of the color, respectively. (White in the four
674 * forms is '#fff' '#ffffff' '#fffffffff' and '#ffffffffffff')
676 * a PangoColor structure in which to store the result
678 * a string specifying the new color
680 * TRUE if parsing of the specifier succeeded,
683 public static int pangoColorParse(PangoColor
* color
, char[] spec
)
685 // gboolean pango_color_parse (PangoColor *color, const char *spec);
686 return pango_color_parse(color
, Str
.toStringz(spec
));
690 * Creates a copy of src, which should be freed with
691 * pango_color_free(). Primarily used by language bindings,
692 * not that useful otherwise (since colors can just be copied
693 * by assignment in C).
697 * the newly allocated PangoColor, which should
698 * be freed with pango_color_free().
700 public static PangoColor
* pangoColorCopy(PangoColor
* src
)
702 // PangoColor* pango_color_copy (const PangoColor *src);
703 return pango_color_copy(src
);
707 * Frees a color allocated by pango_color_copy().
709 * an allocated PangoColor
711 public static void pangoColorFree(PangoColor
* color
)
713 // void pango_color_free (PangoColor *color);
714 pango_color_free(color
);
718 * Returns a textual specification of color in the hexadecimal form
719 * #rrrrggggbbbb, where r,
720 * g and b are hex digits representing
721 * the red, green, and blue components respectively.
725 * a newly-allocated text string that must be freed with g_free().
728 public static char[] pangoColorToString(PangoColor
* color
)
730 // gchar* pango_color_to_string (const PangoColor *color);
731 return Str
.toString(pango_color_to_string(color
) );
742 * Create a new empty attribute list with a reference count of one.
744 * the newly allocated PangoAttrList, which should
745 * be freed with pango_attr_list_unref().
747 public static PangoAttrList
* listNew()
749 // PangoAttrList* pango_attr_list_new (void);
750 return pango_attr_list_new();
754 * Increase the reference count of the given attribute list by one.
758 * The attribute list passed in
761 public static PangoAttrList
* listRef(PangoAttrList
* list
)
763 // PangoAttrList* pango_attr_list_ref (PangoAttrList *list);
764 return pango_attr_list_ref(list
);
768 * Decrease the reference count of the given attribute list by one.
769 * If the result is zero, free the attribute list and the attributes
774 public static void listUnref(PangoAttrList
* list
)
776 // void pango_attr_list_unref (PangoAttrList *list);
777 pango_attr_list_unref(list
);
781 * Copy list and return an identical new list.
785 * the newly allocated PangoAttrList, with a
786 * reference count of one, which should
787 * be freed with pango_attr_list_unref().
789 public static PangoAttrList
* listCopy(PangoAttrList
* list
)
791 // PangoAttrList* pango_attr_list_copy (PangoAttrList *list);
792 return pango_attr_list_copy(list
);
796 * Insert the given attribute into the PangoAttrList. It will
797 * be inserted after all other attributes with a matching
802 * the attribute to insert. Ownership of this value is
803 * assumed by the list.
805 public static void listInsert(PangoAttrList
* list
, PangoAttribute
* attr
)
807 // void pango_attr_list_insert (PangoAttrList *list, PangoAttribute *attr);
808 pango_attr_list_insert(list
, attr
);
812 * Insert the given attribute into the PangoAttrList. It will
813 * be inserted before all other attributes with a matching
818 * the attribute to insert. Ownership of this value is
819 * assumed by the list.
821 public static void listInsertBefore(PangoAttrList
* list
, PangoAttribute
* attr
)
823 // void pango_attr_list_insert_before (PangoAttrList *list, PangoAttribute *attr);
824 pango_attr_list_insert_before(list
, attr
);
828 * Insert the given attribute into the PangoAttrList. It will
829 * replace any attributes of the same type on that segment
830 * and be merged with any adjoining attributes that are identical.
831 * This function is slower than pango_attr_list_insert() for
832 * creating a attribute list in order (potentially much slower
833 * for large lists). However, pango_attr_list_insert() is not
834 * suitable for continually changing a set of attributes
835 * since it never removes or combines existing attributes.
839 * the attribute to insert. Ownership of this value is
840 * assumed by the list.
842 public static void listChange(PangoAttrList
* list
, PangoAttribute
* attr
)
844 // void pango_attr_list_change (PangoAttrList *list, PangoAttribute *attr);
845 pango_attr_list_change(list
, attr
);
849 * This function opens up a hole in list, fills it in with attributes from
850 * the left, and then merges other on top of the hole.
851 * This operation is equivalent to stretching every attribute
852 * that applies at position pos in list by an amount len,
853 * and then calling pango_attr_list_change() with a copy
854 * of each attribute in other in sequence (offset in position by pos).
855 * This operation proves useful for, for instance, inserting
856 * a pre-edit string in the middle of an edit buffer.
860 * another PangoAttrList
862 * the position in list at which to insert other
864 * the length of the spliced segment. (Note that this
865 * must be specified since the attributes in other
866 * may only be present at some subsection of this range)
868 public static void listSplice(PangoAttrList
* list
, PangoAttrList
* other
, int pos
, int len
)
870 // void pango_attr_list_splice (PangoAttrList *list, PangoAttrList *other, gint pos, gint len);
871 pango_attr_list_splice(list
, other
, pos
, len
);
875 * Given a PangoAttrList and callback function, removes any elements
876 * of list for which func returns TRUE and inserts them into
881 * callback function; returns TRUE if an attribute
882 * should be filtered out.
884 * Data to be passed to func
886 * the new PangoAttrList or NULL if
887 * no attributes of the given types were found.
890 public static PangoAttrList
* listFilter(PangoAttrList
* list
, PangoAttrFilterFunc func
, void* data
)
892 // PangoAttrList* pango_attr_list_filter (PangoAttrList *list, PangoAttrFilterFunc func, gpointer data);
893 return pango_attr_list_filter(list
, func
, data
);
898 * Create a iterator initialized to the beginning of the list.
899 * list must not be modified until this iterator is freed.
903 * the newly allocated PangoAttrIterator, which should
904 * be freed with pango_attr_iterator_destroy().
906 public static PangoAttrIterator
* listGetIterator(PangoAttrList
* list
)
908 // PangoAttrIterator* pango_attr_list_get_iterator (PangoAttrList *list);
909 return pango_attr_list_get_iterator(list
);
914 * Copy a PangoAttrIterator
916 * a PangoAttrIterator.
918 * the newly allocated PangoAttrIterator, which should
919 * be freed with pango_attr_iterator_destroy().
921 public static PangoAttrIterator
* iteratorCopy(PangoAttrIterator
* iterator
)
923 // PangoAttrIterator* pango_attr_iterator_copy (PangoAttrIterator *iterator);
924 return pango_attr_iterator_copy(iterator
);
928 * Advance the iterator until the next change of style.
930 * a PangoAttrIterator
932 * FALSE if the iterator is at the end of the list, otherwise TRUE
934 public static int iteratorNext(PangoAttrIterator
* iterator
)
936 // gboolean pango_attr_iterator_next (PangoAttrIterator *iterator);
937 return pango_attr_iterator_next(iterator
);
941 * Get the range of the current segment. Note that the
942 * stored return values are signed, not unsigned like
943 * the values in PangoAttribute. To deal with this API
944 * oversight, stored return values that wouldn't fit into
945 * a signed integer are clamped to G_MAXINT.
947 * a PangoAttrIterator
949 * location to store the start of the range
951 * location to store the end of the range
953 public static void iteratorRange(PangoAttrIterator
* iterator
, int* start
, int* end
)
955 // void pango_attr_iterator_range (PangoAttrIterator *iterator, gint *start, gint *end);
956 pango_attr_iterator_range(iterator
, start
, end
);
960 * Find the current attribute of a particular type at the iterator
961 * location. When multiple attributes of the same type overlap,
962 * the attribute whose range starts closest to the current location
965 * a PangoAttrIterator
967 * the type of attribute to find.
969 * the current attribute of the given type, or NULL
970 * if no attribute of that type applies to the current
973 public static PangoAttribute
* iteratorGet(PangoAttrIterator
* iterator
, PangoAttrType type
)
975 // PangoAttribute* pango_attr_iterator_get (PangoAttrIterator *iterator, PangoAttrType type);
976 return pango_attr_iterator_get(iterator
, type
);
980 * Get the font and other attributes at the current iterator position.
982 * a PangoAttrIterator
984 * a PangoFontDescription to fill in with the current values.
985 * The family name in this structure will be set using
986 * pango_font_description_set_family_static() using values from
987 * an attribute in the PangoAttrList associated with the iterator,
988 * so if you plan to keep it around, you must call:
989 * pango_font_description_set_family (desc, pango_font_description_get_family (desc)).
991 * if non-NULL, location to store language tag for item, or NULL
994 * if non-NULL, location in which to store a list of non-font
995 * attributes at the the current position; only the highest priority
996 * value of each attribute will be added to this list. In order
997 * to free this value, you must call pango_attribute_destroy() on
1000 public static void iteratorGetFont(PangoAttrIterator
* iterator
, PgFontDescription desc
, PangoLanguage
** language
, GSList
** extraAttrs
)
1002 // void pango_attr_iterator_get_font (PangoAttrIterator *iterator, PangoFontDescription *desc, PangoLanguage **language, GSList **extra_attrs);
1003 pango_attr_iterator_get_font(iterator
, (desc
is null) ?
null : desc
.getPgFontDescriptionStruct(), language
, extraAttrs
);
1007 * Gets a list of all attributes at the current position of the
1010 * a PangoAttrIterator
1012 * a list of all attributes for the current range.
1013 * To free this value, call pango_attribute_destroy() on
1014 * each value and g_slist_free() on the list.
1017 public static ListSG
iteratorGetAttrs(PangoAttrIterator
* iterator
)
1019 // GSList* pango_attr_iterator_get_attrs (PangoAttrIterator *iterator);
1020 return new ListSG( pango_attr_iterator_get_attrs(iterator
) );
1024 * Destroy a PangoAttrIterator and free all associated memory.
1026 * a PangoAttrIterator.
1028 public static void iteratorDestroy(PangoAttrIterator
* iterator
)
1030 // void pango_attr_iterator_destroy (PangoAttrIterator *iterator);
1031 pango_attr_iterator_destroy(iterator
);