gtksourceview2 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba7001c2212933572ff924fe932c8eca17152b26
4
- data.tar.gz: 4fbcff2ce5f45779daae26995286ef3bed6a4c39
3
+ metadata.gz: d5363030a432f144766b287697adb7a992846c64
4
+ data.tar.gz: f261c5fce98aa7c4223cc1b8cbd6706ee48ab5d0
5
5
  SHA512:
6
- metadata.gz: 3610edff4001417e8b3ba6cf3c52c8670fd7086f2e3f67d54d540818fc89c74ad3368b01df1a1790213f3af40724e453156292c3143161f44ecf58c4898e158e
7
- data.tar.gz: bbeec69ee2d2a097a6ecabb7ccaa535030c4087f5ce93c286ccb551779a08b5dadb379ddf14a875890a3abe3e1d21af0f60642a54facfe1477fc7a1185bf239b
6
+ metadata.gz: 90bab1da34c3a2759da285d8c6f58b852324201905b3a66bae3803e86dc0f2737d40ac8711a537533645d8c40f161b5a80c9a2821feddc304d794afe31245f26
7
+ data.tar.gz: a3aea8664fa32390ff15b0a97c7af50308780153b9c15af81aea6f888aa3fe05fb202c7d9adeab1a64d678667fb22da535eb826c889a9faa9c437ca9606b01ae
@@ -108,8 +108,8 @@ Init_gtk_sourceiter (VALUE mGtk)
108
108
  /*
109
109
  * They are override original Gtk::TextIter#[for|back]ward_search
110
110
  */
111
- RG_DEF_METHOD(forward_search, -1);
112
- RG_DEF_METHOD(backward_search, -1);
111
+ RG_REPLACE_ACTION(forward_search, -1);
112
+ RG_REPLACE_ACTION(backward_search, -1);
113
113
 
114
114
  G_DEF_CLASS(GTK_TYPE_SOURCE_SEARCH_FLAGS, "SourceSearchFlags", RG_TARGET_NAMESPACE);
115
115
  G_DEF_CONSTANTS(RG_TARGET_NAMESPACE, GTK_TYPE_SOURCE_SEARCH_FLAGS, "GTK_");
@@ -60,80 +60,6 @@ rg_s_default(VALUE self)
60
60
  return GOBJ2RVAL(slm);
61
61
  }
62
62
 
