1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
85
  
86
  
87
  
88
  
89
  
90
  
91
  
92
  
93
  
94
  
95
  
96
  
97
  
98
  
99
  
100
  
101
  
102
  
103
  
104
  
105
  
106
  
107
  
108
  
109
  
110
  
111
  
112
  
113
  
114
  
115
  
116
  
117
  
118
  
119
  
120
  
121
  
122
  
123
  
124
  
125
  
126
  
127
  
128
  
129
  
130
  
131
  
132
  
133
  
134
  
135
  
136
  
137
  
138
  
139
  
140
  
141
  
142
  
143
  
144
  
145
  
146
  
147
  
148
  
149
  
150
  
151
  
152
  
153
  
154
  
155
  
156
  
157
  
158
  
159
  
160
  
161
  
162
  
163
  
164
  
165
  
166
  
167
  
168
  
169
  
170
  
171
  
/* -*- C -*- */ 
require gtksourceview; 
 
class GTK2.SourceView; 
inherit GTK2.TextView; 
 
/* For reference: 
 * 
 * Ref doc for 1.0: 
 *      http://gtksourceview.sourceforge.net/docs/index.html 
 * 
 * Ref doc for 2.0: 
 *      http://www.vala-project.org/doc/docu/gtksourceview-2.0.vapi/index.html 
 * 
 * Ref doc for 3.0: 
 *      http://developer.gnome.org/gtksourceview/stable/ 
 * 
 * The major incompatibility between 1.0 and 2.0 seems to be 
 * that SourceTag and SourceTagTable are gone in 2.0, where 
 * their parents TextTag and TextTagTable are used instead. 
 * 
 * Another incompatibility is that SourceMarker was renamed SourceMark. 
 * 
 * To be backward compatible with code for 1.0, we should 
 * probably add some aliases. 
 */ 
 
//! Properties: 
//! int auto-indent 
//! int highlight-current-line 
//! int insert-spaces-instead-of-tabs 
//! int margin 
//! int show-line-markers 
//! int show-line-numbers 
//! int show-margin 
//! int smart-home-end 
//! int tabs-width 
 
signal redo; 
signal undo; 
 
%{ 
#include "gtksourceview/gtksourceview.h" 
%} 
 
void create(?GTK2.SourceBuffer buffer) 
//! Create a new W(SourceView).  If a buffer isn't specified, an empty default 
//! buffer will be created. 
{ 
  pgtk2_verify_not_inited(); 
  pgtk2_verify_setup(); 
  if (args) { 
    struct object *o1; 
    GtkWidget *gs; 
    get_all_args(NULL,args,"%o",&o1); 
    gs=gtk_source_view_new_with_buffer( 
                        GTK_SOURCE_BUFFER(get_gobject(o1))); 
    THIS->obj=G_OBJECT(gs); 
  } else { 
    GtkWidget *gs; 
    gs=gtk_source_view_new(); 
    THIS->obj=G_OBJECT(gs); 
  } 
  pgtk2_pop_n_elems(args); 
  pgtk2__init_this_object(); 
} 
 
void set_show_line_numbers(int setting); 
//! If true, line numbers will be displayed beside the text. 
 
int get_show_line_numbers(); 
//! Returns whether line numbers are displayed beside the text. 
 
not gtksourceview20; 
void set_show_line_markers(int setting); 
//! If true, line makers will be displayed beside the text. 
endnot; 
 
int get_show_line_numbers(); 
//! Returns whether line markers are displayed beside the text. 
 
not gtksourceview20; 
void set_tabs_width(int width); 
//! Sets the width of tabulation in characters. 
 
int get_tabs_width(); 
//! Returns the width of tabulation in characters. 
endnot; 
 
void set_auto_indent(int setting); 
//! If true, auto indentation of text is enabled. 
 
int get_auto_indent(); 
//! Returns whether auto indentation of text is enabled. 
 
void set_insert_spaces_instead_of_tabs(int setting); 
//! If true, any tabulator character inserted is replaced by a group of space 
//! characters. 
 
int get_insert_spaces_instead_of_tabs(); 
//! Returns whether when inserting a tabulator character it should be replaced 
//! by a group of space characters. 
 
not gtksourceview20; 
void set_show_margin(int setting); 
//! If true, a margin is displayed. 
 
int get_show_margin(); 
//! Returns whether a margin is displayed. 
 
void set_margin(int setting); 
//! Sets the position of the right margin in the given view. 
 
int get_margin(); 
//! Gets the position of the right margin. 
 
void set_marker_pixbuf(string type, GDK2.Pixbuf pixbuf) 
//! Associates a given pixbuf with a given marker type. 
{ 
  pgtk2_verify_inited(); 
  { 
    char *type; 
    struct object *o1; 
    get_all_args(NULL,args,"%s%o",&type,&o1); 
    gtk_source_view_set_marker_pixbuf(GTK_SOURCE_VIEW(THIS->obj),type, 
                        GDK_PIXBUF(get_gobject(o1))); 
  } 
  RETURN_THIS(); 
} 
 
GDK2.Pixbuf get_marker_pixbuf(string type) 
//! Gets the pixbuf which is associated with the given type. 
{ 
  pgtk2_verify_inited(); 
  { 
    char *type; 
    GdkPixbuf *gp; 
    get_all_args(NULL,args,"%s",&type); 
    gp=gtk_source_view_get_marker_pixbuf(GTK_SOURCE_VIEW(THIS->obj),type); 
    pgtk2_pop_n_elems(args); 
    if (gp) 
      push_gobject(gp); 
    else 
      push_int(0); 
  } 
} 
endnot; 
 
void set_smart_home_end(int setting); 
//! If true, HOME and END keys will move to the first/last non-space character 
//! of the line before moving to the start/end. 
 
int get_smart_home_end(); 
//! Returns whether HOME and END keys will move to the first/last non-space 
//! character of the line before moving to the start/end. 
 
not gtksourceview20; 
/* from GtkSourceStyleScheme */ 
GTK2.SourceStyleScheme get_default() 
//! Gets the default style scheme. 
{ 
  pgtk2_verify_inited(); 
  pgtk2_pop_n_elems(args); 
  { 
    GtkSourceStyleScheme *gss; 
    gss=gtk_source_style_scheme_get_default(); 
    push_gobjectclass(gss,pgtk2_source_style_scheme_program); 
  } 
} 
endnot;