Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::TextTag Class Reference

A GtkTextTag C++ wrapper class. More...

`#include <xfc/gtk/texttag.hh>`

Inheritance diagram for Xfc::Gtk::TextTag:

List of all members.

## Property Prototypes

- const NamePropertyType name_property
    The name used to refer to the text tag; null for anonymous tags (see property_name()).
- const BackgroundPropertyType background_property
    The background color as a string (see property_background()).
- const BackgroundGdkPropertyType background_gdk_property
    The background color as a (possibly unallocated) Gdk::Color (see property_background_gdk()).
- const BackgroundFullHeightPropertyType background_full_height_property
    Whether the background color fills the entire line height (see property_background_full_height()).
- const BackgroundStipplePropertyType background_stipple_property
    The bitmap to use as a mask when drawing the text background (see property_background_stipple()).
- const ForegroundPropertyType foreground_property
    The foreground color as a string (see property_foreground()).
- const ForegroundGdkPropertyType foreground_gdk_property
    The foreground color as a (possibly unallocated) Gdk::Color (see property_foreground_gdk()).
- const ForegroundStipplePropertyType foreground_stipple_property
    The bitmap to use as a mask when drawing the text foreground (see property_foreground_stipple()).
- const DirectionPropertyType direction_property
    The text direction, for example, right-to-left or left-to-right (see property_direction()).
- const EditablePropertyType editable_property
    Whether the text can be modified by the user (see property_editable()).
- const FontPropertyType font_property
    The font description as a string, e.g. "Sans Italic 12" (see property_font()).
- const FontDescPropertyType font_desc_property
    The font description as a Pango::FontDescription (see property_font_desc()).
- const FamilyPropertyType family_property
    The name of the font family, e.g. Sans, Helvetica, Times, Monospace (see property_family()).
- const StylePropertyType style_property
    The font style as a Pango::Style, e.g. Pango::STYLE_ITALIC (see property_style()).
- const VariantPropertyType variant_property
    The font variant as a Pango::Variant, e.g. Pango::VARIANT_SMALL_CAPS (see property_variant()).
- const WeightPropertyType weight_property
    The font weight as Pango::Weight, for example, Pango::WEIGHT_BOLD (see property_weight()).
- const StretchPropertyType stretch_property
    The font stretch as a Pango::Stretch, e.g. Pango::STRETCH_CONDENSED (see property_stretch()).
- const SizePropertyType size_property
    The font size in Pango units (see property_size()).
- const ScalePropertyType scale_property
    The font size as a scale factor relative to the default font size (see property_scale()).
- const SizePointsPropertyType size_points_property
    The font size in points (see property_size_points()).
- const JustificationPropertyType justification_property
    Left, right, or center justification (see property_justification()).
- const LanguagePropertyType language_property
    The language this text is in, as an ISO code. (see property_language()).
- const LeftMarginPropertyType left_margin_property
    The width of the left margin in pixels (see property_left_margin()).
- const RightMarginPropertyType right_margin_property
    The width of the right margin in pixels (see property_right_margin()).
- const IndentPropertyType indent_property
    The amount to indent the paragraph, in pixels (see property_indent()).
- const RisePropertyType rise_property
    The offset of text above the baseline (see property_rise()).
- const PixelsAboveLinesPropertyType pixels_above_lines_property
    The pixels of blank space above paragraphs (see property_pixels_above_lines()).
- const PixelsBelowLinesPropertyType pixels_below_lines_property
    The pixels of blank space below paragraphs (see property_pixels_below_lines()).
- const PixelsInsideWrapPropertyType pixels_inside_wrap_property
    The pixels of blank space between wrapped lines in a paragraph (see property_pixels_inside_wrap()).
- const StrikethroughPropertyType strikethrough_property
    Whether to strike through the text (see property_strikethrough()).
- const UnderlinePropertyType underline_property
    The style of underline for this text (see property_underline()).
- const WrapModePropertyType wrap_mode_property
    Whether to wrap lines never, at word boundaries, or at character boundaries (see property_wrap_mode()).
- const TabsPropertyType tabs_property
    The custom tabs for this text (see property_tabs()).
- const InvisiblePropertyType invisible_property
    Whether this text is hidden (see property_invisible()).
- const BackgroundSetPropertyType background_set_property
    Whether this tag affects the background color (see property_background_set()).
