Tags

Tags — Helpers for handling tags.

Functions

Properties

TalkatuTagDisplay display Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── GtkTextTag
        ╰── TalkatuTag

Description

Talkatu deals with a lot of tags which this API tries to make easier.

Functions

talkatu_tag_new ()

GtkTextTag *
talkatu_tag_new (const gchar *name,
                 const gchar *first_property,
                 ...);

Creates a new TalkatuTag to be used for styling text.

Parameters

name

The name to give the tag.

 

first_property

The name of the first property to set.

 

...

The value of the first property followed optionally by more name/value pairs, followed by NULL.

 

Returns

The new TalkatuTag.

[transfer full]


talkatu_tag_set_display ()

void
talkatu_tag_set_display (TalkatuTag *tag,
                         TalkatuTagDisplay display);

Sets the display type for tag to display .

Parameters

tag

The TalkatuTag instance.

 

display

The TalkatuTagDisplay value to set.

 

talkatu_tag_get_display ()

TalkatuTagDisplay
talkatu_tag_get_display (TalkatuTag *tag);

Gets the TalkatuTagDisplay for tag .

Parameters

tag

The TalkatuTag instance.

 

Returns

The TalkatuTagDisplay for tag .


talkatu_tag_name_for_action_name ()

const gchar *
talkatu_tag_name_for_action_name (const gchar *action_name);

Gets the tag name that should be used for action_name .

Parameters

action_name

The name of the action to find a tag name for.

 

Returns

The tag name to be used for action_name , or NULL.


talkatu_tag_name_to_html ()

const gchar *
talkatu_tag_name_to_html (const gchar *tag_name);

Determines the HTML tag for tag_name .

Parameters

tag_name

The name of the tag.

 

Returns

The HTML tag if any for tag_name .

Types and Values

TALKATU_TAG_PREFIX

#define TALKATU_TAG_PREFIX        "talkatu:"

The prefix that all Talkatu tags use.


TALKATU_TAG_PREFIX_LEN

#define TALKATU_TAG_PREFIX_LEN    (sizeof(TALKATU_TAG_PREFIX)-1)

The length of TALKATU_TAG_PREFIX for easy computation.


TALKATU_TAG_BOLD

#define TALKATU_TAG_BOLD          TALKATU_TAG_PREFIX "bold"

A constant that represents the bold font style.


TALKATU_TAG_ITALIC

#define TALKATU_TAG_ITALIC        TALKATU_TAG_PREFIX "italic"

A constant that represents the italic font style.


TALKATU_TAG_UNDERLINE

#define TALKATU_TAG_UNDERLINE     TALKATU_TAG_PREFIX "underline"

A constant that represents the underlined font style.


TALKATU_TAG_STRIKETHROUGH

#define TALKATU_TAG_STRIKETHROUGH TALKATU_TAG_PREFIX "strikethrough"

A constant that represents the strikethrough font style.


TALKATU_TAG_SUBSCRIPT

#define TALKATU_TAG_SUBSCRIPT     TALKATU_TAG_PREFIX "subscript"

A constant that represents the sub-script font style.


TALKATU_TAG_SUPERSCRIPT

#define TALKATU_TAG_SUPERSCRIPT   TALKATU_TAG_PREFIX "superscript"

A constant that represents the super-script font style.


TALKATU_TAG_PRE

#define TALKATU_TAG_PRE           TALKATU_TAG_PREFIX "preformatted"

A constant that represents a preformatted font style.


TALKATU_TAG_CODE

#define TALKATU_TAG_CODE          TALKATU_TAG_PREFIX "code"

A constant that represents a code font style.


TALKATU_TAG_SEARCH

#define TALKATU_TAG_SEARCH        TALKATU_TAG_PREFIX "search"

A constant that represents the highlighted search term font style.


TALKATU_TAG_H1

#define TALKATU_TAG_H1            TALKATU_TAG_PREFIX "header1"

A constant that represents the h1 header font style.


TALKATU_TAG_H2

#define TALKATU_TAG_H2            TALKATU_TAG_PREFIX "header2"

A constant that represents the h2 header font style.


TALKATU_TAG_H3

#define TALKATU_TAG_H3            TALKATU_TAG_PREFIX "header3"

A constant that represents the h3 header font style.


TALKATU_TAG_H4

#define TALKATU_TAG_H4            TALKATU_TAG_PREFIX "header4"

A constant that represents the h4 header font style.


TALKATU_TAG_H5

#define TALKATU_TAG_H5            TALKATU_TAG_PREFIX "header5"

A constant that represents the h5 header font style.


TALKATU_TAG_H6

#define TALKATU_TAG_H6            TALKATU_TAG_PREFIX "header6"

A constant that represents the h6 header font style.


TALKATU_TAG_ANCHOR

#define TALKATU_TAG_ANCHOR        TALKATU_TAG_PREFIX "anchor"

A constant that represents an anchor or link font style.


TALKATU_TAG_DL

#define TALKATU_TAG_DL            TALKATU_TAG_PREFIX "description-list"

A constant that represents the dl HTML element.


TALKATU_TAG_DT

#define TALKATU_TAG_DT            TALKATU_TAG_PREFIX "description-term"

A constant that reprensents the dt HTML element.


TALKATU_TAG_DD

#define TALKATU_TAG_DD            TALKATU_TAG_PREFIX "description-definition"

A constant that represents the dd HTML element.


TALKATU_TAG_MESSAGE

#define TALKATU_TAG_MESSAGE       TALKATU_TAG_PREFIX "message"

A constant for the tag that tags an entire message in a TalkatuHistory buffer.


TALKATU_TAG_TIMESTAMP

#define TALKATU_TAG_TIMESTAMP     TALKATU_TAG_PREFIX "timestamp"

A constant that represents the timestamp font style.


TALKATU_TAG_AUTHOR

#define TALKATU_TAG_AUTHOR        TALKATU_TAG_PREFIX "author"

A constant for referencing the styling for an author.


TALKATU_TAG_CONTENTS

#define TALKATU_TAG_CONTENTS      TALKATU_TAG_PREFIX "contents"

A constant for the tag that tags message contents in a TalkatuHistory buffer.


TALKATU_TAG_FORMATTING_START

#define TALKATU_TAG_FORMATTING_START "-start"

A constant to be used as a prefix for tags that need formatting applied before the original tag.


TALKATU_TAG_FORMATTING_END

#define TALKATU_TAG_FORMATTING_END   "-end"

A constant to be used as a suffix for tags that need formatting applied after the original tag.


enum TalkatuTagDisplay

An enum representing how a tag should be rendered.

Members

TALKATU_TAG_DISPLAY_INLINE

The tag should be rendered inline.

 

TALKATU_TAG_DISPLAY_BLOCK

The tag should be rendered on its own line.

 

TALKATU_TYPE_TAG

#define TALKATU_TYPE_TAG            (talkatu_tag_get_type())

The standard _get_type macro for TalkatuTag.


TalkatuTag

typedef struct _TalkatuTag TalkatuTag;

TalkatuTag is a GtkTextTag subclass that has a few additional properties that allows greater control of how text is rendered.

Property Details

The “display” property

  “display”                  TalkatuTagDisplay

How to display the text.

Flags: Read / Write / Construct

Default value: TALKATU_TAG_DISPLAY_INLINE