Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::TextTag Class Reference

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

`#include <inti/gtk/texttag.h>`

Inheritance diagram for Inti::Gtk::TextTag:

List of all members.

## Public Member Functions

Constructors

- TextTag (const char *name=0)
    Construct a new text tag.
- virtual ~TextTag ()
    Destructor.

Accessors

- GtkTextTag * gtk_text_tag () const
    Get a pointer to the GtkTextTag structure.
- GtkTextTagClass * gtk_text_tag_class () const
    Get a pointer to the GtkTextTagClass 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 prop_name ()
    The name used to refer to the text tag; null for anonymous tags (String : Read / Write / Construct Only).
- const BackgroundPropertyProxy prop_background ()
    The background color as a string (String : Write).
- const BackgroundGdkPropertyProxy prop_background_gdk ()
    The background color as a (possibly unallocated) Gdk::Color (Pointer<Gdk::Color> : Read / Write).
- const BackgroundFullHeightPropertyProxy prop_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 prop_background_stipple ()
    The bitmap to use as a mask when drawing the text background (Gdk::Bitmap* : Read / Write).
- const ForegroundPropertyProxy prop_foreground ()
    The foreground color as a string (String : Write).
- const ForegroundGdkPropertyProxy prop_foreground_gdk ()
    The foreground color as a (possibly unallocated) Gdk::Color (Pointer<Gdk::Color> : Read / Write).
- const ForegroundStipplePropertyProxy prop_foreground_stipple ()
    The bitmap to use as a mask when drawing the text foreground (Gdk::Bitmap* : Read / Write).
- const DirectionPropertyProxy prop_direction ()
    The text direction, for example, right-to-left or left-to-right (TextDirection : Read / Write).
- const EditablePropertyProxy prop_editable ()
    Whether the text can be modified by the user (bool : Read / Write).
- const FontPropertyProxy prop_font ()
    The font description as a string, e.g. "Sans Italic 12" (String : Read / Write).
- const FontDescPropertyProxy prop_font_desc ()
    The font description as a Pango::FontDescription (Pointer<Pango::FontDescription> : Read / Write).
- const FamilyPropertyProxy prop_family ()
    The name of the font family, e.g. Sans, Helvetica, Times, Monospace (String : Read / Write).
- const StylePropertyProxy prop_style ()
    The font style as a Pango::Style, e.g. Pango::STYLE_ITALIC (Pango::Style : Read / Write).
- const VariantPropertyProxy prop_variant ()
    The font variant as a Pango::Variant, e.g. Pango::VARIANT_SMALL_CAPS (Pango::Variant : Read / Write).
- const WeightPropertyProxy prop_weight ()
    The font weight as Pango::Weight, for example, Pango::WEIGHT_BOLD (Pango::Weight : Read / Write).
- const StretchPropertyProxy prop_stretch ()
    The font stretch as a Pango::Stretch, e.g. Pango::STRETCH_CONDENSED (Pango::Stretch : Read / Write).
- const SizePropertyProxy prop_size ()
    The font size in Pango units (int : Read / Write).
- const ScalePropertyProxy prop_scale ()
    The font size as a scale factor relative to the default font size.
- const SizePointsPropertyProxy prop_size_points ()
    The font size in points (double : Read / Write).
- const JustificationPropertyProxy prop_justification ()
    Left, right, or center justification (Justification : Read / Write).
- const LanguagePropertyProxy prop_language ()
    The language this text is in, as an ISO code.
- const LeftMarginPropertyProxy prop_left_margin ()
    The width of the left margin in pixels (int : Read / Write).
- const RightMarginPropertyProxy prop_right_margin ()
    THe width of the right margin in pixels (int : Read / Write).
- const IndentPropertyProxy prop_indent ()
    The amount to indent the paragraph, in pixels (int : Read / Write).
- const RisePropertyProxy prop_rise ()
    The offset of text above the baseline (below the baseline if rise is negative) in pixels (int : Read / Write).
- const PixelsAboveLinesPropertyProxy prop_pixels_above_lines ()
    The pixels of blank space above paragraphs (int : Read / Write).
- const PixelsBelowLinesPropertyProxy prop_pixels_below_lines ()
    The pixels of blank space below paragraphs (int : Read / Write).
- const PixelsInsideWrapPropertyProxy prop_pixels_inside_wrap ()
    The pixels of blank space between wrapped lines in a paragraph (int : Read / Write).
- const StrikethroughPropertyProxy prop_strikethrough ()
    Whether to strike through the text (bool : Read / Write).
- const UnderlinePropertyProxy prop_underline ()
    The style of underline for this text (Pango::Underline : Read / Write).
- const WrapModePropertyProxy prop_wrap_mode ()
    Whether to wrap lines never, at word boundaries, or at character boundaries (WrapMode : Read / Write).
- const TabsPropertyProxy prop_tabs ()
    The custom tabs for this text (Pointer<Pango::TabArray> : Read / Write).
- const InvisiblePropertyProxy prop_invisible ()
    Whether this text is hidden. Not implemented in GTK 2.0 (bool : Read / Write).
