Text View

Text View — Widget that displays a TalkatuBuffer

Functions

Properties

TalkatuViewSendBinding send-binding Read / Write / Construct

Signals

void format-activate Action
void open-url Action
void send-message Action
void should-send-message Action

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkTextView
                    ╰── TalkatuView
                        ╰── TalkatuHistory

Implemented Interfaces

TalkatuView implements AtkImplementorIface, GtkBuildable and GtkScrollable.

Description

TalkatuView handles the display of a TalkatuBuffer, the keybindings for applying formats, as well as displaying links.

Functions

talkatu_view_new ()

GtkWidget *
talkatu_view_new (void);

Creates a new TalkatuView with a TalkatuBuffer.

Returns

The new TalkatuView.

[transfer full]


talkatu_view_new_with_buffer ()

GtkWidget *
talkatu_view_new_with_buffer (GtkTextBuffer *buffer);

Creates a new TalkatuView with buffer .

Parameters

buffer

A GtkTextBuffer.

 

Returns

The new TalkatuView.

[transfer full]


talkatu_view_set_send_binding ()

void
talkatu_view_set_send_binding (TalkatuView *view,
                               TalkatuViewSendBinding bindings);

Sets the bindings for when the send-message signal should be emitted.

Parameters

view

The TalkatuView instance.

 

bindings

The TalkatuViewSendBinding value.

 

talkatu_view_get_send_binding ()

TalkatuViewSendBinding
talkatu_view_get_send_binding (TalkatuView *view);

Gets the TalkatuViewSendBinding which determines when send-message signal will be emitted.

Parameters

view

The TalkatuView instance.

 

Returns

The TalkatuViewSendBinding.

Types and Values

enum TalkatuViewSendBinding

Flags for assigning and determining which key bindings should be used to send a message.

Members

TALKATU_VIEW_SEND_BINDING_RETURN

Represents the return.

 

TALKATU_VIEW_SEND_BINDING_KP_ENTER

Represents the enter.

 

TALKATU_VIEW_SEND_BINDING_SHIFT_RETURN

Represents shift-return.

 

TALKATU_VIEW_SEND_BINDING_CONTROL_RETURN

Represents control-return.

 

TALKATU_TYPE_VIEW

#define TALKATU_TYPE_VIEW            (talkatu_view_get_type())

struct TalkatuViewClass

struct TalkatuViewClass {
	GtkTextViewClass parent;

	void (*format_activate)(TalkatuView *view, const gchar *action_name);

	void (*should_send_message)(TalkatuView *view, TalkatuViewSendBinding binding);
	void (*send_message)(TalkatuView *view);

	void (*open_url)(TalkatuView *view, const gchar *url);

	gpointer reserved[5];
};

TalkatuView

typedef struct _TalkatuView TalkatuView;

Property Details

The “send-binding” property

  “send-binding”             TalkatuViewSendBinding

The keybindings that will trigger the send signal.

Flags: Read / Write / Construct

Default value: TALKATU_VIEW_SEND_BINDING_RETURN | TALKATU_VIEW_SEND_BINDING_KP_ENTER

Signal Details

The “format-activate” signal

void
user_function (TalkatuView *talkatutextview,
               gchar       *arg1,
               gpointer     user_data)

Emitted by the keybindings to apply a format to the underlying buffer.

Parameters

talkatutextview

The TalkatuView instance.

 

arg1

The name of the action to activated.

 

user_data

User supplied data.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “open-url” signal

void
user_function (TalkatuView *talkatutextview,
               gchar       *url,
               gpointer     user_data)

Emitted when a user clicks on a link to open the url

Parameters

talkatutextview

The TalkatuView instances.

 

url

The URL to open.

 

user_data

User supplied data.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “send-message” signal

void
user_function (TalkatuView *talkatutextview,
               gpointer     user_data)

Emitted when a message should be sent.

Parameters

talkatutextview

The TalkatuView instance.

 

user_data

User supplied data.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “should-send-message” signal

void
user_function (TalkatuView           *talkatutextview,
               TalkatuViewSendBinding arg1,
               gpointer               user_data)

Emitted when a potential keybinding to send the message is entered to determine if the message should be sent.

Parameters

talkatutextview

The TalkatuView instance.

 

arg1

The TalkatuViewSendBinding that was entered.

 

user_data

User supplied data.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action