CodeSlayerSourceView

CodeSlayerSourceView — The view to edit a document.

Synopsis

#include <codeslayer/codeslayer-sourceview.h>

struct              CodeSlayerSourceView;
#define             CODESLAYER_SOURCE_VIEW_UNTITLED
GtkWidget *         codeslayer_source_view_new          (GtkWindow *window,
                                                         CodeSlayerDocument *document,
                                                         CodeSlayerProfile *profile);
CodeSlayerDocument * codeslayer_source_view_get_document
                                                        (CodeSlayerSourceView *source_view);
GTimeVal *          codeslayer_source_view_get_modification_time
                                                        (CodeSlayerSourceView *source_view);
void                codeslayer_source_view_set_modification_time
                                                        (CodeSlayerSourceView *source_view,
                                                         GTimeVal *modification_time);
void                codeslayer_source_view_add_completion_provider
                                                        (CodeSlayerSourceView *source_view,
                                                         CodeSlayerCompletionProvider *provider);
void                codeslayer_source_view_set_text     (CodeSlayerSourceView *source_view,
                                                         gchar *text);
gboolean            codeslayer_source_view_scroll_to_line
                                                        (CodeSlayerSourceView *source_view,
                                                         gint line_number);
void                codeslayer_source_view_sync_registry
                                                        (CodeSlayerSourceView *source_view);

Object Hierarchy

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

Implemented Interfaces

CodeSlayerSourceView 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 CodeSlayerSourceView

struct CodeSlayerSourceView;

CODESLAYER_SOURCE_VIEW_UNTITLED

#define CODESLAYER_SOURCE_VIEW_UNTITLED "Document"

codeslayer_source_view_new ()

GtkWidget *         codeslayer_source_view_new          (GtkWindow *window,
                                                         CodeSlayerDocument *document,
                                                         CodeSlayerProfile *profile);

Creates a new CodeSlayerSourceView.

window :

a GtkWindow.

document :

the CodeSlayerDocument for this source_view.

profile :

a CodeSlayerProfile.

Returns :

a new CodeSlayerSourceView.

codeslayer_source_view_get_document ()

CodeSlayerDocument * codeslayer_source_view_get_document
                                                        (CodeSlayerSourceView *source_view);

source_view :

a CodeSlayerSourceView

Returns :

the CodeSlayerDocument that represents this source view.

codeslayer_source_view_get_modification_time ()

GTimeVal *          codeslayer_source_view_get_modification_time
                                                        (CodeSlayerSourceView *source_view);

source_view :

a CodeSlayerSourceView

Returns :

the modification time of the underlying file

codeslayer_source_view_set_modification_time ()

void                codeslayer_source_view_set_modification_time
                                                        (CodeSlayerSourceView *source_view,
                                                         GTimeVal *modification_time);

The modification time of the underlying file

source_view :

a CodeSlayerSourceView

modification_time :

a GTimeVal

codeslayer_source_view_add_completion_provider ()

void                codeslayer_source_view_add_completion_provider
                                                        (CodeSlayerSourceView *source_view,
                                                         CodeSlayerCompletionProvider *provider);

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

source_view :

a CodeSlayerSourceView

provider :

a CodeSlayerCompletionProvider.

codeslayer_source_view_set_text ()

void                codeslayer_source_view_set_text     (CodeSlayerSourceView *source_view,
                                                         gchar *text);

Add the text to the source view, while blocking the cursor position signal.

source_view :

a CodeSlayerSourceView

text :

the text to set.

codeslayer_source_view_scroll_to_line ()

gboolean            codeslayer_source_view_scroll_to_line
                                                        (CodeSlayerSourceView *source_view,
                                                         gint line_number);

source_view :

a CodeSlayerSourceView.

line_number :

the line to scroll to within the source view.

codeslayer_source_view_sync_registry ()

void                codeslayer_source_view_sync_registry
                                                        (CodeSlayerSourceView *source_view);

Apply the preferences to the current source view.

source_view :

a CodeSlayerSourceView.

Signal Details

The "completion" signal

void                user_function                      (CodeSlayerSourceView *source_view,
                                                        gpointer              user_data)        : No Hooks

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

source_view :

the source view that received the signal

user_data :

user data set when the signal handler was connected.

The "copy-lines" signal

void                user_function                      (CodeSlayerSourceView *source_view,
                                                        gpointer              user_data)        : No Hooks

The ::copy_lines signal is a request to copy the lines of the selected text.

source_view :

the source view that received the signal

user_data :

user data set when the signal handler was connected.

The "to-lowercase" signal

void                user_function                      (CodeSlayerSourceView *codeslayersourceview,
                                                        gpointer              user_data)                 : No Hooks

The "to-uppercase" signal

void                user_function                      (CodeSlayerSourceView *source_view,
                                                        gpointer              user_data)        : No Hooks

The ::uppercase signal is a request to lowercase the selected text.

source_view :

the source view that received the signal

user_data :

user data set when the signal handler was connected.