- const BackgroundSetPropertyProxy prop_background_set ()
    Whether this tag affects the background color (bool : Read / Write).
- const BackgroundFullHeightSetPropertyProxy prop_background_full_height_set ()
    Whether this tag affects background height (bool : Read / Write).
- const BackgroundStippleSetPropertyProxy prop_background_stipple_set ()
    Whether this tag affects the background stipple (bool : Read / Write).
- const ForegroundSetPropertyProxy prop_foreground_set ()
    Whether this tag affects the foreground color (bool : Read / Write).
- const ForegroundStippleSetPropertyProxy prop_foreground_stipple_set ()
    Whether this tag affects the foreground stipple (bool : Read / Write).
- const EditableSetPropertyProxy prop_editable_set ()
    Whether this tag affects text editability (bool : Read / Write).
- const FamilySetPropertyProxy prop_family_set ()
    Whether this tag affects the font family (bool : Read / Write).
- const StyleSetPropertyProxy prop_style_set ()
    Whether this tag affects the font style (bool : Read / Write).
- const VariantSetPropertyProxy prop_variant_set ()
    Whether this tag affects the font variant (bool : Read / Write).
- const WeightSetPropertyProxy prop_weight_set ()
    Whether this tag affects the font weight (bool : Read / Write).
- const StretchSetPropertyProxy prop_stretch_set ()
    Whether this tag affects the font stretch (bool : Read / Write).
- const SizeSetPropertyProxy prop_size_set ()
    Whether this tag affects the font size (bool : Read / Write).
- const ScaleSetPropertyProxy prop_scale_set ()
    Whether this tag scales the font size by a factor (bool : Read / Write).
- const JustificationSetPropertyProxy prop_justification_set ()
    Whether this tag affects paragraph justification (bool : Read / Write).
- const LanguageSetPropertyProxy prop_language_set ()
    Whether this tag affects the language the text is rendered in (bool : Read / Write).
- const LeftMarginSetPropertyProxy prop_left_margin_set ()
    Whether this tag affects the left margin (bool : Read / Write).
- const IndentSetPropertyProxy prop_indent_set ()
    Whether this tag affects indentation (bool : Read / Write).
- const RiseSetPropertyProxy prop_rise_set ()
    Whether this tag affects the rise (bool : Read / Write).
- const PixelsAboveLinesSetPropertyProxy prop_pixels_above_lines_set ()
    Whether this tag affects the number of pixels above lines (bool : Read / Write).
- const PixelsBelowLinesSetPropertyProxy prop_pixels_below_lines_set ()
    Whether this tag affects the number of pixels below lines (bool : Read / Write).
- const PixelsInsideWrapSetPropertyProxy prop_pixels_inside_wrap_set ()
    Whether this tag affects the number of pixels between wrapped lines (bool : Read / Write).
- const StrikethroughSetPropertyProxy prop_strikethrough_set ()
    Whether this tag affects strikethrough (bool : Read / Write).
- const RightMarginSetPropertyProxy prop_right_margin_set ()
    Whether this tag affects the right margin (bool : Read / Write).
- const UnderlineSetPropertyProxy prop_underline_set ()
    Whether this tag affects underlining (bool : Read / Write).
- const WrapModeSetPropertyProxy prop_wrap_mode_set ()
    Whether this tag affects line wrap mode (bool : Read / Write).
- const TabsSetPropertyProxy prop_tabs_set ()
    Whether this tag affects tabs (bool : Read / Write).
- const InvisibleSetPropertyProxy prop_invisible_set ()
    Whether this tag affects text visibility (bool : Read / Write).

Signal Proxies

- const EventSignalProxy sig_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 reference=true)
    Construct a new TextTag from an existing GtkTextTag.

Signal Handlers

- bool on_event (G::Object &event_object, Gdk::Event &event, const TextIter &iter)
    Called when the text tag receives a motion, button, or key event signal.

## 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).

## Constructor & Destructor Documentation

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

  | Construct a new TextTag from an existing GtkTextTag. Parameters:
  tag | A pointer to a GtkTextTag.
  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).

Inti::Gtk::TextTag::TextTag | ( | const char * | name = 0 | ) |

  | Construct a new text tag. Parameters:
  name | The name for this tag, or null for an anonymous tag.

## Member Function Documentation

bool Inti::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 Inti::Gtk::TextTag::get_priority | ( |  | ) | const

| Gets the tag priority. Returns: The tag's priority.

bool Inti::Gtk::TextTag::on_event | ( | G::Object & | event_object,
|  | Gdk::Event & | event,
|  | const TextIter & | iter
| ) | `[protected]`

  | Called when the text tag receives a motion, button, or key event signal. 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: true if the event was handled, false if it wasn't handled.

const LanguagePropertyProxy Inti::Gtk::TextTag::prop_language | ( |  | ) | `[inline]`

| 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 Inti::Gtk::TextTag::prop_scale | ( |  | ) | `[inline]`

| 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 Inti::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* Inti::Gtk::TextTag::table | ( |  | ) | const

| Returns the tag table for the tag. Returns: The tag table.

Pointer<TextAttributes> Inti::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.

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

- texttag.h

Main Page - Footer