CodeSlayerEditor

CodeSlayerEditor — The view to edit a document.

Synopsis

#include <codeslayer/codeslayer-editor.h>

struct              CodeSlayerEditor;
GtkWidget *         codeslayer_editor_new               (GtkWindow *window,
                                                         CodeSlayerDocument *document,
                                                         CodeSlayerPreferences *preferences,
                                                         CodeSlayerSettings *settings);
void                codeslayer_editor_scroll_to_line    (CodeSlayerEditor *editor,
                                                         gint line_number);
void                codeslayer_editor_sync_settings_preferences
                                                        (CodeSlayerEditor *editor);
CodeSlayerDocument * codeslayer_editor_get_document     (CodeSlayerEditor *editor);
void                codeslayer_editor_add_completion_provider
                                                        (CodeSlayerEditor *editor,
                                                         CodeSlayerCompletionProvider *provider);
const gchar *       codeslayer_editor_get_file_path     (CodeSlayerEditor *editor);
GTimeVal *          codeslayer_editor_get_modification_time
                                                        (CodeSlayerEditor *editor);
void                codeslayer_editor_set_modification_time
                                                        (CodeSlayerEditor *editor,
                                                         GTimeVal *modification_time);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkWidget
               +----GtkContainer
                     +----GtkTextView
                           +----GtkSourceView
                                 +----CodeSlayerEditor

Implemented Interfaces

CodeSlayerEditor implements AtkImplementorIface, GtkBuildable and GtkScrollable.

Signals

  "completion"                                     : No Hooks
  "copy-lines"                                     : No Hooks
  "to-lowercase"                                   : No Hooks
  "to-uppercase"                                   : No Hooks

Description

Extends the GtkSourceView to further enhance how a document can be edited.

Details

struct CodeSlayerEditor

struct CodeSlayerEditor;

codeslayer_editor_new ()

GtkWidget *         codeslayer_editor_new               (GtkWindow *window,
                                                         CodeSlayerDocument *document,
                                                         CodeSlayerPreferences *preferences,
                                                         CodeSlayerSettings *settings);

Creates a new CodeSlayerEditor.

window :

a GtkWindow.

document :

the CodeSlayerDocument for this editor.

preferences :

a CodeSlayerPreferences.

settings :

a CodeSlayerSettings.

Returns :

a new CodeSlayerEditor.

codeslayer_editor_scroll_to_line ()

void                codeslayer_editor_scroll_to_line    (CodeSlayerEditor *editor,
                                                         gint line_number);

editor :

a CodeSlayerEditor.

line_number :

the line to scroll to within the editor.

codeslayer_editor_sync_settings_preferences ()

void                codeslayer_editor_sync_settings_preferences
                                                        (CodeSlayerEditor *editor);

codeslayer_editor_get_document ()

CodeSlayerDocument * codeslayer_editor_get_document     (CodeSlayerEditor *editor);

editor :

a CodeSlayerEditor

Returns :

the CodeSlayerDocument that represents this editor.

codeslayer_editor_add_completion_provider ()

void                codeslayer_editor_add_completion_provider
                                                        (CodeSlayerEditor *editor,
                                                         CodeSlayerCompletionProvider *provider);

Add the provider to find possible matches for the completion window.

editor :

a CodeSlayerEditor

provider :

a CodeSlayerCompletionProvider.

codeslayer_editor_get_file_path ()

const gchar *       codeslayer_editor_get_file_path     (CodeSlayerEditor *editor);

The file path for the editors document.

editor :

a CodeSlayerEditor

Returns :

a string that is owned by the editor and should not be freed.

codeslayer_editor_get_modification_time ()

GTimeVal *          codeslayer_editor_get_modification_time
                                                        (CodeSlayerEditor *editor);

editor :

a CodeSlayerEditor

Returns :

the modification time of the underlying file

codeslayer_editor_set_modification_time ()

void                codeslayer_editor_set_modification_time
                                                        (CodeSlayerEditor *editor,
                                                         GTimeVal *modification_time);

The modification time of the underlying file

editor :

a CodeSlayerEditor

modification_time :

a GTimeVal

Signal Details

The "completion" signal

void                user_function                      (CodeSlayerEditor *editor,
                                                        gpointer          user_data)      : No Hooks

The ::completion signal enables the (Ctrl + Space) keystroke to invoke the completion widget.

editor :

the editor that received the signal

user_data :

user data set when the signal handler was connected.

The "copy-lines" signal

void                user_function                      (CodeSlayerEditor *editor,
                                                        gpointer          user_data)      : No Hooks

The ::copy-lines signal enables the (Ctrl + Shift + Down) keystroke to copy the currently selected lines.

editor :

the editor that received the signal

user_data :

user data set when the signal handler was connected.

The "to-lowercase" signal

void                user_function                      (CodeSlayerEditor *editor,
                                                        gpointer          user_data)      : No Hooks

The ::to-lowercase signal enables the (Ctrl + L) keystroke to lowercase the selected text.

editor :

the editor that received the signal

user_data :

user data set when the signal handler was connected.

The "to-uppercase" signal

void                user_function                      (CodeSlayerEditor *editor,
                                                        gpointer          user_data)      : No Hooks

The ::to-uppercase signal enables the (Ctrl + U) keystroke to uppercase the selected text.

editor :

the editor that received the signal

user_data :

user data set when the signal handler was connected.