63
- /* Method: set_search_path(dirs)
64
- * dirs: language file directory path
65
- *
66
- * Sets the language files directories for the given language manager.
67
- *
68
- * Returns: self.
69
- */
70
- static VALUE
71
- rg_set_search_path(VALUE self, VALUE dirs)
72
- {
73
- gchar** gdirs = (gchar**)NULL;
74
- gint i;
75
-
76
- if (! NIL_P(dirs)){
77
- Check_Type(dirs, T_ARRAY);
78
- i = RARRAY_LEN(dirs);
79
- gdirs = ALLOCA_N(gchar*, i + 1);
80
- for (i = 0; i < i; i++) {
81
- if (TYPE(RARRAY_PTR(dirs)[i]) == T_STRING) {
82
- gdirs[i] = RVAL2CSTR(RARRAY_PTR(dirs)[i]);
83
- }
84
- else {
85
- gdirs[i] = "";
86
- }
87
- }
88
- gdirs[i] = (gchar*)NULL;
89
- }
90
-
91
- gtk_source_language_manager_set_search_path (_SELF (self), gdirs);
92
-
93
- return self;
94
- }
95
-
96
- /* Method: search_path
97
- * Returns: a list of language files directories (strings) for the given
98
- * language manager.
99
- */
100
- static VALUE
101
- rg_search_path(VALUE self)
102
- {
103
- VALUE ary;
104
- const gchar * const * dirs =
105
- gtk_source_language_manager_get_search_path (_SELF (self));
106
- if (!dirs)
107
- return Qnil;
108
-
109
- ary = rb_ary_new();
110
- while (*dirs){
111
- rb_ary_push(ary, CSTR2RVAL(*dirs));
112
- dirs++;
113
- }
114
- return ary;
115
- }
116
-
117
- /* Method: language_ids
118
- * Returns: a list of languages ids for the given language manager
119
- */
120
- static VALUE
121
- rg_language_ids(VALUE self)
122
- {
123
- VALUE ary;
124
- const gchar * const * ids =
125
- gtk_source_language_manager_get_language_ids (_SELF (self));
126
- if (!ids)
127
- return Qnil;
128
-
129
- ary = rb_ary_new();
130
- while (*ids){
131
- rb_ary_push(ary, CSTR2RVAL(*ids));
132
- ids++;
133
- }
134
- return ary;
135
- }
136
-
137
63
  /*
138
64
  * Method: get_language(id)
139
65
  * id: a language id (as a string).
@@ -181,9 +107,6 @@ Init_gtk_sourcelanguagemanager (VALUE mGtk)
181
107
  "SourceLanguageManager", mGtk);
182
108
 
183
109
  RG_DEF_METHOD(initialize, 0);
184
- RG_DEF_METHOD(set_search_path, 1);
185
- RG_DEF_METHOD(search_path, 0);
186
- RG_DEF_METHOD(language_ids, 0);
187
110
  RG_DEF_METHOD(get_language, 1);
188
111
  #ifdef HAVE_GTK_SOURCE_LANGUAGE_MANAGER_GUESS_LANGUAGE
189
112
  RG_DEF_METHOD(guess_language, 2);
@@ -60,38 +60,6 @@ rg_s_default(VALUE self)
60
60
  return GOBJ2RVAL(sssm);
61
61
  }
62
62
 
63
- /* Method: set_search_path(dirs)
64
- * dirs: style scheme file directory path
65
- *
66
- * Sets the style scheme files directories for the given style scheme manager.
67
- *
68
- * Returns: self.
69
- */
70
- static VALUE
71
- rg_set_search_path(VALUE self, VALUE dirs)
72
- {
73
- gchar** gdirs = (gchar**)NULL;
74
- gint i;
75
-
76
- if (! NIL_P(dirs)){
77
- Check_Type(dirs, T_ARRAY);
78
- i = RARRAY_LEN(dirs);
79
- gdirs = ALLOCA_N(gchar*, i + 1);
80
- for (i = 0; i < i; i++) {
81
- if (TYPE(RARRAY_PTR(dirs)[i]) == T_STRING) {
82
- gdirs[i] = RVAL2CSTR(RARRAY_PTR(dirs)[i]);
83
- }
84
- else {
85
- gdirs[i] = "";
86
- }
87
- }
88
- gdirs[i] = (gchar*)NULL;
89
- }
90
-
91
- gtk_source_style_scheme_manager_set_search_path (_SELF (self), gdirs);
92
- return self;
93
- }
94
-
95
63
  /* Method: append_search_path(path)
96
64
  * path: additional style scheme file directory path (string)
97
65
  *
@@ -120,47 +88,6 @@ rg_prepend_search_path(VALUE self, VALUE path)
120
88
  return self;
121
89
  }
122
90
 
123
- /* Method: get_search_path
124
- * Returns: a list of style scheme files directories (strings) for the given
125
- * style scheme manager.
126
- */
127
- static VALUE
128
- rg_search_path(VALUE self)
129
- {
130
- VALUE ary;
131
- const gchar * const * dirs =
132
- gtk_source_style_scheme_manager_get_search_path (_SELF (self));
133
- if (!dirs)
134
- return Qnil;
135
-
136
- ary = rb_ary_new();
137
- while (*dirs){
138
- rb_ary_push(ary, CSTR2RVAL(*dirs));
139
- dirs++;
140
- }
141
- return ary;
142
- }
143
-
144
- /* Method: scheme_ids
145
- * Returns: a list of style scheme ids for the given style scheme manager
146
- */
147
- static VALUE
148
- rg_scheme_ids(VALUE self)
149
- {
150
- VALUE ary;
151
- const gchar * const * ids =
152
- gtk_source_style_scheme_manager_get_scheme_ids (_SELF (self));
153
- if (!ids)
154
- return Qnil;
155
-
156
- ary = rb_ary_new();
157
- while (*ids){
158
- rb_ary_push(ary, CSTR2RVAL(*ids));
159
- ids++;
160
- }
161
- return ary;
162
- }
163
-
164
91
  /*
165
92
  * Method: scheme(scheme_id)
166
93
  * scheme_id: a style scheme id (as a string).
@@ -202,11 +129,8 @@ Init_gtk_sourcestyleschememanager (VALUE mGtk)
202
129
  "SourceStyleSchemeManager", mGtk);
203
130
 
204
131
  RG_DEF_METHOD(initialize, 0);
205
- RG_DEF_METHOD(set_search_path, 1);
206
132
  RG_DEF_METHOD(append_search_path, 1);
207
133
  RG_DEF_METHOD(prepend_search_path, 1);
208
- RG_DEF_METHOD(search_path, 0);
209
- RG_DEF_METHOD(scheme_ids, 0);
210
134
  RG_DEF_METHOD(get_scheme, 1);
211
135
  RG_DEF_METHOD(force_rescan, 0);
212
136
  RG_DEF_SMETHOD(default, 0);
@@ -143,10 +143,15 @@ static VALUE
143
143
  rg_get_mark_category_background(VALUE self, VALUE category)
144
144
  {
145
145
  GdkColor color;
146
- gtk_source_view_get_mark_category_background(_SELF (self),
147
- RVAL2CSTR(category),
148
- &color);
149
- return GDKCOLOR2RVAL(&color);
146
+ gboolean found;
147
+ found = gtk_source_view_get_mark_category_background(_SELF (self),
148
+ RVAL2CSTR(category),
149
+ &color);
150
+ if (found) {
151
+ return GDKCOLOR2RVAL(&color);
152
+ } else {
153
+ return Qnil;
154
+ }
150
155
  }
151
156
 
152
157
  /*
@@ -12,7 +12,7 @@ vendor_dir = base_dir + "vendor" + "local"
12
12
  vendor_bin_dir = vendor_dir + "bin"
13
13
  GLib.prepend_dll_path(vendor_bin_dir)
14
14
  begin
15
- major, minor, micro, = RUBY_VERSION.split(/\./)
15
+ major, minor, = RUBY_VERSION.split(/\./)
16
16
  require "#{major}.#{minor}/gtksourceview2.so"
17
17
  rescue LoadError
18
18
  require "gtksourceview2.so"
@@ -6,12 +6,13 @@ class TestSourceView < Test::Unit::TestCase
6
6
 
7
7
  red_rgb = [65535, 0, 0]
8
8
  red_color = Gdk::Color.parse("red")
9
- assert_not_equal(red_rgb, view.get_mark_category_background("XXX").to_a)
10
9
 
11
- view.set_mark_category_background("XXX", red_color)
12
- assert_equal(red_rgb, view.get_mark_category_background("XXX").to_a)
10
+ assert_nil(view.get_mark_category_background("new-category"))
13
11
 
14
- view.set_mark_category_background("XXX", nil)
15
- assert_not_equal(red_rgb, view.get_mark_category_background("XXX").to_a)
12
+ view.set_mark_category_background("new-category", red_color)
13
+ assert_equal(red_rgb, view.get_mark_category_background("new-category").to_a)
14
+
15
+ view.set_mark_category_background("new-category", nil)
16
+ assert_nil(view.get_mark_category_background("new-category"))
16
17
  end
17
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gtksourceview2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Ruby-GNOME2 Project Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-29 00:00:00.000000000 Z
11
+ date: 2014-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gtk2
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.0
19
+ version: 2.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.0
26
+ version: 2.2.0
27
27
  description: Ruby/GtkSourceView2 is a Ruby binding of gtksourceview-2.x.
28
28
  email: ruby-gnome2-devel-en@lists.sourceforge.net
29
29
  executables: []