![]() |
![]() |
![]() |
Anjuta Developers Reference Manual | ![]() |
---|---|---|---|---|
#include <libanjuta/interfaces/ianjuta-editor-assist.h> #define IANJUTA_EDITOR_ASSIST_ERROR gchar* (*IAnjutaEditorAssistContextParser) (IAnjutaEditor *editor, gint position); IAnjutaEditorAssist; IAnjutaEditorAssistIface; GQuark ianjuta_editor_assist_error_quark (void); void ianjuta_editor_assist_add_trigger (IAnjutaEditorAssist *obj, const gchar *trigger, IAnjutaEditorAssistContextParser context_parser, GError **err); void ianjuta_editor_assist_autocomplete (IAnjutaEditorAssist *obj, GError **err); GList* ianjuta_editor_assist_get_suggestions (IAnjutaEditorAssist *obj, const gchar *context, GError **err); void ianjuta_editor_assist_react (IAnjutaEditorAssist *obj, gint selection, const gchar *context, const gchar *completion, GError **err); void ianjuta_editor_assist_remove_trigger (IAnjutaEditorAssist *obj, const gchar *trigger, GError **err); void ianjuta_editor_assist_suggest (IAnjutaEditorAssist *obj, GList *choices, gint char_alignment, GError **err); void ianjuta_editor_assist_tip (IAnjutaEditorAssist *obj, GList *tips, gint char_alignment, GError **err);
"assist-begin" : Run Last "assist-canceled" : Run Last "assist-choosen" : Run Last "assist-end" : Run Last "assist-update" : Run Last
gchar* (*IAnjutaEditorAssistContextParser) (IAnjutaEditor *editor, gint position);
editor : |
|
position : |
|
Returns : |
typedef struct { IAnjutaEditorIface g_iface; /* Signal */ void (*assist_begin) (IAnjutaEditorAssist *obj, const gchar *context); /* Signal */ void (*assist_canceled) (IAnjutaEditorAssist *obj); /* Signal */ void (*assist_choosen) (IAnjutaEditorAssist *obj, gint selection); /* Signal */ void (*assist_end) (IAnjutaEditorAssist *obj); /* Signal */ void (*assist_update) (IAnjutaEditorAssist *obj, const gchar *context); void (*add_trigger) (IAnjutaEditorAssist *obj, const gchar *trigger, IAnjutaEditorAssistContextParser context_parser, GError **err); void (*autocomplete) (IAnjutaEditorAssist *obj, GError **err); GList* (*get_suggestions) (IAnjutaEditorAssist *obj, const gchar *context, GError **err); void (*react) (IAnjutaEditorAssist *obj, gint selection, const gchar *context, const gchar *completion, GError **err); void (*remove_trigger) (IAnjutaEditorAssist *obj, const gchar *trigger, GError **err); void (*suggest) (IAnjutaEditorAssist *obj, GList* choices, gint char_alignment, GError **err); void (*tip) (IAnjutaEditorAssist *obj, GList* tips, gint char_alignment, GError **err); } IAnjutaEditorAssistIface;
void ianjuta_editor_assist_add_trigger (IAnjutaEditorAssist *obj, const gchar *trigger, IAnjutaEditorAssistContextParser context_parser, GError **err);
Add the given character sequence as a trigger for begining assist. context_parser is a callback to use to retrieve the context when the trigger happens.
By default there is always a trigger for aphanumeric characters with default context_parser picking up the word just before the carat.
obj : |
Self |
trigger : |
trigger character sequence |
context_parser : |
Callback used to parse the context. |
err : |
Error propagation and reporting |
void ianjuta_editor_assist_autocomplete (IAnjutaEditorAssist *obj, GError **err);
obj : |
|
err : |
GList* ianjuta_editor_assist_get_suggestions (IAnjutaEditorAssist *obj, const gchar *context, GError **err);
obj : |
|
context : |
|
err : |
|
Returns : |
void ianjuta_editor_assist_react (IAnjutaEditorAssist *obj, gint selection, const gchar *context, const gchar *completion, GError **err);
When a user makes a choice, the editor is requested to react to it. Usually the editor inserts it at the current carat position and end or update current assist context.
obj : |
Self |
selection : |
The user selection index. |
context : |
The context to react in. |
completion : |
corresponding completion. |
err : |
Error propagation and reporting |
void ianjuta_editor_assist_remove_trigger (IAnjutaEditorAssist *obj, const gchar *trigger, GError **err);
obj : |
|
trigger : |
|
err : |
void ianjuta_editor_assist_suggest (IAnjutaEditorAssist *obj, GList *choices, gint char_alignment, GError **err);
Suggest a list of choices to the user. char_alignment
indicates
the position before which is the known context and after which are
the suggestions. Usually the editor would use this to
align the choices displayed such that the carat is just at this
position when the choices are displayed.
obj : |
Self |
choices : |
list of choices. |
char_alignment : |
Character alignment. |
err : |
Error propagation and reporting |
void ianjuta_editor_assist_tip (IAnjutaEditorAssist *obj, GList *tips, gint char_alignment, GError **err);
Show tips showing more information on current context. No user feedback
is required when tips are shown. char_alignment
indicates
the position before which is the known context and after which are
the suggestions. Usually the editor would use this to
align the choices displayed such that the carat is just at this
position when the choices are displayed.
obj : |
Self |
tips : |
list of alternative tips. |
char_alignment : |
Character alignment. |
err : |
Error propagation and reporting |
void user_function (IAnjutaEditorAssist *ianjutaeditorassist, gchar *arg1, gpointer user_data) : Run Last
ianjutaeditorassist : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (IAnjutaEditorAssist *ianjutaeditorassist, gpointer user_data) : Run Last
ianjutaeditorassist : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (IAnjutaEditorAssist *ianjutaeditorassist, gint arg1, gpointer user_data) : Run Last
ianjutaeditorassist : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (IAnjutaEditorAssist *ianjutaeditorassist, gpointer user_data) : Run Last
ianjutaeditorassist : |
the object which received the signal. |
user_data : |
user data set when the signal handler was connected. |
void user_function (IAnjutaEditorAssist *ianjutaeditorassist, gchar *arg1, gpointer user_data) : Run Last
ianjutaeditorassist : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |