![]() |
![]() |
![]() |
GtkSourceCompletion Reference Manual | |
---|---|---|---|---|
gchar* gsc_get_last_word_and_iter (GtkTextView *text_view, GtkTextIter *start_word, GtkTextIter *end_word); gchar* gsc_get_last_word (GtkTextView *text_view); gchar* gsc_get_last_word_cleaned (GtkTextView *text_view); void gsc_get_cursor_pos (GtkTextView *text_view, gint *x, gint *y); gchar* gsc_gsv_get_text (GtkTextView *text_view); void gsc_replace_actual_word (GtkTextView *text_view, const gchar *text); gboolean gsc_char_is_separator (gunichar ch); gchar* gsc_clear_word (const gchar *word); gchar* gsc_compute_line_indentation (GtkTextView *view, GtkTextIter *cur); gchar* gsc_get_text_with_indent (const gchar *content, gchar *indent); void gsc_insert_text_with_indent (GtkTextView *view, const gchar *text); gboolean gsc_is_valid_word (gchar *current_word, gchar *completion_word); gboolean gsc_get_window_position_in_cursor (GtkWindow *window, GtkTextView *view, gint *x, gint *y); void gsc_get_window_position_center_screen (GtkWindow *window, gint *x, gint *y); void gsc_get_window_position_center_parent (GtkWindow *window, GtkWidget *parent, gint *x, gint *y); gboolean gsc_compare_keys (guint key, guint mods, GdkEventKey *event);
gchar* gsc_get_last_word_and_iter (GtkTextView *text_view, GtkTextIter *start_word, GtkTextIter *end_word);
|
The GtkTextView |
|
if != NULL then assign it the start position of the word |
|
if != NULL then assing it the end position of the word |
Returns : |
the last word written in the GtkTextView or "" |
gchar* gsc_get_last_word (GtkTextView *text_view);
|
The GtkTextView |
Returns : |
the last word written in the GtkTextView or "" |
gchar* gsc_get_last_word_cleaned (GtkTextView *text_view);
See gsc_get_last_word and gsc_clear_word
|
The GtkTextView |
Returns : |
the last word written in the GtkTextView or "" (new allocated) |
void gsc_get_cursor_pos (GtkTextView *text_view, gint *x, gint *y);
Gets the cursor position on the screen.
|
The GtkTextView |
|
Assign the x position of the cursor |
|
Assign the y position of the cursor |
void gsc_replace_actual_word (GtkTextView *text_view, const gchar *text);
Replaces the current word in the GtkTextView with the new word
|
The GtkTextView |
|
The text to be inserted instead of the current word |
gboolean gsc_char_is_separator (gunichar ch);
A separator is a character like (, an space etc. An _ is not a separator
|
The character to check |
Returns : |
TRUE if the ch is a separator |
gchar* gsc_clear_word (const gchar *word);
Clean the word eliminates the special characters at the start of this word. By example "$variable" is cleaned to "variable"
|
The word to be cleaned |
Returns : |
New allocated string with the word cleaned. If all characters are separators, it return NULL; |
gchar* gsc_compute_line_indentation (GtkTextView *view, GtkTextIter *cur);
|
The GtkTextView |
|
Cursor in the line where we compute the indentation |
Returns : |
New allocated string with the indentation of this line |
gchar* gsc_get_text_with_indent (const gchar *content, gchar *indent);
|
The initial text to indent |
|
Indentation string. You can get the indentation of a line with gsc_compute_line_indentation. |
Returns : |
New allocated string with the content indented. |
void gsc_insert_text_with_indent (GtkTextView *view, const gchar *text);
This function indent the text and insert it into the view in the current position.
|
The GtkTextView where we will insert the indented text |
|
Text to indent and insert into the view. |
gboolean gsc_is_valid_word (gchar *current_word, gchar *completion_word);
|
The current word |
|
The completion word |
Returns : |
TRUE if the completion_word starts with current_word and it is not the same word. |
gboolean gsc_get_window_position_in_cursor (GtkWindow *window, GtkTextView *view, gint *x, gint *y);
|
Window to set |
|
Parent view where we get the cursor position |
|
The returned x position |
|
The returned y position |
Returns : |
TRUE if the position is over the text and FALSE if the position is under the text. |
void gsc_get_window_position_center_screen (GtkWindow *window, gint *x, gint *y);
Assing x and y values to center the window in the screen
|
Window to set |
|
The returned x position |
|
The returned y position |
void gsc_get_window_position_center_parent (GtkWindow *window, GtkWidget *parent, gint *x, gint *y);
Assing x and y values to center the window in the parent widget
|
Window to set |
|
Parent widget where we want to center the window |
|
The returned x position |
|
The returned y position |
gboolean gsc_compare_keys (guint key, guint mods, GdkEventKey *event);
|
key to compare |
|
modifiers to compare |
|
Event to be compared with the previous key and modifiers |
Returns : |
TRUE if the event key has the same key and mods. |