- const BackgroundFullHeightSetPropertyType background_full_height_set_property
    Whether this tag affects background height (see property_background_full_height_set()).
- const BackgroundStippleSetPropertyType background_stipple_set_property
    Whether this tag affects the background stipple (see property_background_stipple_set()).
- const ForegroundSetPropertyType foreground_set_property
    Whether this tag affects the foreground color (see property_foreground_set()).
- const ForegroundStippleSetPropertyType foreground_stipple_set_property
    Whether this tag affects the foreground stipple (see property_foreground_stipple_set()).
- const EditableSetPropertyType editable_set_property
    Whether this tag affects text editability (see property_editable_set()).
- const FamilySetPropertyType family_set_property
    Whether this tag affects the font family (see property_editable_set()).
- const StyleSetPropertyType style_set_property
    Whether this tag affects the font style (see property_style_set()).
- const VariantSetPropertyType variant_set_property
    Whether this tag affects the font variant (see property_variant_set()).
- const WeightSetPropertyType weight_set_property
    Whether this tag affects the font weight (see property_weight_set()).
- const StretchSetPropertyType stretch_set_property
    Whether this tag affects the font stretch (see property_stretch_set()).
- const SizeSetPropertyType size_set_property
    Whether this tag affects the font size (see property_size_set()).
- const ScaleSetPropertyType scale_set_property
    Whether this tag scales the font size by a factor (see property_scale_set()).
- const JustificationSetPropertyType justification_set_property
    Whether this tag affects paragraph justification (see property_justification_set()).
- const LanguageSetPropertyType language_set_property
    Whether this tag affects the language the text is rendered in (see property_language_set()).
- const LeftMarginSetPropertyType left_margin_set_property
    Whether this tag affects the left margin (see property_left_margin_set()).
- const IndentSetPropertyType indent_set_property
    Whether this tag affects indentation (see property_indent_set()).
- const RiseSetPropertyType rise_set_property
    Whether this tag affects the rise (see property_rise_set()).
- const PixelsAboveLinesSetPropertyType pixels_above_lines_set_property
    Whether this tag affects the number of pixels above lines (see property_pixels_above_lines_set()).
- const PixelsBelowLinesSetPropertyType pixels_below_lines_set_property
    Whether this tag affects the number of pixels below lines (see property_pixels_below_lines_set()).
- const PixelsInsideWrapSetPropertyType pixels_inside_wrap_set_property
    Whether this tag affects the number of pixels between wrapped lines (see property_pixels_inside_wrap_set()).
- const StrikethroughSetPropertyType strikethrough_set_property
    Whether this tag affects strikethrough (see property_strikethrough_set()).
- const RightMarginSetPropertyType right_margin_set_property
    Whether this tag affects the right margin (see property_right_margin_set()).
- const UnderlineSetPropertyType underline_set_property
    Whether this tag affects underlining (see property_underline_set()).
- const WrapModeSetPropertyType wrap_mode_set_property
    Whether this tag affects line wrap mode (see property_wrap_mode_set()).
- const TabsSetPropertyType tabs_set_property
    Whether this tag affects tabs (see property_tabs_set()).
- const InvisibleSetPropertyType invisible_set_property
    Whether this tag affects text visibility (see property_invisible_set()).

## Signal Prototypes

- const EventSignalType event_signal
    Event signal (see signal_event()).

## Public Member Functions

Constructors

- TextTag ()
    Constructs a new anonymous text tag with a reference count of 1 that the caller owns.
- TextTag (const String &name)
    Constructs a new text tag with a reference count of 1 that the caller owns.
- virtual ~TextTag ()
    Destructor.

Accessors

- GtkTextTag * gtk_text_tag () const
    Get a pointer to the GtkTextTag structure.
- operator GtkTextTag * () const
    Conversion operator; safely converts a TextTag to a GtkTextTag pointer.
- TextTagTable * table () const
    Returns the tag table for the tag.
- Pointer< TextAttributes > values () const
    Returns a smart pointer to the TextAttributes the tag uses for displaying text.
- int get_priority () const
    Gets the tag priority.

Methods

- void set_priority (int priority)
    Sets the priority of the TextTag.
- bool event (G::Object &event_object, Gdk::Event &event, const TextIter &iter)
    Emits the event signal on the TextTag.

