![]() |
![]() |
![]() |
GtkSourceView 3 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <gtksourceview/gtksourcecompletion.h> GtkSourceCompletion; gboolean gtk_source_completion_add_provider (GtkSourceCompletion *completion
,GtkSourceCompletionProvider *provider
,GError **error
); gboolean gtk_source_completion_remove_provider (GtkSourceCompletion *completion
,GtkSourceCompletionProvider *provider
,GError **error
); GList * gtk_source_completion_get_providers (GtkSourceCompletion *completion
); gboolean gtk_source_completion_show (GtkSourceCompletion *completion
,GList *providers
,GtkSourceCompletionContext *context
); void gtk_source_completion_hide (GtkSourceCompletion *completion
); GtkSourceCompletionInfo * gtk_source_completion_get_info_window (GtkSourceCompletion *completion
); GtkSourceView * gtk_source_completion_get_view (GtkSourceCompletion *completion
); GtkSourceCompletionContext * gtk_source_completion_create_context (GtkSourceCompletion *completion
,GtkTextIter *position
); void gtk_source_completion_move_window (GtkSourceCompletion *completion
,GtkTextIter *iter
); void gtk_source_completion_block_interactive (GtkSourceCompletion *completion
); void gtk_source_completion_unblock_interactive (GtkSourceCompletion *completion
);
"accelerators" guint : Read / Write / Construct "auto-complete-delay" guint : Read / Write / Construct "proposal-page-size" guint : Read / Write / Construct "provider-page-size" guint : Read / Write / Construct "remember-info-visibility" gboolean : Read / Write / Construct "select-on-show" gboolean : Read / Write / Construct "show-headers" gboolean : Read / Write / Construct "show-icons" gboolean : Read / Write / Construct "view" GtkSourceView* : Read / Write / Construct Only
"activate-proposal" :Action
"hide" :Action
"move-cursor" :Action
"move-page" :Action
"populate-context" :Action
"show" :Action
gboolean gtk_source_completion_add_provider (GtkSourceCompletion *completion
,GtkSourceCompletionProvider *provider
,GError **error
);
Add a new GtkSourceCompletionProvider to the completion object. This will
add a reference provider
, so make sure to unref your own copy when you
no longer need it.
|
a GtkSourceCompletion. |
|
a GtkSourceCompletionProvider. |
|
a GError. [allow-none] |
Returns : |
TRUE if provider was successfully added, otherwise if error
is provided, it will be set with the error and FALSE is returned. |
gboolean gtk_source_completion_remove_provider (GtkSourceCompletion *completion
,GtkSourceCompletionProvider *provider
,GError **error
);
Remove provider
from the completion.
|
a GtkSourceCompletion. |
|
a GtkSourceCompletionProvider. |
|
a GError. [allow-none] |
Returns : |
TRUE if provider was successfully removed, otherwise if error
is provided, it will be set with the error and FALSE is returned. |
GList * gtk_source_completion_get_providers (GtkSourceCompletion *completion
);
Get list of providers registered on completion
. The returned list is owned
by the completion and should not be freed.
|
a GtkSourceCompletion. |
Returns : |
list of GtkSourceCompletionProvider. [element-type GtkSource.CompletionProvider][transfer none] |
gboolean gtk_source_completion_show (GtkSourceCompletion *completion
,GList *providers
,GtkSourceCompletionContext *context
);
Starts a new completion with the specified GtkSourceCompletionContext and a list of potential candidate providers for completion.
|
a GtkSourceCompletion. |
|
a list of GtkSourceCompletionProvider, or NULL . [element-type GtkSource.CompletionProvider][allow-none]
|
|
The GtkSourceCompletionContext with which to start the completion. [transfer floating] |
Returns : |
TRUE if it was possible to the show completion window. |
void gtk_source_completion_hide (GtkSourceCompletion *completion
);
Hides the completion if it is active (visible).
|
a GtkSourceCompletion. |
GtkSourceCompletionInfo * gtk_source_completion_get_info_window
(GtkSourceCompletion *completion
);
The info widget is the window where the completion displays optional extra information of the proposal.
|
a GtkSourceCompletion. |
Returns : |
The GtkSourceCompletionInfo window
associated with completion . [transfer none]
|
GtkSourceView * gtk_source_completion_get_view (GtkSourceCompletion *completion
);
The GtkSourceView associated with completion
.
|
a GtkSourceCompletion. |
Returns : |
The GtkSourceView associated with completion . [type GtkSource.View][transfer none]
|
GtkSourceCompletionContext * gtk_source_completion_create_context (GtkSourceCompletion *completion
,GtkTextIter *position
);
Create a new GtkSourceCompletionContext for completion
. The position where
the completion occurs can be specified by position
. If position
is NULL
,
the current cursor position will be used.
|
a GtkSourceCompletion. |
|
a GtkTextIter, or NULL . [allow-none]
|
Returns : |
a new GtkSourceCompletionContext. The reference being returned is a 'floating' reference, so if you invoke gtk_source_completion_show with this context you don't need to unref it. [transfer floating] |
void gtk_source_completion_move_window (GtkSourceCompletion *completion
,GtkTextIter *iter
);
Move the completion window to a specific iter.
|
a GtkSourceCompletion. |
|
a GtkTextIter. |
void gtk_source_completion_block_interactive
(GtkSourceCompletion *completion
);
Block interactive completion. This can be used to disable interactive completion when inserting or deleting text from the buffer associated with the completion. Use gtk_source_completion_unblock_interactive to enable interactive completion again.
|
a GtkSourceCompletion. |
void gtk_source_completion_unblock_interactive
(GtkSourceCompletion *completion
);
Unblock interactive completion. This can be used after using gtk_source_completion_block_interactive to enable interactive completion again.
|
a GtkSourceCompletion. |
"accelerators"
property "accelerators" guint : Read / Write / Construct
Number of keyboard accelerators to show for the first proposals. For example, to activate the first proposal, the user can press Alt+1.
Allowed values: <= 10
Default value: 5
"auto-complete-delay"
property "auto-complete-delay" guint : Read / Write / Construct
Determines the popup delay (in milliseconds) at which the completion will be shown for interactive completion.
Default value: 250
"proposal-page-size"
property "proposal-page-size" guint : Read / Write / Construct
The scroll page size of the proposals in the completion window. In other words, when PageDown or PageUp is pressed, the selected proposal becomes the one which is located one page size backward or forward.
Allowed values: >= 1
Default value: 5
"provider-page-size"
property "provider-page-size" guint : Read / Write / Construct
The scroll page size of the provider pages in the completion window. Not yet used.
Allowed values: >= 1
Default value: 5
"remember-info-visibility"
property "remember-info-visibility" gboolean : Read / Write / Construct
Determines whether the visibility of the info window should be saved when the completion is hidden, and restored when the completion is shown again.
Default value: FALSE
"select-on-show"
property "select-on-show" gboolean : Read / Write / Construct
Determines whether the first proposal should be selected when the completion is first shown.
Default value: TRUE
"show-headers"
property "show-headers" gboolean : Read / Write / Construct
Determines whether provider headers should be shown in the proposal list. It can be useful to disable when there is only one provider.
Default value: TRUE
"show-icons"
property "show-icons" gboolean : Read / Write / Construct
Determines whether provider and proposal icons should be shown in the completion popup.
Default value: TRUE
"view"
property"view" GtkSourceView* : Read / Write / Construct Only
The GtkSourceView bound to the completion object.
"activate-proposal"
signalvoid user_function (GtkSourceCompletion *completion,
gpointer user_data) : Action
The ::activate-proposal signal is a keybinding signal which gets emitted when the user initiates a proposal activation.
Applications should not connect to it, but may emit it with g_signal_emit_by_name if they need to control the proposal activation programmatically.
|
The GtkSourceCompletion who emits the signal |
|
user data set when the signal handler was connected. |
"hide"
signalvoid user_function (GtkSourceCompletion *completion,
gpointer user_data) : Action
Emitted when the completion window is hidden. The default handler will actually hide the window.
|
The GtkSourceCompletion who emits the signal |
|
user data set when the signal handler was connected. |
"move-cursor"
signalvoid user_function (GtkSourceCompletion *completion,
GtkScrollStep step,
gint num,
gpointer user_data) : Action
The ::move-cursor signal is a keybinding signal which gets emitted when the user initiates a cursor movement.
The Up, Down, PageUp, PageDown, Home and End keys are bound to the normal behavior expected by those keys. The PageDown and PageUp keys use the page size defined by the "proposal-page-size" property.
Applications should not connect to it, but may emit it with g_signal_emit_by_name if they need to control the cursor programmatically.
|
The GtkSourceCompletion who emits the signal |
|
The GtkScrollStep by which to move the cursor |
|
The amount of steps to move the cursor |
|
user data set when the signal handler was connected. |
"move-page"
signalvoid user_function (GtkSourceCompletion *completion,
GtkScrollStep step,
gint num,
gpointer user_data) : Action
The ::move-page signal is a keybinding signal which gets emitted when the user initiates a page movement (i.e. switches between provider pages).
Control+Left is for going to the previous provider. Control+Right is for going to the next provider. Control+Home is for displaying all the providers. Control+End is for going to the last provider.
Applications should not connect to it, but may emit it with g_signal_emit_by_name if they need to control the page selection programmatically.
|
The GtkSourceCompletion who emits the signal |
|
The GtkScrollStep by which to move the page |
|
The amount of steps to move the page |
|
user data set when the signal handler was connected. |
"populate-context"
signalvoid user_function (GtkSourceCompletion *completion,
GtkSourceCompletionContext *context,
gpointer user_data) : Action
Emitted just before starting to populate the completion with providers. You can use this signal to add additional attributes in the context.
|
The GtkSourceCompletion who emits the signal |
|
The GtkSourceCompletionContext for the current completion |
|
user data set when the signal handler was connected. |
"show"
signalvoid user_function (GtkSourceCompletion *completion,
gpointer user_data) : Action
Emitted when the completion window is shown. The default handler will actually show the window.
|
The GtkSourceCompletion who emits the signal |
|
user data set when the signal handler was connected. |