Talkatu Actions

Talkatu Actions — GAction Helpers

Functions

Properties

GtkTextBuffer * buffer Read / Write / Construct Only

Signals

void action-activated Action

Types and Values

Object Hierarchy

    GObject
    ╰── GSimpleActionGroup
        ╰── TalkatuActionGroup

Implemented Interfaces

TalkatuActionGroup implements GActionGroup and GActionMap.

Description

A lot of Talkatu's user interation is handled by GAction's. These functions help make that easier.

Functions

talkatu_action_group_new ()

GSimpleActionGroup *
talkatu_action_group_new (GtkTextBuffer *buffer);

Creates a new TalkatuActionGroup bound to buffer .

Parameters

buffer

The GtkTextBuffer to bind this action group to.

 

Returns

The new TalkatuActionGroup instance.

[transfer full]


talkatu_action_group_get_buffer ()

GtkTextBuffer *
talkatu_action_group_get_buffer (TalkatuActionGroup *ag);

TalkatuActionGroup's are bound to a specific GtkTextBuffer. This function return the one that ag is bound to.

Parameters

ag

The TalkatuActionGroup instance.

 

Returns

The GtkTextBuffer that ag is bound to.

[transfer none]


talkatu_action_group_enable_action ()

void
talkatu_action_group_enable_action (TalkatuActionGroup *ag,
                                    const gchar *name);

By default a TalkatuActionGroup's actions are all disabled. To enable them you must call this function one at time.

Parameters

ag

The TalkatuActionGroup instance.

 

name

The name of the action to enable.

 

talkatu_action_name_for_tag_name ()

const gchar *
talkatu_action_name_for_tag_name (const gchar *tag_name);

Looks up a GAction for the the tag named tag_name .

Parameters

tag_name

The name of the tag to lookup.

 

Returns

The GAction if one is found, otherwise NULL.


talkatu_action_group_activate_format ()

void
talkatu_action_group_activate_format (TalkatuActionGroup *ag,
                                      const gchar *format_name);

Activates action named format_name . This will apply it to a selection if there is one.

Parameters

ag

The TalkatuActionGroup instance.

 

format_name

The name of the format to activate.

 

talkatu_action_group_get_action_activated ()

gboolean
talkatu_action_group_get_action_activated
                               (TalkatuActionGroup *ag,
                                const gchar *name);

Returns that state of the action named name . If name doesn't exist or is not a toggle action, FALSE is returned.

Parameters

ag

The TalkatuActionGroup instance.

 

name

The name of the action to check.

 

Returns

Whether or not name is toggled.


talkatu_action_group_get_activated_formats ()

gchar **
talkatu_action_group_get_activated_formats
                               (TalkatuActionGroup *ag);

Returns an array of all actions that are activated. This values must be free'd with g_strfreev.

Parameters

ag

The TalkatuActionGroup instance.

 

Returns

A list of actions that are activated.

[transfer full]

Types and Values

TALKATU_ACTION_FORMAT_BOLD

#define TALKATU_ACTION_FORMAT_BOLD          ("format-bold")

A constant that represents the bold font style action.


TALKATU_ACTION_FORMAT_ITALIC

#define TALKATU_ACTION_FORMAT_ITALIC        ("format-italic")

A constant that represents the italic font style action.


TALKATU_ACTION_FORMAT_UNDERLINE

#define TALKATU_ACTION_FORMAT_UNDERLINE     ("format-underline")

A constant that represents the underline font style action.


TALKATU_ACTION_FORMAT_STRIKETHROUGH

#define TALKATU_ACTION_FORMAT_STRIKETHROUGH ("format-strikethrough")

A constant that represents the strike through font style action.


TALKATU_ACTION_FORMAT_GROW

#define TALKATU_ACTION_FORMAT_GROW          ("format-grow")

A constant that represents the increase font size action.


TALKATU_ACTION_FORMAT_SHRINK

#define TALKATU_ACTION_FORMAT_SHRINK        ("format-shrink")

A constant that represents the decrease font size action.


TALKATU_ACTION_FORMAT_RESET

#define TALKATU_ACTION_FORMAT_RESET         ("format-reset")

A constant that represents the reset all formatting action.


TALKATU_ACTION_INSERT_LINK

#define TALKATU_ACTION_INSERT_LINK          ("insert-link")

A constant that presents the action to activate when the user wants to insert a link.


TALKATU_TYPE_ACTION_GROUP

#define TALKATU_TYPE_ACTION_GROUP           (talkatu_action_group_get_type())

The standard _get_type macro for TalkatuActionGroup.


struct TalkatuActionGroupClass

struct TalkatuActionGroupClass {
	void (*action_activated)(TalkatuActionGroup *ag, GAction *action, const gchar *name);
};

The backing class of a TalkatuActionGroup.

Members

action_activated ()

The class handler for the “action-activated” signal.

 

TalkatuActionGroup

typedef struct _TalkatuActionGroup TalkatuActionGroup;

A GSimpleActionGroup subclass that contains all of the actions for formatting text in Talkatu. They are typically created by TalkatuBuffer subclasses.

Property Details

The “buffer” property

  “buffer”                   GtkTextBuffer *

The buffer to work on.

Flags: Read / Write / Construct Only

Signal Details

The “action-activated” signal

void
user_function (TalkatuActionGroup *talkatuactiongroup,
               GAction            *arg1,
               gchar              *user_data,
               gpointer            user_data)

Emitted when one of the actions in talkatuactiongroup are activated. This is a convenience signal so people don't have to connect to every action themselves.

Parameters

talkatuactiongroup

The TalkatuActionGroup instance.

 

arg1

The GAction that was activated.

 

user_data

User supplied data.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action