Top | ![]() |
![]() |
![]() |
![]() |
void | gtk_source_snippet_add_chunk () |
GtkSourceSnippet * | gtk_source_snippet_copy () |
GtkSourceSnippetContext * | gtk_source_snippet_get_context () |
const gchar * | gtk_source_snippet_get_description () |
gint | gtk_source_snippet_get_focus_position () |
const gchar * | gtk_source_snippet_get_language_id () |
const gchar * | gtk_source_snippet_get_name () |
guint | gtk_source_snippet_get_n_chunks () |
GtkSourceSnippetChunk * | gtk_source_snippet_get_nth_chunk () |
const gchar * | gtk_source_snippet_get_trigger () |
GtkSourceSnippet * | gtk_source_snippet_new () |
void | gtk_source_snippet_set_description () |
void | gtk_source_snippet_set_language_id () |
void | gtk_source_snippet_set_name () |
void | gtk_source_snippet_set_trigger () |
GtkTextBuffer * | buffer | Read |
char * | description | Read / Write |
int | focus-position | Read |
char * | language-id | Read / Write |
char * | name | Read / Write |
char * | trigger | Read / Write |
The GtkSourceSnippet represents a series of chunks that can quickly be inserted into the GtkSourceView.
Snippets are defined in XML files which are loaded by the
GtkSourceSnippetManager. Alternatively, applications can create snippets
on demand and insert them into the GtkSourceView using
gtk_source_view_push_snippet()
.
Snippet chunks can reference other snippet chunks as well as post-process the values from other chunks such as capitalization.
void gtk_source_snippet_add_chunk (GtkSourceSnippet *snippet
,GtkSourceSnippetChunk *chunk
);
Appends chunk
to the snippet
.
This may only be called before the snippet has been expanded.
Since: 5.0
GtkSourceSnippet *
gtk_source_snippet_copy (GtkSourceSnippet *snippet
);
Does a deep copy of the snippet.
Since: 5.0
GtkSourceSnippetContext *
gtk_source_snippet_get_context (GtkSourceSnippet *snippet
);
Gets the context used for expanding the snippet.
Since: 5.0
const gchar *
gtk_source_snippet_get_description (GtkSourceSnippet *snippet
);
Gets the description for the snippet.
Since: 5.0
gint
gtk_source_snippet_get_focus_position (GtkSourceSnippet *snippet
);
Gets the current focus for the snippet. This is changed as the user tabs through focus locations.
Since: 5.0
const gchar *
gtk_source_snippet_get_language_id (GtkSourceSnippet *snippet
);
Gets the language-id used for the source snippet.
The language identifier should be one that matches a source language “id” property.
Since: 5.0
const gchar *
gtk_source_snippet_get_name (GtkSourceSnippet *snippet
);
Gets the name for the snippet.
Since: 5.0
guint
gtk_source_snippet_get_n_chunks (GtkSourceSnippet *snippet
);
Gets the number of chunks in the snippet.
Note that not all chunks are editable.
Since: 5.0
GtkSourceSnippetChunk * gtk_source_snippet_get_nth_chunk (GtkSourceSnippet *snippet
,guint nth
);
Gets the chunk at nth
.
Since: 5.0
const gchar *
gtk_source_snippet_get_trigger (GtkSourceSnippet *snippet
);
Gets the trigger for the source snippet. A trigger is a word that can be expanded into the full snippet when the user presses Tab.
Since: 5.0
GtkSourceSnippet * gtk_source_snippet_new (const gchar *trigger
,const gchar *language_id
);
Creates a new GtkSourceSnippet
Since: 5.0
void gtk_source_snippet_set_description (GtkSourceSnippet *snippet
,const gchar *description
);
Sets the description for the snippet.
Since: 5.0
void gtk_source_snippet_set_language_id (GtkSourceSnippet *snippet
,const gchar *language_id
);
Sets the language identifier for the snippet.
This should match the “id” identifier.
Since: 5.0
void gtk_source_snippet_set_name (GtkSourceSnippet *snippet
,const gchar *name
);
Sets the name for the snippet.
Since: 5.0
void gtk_source_snippet_set_trigger (GtkSourceSnippet *snippet
,const gchar *trigger
);
Sets the trigger for the snippet.
Since: 5.0
“buffer”
property “buffer” GtkTextBuffer *
The GtkTextBuffer for the snippet.
Owner: GtkSourceSnippet
Flags: Read
“description”
property “description” char *
The description for the snippet.
Owner: GtkSourceSnippet
Flags: Read / Write
Default value: NULL
“focus-position”
property “focus-position” int
The currently focused chunk.
Owner: GtkSourceSnippet
Flags: Read
Allowed values: >= -1
Default value: -1
“language-id”
property “language-id” char *
The language-id for the snippet.
Owner: GtkSourceSnippet
Flags: Read / Write
Default value: NULL
“name”
property “name” char *
The name for the snippet.
Owner: GtkSourceSnippet
Flags: Read / Write
Default value: NULL