GtkSourceView

GtkSourceView —

Synopsis


#include <gtksourceview/gtksourceview.h>


struct      GtkSourceView;
GtkWidget*  gtk_source_view_new             (void);
GtkWidget*  gtk_source_view_new_with_buffer (GtkSourceBuffer *buffer);
void        gtk_source_view_set_show_line_numbers
                                            (GtkSourceView *view,
                                             gboolean show);
gboolean    gtk_source_view_get_show_line_numbers
                                            (GtkSourceView *view);
void        gtk_source_view_set_show_line_markers
                                            (GtkSourceView *view,
                                             gboolean show);
gboolean    gtk_source_view_get_show_line_markers
                                            (GtkSourceView *view);
void        gtk_source_view_set_tabs_width  (GtkSourceView *view,
                                             guint width);
guint       gtk_source_view_get_tabs_width  (GtkSourceView *view);
void        gtk_source_view_set_auto_indent (GtkSourceView *view,
                                             gboolean enable);
gboolean    gtk_source_view_get_auto_indent (GtkSourceView *view);
void        gtk_source_view_set_insert_spaces_instead_of_tabs
                                            (GtkSourceView *view,
                                             gboolean enable);
gboolean    gtk_source_view_get_insert_spaces_instead_of_tabs
                                            (GtkSourceView *view);
void        gtk_source_view_set_show_margin (GtkSourceView *view,
                                             gboolean show);
gboolean    gtk_source_view_get_show_margin (GtkSourceView *view);
void        gtk_source_view_set_margin      (GtkSourceView *view,
                                             guint margin);
guint       gtk_source_view_get_margin      (GtkSourceView *view);
void        gtk_source_view_set_marker_pixbuf
                                            (GtkSourceView *view,
                                             const gchar *marker_type,
                                             GdkPixbuf *pixbuf);
GdkPixbuf*  gtk_source_view_get_marker_pixbuf
                                            (GtkSourceView *view,
                                             const gchar *marker_type);
void        gtk_source_view_set_smart_home_end
                                            (GtkSourceView *view,
                                             gboolean enable);
gboolean    gtk_source_view_get_smart_home_end
                                            (GtkSourceView *view);

Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----GtkContainer
                     +----GtkTextView
                           +----GtkSourceView

Implemented Interfaces

GtkSourceView implements AtkImplementorIface.

Properties


  "auto-indent"          gboolean             : Read / Write
  "insert-spaces-instead-of-tabs" gboolean             : Read / Write
  "margin"               guint                : Read / Write
  "show-line-markers"    gboolean             : Read / Write
  "show-line-numbers"    gboolean             : Read / Write
  "show-margin"          gboolean             : Read / Write
  "smart-home-end"       gboolean             : Read / Write
  "tabs-width"           guint                : Read / Write

Signal Prototypes


"redo"      void        user_function      (GtkSourceView *sourceview,
                                            gpointer user_data);
"undo"      void        user_function      (GtkSourceView *sourceview,
                                            gpointer user_data);

Description

Details

struct GtkSourceView

struct GtkSourceView;


gtk_source_view_new ()

GtkWidget*  gtk_source_view_new             (void);

Creates a new GtkSourceView. An empty default buffer will be created for you. If you want to specify your own buffer, consider gtk_source_view_new_with_buffer().

Returns : a new GtkSourceView

gtk_source_view_new_with_buffer ()

GtkWidget*  gtk_source_view_new_with_buffer (GtkSourceBuffer *buffer);

Creates a new GtkSourceView widget displaying the buffer buffer. One buffer can be shared among many widgets.

buffer : a GtkSourceBuffer
Returns : a new GtkTextView.

gtk_source_view_set_show_line_numbers ()

void        gtk_source_view_set_show_line_numbers
                                            (GtkSourceView *view,
                                             gboolean show);

If TRUE line numbers will be displayed beside the text.

view : a GtkSourceView
show : whether line numbers should be displayed

gtk_source_view_get_show_line_numbers ()

gboolean    gtk_source_view_get_show_line_numbers
                                            (GtkSourceView *view);

Returns whether line numbers are displayed beside the text.

view : a GtkSourceView
Returns : TRUE if the line numbers are displayed.

gtk_source_view_set_show_line_markers ()

void        gtk_source_view_set_show_line_markers
                                            (GtkSourceView *view,
                                             gboolean show);

If TRUE line markers will be displayed beside the text.

view : a GtkSourceView
show : whether line markers should be displayed

gtk_source_view_get_show_line_markers ()

gboolean    gtk_source_view_get_show_line_markers
                                            (GtkSourceView *view);

Returns whether line markers are displayed beside the text.

view : a GtkSourceView
Returns : TRUE if the line markers are displayed.

