Top | ![]() |
![]() |
![]() |
![]() |
GtkSourceSnippetContext * | context | Read / Write |
int | focus-position | Read / Write |
char * | spec | Read / Write |
char * | text | Read / Write |
gboolean | text-set | Read / Write |
char * | tooltip-text | Read / Write |
The GtkSourceSnippetChunk represents a single chunk of text that may or may not be an edit point within the snippet. Chunks that are an edit point (also called a tab stop) have the “focus-position” property set.
GtkSourceSnippetChunk *
gtk_source_snippet_chunk_copy (GtkSourceSnippetChunk *chunk
);
Copies the source snippet.
Since: 5.0
GtkSourceSnippetContext *
gtk_source_snippet_chunk_get_context (GtkSourceSnippetChunk *chunk
);
Gets the context for the snippet insertion.
Since: 5.0
gint
gtk_source_snippet_chunk_get_focus_position
(GtkSourceSnippetChunk *chunk
);
Gets the “focus-position”.
The focus-position is used to determine how many tabs it takes for the snippet to advanced to this chunk.
A focus-position of zero will be the last focus position of the snippet and snippet editing ends when it has been reached.
A focus-position of -1 means the chunk cannot be focused by the user.
Since: 5.0
const gchar *
gtk_source_snippet_chunk_get_spec (GtkSourceSnippetChunk *chunk
);
Gets the specification for the chunk.
The specification is evaluated for variables when other chunks are edited within the snippet context. If the user has changed the text, the “text” and “text-set” properties are updated.
Since: 5.0
const gchar *
gtk_source_snippet_chunk_get_text (GtkSourceSnippetChunk *chunk
);
Gets the “text” property.
The text property is updated when the user edits the text of the chunk. If it has not been edited, the “spec” property is returned.
Since: 5.0
gboolean
gtk_source_snippet_chunk_get_text_set (GtkSourceSnippetChunk *chunk
);
Gets the “text-set” property.
This is typically set when the user has edited a snippet chunk.
Since: 5.0
GtkSourceSnippetChunk *
gtk_source_snippet_chunk_new (void
);
Create a new GtkSourceSnippetChunk that can be added to a GtkSourceSnippet.
Since: 5.0
void gtk_source_snippet_chunk_set_context (GtkSourceSnippetChunk *chunk
,GtkSourceSnippetContext *context
);
void gtk_source_snippet_chunk_set_focus_position (GtkSourceSnippetChunk *chunk
,gint focus_position
);
Sets the “focus-position” property.
The focus-position is used to determine how many tabs it takes for the snippet to advanced to this chunk.
A focus-position of zero will be the last focus position of the snippet and snippet editing ends when it has been reached.
A focus-position of -1 means the chunk cannot be focused by the user.
Since: 5.0
void gtk_source_snippet_chunk_set_spec (GtkSourceSnippetChunk *chunk
,const gchar *spec
);
Sets the specification for the chunk.
The specification is evaluated for variables when other chunks are edited within the snippet context. If the user has changed the text, the “text” and “text-set” properties are updated.
Since: 5.0
void gtk_source_snippet_chunk_set_text (GtkSourceSnippetChunk *chunk
,const gchar *text
);
Sets the text for the snippet chunk.
This is usually used by the snippet engine to update the text, but may be useful when creating custom snippets to avoid expansion of any specification.
Since: 5.0
void gtk_source_snippet_chunk_set_text_set (GtkSourceSnippetChunk *chunk
,gboolean text_set
);
Sets the “text-set” property.
This is typically set when the user has edited a snippet chunk by the snippet engine.
Since: 5.0
“context”
property“context” GtkSourceSnippetContext *
The snippet context.
Owner: GtkSourceSnippetChunk
Flags: Read / Write
“focus-position”
property “focus-position” int
The focus position for the chunk.
Owner: GtkSourceSnippetChunk
Flags: Read / Write
Allowed values: >= -1
Default value: -1
“spec”
property “spec” char *
The specification to expand using the context.
Owner: GtkSourceSnippetChunk
Flags: Read / Write
Default value: NULL
“text”
property “text” char *
The text for the chunk.
Owner: GtkSourceSnippetChunk
Flags: Read / Write
Default value: NULL
“text-set”
property“text-set” gboolean
If the text property has been manually set.
Owner: GtkSourceSnippetChunk
Flags: Read / Write
Default value: FALSE