Property Proxies

- const NamePropertyProxy property_name ()
    The name used to refer to the text tag; null for anonymous tags (String : Read / Write / Construct Only).
- const BackgroundPropertyProxy property_background ()
    The background color as a string (String : Write).
- const BackgroundGdkPropertyProxy property_background_gdk ()
    The background color as a (possibly unallocated) Gdk::Color (Pointer<Gdk::Color> : Read / Write).
- const BackgroundFullHeightPropertyProxy property_background_full_height ()
    Whether the background color fills the entire line height or only the height of the tagged characters (bool : Read / Write).
- const BackgroundStipplePropertyProxy property_background_stipple ()
    The bitmap to use as a mask when drawing the text background (Gdk::Bitmap* : Read / Write).
- const ForegroundPropertyProxy property_foreground ()
    The foreground color as a string (String : Write).
- const ForegroundGdkPropertyProxy property_foreground_gdk ()
    The foreground color as a (possibly unallocated) Gdk::Color (Pointer<Gdk::Color> : Read / Write).
- const ForegroundStipplePropertyProxy property_foreground_stipple ()
    The bitmap to use as a mask when drawing the text foreground (Gdk::Bitmap* : Read / Write).
- const DirectionPropertyProxy property_direction ()
    The text direction, for example, right-to-left or left-to-right (TextDirection : Read / Write).
- const EditablePropertyProxy property_editable ()
    Whether the text can be modified by the user (bool : Read / Write).
- const FontPropertyProxy property_font ()
    The font description as a string, e.g. "Sans Italic 12" (String : Read / Write).
- const FontDescPropertyProxy property_font_desc ()
    The font description as a Pango::FontDescription (Pointer<Pango::FontDescription> : Read / Write).
- const FamilyPropertyProxy property_family ()
    The name of the font family, e.g. Sans, Helvetica, Times, Monospace (String : Read / Write).
- const StylePropertyProxy property_style ()
    The font style as a Pango::Style, e.g. Pango::STYLE_ITALIC (Pango::Style : Read / Write).
- const VariantPropertyProxy property_variant ()
    The font variant as a Pango::Variant, e.g. Pango::VARIANT_SMALL_CAPS (Pango::Variant : Read / Write).
- const WeightPropertyProxy property_weight ()
    The font weight as Pango::Weight, for example, Pango::WEIGHT_BOLD (Pango::Weight : Read / Write).
- const StretchPropertyProxy property_stretch ()
    The font stretch as a Pango::Stretch, e.g. Pango::STRETCH_CONDENSED (Pango::Stretch : Read / Write).
- const SizePropertyProxy property_size ()
    The font size in Pango units (int : Read / Write).
- const ScalePropertyProxy property_scale ()
    The font size as a scale factor relative to the default font size.
- const SizePointsPropertyProxy property_size_points ()
    The font size in points (double : Read / Write).
- const JustificationPropertyProxy property_justification ()
    Left, right, or center justification (Justification : Read / Write).
- const LanguagePropertyProxy property_language ()
    The language this text is in, as an ISO code.
- const LeftMarginPropertyProxy property_left_margin ()
    The width of the left margin in pixels (int : Read / Write).
- const RightMarginPropertyProxy property_right_margin ()
    The width of the right margin in pixels (int : Read / Write).
- const IndentPropertyProxy property_indent ()
    The amount to indent the paragraph, in pixels (int : Read / Write).
- const RisePropertyProxy property_rise ()
    The offset of text above the baseline (below the baseline if rise is negative) in pixels (int : Read / Write).
- const PixelsAboveLinesPropertyProxy property_pixels_above_lines ()
    The pixels of blank space above paragraphs (int : Read / Write).
- const PixelsBelowLinesPropertyProxy property_pixels_below_lines ()
    The pixels of blank space below paragraphs (int : Read / Write).
- const PixelsInsideWrapPropertyProxy property_pixels_inside_wrap ()
    The pixels of blank space between wrapped lines in a paragraph (int : Read / Write).
- const StrikethroughPropertyProxy property_strikethrough ()
    Whether to strike through the text (bool : Read / Write).
- const UnderlinePropertyProxy property_underline ()
    The style of underline for this text (Pango::Underline : Read / Write).