gtk_source_view_set_tabs_width ()

void        gtk_source_view_set_tabs_width  (GtkSourceView *view,
                                             guint width);

Sets the width of tabulation in characters.

view : a GtkSourceView
width : width of tab in characters

gtk_source_view_get_tabs_width ()

guint       gtk_source_view_get_tabs_width  (GtkSourceView *view);

Returns the width of tabulation in characters.

view : a GtkSourceView
Returns : width of tab.

gtk_source_view_set_auto_indent ()

void        gtk_source_view_set_auto_indent (GtkSourceView *view,
                                             gboolean enable);

If TRUE auto indentation of text is enabled.

view : a GtkSourceView
enable : whether to enable auto indentation

gtk_source_view_get_auto_indent ()

gboolean    gtk_source_view_get_auto_indent (GtkSourceView *view);

Returns whether auto indentation of text is enabled.

view : a GtkSourceView
Returns : TRUE if auto indentation is enabled.

gtk_source_view_set_insert_spaces_instead_of_tabs ()

void        gtk_source_view_set_insert_spaces_instead_of_tabs
                                            (GtkSourceView *view,
                                             gboolean enable);

If TRUE any tabulator character inserted is replaced by a group of space characters.

view : a GtkSourceView
enable : whether to insert spaces instead of tabs

gtk_source_view_get_insert_spaces_instead_of_tabs ()

gboolean    gtk_source_view_get_insert_spaces_instead_of_tabs
                                            (GtkSourceView *view);

Returns whether when inserting a tabulator character it should be replaced by a group of space characters.

view : a GtkSourceView
Returns : TRUE if spaces are inserted instead of tabs.

gtk_source_view_set_show_margin ()

void        gtk_source_view_set_show_margin (GtkSourceView *view,
                                             gboolean show);

If TRUE a margin is displayed

view : a GtkSourceView
show : whether to show a margin

gtk_source_view_get_show_margin ()

gboolean    gtk_source_view_get_show_margin (GtkSourceView *view);

Returns whether a margin is displayed

view : a GtkSourceView
Returns : TRUE if the margin is showed

gtk_source_view_set_margin ()

void        gtk_source_view_set_margin      (GtkSourceView *view,
                                             guint margin);

view : a GtkSourceView
margin :

gtk_source_view_get_margin ()

guint       gtk_source_view_get_margin      (GtkSourceView *view);

view : a GtkSourceView
Returns :

gtk_source_view_set_marker_pixbuf ()

void        gtk_source_view_set_marker_pixbuf
                                            (GtkSourceView *view,
                                             const gchar *marker_type,
                                             GdkPixbuf *pixbuf);

view : a GtkSourceView
marker_type :
pixbuf :

gtk_source_view_get_marker_pixbuf ()

GdkPixbuf*  gtk_source_view_get_marker_pixbuf
                                            (GtkSourceView *view,
                                             const gchar *marker_type);

view : a GtkSourceView
marker_type :
Returns :

gtk_source_view_set_smart_home_end ()

void        gtk_source_view_set_smart_home_end
                                            (GtkSourceView *view,
                                             gboolean enable);

If TRUE HOME and END keys will move to the first/last non-space character of the line before moving to the start/end.

view : a GtkSourceView
enable : whether to enable smart behavior for HOME and END keys

gtk_source_view_get_smart_home_end ()

gboolean    gtk_source_view_get_smart_home_end
                                            (GtkSourceView *view);

Returns whether HOME and END keys will move to the first/last non-space character of the line before moving to the start/end.

view : a GtkSourceView
Returns : TRUE if smart behavior for HOME and END keys is enabled

Properties

"auto-indent" (gboolean : Read / Write)

Whether to enable auto indentation.

"insert-spaces-instead-of-tabs" (gboolean : Read / Write)

Whether to insert spaces instead of tabs.

"margin" (guint : Read / Write)

Position of the right margin.

"show-line-markers" (gboolean : Read / Write)

Whether to display line marker pixbufs.

"show-line-numbers" (gboolean : Read / Write)

Whether to display line numbers.

"show-margin" (gboolean : Read / Write)

Whether to display the right margin.

"smart-home-end" (gboolean : Read / Write)

HOME and END keys move to first/last characters on line first before going to the start/end of the line.

"tabs-width" (guint : Read / Write)

Tabs Width.

Signals

The "redo" signal

void        user_function                  (GtkSourceView *sourceview,
                                            gpointer user_data);

sourceview :the object which received the signal.
user_data :user data set when the signal handler was connected.

The "undo" signal

void        user_function                  (GtkSourceView *sourceview,
                                            gpointer user_data);

sourceview :the object which received the signal.
user_data :user data set when the signal handler was connected.