TeplLanguageChooser

TeplLanguageChooser — Interface implemented by widgets for choosing a GtkSourceLanguage

Functions

Signals

Types and Values

Object Hierarchy

    GInterface
    ╰── TeplLanguageChooser

Prerequisites

TeplLanguageChooser requires GObject.

Known Implementations

TeplLanguageChooser is implemented by TeplLanguageChooserDialog and TeplLanguageChooserWidget.

Includes

#include <tepl/tepl.h>

Description

A TeplLanguageChooser widget shows a list of available GtkSourceLanguage's, as returned by gtk_source_language_manager_get_default(). The list contains a "Plain Text" item for the NULL language.

The typical workflow when using a TeplLanguageChooser widget in an application is:

  1. Create a TeplLanguageChooser widget.

  2. Call tepl_language_chooser_select_language() with the value of the “language” property.

  3. Wait for the “language-activated” signal to be emitted and/or destroy the TeplLanguageChooser widget.

Functions

tepl_language_chooser_select_language ()

void
tepl_language_chooser_select_language (TeplLanguageChooser *chooser,
                                       GtkSourceLanguage *language);

Selects language in the list.

Parameters

chooser

a TeplLanguageChooser.

 

language

a GtkSourceLanguage, or NULL for "Plain Text".

[nullable]

Since: 6.0

Types and Values

TeplLanguageChooser

typedef struct _TeplLanguageChooser TeplLanguageChooser;

struct TeplLanguageChooserInterface

struct TeplLanguageChooserInterface {
	GTypeInterface parent_interface;

	/* Interface functions */
	void (* select_language) (TeplLanguageChooser *chooser,
					 GtkSourceLanguage   *language);

	/* Signals */
	void (* language_activated) (TeplLanguageChooser *chooser,
					 GtkSourceLanguage   *language);
};

The virtual function table for TeplLanguageChooser.

Members

GTypeInterface parent_interface;

The parent interface.

 

select_language ()

The virtual function pointer for tepl_language_chooser_select_language(). By default, does nothing.

 

language_activated ()

The function pointer for the “language-activated” signal.

 

Since: 6.0

Signal Details

The “language-activated” signal

void
user_function (TeplLanguageChooser *chooser,
               GtkSourceLanguage   *language,
               gpointer             user_data)

This signal is emitted when the user has chosen a language.

Parameters

chooser

the TeplLanguageChooser emitting the signal.

 

language

the GtkSourceLanguage object that has been selected, or NULL if "Plain Text" has been selected.

[nullable]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 6.0