- const WrapModePropertyProxy property_wrap_mode ()
    Whether to wrap lines never, at word boundaries, or at character boundaries (WrapMode : Read / Write).
- const TabsPropertyProxy property_tabs ()
    The custom tabs for this text (Pointer<Pango::TabArray> : Read / Write).
- const InvisiblePropertyProxy property_invisible ()
    Whether this text is hidden. Not implemented in GTK 2.0 (bool : Read / Write).
- const BackgroundSetPropertyProxy property_background_set ()
    Whether this tag affects the background color (bool : Read / Write).
- const BackgroundFullHeightSetPropertyProxy property_background_full_height_set ()
    Whether this tag affects background height (bool : Read / Write).
- const BackgroundStippleSetPropertyProxy property_background_stipple_set ()
    Whether this tag affects the background stipple (bool : Read / Write).
- const ForegroundSetPropertyProxy property_foreground_set ()
    Whether this tag affects the foreground color (bool : Read / Write).
- const ForegroundStippleSetPropertyProxy property_foreground_stipple_set ()
    Whether this tag affects the foreground stipple (bool : Read / Write).
- const EditableSetPropertyProxy property_editable_set ()
    Whether this tag affects text editability (bool : Read / Write).
- const FamilySetPropertyProxy property_family_set ()
    Whether this tag affects the font family (bool : Read / Write).
- const StyleSetPropertyProxy property_style_set ()
    Whether this tag affects the font style (bool : Read / Write).
- const VariantSetPropertyProxy property_variant_set ()
    Whether this tag affects the font variant (bool : Read / Write).
- const WeightSetPropertyProxy property_weight_set ()
    Whether this tag affects the font weight (bool : Read / Write).
- const StretchSetPropertyProxy property_stretch_set ()
    Whether this tag affects the font stretch (bool : Read / Write).
- const SizeSetPropertyProxy property_size_set ()
    Whether this tag affects the font size (bool : Read / Write).
- const ScaleSetPropertyProxy property_scale_set ()
    Whether this tag scales the font size by a factor (bool : Read / Write).
- const JustificationSetPropertyProxy property_justification_set ()
    Whether this tag affects paragraph justification (bool : Read / Write).
- const LanguageSetPropertyProxy property_language_set ()
    Whether this tag affects the language the text is rendered in (bool : Read / Write).
- const LeftMarginSetPropertyProxy property_left_margin_set ()
    Whether this tag affects the left margin (bool : Read / Write).
- const IndentSetPropertyProxy property_indent_set ()
    Whether this tag affects indentation (bool : Read / Write).
- const RiseSetPropertyProxy property_rise_set ()
    Whether this tag affects the rise (bool : Read / Write).
- const PixelsAboveLinesSetPropertyProxy property_pixels_above_lines_set ()
    Whether this tag affects the number of pixels above lines (bool : Read / Write).
- const PixelsBelowLinesSetPropertyProxy property_pixels_below_lines_set ()
    Whether this tag affects the number of pixels below lines (bool : Read / Write).
- const PixelsInsideWrapSetPropertyProxy property_pixels_inside_wrap_set ()
    Whether this tag affects the number of pixels between wrapped lines (bool : Read / Write).
- const StrikethroughSetPropertyProxy property_strikethrough_set ()
    Whether this tag affects strikethrough (bool : Read / Write).
- const RightMarginSetPropertyProxy property_right_margin_set ()
    Whether this tag affects the right margin (bool : Read / Write).
- const UnderlineSetPropertyProxy property_underline_set ()
    Whether this tag affects underlining (bool : Read / Write).
- const WrapModeSetPropertyProxy property_wrap_mode_set ()
    Whether this tag affects line wrap mode (bool : Read / Write).
- const TabsSetPropertyProxy property_tabs_set ()
    Whether this tag affects tabs (bool : Read / Write).
- const InvisibleSetPropertyProxy property_invisible_set ()
    Whether this tag affects text visibility (bool : Read / Write).

Signal Proxies

- const EventSignalProxy signal_event ()
    Connect to the event_signal; emitted when the text tag receives a motion, button, or key event signal.

## Protected Member Functions

Constructors

- TextTag (GtkTextTag *tag, bool owns_reference=true)
    Construct a new TextTag from an existing GtkTextTag.

## Detailed Description

A GtkTextTag C++ wrapper class.

