![]() |
![]() |
![]() |
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); GList* ianjuta_editor_assist_get_suggestions (IAnjutaEditorAssist *obj, const gchar *context, GError **err); void ianjuta_editor_assist_react (IAnjutaEditorAssist *obj, gint selection, 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, int 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-chosen" : 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, const gchar* trigger); /* Signal */ void (*assist_canceled) (IAnjutaEditorAssist *obj); /* Signal */ void (*assist_chosen) (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); GList* (*get_suggestions) (IAnjutaEditorAssist *obj, const gchar *context, GError **err); void (*react) (IAnjutaEditorAssist *obj, gint selection, const gchar *completion, GError **err); void (*remove_trigger) (IAnjutaEditorAssist *obj, const gchar *trigger, GError **err); void (*suggest) (IAnjutaEditorAssist *obj, GList* choices, int 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 |
GList* ianjuta_editor_assist_get_suggestions (IAnjutaEditorAssist *obj, const gchar *context, GError **err);
Usually the editor might have some suggestions to make for a context. For example in a simple word completion context. If the editor has no suggestions to make, it returns NULL.
Returns: A list of suggestions for the given context or NULL if there is nothing to suggest.
obj : |
Self |
context : |
The context for the suggestions. |
err : |
Error propagation and reporting |
Returns : | A list of dynamically allocated strings. The whole list, including the the strings should be freed when done. |
void ianjuta_editor_assist_react (IAnjutaEditorAssist *obj, gint selection, 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. |
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, int char_alignment, GError **err);
Suggest a list of choices to the user. The suggestions are viewed at char_alignment which should be the beginning of the completed word. If choices is NULL, and assist_end signal will occur
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, gchar *arg2, gpointer user_data) : Run Last
ianjutaeditorassist : |
the object which received the signal. |
arg1 : |
|
arg2 : |
|
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. |