![]() |
![]() |
![]() |
Anjuta Developers Reference Manual | ![]() |
---|---|---|---|---|
#include <libanjuta/interfaces/ianjuta-editor.h> #define IANJUTA_TYPE_EDITOR_ATTRIBUTE #define IANJUTA_TYPE_EDITOR_ERROR enum IAnjutaEditorAttribute; enum IAnjutaEditorError; #define IANJUTA_EDITOR_ERROR IAnjutaEditor; IAnjutaEditorIface; GType ianjuta_editor_error_get_type (void); GQuark ianjuta_editor_error_quark (void); GType ianjuta_editor_get_type (void); void ianjuta_editor_append (IAnjutaEditor *obj, const gchar *text, gint length, GError **err); void ianjuta_editor_erase (IAnjutaEditor *obj, IAnjutaIterable *position_start, IAnjutaIterable *position_end, GError **err); void ianjuta_editor_erase_all (IAnjutaEditor *obj, GError **err); gint ianjuta_editor_get_column (IAnjutaEditor *obj, GError **err); gchar* ianjuta_editor_get_current_word (IAnjutaEditor *obj, GError **err); IAnjutaIterable* ianjuta_editor_get_end_position (IAnjutaEditor *obj, GError **err); gint ianjuta_editor_get_length (IAnjutaEditor *obj, GError **err); IAnjutaIterable* ianjuta_editor_get_line_begin_position (IAnjutaEditor *obj, gint line, GError **err); IAnjutaIterable* ianjuta_editor_get_line_end_position (IAnjutaEditor *obj, gint line, GError **err); int ianjuta_editor_get_line_from_position (IAnjutaEditor *obj, IAnjutaIterable *position, GError **err); gint ianjuta_editor_get_lineno (IAnjutaEditor *obj, GError **err); gint ianjuta_editor_get_offset (IAnjutaEditor *obj, GError **err); gboolean ianjuta_editor_get_overwrite (IAnjutaEditor *obj, GError **err); IAnjutaIterable* ianjuta_editor_get_position (IAnjutaEditor *obj, GError **err); IAnjutaIterable* ianjuta_editor_get_position_from_offset (IAnjutaEditor *obj, gint offset, GError **err); IAnjutaIterable* ianjuta_editor_get_start_position (IAnjutaEditor *obj, GError **err); gint ianjuta_editor_get_tabsize (IAnjutaEditor *obj, GError **err); gchar* ianjuta_editor_get_text (IAnjutaEditor *obj, IAnjutaIterable *begin, IAnjutaIterable *end, GError **err); gchar* ianjuta_editor_get_text_all (IAnjutaEditor *obj, GError **err); gboolean ianjuta_editor_get_use_spaces (IAnjutaEditor *obj, GError **err); void ianjuta_editor_goto_end (IAnjutaEditor *obj, GError **err); void ianjuta_editor_goto_line (IAnjutaEditor *obj, gint lineno, GError **err); void ianjuta_editor_goto_position (IAnjutaEditor *obj, IAnjutaIterable *position, GError **err); void ianjuta_editor_goto_start (IAnjutaEditor *obj, GError **err); void ianjuta_editor_insert (IAnjutaEditor *obj, IAnjutaIterable *position, const gchar *text, gint length, GError **err); void ianjuta_editor_set_auto_indent (IAnjutaEditor *obj, gboolean auto_indent, GError **err); void ianjuta_editor_set_popup_menu (IAnjutaEditor *obj, GtkWidget *menu, GError **err); void ianjuta_editor_set_tabsize (IAnjutaEditor *obj, gint tabsize, GError **err); void ianjuta_editor_set_use_spaces (IAnjutaEditor *obj, gboolean use_spaces, GError **err);
IAnjutaEditor is required by IAnjutaEditorComment, IAnjutaEditorConvert, IAnjutaEditorZoom, IAnjutaEditorGoto, IAnjutaEditorView, IAnjutaEditorHover, IAnjutaEditorSelection, IAnjutaEditorAssist, IAnjutaEditorLineMode, IAnjutaEditorFolds and IAnjutaEditorLanguage.
#define IANJUTA_TYPE_EDITOR_ATTRIBUTE (ianjuta_editor_attribute_get_type())
typedef enum { IANJUTA_EDITOR_TEXT, IANJUTA_EDITOR_KEYWORD, IANJUTA_EDITOR_COMMENT, IANJUTA_EDITOR_STRING } IAnjutaEditorAttribute;
typedef struct { GTypeInterface g_iface; /* Signal */ void (*changed) (IAnjutaEditor *obj, GObject *position, gboolean added, gint length, gint lines, const gchar *text); /* Signal */ void (*char_added) (IAnjutaEditor *obj, GObject *position, gchar ch); void (*append) (IAnjutaEditor *obj, const gchar *text, gint length, GError **err); void (*erase) (IAnjutaEditor *obj, IAnjutaIterable *position_start, IAnjutaIterable *position_end, GError **err); void (*erase_all) (IAnjutaEditor *obj, GError **err); gint (*get_column) (IAnjutaEditor *obj, GError **err); gchar* (*get_current_word) (IAnjutaEditor *obj, GError **err); IAnjutaIterable* (*get_end_position) (IAnjutaEditor *obj, GError **err); gint (*get_length) (IAnjutaEditor *obj, GError **err); IAnjutaIterable* (*get_line_begin_position) (IAnjutaEditor *obj, gint line, GError **err); IAnjutaIterable * (*get_line_end_position) (IAnjutaEditor *obj, gint line, GError **err); int (*get_line_from_position) (IAnjutaEditor *obj, IAnjutaIterable *position, GError **err); gint (*get_lineno) (IAnjutaEditor *obj, GError **err); gint (*get_offset) (IAnjutaEditor *obj, GError **err); gboolean (*get_overwrite) (IAnjutaEditor *obj, GError **err); IAnjutaIterable* (*get_position) (IAnjutaEditor *obj, GError **err); IAnjutaIterable* (*get_position_from_offset) (IAnjutaEditor *obj, gint offset, GError **err); IAnjutaIterable* (*get_start_position) (IAnjutaEditor *obj, GError **err); gint (*get_tabsize) (IAnjutaEditor *obj, GError **err); gchar* (*get_text) (IAnjutaEditor *obj, IAnjutaIterable *begin, IAnjutaIterable *end, GError **err); gchar* (*get_text_all) (IAnjutaEditor *obj, GError **err); gboolean (*get_use_spaces) (IAnjutaEditor *obj, GError **err); void (*goto_end) (IAnjutaEditor *obj, GError **err); void (*goto_line) (IAnjutaEditor *obj, gint lineno, GError **err); void (*goto_position) (IAnjutaEditor *obj, IAnjutaIterable *position, GError **err); void (*goto_start) (IAnjutaEditor *obj, GError **err); void (*insert) (IAnjutaEditor *obj, IAnjutaIterable *position, const gchar *text, gint length, GError **err); void (*set_auto_indent) (IAnjutaEditor *obj, gboolean auto_indent, GError **err); void (*set_popup_menu) (IAnjutaEditor *obj, GtkWidget *menu, GError **err); void (*set_tabsize) (IAnjutaEditor *obj, gint tabsize, GError **err); void (*set_use_spaces) (IAnjutaEditor *obj, gboolean use_spaces, GError **err); } IAnjutaEditorIface;
void ianjuta_editor_append (IAnjutaEditor *obj, const gchar *text, gint length, GError **err);
Appends length
characters from text
buffer at the end of editor
buffer. If length
is -1, the whole text
is used. length
is in bytes.
obj : |
Self |
text : |
Text to append. |
length : |
Length of text to use.
|
err : |
Error propagation and reporting |
void ianjuta_editor_erase (IAnjutaEditor *obj, IAnjutaIterable *position_start, IAnjutaIterable *position_end, GError **err);
obj : |
|
position_start : |
|
position_end : |
|
err : |
void ianjuta_editor_erase_all (IAnjutaEditor *obj, GError **err);
Empties the whole editor buffer. There will be zero characters. After the erase operation, none of the active iters are guranteed to be valid.
obj : |
Self |
err : |
Error propagation and reporting |
gint ianjuta_editor_get_column (IAnjutaEditor *obj, GError **err);
obj : |
|
err : |
|
Returns : |
gchar* ianjuta_editor_get_current_word (IAnjutaEditor *obj, GError **err);
Obtains the word on which carat is currently on.
obj : |
Self |
err : |
Error propagation and reporting |
Returns : | Current word. |
IAnjutaIterable* ianjuta_editor_get_end_position (IAnjutaEditor *obj, GError **err);
Gets the iter positioned at the end of the editor buffer. The returned iter is the end-iter which does not point to any valid character in the buffer (it is pointed one step beyond the last valid character).
Retrun value: Cell iter set to the end of the editor (end-iter).
obj : |
Self |
err : |
Error propagation and reporting |
Returns : |
gint ianjuta_editor_get_length (IAnjutaEditor *obj, GError **err);
Get length of complete text in editor. This will be the total number of characters in the file or buffer.
obj : |
Self |
err : |
Error propagation and reporting |
Returns : | Text length. |
IAnjutaIterable* ianjuta_editor_get_line_begin_position (IAnjutaEditor *obj, gint line, GError **err);
fixme
obj : |
Self |
line : |
fixme |
err : |
Error propagation and reporting. |
Returns : | fixme |
IAnjutaIterable* ianjuta_editor_get_line_end_position (IAnjutaEditor *obj, gint line, GError **err);
fixme
obj : |
Self |
line : |
fixme |
err : |
Error propagation and reporting. |
Returns : | fixme |
int ianjuta_editor_get_line_from_position (IAnjutaEditor *obj, IAnjutaIterable *position, GError **err);
obj : |
|
position : |
|
err : |
|
Returns : |
gint ianjuta_editor_get_lineno (IAnjutaEditor *obj, GError **err);
Obtains current line number on which carat is.
obj : |
Self |
err : |
Error propagation and reporting |
Returns : | Line number. |
gint ianjuta_editor_get_offset (IAnjutaEditor *obj, GError **err);
obj : |
|
err : |
|
Returns : |
gboolean ianjuta_editor_get_overwrite (IAnjutaEditor *obj, GError **err);
Obtains editor overwirte mode: TRUE = Override, FALSE = Insert.
obj : |
Self |
err : |
Error propagation and reporting |
Returns : | editor mode. |
IAnjutaIterable* ianjuta_editor_get_position (IAnjutaEditor *obj, GError **err);
obj : |
|
err : |
|
Returns : |
IAnjutaIterable* ianjuta_editor_get_position_from_offset (IAnjutaEditor *obj, gint offset, GError **err);
Creates and returns an iter for editor cells. The iter is
placed at the unicode character position where the given offset
offset
happens to fall. The returned iter is cell (character)
iter and not byte iter, so all iter operations
on it are character (not byte) iteration, including all position
and index references in the iter.
The iter must be unreferrenced by the caller when done. The iter navigates (next/previous) in step of unicode characters (one unicode character == one cell).
Retrun value: a newly created iter of IAnjutaEditorCell placed at the
given offset
position.
obj : |
Self |
offset : |
Character offset position where the iter will be set |
err : |
Error propagation and reporting |
Returns : |
IAnjutaIterable* ianjuta_editor_get_start_position (IAnjutaEditor *obj, GError **err);
Gets the iter positioned at the start of the editor buffer.
Retrun value: Cell iter set to the begining of the editor.
obj : |
Self |
err : |
Error propagation and reporting |
Returns : |
gint ianjuta_editor_get_tabsize (IAnjutaEditor *obj, GError **err);
Returns the tabsize (in spaces) currently used by the editor.
obj : |
Self |
err : |
Error propagation and reporting |
Returns : | tabsize in number of spaces |
gchar* ianjuta_editor_get_text (IAnjutaEditor *obj, IAnjutaIterable *begin, IAnjutaIterable *end, GError **err);
Gets text characters beginning from begin
(including char
pointed by begin
) and ending with end
(excluding character
pointed by end
). The characters returned are utf-8 encoded.
The iterators begin
and end
could be in either order. The returned
text, however, is in right order. If both begin
and end
points
to the same position, NULL is returned.
obj : |
Self |
begin : |
Begining iterator |
end : |
End iterator |
err : |
Error propagation and reporting |
Returns : | A buffer of utf-8 characters. The returned buffer must be freed when no longer required. |
gchar* ianjuta_editor_get_text_all (IAnjutaEditor *obj, GError **err);
Gets all text characters in the editor. The characters returned are utf-8 encoded.
obj : |
Self |
err : |
Error propagation and reporting |
Returns : | A buffer of utf-8 characters containing all text from editor. The returned buffer must be freed when no longer required. |
gboolean ianjuta_editor_get_use_spaces (IAnjutaEditor *obj, GError **err);
Returns if the editor uses spaces for filling up tab characters.
obj : |
Self |
err : |
Error propagation and reporting |
Returns : | TRUE if yes, FALSE if no. |
void ianjuta_editor_goto_end (IAnjutaEditor *obj, GError **err);
Carat is moved to the end of editor and text view is scrolled to bring it in viewable area of the editor.
obj : |
Self |
err : |
Error propagation and reporting |
void ianjuta_editor_goto_line (IAnjutaEditor *obj, gint lineno, GError **err);
Carat is moved to the given lineno
line and text view is scrolled to
bring it in viewable area of the editor.
obj : |
Self |
lineno : |
line number where carat will be moved. |
err : |
Error propagation and reporting |
void ianjuta_editor_goto_position (IAnjutaEditor *obj, IAnjutaIterable *position, GError **err);
Carat is moved to the given position
and text view is scrolled to
bring position
in viewable area of the editor.
obj : |
Self |
position : |
Character position where carat will be moved. |
err : |
Error propagation and reporting |
void ianjuta_editor_goto_start (IAnjutaEditor *obj, GError **err);
Carat is moved to the begining of editor and text view is scrolled to bring it in viewable area of the editor.
obj : |
Self |
err : |
Error propagation and reporting |
void ianjuta_editor_insert (IAnjutaEditor *obj, IAnjutaIterable *position, const gchar *text, gint length, GError **err);
Inserts length
characters from text
buffer at given position
of
editor buffer. If length
is -1, the whole text
is used.
obj : |
Self |
position : |
Character position in editor where insert will take place. |
text : |
Text to append. |
length : |
Length of text to use.
|
err : |
Error propagation and reporting |
void ianjuta_editor_set_auto_indent (IAnjutaEditor *obj, gboolean auto_indent, GError **err);
Sets whether the editor should auto-indent itself. A plugin that does custom auto-indent can set this to false and override the preferences setting
obj : |
Self |
auto_indent : |
TRUE to enable auto-indent, FALSE to disable |
err : |
void ianjuta_editor_set_popup_menu (IAnjutaEditor *obj, GtkWidget *menu, GError **err);
Set Editor popup menu. This is the menu shown in the editor when one right-clicks on it.
obj : |
Self |
menu : |
Popupmenu |
err : |
Error propagation and reporting |
void ianjuta_editor_set_tabsize (IAnjutaEditor *obj, gint tabsize, GError **err);
Sets the tabsize of the editor.
obj : |
Self |
tabsize : |
Tabsize in spaces |
err : |
Error propagation and reporting |
void ianjuta_editor_set_use_spaces (IAnjutaEditor *obj, gboolean use_spaces, GError **err);
obj : |
|
use_spaces : |
|
err : |
void user_function (IAnjutaEditor *ianjutaeditor, GObject *arg1, gboolean arg2, gint arg3, gint arg4, gchar *arg5, gpointer user_data) : Run Last
ianjutaeditor : |
the object which received the signal. |
arg1 : |
|
arg2 : |
|
arg3 : |
|
arg4 : |
|
arg5 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (IAnjutaEditor *ianjutaeditor, GObject *arg1, gchar arg2, gpointer user_data) : Run Last
ianjutaeditor : |
the object which received the signal. |
arg1 : |
|
arg2 : |
|
user_data : |
user data set when the signal handler was connected. |