gtksourceview3 2.2.5 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -4
- data/lib/gtksourceview3/loader.rb +46 -0
- data/lib/gtksourceview3/mark-attributes.rb +29 -0
- data/lib/gtksourceview3.rb +47 -12
- data/test/run-test.rb +2 -0
- data/test/{test_mark_attributes.rb → test-mark-attributes.rb} +1 -1
- data/test/{test_source_language_manager.rb → test-source-language-manager.rb} +6 -6
- data/test/{test_source_view.rb → test-source-view.rb} +1 -1
- metadata +25 -34
- data/ext/gtksourceview3/depend +0 -6
- data/ext/gtksourceview3/extconf.rb +0 -67
- data/ext/gtksourceview3/gtksourceview3.def +0 -2
- data/ext/gtksourceview3/rbgtksource.c +0 -53
- data/ext/gtksourceview3/rbgtksourcebuffer.c +0 -318
- data/ext/gtksourceview3/rbgtksourcegutter.c +0 -82
- data/ext/gtksourceview3/rbgtksourcegutterrenderer.c +0 -143
- data/ext/gtksourceview3/rbgtksourcegutterrendererpixbuf.c +0 -42
- data/ext/gtksourceview3/rbgtksourcegutterrenderertext.c +0 -40
- data/ext/gtksourceview3/rbgtksourcelanguage.c +0 -124
- data/ext/gtksourceview3/rbgtksourcelanguagemanager.c +0 -114
- data/ext/gtksourceview3/rbgtksourcemark.c +0 -85
- data/ext/gtksourceview3/rbgtksourcemarkattributes.c +0 -77
- data/ext/gtksourceview3/rbgtksourceprintcompositor.c +0 -171
- data/ext/gtksourceview3/rbgtksourcestyle.c +0 -42
- data/ext/gtksourceview3/rbgtksourcestylescheme.c +0 -72
- data/ext/gtksourceview3/rbgtksourcestyleschememanager.c +0 -140
- data/ext/gtksourceview3/rbgtksourceundomanager.c +0 -83
- data/ext/gtksourceview3/rbgtksourceview.c +0 -94
- data/ext/gtksourceview3/rbgtksourceview3conversions.h +0 -50
- data/ext/gtksourceview3/rbgtksourceview3private.h +0 -53
- data/extconf.rb +0 -49
- data/sample/sourcelanguagemanager.rb +0 -21
- data/sample/test.rb +0 -32
- /data/test/{test_source_gutter_renderer.rb → test-source-gutter-renderer.rb} +0 -0
@@ -1,140 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2004 Ruby-GNOME2 Project Team
|
5
|
-
* Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh
|
6
|
-
*
|
7
|
-
* This library is free software; you can redistribute it and/or
|
8
|
-
* modify it under the terms of the GNU Lesser General Public
|
9
|
-
* License as published by the Free Software Foundation; either
|
10
|
-
* version 2.1 of the License, or (at your option) any later version.
|
11
|
-
*
|
12
|
-
* This library is distributed in the hope that it will be useful,
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
-
* Lesser General Public License for more details.
|
16
|
-
*
|
17
|
-
* You should have received a copy of the GNU Lesser General Public
|
18
|
-
* License along with this library; if not, write to the Free Software
|
19
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
|
-
* MA 02110-1301 USA
|
21
|
-
*/
|
22
|
-
|
23
|
-
#include "rbgtksourceview3private.h"
|
24
|
-
|
25
|
-
/* Class: Gtk::SourceStyleSchemeManager
|
26
|
-
* A class to manage source style scheme.
|
27
|
-
*/
|
28
|
-
|
29
|
-
#define RG_TARGET_NAMESPACE cStyleSchemeManager
|
30
|
-
#define _SELF(self) (RVAL2GTKSOURCESTYLESCHEMEMANAGER(self))
|
31
|
-
|
32
|
-
static VALUE rb_mGtkSource;
|
33
|
-
|
34
|
-
/* Class method: new
|
35
|
-
* Returns: a newly created Gtk::SourceStyleSchemeManager object.
|
36
|
-
*/
|
37
|
-
static VALUE
|
38
|
-
rg_initialize(VALUE self)
|
39
|
-
{
|
40
|
-
G_INITIALIZE (self, gtk_source_style_scheme_manager_new ());
|
41
|
-
return Qnil;
|
42
|
-
}
|
43
|
-
|
44
|
-
/* Class method: default
|
45
|
-
*
|
46
|
-
* Gets the default style scheme manager.
|
47
|
-
*
|
48
|
-
* Returns: a Gtk::SourceStyleSchemeManager
|
49
|
-
*/
|
50
|
-
static VALUE
|
51
|
-
rg_s_default(G_GNUC_UNUSED VALUE self)
|
52
|
-
{
|
53
|
-
GtkSourceStyleSchemeManager* sssm = gtk_source_style_scheme_manager_get_default();
|
54
|
-
GType gtype = G_TYPE_FROM_INSTANCE(sssm);
|
55
|
-
|
56
|
-
gchar *gtypename = (gchar *) g_type_name (gtype);
|
57
|
-
if (strncmp (gtypename, "GtkSource", 9) == 0)
|
58
|
-
gtypename += 9;
|
59
|
-
if (!rb_const_defined_at (rb_mGtkSource, rb_intern (gtypename)))
|
60
|
-
G_DEF_CLASS (gtype, gtypename, rb_mGtkSource);
|
61
|
-
|
62
|
-
return GOBJ2RVAL(sssm);
|
63
|
-
}
|
64
|
-
|
65
|
-
/* Method: append_search_path(path)
|
66
|
-
* path: additional style scheme file directory path (string)
|
67
|
-
*
|
68
|
-
* Appends the style scheme files directory for the given style scheme manager.
|
69
|
-
*
|
70
|
-
* Returns: self.
|
71
|
-
*/
|
72
|
-
static VALUE
|
73
|
-
rg_append_search_path(VALUE self, VALUE path)
|
74
|
-
{
|
75
|
-
gtk_source_style_scheme_manager_append_search_path (_SELF (self), RVAL2CSTR(path));
|
76
|
-
return self;
|
77
|
-
}
|
78
|
-
|
79
|
-
/* Method: prepend_search_path(path)
|
80
|
-
* path: additional style scheme file directory path (string)
|
81
|
-
*
|
82
|
-
* Prepend the style scheme files directory for the given style scheme manager.
|
83
|
-
*
|
84
|
-
* Returns: self.
|
85
|
-
*/
|
86
|
-
static VALUE
|
87
|
-
rg_prepend_search_path(VALUE self, VALUE path)
|
88
|
-
{
|
89
|
-
gtk_source_style_scheme_manager_prepend_search_path (_SELF (self), RVAL2CSTR(path));
|
90
|
-
return self;
|
91
|
-
}
|
92
|
-
|
93
|
-
/*
|
94
|
-
* Method: scheme(scheme_id)
|
95
|
-
* scheme_id: a style scheme id (as a string).
|
96
|
-
*
|
97
|
-
* Gets the Gtk::SourceStyleScheme which is associated with the given id
|
98
|
-
* in the style scheme manager.
|
99
|
-
*
|
100
|
-
* Returns: a Gtk::SourceStyleScheme, or nil if there is no style scheme
|
101
|
-
* associated with the given id.
|
102
|
-
*/
|
103
|
-
static VALUE
|
104
|
-
rg_get_scheme(VALUE self, VALUE scheme_id)
|
105
|
-
{
|
106
|
-
return
|
107
|
-
GOBJ2RVAL (gtk_source_style_scheme_manager_get_scheme
|
108
|
-
(_SELF (self), RVAL2CSTR (scheme_id)));
|
109
|
-
}
|
110
|
-
|
111
|
-
/*
|
112
|
-
* Method: force_rescan
|
113
|
-
*
|
114
|
-
* Forces all style schemes to be reloaded the next time the
|
115
|
-
* Gtk::SourceStyleSchemeManager is accessed.
|
116
|
-
*
|
117
|
-
* Returns: self.
|
118
|
-
*/
|
119
|
-
static VALUE
|
120
|
-
rg_force_rescan(VALUE self)
|
121
|
-
{
|
122
|
-
gtk_source_style_scheme_manager_force_rescan(_SELF (self));
|
123
|
-
return self;
|
124
|
-
}
|
125
|
-
|
126
|
-
void
|
127
|
-
Init_gtksource_styleschememanager (VALUE mGtkSource)
|
128
|
-
{
|
129
|
-
rb_mGtkSource = mGtkSource;
|
130
|
-
VALUE RG_TARGET_NAMESPACE =
|
131
|
-
G_DEF_CLASS (GTK_SOURCE_TYPE_STYLE_SCHEME_MANAGER,
|
132
|
-
"StyleSchemeManager", mGtkSource);
|
133
|
-
|
134
|
-
RG_DEF_METHOD(initialize, 0);
|
135
|
-
RG_DEF_METHOD(append_search_path, 1);
|
136
|
-
RG_DEF_METHOD(prepend_search_path, 1);
|
137
|
-
RG_DEF_METHOD(get_scheme, 1);
|
138
|
-
RG_DEF_METHOD(force_rescan, 0);
|
139
|
-
RG_DEF_SMETHOD(default, 0);
|
140
|
-
}
|
@@ -1,83 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
*
|
5
|
-
* This library is free software; you can redistribute it and/or
|
6
|
-
* modify it under the terms of the GNU Lesser General Public
|
7
|
-
* License as published by the Free Software Foundation; either
|
8
|
-
* version 2.1 of the License, or (at your option) any later version.
|
9
|
-
*
|
10
|
-
* This library is distributed in the hope that it will be useful,
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
-
* Lesser General Public License for more details.
|
14
|
-
*
|
15
|
-
* You should have received a copy of the GNU Lesser General Public
|
16
|
-
* License along with this library; if not, write to the Free Software
|
17
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
-
* MA 02110-1301 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#include "rbgtksourceview3private.h"
|
22
|
-
|
23
|
-
#define RG_TARGET_NAMESPACE mUndoManager
|
24
|
-
#define _SELF(self) (RVAL2GTKSOURCEUNDOMANAGER(self))
|
25
|
-
|
26
|
-
static VALUE
|
27
|
-
rg_end_not_undoable_action(VALUE self)
|
28
|
-
{
|
29
|
-
gtk_source_undo_manager_end_not_undoable_action(_SELF(self));
|
30
|
-
|
31
|
-
return self;
|
32
|
-
}
|
33
|
-
|
34
|
-
static VALUE
|
35
|
-
rg_begin_not_undoable_action(VALUE self)
|
36
|
-
{
|
37
|
-
gtk_source_undo_manager_begin_not_undoable_action(_SELF(self));
|
38
|
-
if (rb_block_given_p())
|
39
|
-
rb_ensure(rb_yield, self, rg_end_not_undoable_action, self);
|
40
|
-
|
41
|
-
return self;
|
42
|
-
}
|
43
|
-
|
44
|
-
static VALUE
|
45
|
-
rg_can_redo_p(VALUE self)
|
46
|
-
{
|
47
|
-
return CBOOL2RVAL(gtk_source_undo_manager_can_redo(_SELF(self)));
|
48
|
-
}
|
49
|
-
|
50
|
-
static VALUE
|
51
|
-
rg_can_undo_p(VALUE self)
|
52
|
-
{
|
53
|
-
return CBOOL2RVAL(gtk_source_undo_manager_can_undo(_SELF(self)));
|
54
|
-
}
|
55
|
-
|
56
|
-
static VALUE
|
57
|
-
rg_redo(VALUE self)
|
58
|
-
{
|
59
|
-
gtk_source_undo_manager_redo(_SELF(self));
|
60
|
-
|
61
|
-
return self;
|
62
|
-
}
|
63
|
-
|
64
|
-
static VALUE
|
65
|
-
rg_undo(VALUE self)
|
66
|
-
{
|
67
|
-
gtk_source_undo_manager_undo(_SELF(self));
|
68
|
-
|
69
|
-
return self;
|
70
|
-
}
|
71
|
-
|
72
|
-
void
|
73
|
-
Init_gtksource_undomanager(VALUE mGtkSource)
|
74
|
-
{
|
75
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_INTERFACE(GTK_SOURCE_TYPE_UNDO_MANAGER, "UndoManager", mGtkSource);
|
76
|
-
|
77
|
-
RG_DEF_METHOD(begin_not_undoable_action, 0);
|
78
|
-
RG_DEF_METHOD_P(can_redo, 0);
|
79
|
-
RG_DEF_METHOD_P(can_undo, 0);
|
80
|
-
RG_DEF_METHOD(end_not_undoable_action, 0);
|
81
|
-
RG_DEF_METHOD(redo, 0);
|
82
|
-
RG_DEF_METHOD(undo, 0);
|
83
|
-
}
|
@@ -1,94 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2004,2005 Ruby-GNOME2 Project Team
|
5
|
-
* Copyright (C) 2003 Geoff Youngs, based on gtktextview.c by Masao Mutoh
|
6
|
-
*
|
7
|
-
* This library is free software; you can redistribute it and/or
|
8
|
-
* modify it under the terms of the GNU Lesser General Public
|
9
|
-
* License as published by the Free Software Foundation; either
|
10
|
-
* version 2.1 of the License, or (at your option) any later version.
|
11
|
-
*
|
12
|
-
* This library is distributed in the hope that it will be useful,
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
-
* Lesser General Public License for more details.
|
16
|
-
*
|
17
|
-
* You should have received a copy of the GNU Lesser General Public
|
18
|
-
* License along with this library; if not, write to the Free Software
|
19
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
|
-
* MA 02110-1301 USA
|
21
|
-
*/
|
22
|
-
|
23
|
-
#include "rbgtksourceview3private.h"
|
24
|
-
|
25
|
-
/* Class: Gtk::SourceView
|
26
|
-
* A view on a source.
|
27
|
-
*/
|
28
|
-
|
29
|
-
#define RG_TARGET_NAMESPACE cView
|
30
|
-
#define _SELF(self) (RVAL2GTKSOURCEVIEW(self))
|
31
|
-
|
32
|
-
/*
|
33
|
-
* Class method: new(buffer=nil)
|
34
|
-
* buffer: a Gtk::SourceBuffer object.
|
35
|
-
*
|
36
|
-
* Creates a new Gtk::SourceView. If buffer is not provided or nil, an empty
|
37
|
-
* buffer will be created for you. Note that one buffer can be shared among
|
38
|
-
* many widgets.
|
39
|
-
*
|
40
|
-
* Returns: a newly created Gtk::SourceView object.
|
41
|
-
*/
|
42
|
-
static VALUE
|
43
|
-
rg_initialize(int argc, VALUE *argv, VALUE self)
|
44
|
-
{
|
45
|
-
VALUE buffer;
|
46
|
-
GtkWidget *widget;
|
47
|
-
|
48
|
-
rb_scan_args(argc, argv, "01", &buffer);
|
49
|
-
|
50
|
-
if (NIL_P(buffer))
|
51
|
-
widget = gtk_source_view_new();
|
52
|
-
else
|
53
|
-
widget = gtk_source_view_new_with_buffer(RVAL2GTKSOURCEBUFFER(buffer));
|
54
|
-
|
55
|
-
RBGTK_INITIALIZE(self, widget);
|
56
|
-
return self;
|
57
|
-
}
|
58
|
-
|
59
|
-
static VALUE
|
60
|
-
rg_get_gutter(VALUE self, VALUE window_type)
|
61
|
-
{
|
62
|
-
VALUE gutter;
|
63
|
-
|
64
|
-
gutter = GOBJ2RVAL(gtk_source_view_get_gutter(_SELF(self),
|
65
|
-
RVAL2GTKTEXTWINDOWTYPE(window_type)));
|
66
|
-
G_CHILD_ADD(self, gutter);
|
67
|
-
|
68
|
-
return gutter;
|
69
|
-
}
|
70
|
-
|
71
|
-
static VALUE
|
72
|
-
rg_set_mark_attributes(VALUE self, VALUE category, VALUE attributes, VALUE priority)
|
73
|
-
{
|
74
|
-
gtk_source_view_set_mark_attributes(_SELF(self),
|
75
|
-
RVAL2CSTR_ACCEPT_SYMBOL(category),
|
76
|
-
RVAL2GTKSOURCEMARKATTRIBUTES(attributes),
|
77
|
-
NUM2INT(priority));
|
78
|
-
|
79
|
-
return self;
|
80
|
-
}
|
81
|
-
|
82
|
-
void
|
83
|
-
Init_gtksource_view (VALUE mGtkSource)
|
84
|
-
{
|
85
|
-
VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS (GTK_SOURCE_TYPE_VIEW, "View", mGtkSource);
|
86
|
-
G_DEF_CLASS(GTK_SOURCE_TYPE_VIEW_GUTTER_POSITION, "GutterPosition", RG_TARGET_NAMESPACE);
|
87
|
-
|
88
|
-
RG_DEF_METHOD(initialize, -1);
|
89
|
-
RG_DEF_METHOD(get_gutter, 1);
|
90
|
-
RG_DEF_METHOD(set_mark_attributes, 3);
|
91
|
-
|
92
|
-
G_DEF_CLASS(GTK_SOURCE_TYPE_SMART_HOME_END_TYPE, "SmartHomeEndType", RG_TARGET_NAMESPACE);
|
93
|
-
G_DEF_CLASS(GTK_SOURCE_TYPE_DRAW_SPACES_FLAGS, "DrawSpacesFlags", RG_TARGET_NAMESPACE);
|
94
|
-
}
|
@@ -1,50 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
*
|
5
|
-
* This library is free software; you can redistribute it and/or
|
6
|
-
* modify it under the terms of the GNU Lesser General Public
|
7
|
-
* License as published by the Free Software Foundation; either
|
8
|
-
* version 2.1 of the License, or (at your option) any later version.
|
9
|
-
*
|
10
|
-
* This library is distributed in the hope that it will be useful,
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
-
* Lesser General Public License for more details.
|
14
|
-
*
|
15
|
-
* You should have received a copy of the GNU Lesser General Public
|
16
|
-
* License along with this library; if not, write to the Free Software
|
17
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
-
* MA 02110-1301 USA
|
19
|
-
*/
|
20
|
-
|
21
|
-
#ifndef __RBGTKSOURCEVIEW3CONVERSIONS_H__
|
22
|
-
#define __RBGTKSOURCEVIEW3CONVERSIONS_H__
|
23
|
-
|
24
|
-
#define RVAL2GTKSOURCEBUFFER(o) (GTK_SOURCE_BUFFER(RVAL2GOBJ(o)))
|
25
|
-
#define RVAL2GTKSOURCEGUTTER(o) (GTK_SOURCE_GUTTER(RVAL2GOBJ(o)))
|
26
|
-
#define RVAL2GTKSOURCEGUTTERRENDERER(o) (GTK_SOURCE_GUTTER_RENDERER(RVAL2GOBJ(o)))
|
27
|
-
#define RVAL2GTKSOURCEGUTTERRENDERERPIXBUF(o) (GTK_SOURCE_GUTTER_RENDERER_PIXBUF(RVAL2GOBJ(o)))
|
28
|
-
#define RVAL2GTKSOURCEGUTTERRENDERERTEXT(o) (GTK_SOURCE_GUTTER_RENDERER_TEXT(RVAL2GOBJ(o)))
|
29
|
-
#define RVAL2GTKSOURCELANGUAGE(o) (GTK_SOURCE_LANGUAGE(RVAL2GOBJ(o)))
|
30
|
-
#define RVAL2GTKSOURCELANGUAGEMANAGER(o) (GTK_SOURCE_LANGUAGE_MANAGER(RVAL2GOBJ(o)))
|
31
|
-
#define RVAL2GTKSOURCEMARK(o) (GTK_SOURCE_MARK(RVAL2GOBJ(o)))
|
32
|
-
#define RVAL2GTKSOURCEMARKATTRIBUTES(o) (GTK_SOURCE_MARK_ATTRIBUTES(RVAL2GOBJ(o)))
|
33
|
-
#define RVAL2GTKSOURCEPRINTCOMPOSITOR(o) (GTK_SOURCE_PRINT_COMPOSITOR(RVAL2GOBJ(o)))
|
34
|
-
#define RVAL2GTKSOURCESTYLE(o) (GTK_SOURCE_STYLE(RVAL2GOBJ(o)))
|
35
|
-
#define RVAL2GTKSOURCESTYLESCHEME(o) (GTK_SOURCE_STYLE_SCHEME(RVAL2GOBJ(o)))
|
36
|
-
#define RVAL2GTKSOURCESTYLESCHEMEMANAGER(o) (GTK_SOURCE_STYLE_SCHEME_MANAGER(RVAL2GOBJ(o)))
|
37
|
-
#define RVAL2GTKSOURCEUNDOMANAGER(o) (GTK_SOURCE_UNDO_MANAGER(RVAL2GOBJ(o)))
|
38
|
-
#define RVAL2GTKSOURCEVIEW(o) (GTK_SOURCE_VIEW(RVAL2GOBJ(o)))
|
39
|
-
|
40
|
-
#define RVAL2GTKSOURCEGUTTERRENDERERSTATE(o) (RVAL2GFLAGS(o, GTK_SOURCE_TYPE_GUTTER_RENDERER_STATE))
|
41
|
-
#define GTKSOURCEGUTTERRENDERERSTATE2RVAL(o) (GFLAGS2RVAL(o, GTK_SOURCE_TYPE_GUTTER_RENDERER_STATE))
|
42
|
-
|
43
|
-
/* For GDK3. They are temporary. They will be needless after Ruby/SourceView3
|
44
|
-
* is based on Ruby/GObjectIntrospection.
|
45
|
-
*/
|
46
|
-
#define RVAL2GDKRECTANGLE(o) ((GdkRectangle*)RVAL2BOXED(o, GDK_TYPE_RECTANGLE))
|
47
|
-
#define RVAL2GDKRGBA(o) ((GdkRGBA*)RVAL2BOXED(o, GDK_TYPE_RGBA))
|
48
|
-
#define GDKRGBA2RVAL(o) (BOXED2RVAL(o, GDK_TYPE_RGBA))
|
49
|
-
|
50
|
-
#endif /* __RBGTKSOURCEVIEW3CONVERSIONS_H__ */
|
@@ -1,53 +0,0 @@
|
|
1
|
-
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
-
/*
|
3
|
-
* Copyright (C) 2011 Ruby-GNOME2 Project Team
|
4
|
-
* Copyright (C) 2004,2005 Ruby-GNOME2 Project Team
|
5
|
-
* Copyright (C) 2003 Geoff Youngs
|
6
|
-
*
|
7
|
-
* This library is free software; you can redistribute it and/or
|
8
|
-
* modify it under the terms of the GNU Lesser General Public
|
9
|
-
* License as published by the Free Software Foundation; either
|
10
|
-
* version 2.1 of the License, or (at your option) any later version.
|
11
|
-
*
|
12
|
-
* This library is distributed in the hope that it will be useful,
|
13
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
15
|
-
* Lesser General Public License for more details.
|
16
|
-
*
|
17
|
-
* You should have received a copy of the GNU Lesser General Public
|
18
|
-
* License along with this library; if not, write to the Free Software
|
19
|
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
20
|
-
* MA 02110-1301 USA
|
21
|
-
*/
|
22
|
-
|
23
|
-
#ifndef __RBGTKSOURCEVIEW3PRIVATE_H__
|
24
|
-
#define __RBGTKSOURCEVIEW3PRIVATE_H__
|
25
|
-
|
26
|
-
#include <gtksourceview/gtksource.h>
|
27
|
-
#include <gtksourceview/gtksourceview-typebuiltins.h>
|
28
|
-
|
29
|
-
#include <ruby.h>
|
30
|
-
#include <rb_cairo.h>
|
31
|
-
#include <rbgtk3.h>
|
32
|
-
#include "rbgtksourceview3conversions.h"
|
33
|
-
#include "rbgtksourceview3version.h"
|
34
|
-
|
35
|
-
extern void Init_gtksourceview3(void);
|
36
|
-
|
37
|
-
G_GNUC_INTERNAL void Init_gtksource_view (VALUE mGtkSource);
|
38
|
-
G_GNUC_INTERNAL void Init_gtksource_buffer (VALUE mGtkSource);
|
39
|
-
G_GNUC_INTERNAL void Init_gtksource_language (VALUE mGtkSource);
|
40
|
-
G_GNUC_INTERNAL void Init_gtksource_languagemanager (VALUE mGtkSource);
|
41
|
-
G_GNUC_INTERNAL void Init_gtksource_mark (VALUE mGtkSource);
|
42
|
-
G_GNUC_INTERNAL void Init_gtksource_printcompositor (VALUE mGtkSource);
|
43
|
-
G_GNUC_INTERNAL void Init_gtksource_style (VALUE mGtkSource);
|
44
|
-
G_GNUC_INTERNAL void Init_gtksource_stylescheme (VALUE mGtkSource);
|
45
|
-
G_GNUC_INTERNAL void Init_gtksource_styleschememanager (VALUE mGtkSource);
|
46
|
-
G_GNUC_INTERNAL void Init_gtksource_gutter(VALUE mGtkSource);
|
47
|
-
G_GNUC_INTERNAL void Init_gtksource_gutterrenderer(VALUE mGtkSource);
|
48
|
-
G_GNUC_INTERNAL void Init_gtksource_gutterrendererpixbuf(VALUE mGtkSource);
|
49
|
-
G_GNUC_INTERNAL void Init_gtksource_gutterrenderertext(VALUE mGtkSource);
|
50
|
-
G_GNUC_INTERNAL void Init_gtksource_markattributes(VALUE mGtkSource);
|
51
|
-
G_GNUC_INTERNAL void Init_gtksource_undomanager(VALUE mGtkSource);
|
52
|
-
|
53
|
-
#endif /* __RBGTKSOURCEVIEW3PRIVATE_H__ */
|
data/extconf.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'pathname'
|
4
|
-
require 'mkmf'
|
5
|
-
require 'rbconfig'
|
6
|
-
require 'fileutils'
|
7
|
-
|
8
|
-
package = "gtksourceview3"
|
9
|
-
|
10
|
-
base_dir = Pathname(__FILE__).dirname.expand_path
|
11
|
-
ext_dir = base_dir + "ext" + package
|
12
|
-
mkmf_gnome2_dir = base_dir + 'lib'
|
13
|
-
|
14
|
-
ruby = File.join(RbConfig::CONFIG['bindir'],
|
15
|
-
RbConfig::CONFIG['ruby_install_name'] +
|
16
|
-
RbConfig::CONFIG["EXEEXT"])
|
17
|
-
|
18
|
-
build_dir = Pathname("ext") + package
|
19
|
-
FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
|
20
|
-
extconf_rb_path = ext_dir + "extconf.rb"
|
21
|
-
system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false)
|
22
|
-
|
23
|
-
create_makefile(package)
|
24
|
-
FileUtils.mv("Makefile", "Makefile.lib")
|
25
|
-
|
26
|
-
File.open("Makefile", "w") do |makefile|
|
27
|
-
makefile.puts(<<-EOM)
|
28
|
-
all:
|
29
|
-
(cd ext/#{package} && $(MAKE))
|
30
|
-
$(MAKE) -f Makefile.lib
|
31
|
-
|
32
|
-
install:
|
33
|
-
(cd ext/#{package} && $(MAKE) install)
|
34
|
-
$(MAKE) -f Makefile.lib install
|
35
|
-
|
36
|
-
site-install:
|
37
|
-
(cd ext/#{package} && $(MAKE) site-install)
|
38
|
-
$(MAKE) -f Makefile.lib site-install
|
39
|
-
|
40
|
-
clean:
|
41
|
-
(cd ext/#{package} && $(MAKE) clean)
|
42
|
-
$(MAKE) -f Makefile.lib clean
|
43
|
-
|
44
|
-
distclean:
|
45
|
-
(cd ext/#{package} && $(MAKE) distclean)
|
46
|
-
$(MAKE) -f Makefile.lib distclean
|
47
|
-
@rm -f Makefile.lib
|
48
|
-
EOM
|
49
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
=begin
|
3
|
-
sourcelanguagesmanager.rb - Ruby/GtkSourceView3 sample script.
|
4
|
-
|
5
|
-
Copyright (c) 2006-2014 Ruby-GNOME2 Project Team
|
6
|
-
This program is licenced under the same licence as Ruby-GNOME2.
|
7
|
-
|
8
|
-
$Id: sourcelanguagesmanager.rb,v 1.3 2007/06/03 02:11:07 mutoh Exp $
|
9
|
-
=end
|
10
|
-
|
11
|
-
require "gtksourceview3"
|
12
|
-
|
13
|
-
s = GtkSource::LanguageManager.new
|
14
|
-
s.language_ids.each do |v|
|
15
|
-
puts v
|
16
|
-
end
|
17
|
-
s.search_path.each do |v|
|
18
|
-
puts v
|
19
|
-
end
|
20
|
-
puts s.get_language("html").name
|
21
|
-
|
data/sample/test.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
=begin
|
3
|
-
test.rb - Ruby/GtkSourceView3 sample script.
|
4
|
-
|
5
|
-
Copyright (c) 2006-2014 Ruby-GNOME2 Project Team
|
6
|
-
This program is licenced under the same licence as Ruby-GNOME2.
|
7
|
-
|
8
|
-
$Id: test.rb,v 1.4 2007/06/03 02:11:07 mutoh Exp $
|
9
|
-
=end
|
10
|
-
|
11
|
-
require "gtksourceview3"
|
12
|
-
|
13
|
-
window = Gtk::Window.new
|
14
|
-
window.signal_connect("delete-event") {Gtk.main_quit}
|
15
|
-
|
16
|
-
view = GtkSource::View.new
|
17
|
-
window.add(Gtk::ScrolledWindow.new.add(view))
|
18
|
-
view.show_line_numbers = true
|
19
|
-
view.insert_spaces_instead_of_tabs = true
|
20
|
-
view.indent_width = 4
|
21
|
-
view.show_right_margin = true
|
22
|
-
view.right_margin_position = 80
|
23
|
-
|
24
|
-
lang = GtkSource::LanguageManager.new.get_language("ruby")
|
25
|
-
view.buffer.language = lang
|
26
|
-
view.buffer.highlight_syntax = true
|
27
|
-
view.buffer.highlight_matching_brackets = true
|
28
|
-
|
29
|
-
window.set_default_size(450, 300)
|
30
|
-
window.show_all
|
31
|
-
|
32
|
-
Gtk.main
|
File without changes
|