gtk3 3.2.5-x86-mingw32 → 3.2.6-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Ruby/GTK3
2
+
3
+ Ruby/GTK3 is a Ruby binding of GTK+ 3.
4
+
5
+ ## Requirements
6
+
7
+ * Ruby/GLib2, Ruby/ATK, Ruby/Pango, Ruby/GdkPixbuf2, Ruby/GIO2,
8
+ Ruby/GDK3, Ruby/GObjectIntrospection and Ruby/GTK3 in
9
+ [Ruby-GNOME2](https://ruby-gnome2.osdn.jp/)
10
+ * [rcairo](https://github.com/rcairo/rcairo)
11
+ * [GTK+](http://www.gtk.org/) 3.4.2 or later
12
+
13
+ ## Install
14
+
15
+ gem install gtk3
16
+
17
+ ## Tutorials, examples:
18
+
19
+ * gtk3/sample/misc: a lot of simple examples.
20
+ * gtk3/sample/gtk-demo: the ruby version of `gtk-demo`.
21
+ * gtk3/sample/tutorial: the ruby version of the [offical Gtk3 tutorial "getting started"](https://developer.gnome.org/gtk3/stable/gtk-getting-started.html).
22
+ * a well written tutorial [on how to create a todo application](http://iridakos.com/tutorials/2018/01/25/creating-a-gtk-todo-application-with-ruby)
23
+
24
+ ## License
25
+
26
+ Copyright (c) 2002-2018 Ruby-GNOME2 Project Team
27
+
28
+ This program is free software. You can distribute/modify this program
29
+ under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
30
+
31
+ ## Project Websites
32
+
33
+ * https://github.com/ruby-gnome2/ruby-gnome2
34
+ * https://ruby-gnome2.osdn.jp/
data/Rakefile CHANGED
@@ -1,11 +1,29 @@
1
1
  # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2018 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, MA 02110-1301 USA
18
+
2
19
 
3
20
  $LOAD_PATH.unshift("./../glib2/lib")
4
21
  require 'gnome2/rake/package-task'
5
22
 
6
- package_task = GNOME2::Rake::PackageTask.new do |package|
7
- package.summary = "Ruby/GTK3 is a Ruby binding of GTK+-3.x."
8
- package.description = "Ruby/GTK3 is a Ruby binding of GTK+-3.x."
23
+ package_name = File.basename(__dir__)
24
+ spec = Gem::Specification.load("#{package_name}.gemspec")
25
+
26
+ GNOME2::Rake::PackageTask.define(spec, __dir__) do |package|
9
27
  package.dependency.gem.runtime = [
10
28
  "glib2",
11
29
  "gio2",
@@ -23,4 +41,3 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
23
41
  end
24
42
  end
25
43
  end
26
- package_task.define
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2015-2017 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2015-2018 Ruby-GNOME2 Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -21,6 +21,15 @@
21
21
  #ifndef RB_GTK3_PRIVATE_H
22
22
  #define RB_GTK3_PRIVATE_H
23
23
 
24
+ /*
25
+ * CentOS 6: No GTK+ 3
26
+ * CentOS 7: GTK+ 3.22
27
+ * Ubuntu 14.04: GTK+ 3.10
28
+ * Ubuntu 16.04: GTK+ 3.18
29
+ * Ubuntu 18.04: GTK+ 3.22
30
+ */
31
+ #define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_10
32
+
24
33
  #include "rb-gtk3.h"
25
34
 
26
35
  G_GNUC_INTERNAL void rbgtk3_class_init_func(gpointer g_class, gpointer class_data);
data/ext/gtk3/rb-gtk3.c CHANGED
@@ -1,6 +1,6 @@
1
1
  /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
2
  /*
3
- * Copyright (C) 2015-2017 Ruby-GNOME2 Project Team
3
+ * Copyright (C) 2015-2018 Ruby-GNOME2 Project Team
4
4
  *
5
5
  * This library is free software; you can redistribute it and/or
6
6
  * modify it under the terms of the GNU Lesser General Public
@@ -58,7 +58,8 @@ rb_gtk3_callback_callback(GtkWidget *widget, gpointer user_data)
58
58
  {
59
59
  RBGICallbackData *callback_data = user_data;
60
60
 
61
- rb_funcall(callback_data->rb_callback, id_call, 1,
61
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
62
+ id_call, 1,
62
63
  GOBJ2RVAL(widget));
63
64
  }
64
65
 
@@ -79,7 +80,7 @@ rb_gtk3_cell_layout_data_func_callback(GtkCellLayout *cell_layout,
79
80
  rb_iter = BOXED2RVAL(iter, GTK_TYPE_TREE_ITER);
80
81
  rb_funcall(rb_iter, id_set_model, 1, rb_model);
81
82
 
82
- rb_funcall(callback_data->rb_callback,
83
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
83
84
  id_call,
84
85
  4,
85
86
  GOBJ2RVAL(cell_layout),
@@ -95,30 +96,13 @@ rb_gtk3_clipboard_received_func_callback(GtkClipboard *clipboard,
95
96
  {
96
97
  RBGICallbackData *callback_data = user_data;
97
98
 
98
- rb_funcall(callback_data->rb_callback,
99
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
99
100
  id_call,
100
101
  2,
101
102
  GOBJ2RVAL(clipboard),
102
103
  BOXED2RVAL(selection_data, GTK_TYPE_SELECTION_DATA));
103
104
  }
104
105
 
105
- static void
106
- rb_gtk3_clipboard_rich_text_received_func_callback(GtkClipboard *clipboard,
107
- GdkAtom format,
108
- const guint *text,
109
- G_GNUC_UNUSED gsize length,
110
- gpointer user_data)
111
- {
112
- RBGICallbackData *callback_data = user_data;
113
-
114
- rb_funcall(callback_data->rb_callback,
115
- id_call,
116
- 3,
117
- GOBJ2RVAL(clipboard),
118
- Data_Wrap_Struct(cGdkAtom, NULL, NULL, format),
119
- CSTR2RVAL((const gchar *)text));
120
- }
121
-
122
106
  static void
123
107
  rb_gtk3_clipboard_image_received_func_callback(GtkClipboard *clipboard,
124
108
  GdkPixbuf *pixbuf,
@@ -126,7 +110,7 @@ rb_gtk3_clipboard_image_received_func_callback(GtkClipboard *clipboard,
126
110
  {
127
111
  RBGICallbackData *callback_data = user_data;
128
112
 
129
- rb_funcall(callback_data->rb_callback,
113
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
130
114
  id_call,
131
115
  2,
132
116
  GOBJ2RVAL(clipboard),
@@ -149,12 +133,12 @@ rb_gtk3_clipboard_targets_received_func_callback(GtkClipboard *clipboard,
149
133
  rb_atoms = rb_ary_new2(n_atoms);
150
134
  for (i = 0; i < n_atoms; i++) {
151
135
  VALUE rb_atom;
152
- rb_atom = Data_Wrap_Struct(cGdkAtom, NULL, NULL, atoms[i]);
136
+ rb_atom = rb_gi_struct_new_raw(cGdkAtom, atoms[i], FALSE);
153
137
  rb_ary_push(rb_atoms, rb_atom);
154
138
  }
155
139
  }
156
140
 
157
- rb_funcall(callback_data->rb_callback,
141
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
158
142
  id_call,
159
143
  2,
160
144
  GOBJ2RVAL(clipboard),
@@ -168,7 +152,7 @@ rb_gtk3_clipboard_text_received_func_callback(GtkClipboard *clipboard,
168
152
  {
169
153
  RBGICallbackData *callback_data = user_data;
170
154
 
171
- rb_funcall(callback_data->rb_callback,
155
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
172
156
  id_call,
173
157
  2,
174
158
  GOBJ2RVAL(clipboard),
@@ -182,7 +166,7 @@ rb_gtk3_clipboard_uri_received_func_callback(GtkClipboard *clipboard,
182
166
  {
183
167
  RBGICallbackData *callback_data = user_data;
184
168
 
185
- rb_funcall(callback_data->rb_callback,
169
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
186
170
  id_call,
187
171
  2,
188
172
  GOBJ2RVAL(clipboard),
@@ -209,7 +193,7 @@ rb_gtk3_entry_completion_match_func_callback(GtkEntryCompletion *completion,
209
193
  rb_iter = BOXED2RVAL(iter, GTK_TYPE_TREE_ITER);
210
194
  rb_funcall(rb_iter, id_set_model, 1, rb_model);
211
195
 
212
- rb_match = rb_funcall(callback_data->rb_callback,
196
+ rb_match = rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
213
197
  id_call,
214
198
  3,
215
199
  GOBJ2RVAL(completion),
@@ -231,7 +215,7 @@ rb_gtk3_menu_position_func_callback(GtkMenu *menu,
231
215
  VALUE rb_result_raw;
232
216
  VALUE rb_result;
233
217
 
234
- rb_result_raw = rb_funcall(callback_data->rb_callback,
218
+ rb_result_raw = rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
235
219
  id_call,
236
220
  3,
237
221
  GOBJ2RVAL(menu),
@@ -261,7 +245,7 @@ rb_gtk3_translate_func_callback(const gchar *path,
261
245
  RBGICallbackData *callback_data = user_data;
262
246
  VALUE rb_translated;
263
247
 
264
- rb_translated = rb_funcall(callback_data->rb_callback,
248
+ rb_translated = rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
265
249
  id_call,
266
250
  1,
267
251
  CSTR2RVAL(path));
@@ -285,7 +269,7 @@ rb_gtk3_tree_cell_data_func_callback(GtkTreeViewColumn *column,
285
269
  rb_iter = BOXED2RVAL(iter, GTK_TYPE_TREE_ITER);
286
270
  rb_funcall(rb_iter, id_set_model, 1, rb_model);
287
271
 
288
- rb_funcall(callback_data->rb_callback,
272
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
289
273
  id_call,
290
274
  4,
291
275
  GOBJ2RVAL(column),
@@ -316,7 +300,7 @@ rb_gtk3_tree_iter_compare_func_callback(GtkTreeModel *model,
316
300
  rb_iter2 = BOXED2RVAL(iter2, GTK_TYPE_TREE_ITER);
317
301
  rb_funcall(rb_iter2, id_set_model, 1, rb_model);
318
302
 
319
- rb_result = rb_funcall(callback_data->rb_callback,
303
+ rb_result = rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
320
304
  id_call,
321
305
  3,
322
306
  rb_model,
@@ -345,7 +329,7 @@ rb_gtk3_tree_model_filter_modify_func_callback(GtkTreeModel *model,
345
329
  rb_funcall(rb_iter, id_set_model, 1, rb_model);
346
330
  rb_column = INT2NUM(column);
347
331
 
348
- rb_value = rb_funcall(callback_data->rb_callback,
332
+ rb_value = rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
349
333
  id_call,
350
334
  3,
351
335
  rb_model,
@@ -371,7 +355,7 @@ rb_gtk3_tree_model_filter_visible_func_callback(GtkTreeModel *model,
371
355
  rb_iter = BOXED2RVAL(iter, GTK_TYPE_TREE_ITER);
372
356
  rb_funcall(rb_iter, id_set_model, 1, rb_model);
373
357
 
374
- rb_visible = rb_funcall(callback_data->rb_callback,
358
+ rb_visible = rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
375
359
  id_call,
376
360
  2,
377
361
  rb_model,
@@ -398,7 +382,7 @@ rb_gtk3_tree_model_foreach_func_callback(GtkTreeModel *model,
398
382
  rb_iter = BOXED2RVAL(iter, GTK_TYPE_TREE_ITER);
399
383
  rb_funcall(rb_iter, id_set_model, 1, rb_model);
400
384
 
401
- rb_funcall(callback_data->rb_callback,
385
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
402
386
  id_call,
403
387
  3,
404
388
  rb_model,
@@ -424,7 +408,7 @@ rb_gtk3_tree_selection_foreach_func_callback(GtkTreeModel *model,
424
408
  rb_iter = BOXED2RVAL(iter, GTK_TYPE_TREE_ITER);
425
409
  rb_funcall(rb_iter, id_set_model, 1, rb_model);
426
410
 
427
- rb_funcall(callback_data->rb_callback,
411
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
428
412
  id_call,
429
413
  3,
430
414
  rb_model,
@@ -443,7 +427,7 @@ rb_gtk3_tree_selection_func_callback(GtkTreeSelection *selection,
443
427
  VALUE rb_selection_is_changeable;
444
428
 
445
429
  rb_selection_is_changeable =
446
- rb_funcall(callback_data->rb_callback,
430
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
447
431
  id_call,
448
432
  4,
449
433
  GOBJ2RVAL(selection),
@@ -460,7 +444,7 @@ rb_gtk3_tree_view_mapping_func_callback(GtkTreeView *tree_view,
460
444
  {
461
445
  RBGICallbackData *callback_data = user_data;
462
446
 
463
- rb_funcall(callback_data->rb_callback,
447
+ rb_funcall(rb_gi_callback_data_get_rb_callback(callback_data),
464
448
  id_call,
465
449
  2,
466
450
  GOBJ2RVAL(tree_view),
@@ -476,8 +460,6 @@ rb_gtk3_callback_finder(GIArgInfo *info)
476
460
  return rb_gtk3_cell_layout_data_func_callback;
477
461
  } else if (name_equal(info, "ClipboardReceivedFunc")) {
478
462
  return rb_gtk3_clipboard_received_func_callback;
479
- } else if (name_equal(info, "ClipboardRichTextReceivedFunc")) {
480
- return rb_gtk3_clipboard_rich_text_received_func_callback;
481
463
  } else if (name_equal(info, "ClipboardImageReceivedFunc")) {
482
464
  return rb_gtk3_clipboard_image_received_func_callback;
483
465
  } else if (name_equal(info, "ClipboardTargetsReceivedFunc")) {
data/gtk3.gemspec ADDED
@@ -0,0 +1,44 @@
1
+ # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2018 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, MA 02110-1301 USA
18
+
19
+ require_relative "../glib2/version"
20
+
21
+ Gem::Specification.new do |s|
22
+ s.name = "gtk3"
23
+ s.summary = "Ruby/GTK3 is a Ruby binding of GTK+-3.x."
24
+ s.description = "Ruby/GTK3 is a Ruby binding of GTK+-3.x."
25
+ s.author = "The Ruby-GNOME2 Project Team"
26
+ s.email = "ruby-gnome2-devel-en@lists.sourceforge.net"
27
+ s.homepage = "https://ruby-gnome2.osdn.jp/"
28
+ s.licenses = ["LGPL-2.1+"]
29
+ s.version = ruby_glib2_version
30
+ s.extensions = ["ext/#{s.name}/extconf.rb"]
31
+ s.require_paths = ["lib"]
32
+ s.files = [
33
+ "COPYING.LIB",
34
+ "README.md",
35
+ "Rakefile",
36
+ "#{s.name}.gemspec",
37
+ "extconf.rb",
38
+ "ext/#{s.name}/depend",
39
+ ]
40
+ s.files += Dir.glob("lib/**/*.rb")
41
+ s.files += Dir.glob("ext/#{s.name}/*.{c,h,def,rb}")
42
+ s.files += Dir.glob("sample/**/*")
43
+ s.files += Dir.glob("test/**/*")
44
+ end
data/lib/2.2/gtk3.so CHANGED
Binary file
data/lib/2.3/gtk3.so CHANGED
Binary file
data/lib/2.4/gtk3.so CHANGED
Binary file
data/lib/2.5/gtk3.so CHANGED
Binary file
@@ -0,0 +1,35 @@
1
+ # Copyright (C) 2018 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ module Gtk
18
+ class Application
19
+ alias_method :initialize_raw, :initialize
20
+ def initialize(*args)
21
+ case args.size
22
+ when 0
23
+ initialize_raw(nil, :flags_none)
24
+ when 1
25
+ if args[0].is_a?(String)
26
+ initialize_raw(args[0], :flags_none)
27
+ else
28
+ initialize_raw(nil, args[0])
29
+ end
30
+ else
31
+ initialize_raw(*args)
32
+ end
33
+ end
34
+ end
35
+ end
data/lib/gtk3/entry.rb ADDED
@@ -0,0 +1,30 @@
1
+ # Copyright (C) 2018 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ module Gtk
18
+ class Entry
19
+ # TODO: It's workaround for a GTK+ problem:
20
+ # It should be removed when GTK+ fix the problem.
21
+ # https://github.com/ruby-gnome2/ruby-gnome2/issues/1176
22
+ alias_method :set_attributes_raw, :set_attributes
23
+ def set_attributes(attrs)
24
+ attrs ||= Pango::AttrList.new
25
+ set_attributes_raw(attrs)
26
+ end
27
+ remove_method :attributes=
28
+ alias_method :attributes=, :set_attributes
29
+ end
30
+ end
data/lib/gtk3/loader.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2014-2016 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2014-2018 Ruby-GNOME2 Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -83,6 +83,7 @@ module Gtk
83
83
  require "gtk3/about-dialog"
84
84
  require "gtk3/action"
85
85
  require "gtk3/action-group"
86
+ require "gtk3/application"
86
87
  require "gtk3/binding-set"
87
88
  require "gtk3/border"
88
89
  require "gtk3/box"
@@ -98,6 +99,7 @@ module Gtk
98
99
  require "gtk3/container"
99
100
  require "gtk3/css-provider"
100
101
  require "gtk3/dialog"
102
+ require "gtk3/entry"
101
103
  require "gtk3/entry-buffer"
102
104
  require "gtk3/file-chooser-dialog"
103
105
  require "gtk3/font-chooser-dialog"
@@ -144,7 +144,13 @@ module Gtk
144
144
  if tags
145
145
  start_iter = get_iter_at(:offset => start_offset)
146
146
  tags.each do |tag|
147
- tag = tag_table.lookup(tag) if tag.is_a?(String)
147
+ if tag.is_a?(String)
148
+ resolved_tag = tag_table.lookup(tag)
149
+ if resolved_tag.nil?
150
+ raise ArgumentError "unknown tag: #{tag.inspect}"
151
+ end
152
+ tag = resolved_tag
153
+ end
148
154
  apply_tag(tag, start_iter, iter)
149
155
  end
150
156
  end