Text in a buffer can be marked with tags. A tag is an attribute that can be applied to some range of text. For example, a tag might be called "bold" and make the text inside the tag bold. However, the tag concept is more general than that; tags don't have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user can't edit it, or countless other things.

A tag is represented by a TextTag object. One TextTag can be applied to any number of text ranges in any number of buffers. Each tag is stored in a TextTagTable. A tag table defines a set of tags that can be used together. Each buffer has one tag table associated with it; only tags from that tag table can be used with the buffer. A single tag table can be shared between multiple buffers, however.

Tags can have names, which is convenient sometimes (for example, you can name your tag that makes things bold "bold"), but they can also be anonymous (which is convenient if you're creating tags on-the-fly).

Note: dynamically allocated objects must either be unreferenced or assigned to a smart pointer. Stack objects are automatically unreferenced when they go out of scope.

See also: the TextView Widget HOWTO and example.

## Constructor & Destructor Documentation

Xfc::Gtk::TextTag::TextTag | ( | GtkTextTag * | tag,
|  | bool | owns_reference = `true`
| ) | `[explicit, protected]`

Construct a new TextTag from an existing GtkTextTag.

Parameters:

  | tag | A pointer to a GtkTextTag.
  | owns_reference | Set false if the initial reference count is floating, set true if it's not.

The tag can be a newly created GtkTextTag or an existing GtkTextTag (see G::Object::Object).

Xfc::Gtk::TextTag::TextTag | ( | const String & | name | ) | `[explicit]`

Constructs a new text tag with a reference count of 1 that the caller owns.

Parameters:

  | name | The name for the text tag.

## Member Function Documentation

bool Xfc::Gtk::TextTag::event | ( | G::Object & | event_object,
|  | Gdk::Event & | event,
|  | const TextIter & | iter
| ) |

Emits the event signal on the TextTag.

Parameters:

  | event_object | The object that received the event, such as a widget.
  | event | The event.
  | iter | The location where the event was received.

Returns:
  The result of signal emission (whether the event was handled).

int Xfc::Gtk::TextTag::get_priority | ( |  | ) | const

Gets the tag priority.

Returns:
  The tag's priority.

const LanguagePropertyProxy Xfc::Gtk::TextTag::property_language | ( |  | ) |

| The language this text is in, as an ISO code. Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it (String : Read / Write).

const ScalePropertyProxy Xfc::Gtk::TextTag::property_scale | ( |  | ) |

| The font size as a scale factor relative to the default font size. This properly adapts to theme changes etc. so is recommended. Pango predefines some scales such as PANGO_SCALE_X_LARGE (double : Read / Write).

void Xfc::Gtk::TextTag::set_priority | ( | int | priority | ) |

Sets the priority of the TextTag.

Parameters:

  | priority | The new priority.

Valid priorities are start at 0 and go to one less than Gtk::TextTagTable::get_size(). Each tag in a table has a unique priority; setting the priority of one tag shifts the priorities of all the other tags in the table to maintain a unique priority for each tag. Higher priority tags "win" if two tags both set the same text attribute. When adding a tag to a tag table, it will be assigned the highest priority in the table by default; so normally the precedence of a set of tags is the order in which they were added to the table, or created with gtk_text_buffer_create_tag(), which adds the tag to the buffer's table automatically.

TextTagTable* Xfc::Gtk::TextTag::table | ( |  | ) | const

Returns the tag table for the tag.

Returns:
  The tag table.

Pointer<TextAttributes> Xfc::Gtk::TextTag::values | ( |  | ) | const

| Returns a smart pointer to the TextAttributes the tag uses for displaying text. The information specified acts an override on information specified by lower-priority tags. If no value is specified, then the next-lower-priority tag on the text determines the value. The text widget itself provides defaults if no tag specifies an override.

## Member Data Documentation

const EventSignalType Xfc::Gtk::TextTag::event_signal `[static, protected]`

Event signal (see signal_event()).

Calls a slot with the signature:

                 bool function(G::Object& event_object, Gdk::Event& event, const TextIter& iter);
                 // event_object: The object that received the event, such as a widget.
                 // event: The event.
                 // iter: The location where the event was received.
                 // return: true if the event was handled, false if it wasn't handled.

The documentation for this class was generated from the following file:

- texttag.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3