gtk3 3.0.5-x64-mingw32 → 3.0.6-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/gtk3/rb-gtk3-cell-layout.c +42 -0
- data/ext/gtk3/rb-gtk3-private.h +3 -0
- data/ext/gtk3/rb-gtk3-tree-model.c +77 -0
- data/ext/gtk3/rb-gtk3-tree-view.c +42 -0
- data/ext/gtk3/rb-gtk3.c +33 -0
- data/lib/2.0/gtk3.so +0 -0
- data/lib/2.1/gtk3.so +0 -0
- data/lib/2.2/gtk3.so +0 -0
- data/lib/gtk3/builder.rb +54 -11
- data/lib/gtk3/container.rb +13 -0
- data/lib/gtk3/deprecated.rb +4 -4
- data/lib/gtk3/loader.rb +2 -0
- data/lib/gtk3/show-uri.rb +34 -0
- data/lib/gtk3/stock-item.rb +36 -0
- data/lib/gtk3/tree-iter.rb +3 -1
- data/sample/gtk-demo/TODO +1 -1
- data/sample/gtk-demo/alias_cursor.png +0 -0
- data/sample/gtk-demo/all_scroll_cursor.png +0 -0
- data/sample/gtk-demo/application.ui +11 -18
- data/sample/gtk-demo/brick.png +0 -0
- data/sample/gtk-demo/brick2.png +0 -0
- data/sample/gtk-demo/cell_cursor.png +0 -0
- data/sample/gtk-demo/col_resize_cursor.png +0 -0
- data/sample/gtk-demo/copy_cursor.png +0 -0
- data/sample/gtk-demo/crosshair_cursor.png +0 -0
- data/sample/gtk-demo/css_accordion.css +1 -2
- data/sample/gtk-demo/css_basics.css +1 -1
- data/sample/gtk-demo/css_multiplebgs.css +136 -0
- data/sample/gtk-demo/css_pixbufs.css +76 -0
- data/sample/gtk-demo/css_shadows.css +44 -0
- data/sample/gtk-demo/cssview.css +41 -0
- data/sample/gtk-demo/decor1.png +0 -0
- data/sample/gtk-demo/decor2.png +0 -0
- data/sample/gtk-demo/default_cursor.png +0 -0
- data/sample/gtk-demo/demo.gresource.xml +216 -0
- data/sample/gtk-demo/demo.ui +285 -241
- data/sample/gtk-demo/e_resize_cursor.png +0 -0
- data/sample/gtk-demo/ew_resize_cursor.png +0 -0
- data/sample/gtk-demo/filtermodel.ui +195 -0
- data/sample/gtk-demo/font-features.ui +966 -0
- data/sample/gtk-demo/glarea-fragment.glsl +9 -0
- data/sample/gtk-demo/glarea-vertex.glsl +8 -0
- data/sample/gtk-demo/grab_cursor.png +0 -0
- data/sample/gtk-demo/grabbing_cursor.png +0 -0
- data/sample/gtk-demo/hand_cursor.png +0 -0
- data/sample/gtk-demo/help_cursor.png +0 -0
- data/sample/gtk-demo/listbox.ui +332 -0
- data/sample/gtk-demo/main.rb +132 -313
- data/sample/gtk-demo/main.ui +190 -0
- data/sample/gtk-demo/markup.txt +16 -0
- data/sample/gtk-demo/menus.ui +1 -1
- data/sample/gtk-demo/messages.txt +388 -0
- data/sample/gtk-demo/modelbutton.ui +162 -0
- data/sample/gtk-demo/move_cursor.png +0 -0
- data/sample/gtk-demo/n_resize_cursor.png +0 -0
- data/sample/gtk-demo/ne_resize_cursor.png +0 -0
- data/sample/gtk-demo/nesw_resize_cursor.png +0 -0
- data/sample/gtk-demo/no_drop_cursor.png +0 -0
- data/sample/gtk-demo/none_cursor.png +0 -0
- data/sample/gtk-demo/not_allowed_cursor.png +0 -0
- data/sample/gtk-demo/ns_resize_cursor.png +0 -0
- data/sample/gtk-demo/nw_resize_cursor.png +0 -0
- data/sample/gtk-demo/nwse_resize_cursor.png +0 -0
- data/sample/gtk-demo/org.gtk.Demo.gschema.xml +17 -0
- data/sample/gtk-demo/pointer_cursor.png +0 -0
- data/sample/gtk-demo/popover.ui +94 -0
- data/sample/gtk-demo/progress_cursor.png +0 -0
- data/sample/gtk-demo/reset.css +0 -1
- data/sample/gtk-demo/revealer.ui +177 -0
- data/sample/gtk-demo/row_resize_cursor.png +0 -0
- data/sample/gtk-demo/s_resize_cursor.png +0 -0
- data/sample/gtk-demo/scale.ui +117 -0
- data/sample/gtk-demo/se_resize_cursor.png +0 -0
- data/sample/gtk-demo/spinbutton.ui +194 -0
- data/sample/gtk-demo/stack.ui +72 -0
- data/sample/gtk-demo/sw_resize_cursor.png +0 -0
- data/sample/gtk-demo/text_cursor.png +0 -0
- data/sample/gtk-demo/theming.ui +102 -147
- data/sample/gtk-demo/vertical_text_cursor.png +0 -0
- data/sample/gtk-demo/w_resize_cursor.png +0 -0
- data/sample/gtk-demo/wait_cursor.png +0 -0
- data/sample/gtk-demo/zoom_in_cursor.png +0 -0
- data/sample/gtk-demo/zoom_out_cursor.png +0 -0
- data/sample/tutorial/README.md +415 -0
- data/test/run-test.rb +1 -1
- data/test/test-gtk-builder.rb +108 -30
- data/test/test-gtk-cell-layout.rb +6 -0
- metadata +82 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9706ae0541f440b263d7ee017484cea391ec95fd
|
4
|
+
data.tar.gz: 1056aca1066f9b6e3841d1faf721cb88015b078f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e36a00f11b09430ad4c01bc59cf19c75acd78541c8e56a264a32513e50b36575023a38f1660e450b66419ca65da06279d9a965c057b2340bb60a881af5f3dda
|
7
|
+
data.tar.gz: 0ade16b68c8225eb47cb84c302142f858ce9511dc50f5c6c3ca383697a6a71140394186ed9b9623aa2085b94b6094f44a37c4f190248bb3efe627991b47ce314
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2015 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 "rb-gtk3-private.h"
|
22
|
+
|
23
|
+
static void
|
24
|
+
rb_gtk3_cell_layout_mark(gpointer object)
|
25
|
+
{
|
26
|
+
GtkCellLayout *cell_layout = object;
|
27
|
+
GList *node;
|
28
|
+
GList *renderers;
|
29
|
+
|
30
|
+
renderers = gtk_cell_layout_get_cells(cell_layout);
|
31
|
+
for (node = renderers; node; node = g_list_next(node)) {
|
32
|
+
GtkCellRenderer *renderer = node->data;
|
33
|
+
rbgobj_gc_mark_instance(renderer);
|
34
|
+
}
|
35
|
+
g_list_free(renderers);
|
36
|
+
}
|
37
|
+
|
38
|
+
void
|
39
|
+
rbgtk3_cell_layout_init(void)
|
40
|
+
{
|
41
|
+
rbgobj_register_mark_func(GTK_TYPE_CELL_LAYOUT, rb_gtk3_cell_layout_mark);
|
42
|
+
}
|
data/ext/gtk3/rb-gtk3-private.h
CHANGED
@@ -26,7 +26,10 @@
|
|
26
26
|
G_GNUC_INTERNAL void rbgtk3_class_init_func(gpointer g_class, gpointer class_data);
|
27
27
|
G_GNUC_INTERNAL void rbgtk3_initialize(VALUE self);
|
28
28
|
|
29
|
+
G_GNUC_INTERNAL void rbgtk3_cell_layout_init(void);
|
29
30
|
G_GNUC_INTERNAL void rbgtk3_container_init(void);
|
31
|
+
G_GNUC_INTERNAL void rbgtk3_tree_model_init(void);
|
32
|
+
G_GNUC_INTERNAL void rbgtk3_tree_view_init(void);
|
30
33
|
G_GNUC_INTERNAL void rbgtk3_widget_init(void);
|
31
34
|
|
32
35
|
#endif
|
@@ -0,0 +1,77 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2015 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 "rb-gtk3-private.h"
|
22
|
+
|
23
|
+
static gboolean
|
24
|
+
rb_gtk3_tree_model_mark_callback(GtkTreeModel *model,
|
25
|
+
G_GNUC_UNUSED GtkTreePath *path,
|
26
|
+
GtkTreeIter *iter,
|
27
|
+
gpointer data)
|
28
|
+
{
|
29
|
+
GArray *target_columns = data;
|
30
|
+
guint i, n;
|
31
|
+
|
32
|
+
n = target_columns->len;
|
33
|
+
for (i = 0; i < n; i++) {
|
34
|
+
gint nth_column;
|
35
|
+
GValue value = G_VALUE_INIT;
|
36
|
+
|
37
|
+
nth_column = g_array_index(target_columns, gint, i);
|
38
|
+
gtk_tree_model_get_value(model, iter, nth_column, &value);
|
39
|
+
rbgobj_gc_mark_gvalue(&value);
|
40
|
+
g_value_unset(&value);
|
41
|
+
}
|
42
|
+
|
43
|
+
return FALSE;
|
44
|
+
}
|
45
|
+
|
46
|
+
static void
|
47
|
+
rb_gtk3_tree_model_mark(gpointer object)
|
48
|
+
{
|
49
|
+
GtkTreeModel *tree_model;
|
50
|
+
GArray *target_columns;
|
51
|
+
gint i, n;
|
52
|
+
|
53
|
+
tree_model = GTK_TREE_MODEL(object);
|
54
|
+
|
55
|
+
target_columns = g_array_new(FALSE, FALSE, sizeof(gint));
|
56
|
+
n = gtk_tree_model_get_n_columns(tree_model);
|
57
|
+
for (i = 0; i < n; i++) {
|
58
|
+
GType column_type = gtk_tree_model_get_column_type(tree_model, i);
|
59
|
+
|
60
|
+
if (G_TYPE_FUNDAMENTAL(column_type) != G_TYPE_OBJECT)
|
61
|
+
continue;
|
62
|
+
|
63
|
+
g_array_append_val(target_columns, i);
|
64
|
+
}
|
65
|
+
|
66
|
+
gtk_tree_model_foreach(tree_model,
|
67
|
+
rb_gtk3_tree_model_mark_callback,
|
68
|
+
target_columns);
|
69
|
+
|
70
|
+
g_array_unref(target_columns);
|
71
|
+
}
|
72
|
+
|
73
|
+
void
|
74
|
+
rbgtk3_tree_model_init(void)
|
75
|
+
{
|
76
|
+
rbgobj_register_mark_func(GTK_TYPE_TREE_MODEL, rb_gtk3_tree_model_mark);
|
77
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2015 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 "rb-gtk3-private.h"
|
22
|
+
|
23
|
+
static void
|
24
|
+
rb_gtk3_tree_view_mark(gpointer object)
|
25
|
+
{
|
26
|
+
GtkTreeView *tree_view = object;
|
27
|
+
GList *node;
|
28
|
+
GList *columns;
|
29
|
+
|
30
|
+
columns = gtk_tree_view_get_columns(tree_view);
|
31
|
+
for (node = columns; node; node = g_list_next(node)) {
|
32
|
+
GtkTreeViewColumn *column = node->data;
|
33
|
+
rbgobj_gc_mark_instance(column);
|
34
|
+
}
|
35
|
+
g_list_free(columns);
|
36
|
+
}
|
37
|
+
|
38
|
+
void
|
39
|
+
rbgtk3_tree_view_init(void)
|
40
|
+
{
|
41
|
+
rbgobj_register_mark_func(GTK_TYPE_TREE_VIEW, rb_gtk3_tree_view_mark);
|
42
|
+
}
|
data/ext/gtk3/rb-gtk3.c
CHANGED
@@ -98,6 +98,34 @@ rb_gtk3_builder_connect_func_callback(GtkBuilder *builder,
|
|
98
98
|
GCONNECTFLAGS2RVAL(flags));
|
99
99
|
}
|
100
100
|
|
101
|
+
static void
|
102
|
+
rb_gtk3_cell_layout_data_func_callback(GtkCellLayout *cell_layout,
|
103
|
+
GtkCellRenderer *cell,
|
104
|
+
GtkTreeModel *model,
|
105
|
+
GtkTreeIter *iter,
|
106
|
+
gpointer user_data)
|
107
|
+
{
|
108
|
+
RBGICallbackData *callback_data = user_data;
|
109
|
+
ID id_set_model;
|
110
|
+
ID id_call;
|
111
|
+
VALUE rb_model;
|
112
|
+
VALUE rb_iter;
|
113
|
+
|
114
|
+
CONST_ID(id_set_model, "model=");
|
115
|
+
rb_model = GOBJ2RVAL(model);
|
116
|
+
rb_iter = BOXED2RVAL(iter, GTK_TYPE_TREE_ITER);
|
117
|
+
rb_funcall(rb_iter, id_set_model, 1, rb_model);
|
118
|
+
|
119
|
+
CONST_ID(id_call, "call");
|
120
|
+
rb_funcall(callback_data->rb_callback,
|
121
|
+
id_call,
|
122
|
+
4,
|
123
|
+
GOBJ2RVAL(cell_layout),
|
124
|
+
GOBJ2RVAL(cell),
|
125
|
+
rb_model,
|
126
|
+
rb_iter);
|
127
|
+
}
|
128
|
+
|
101
129
|
static const gchar *
|
102
130
|
rb_gtk3_translate_func_callback(const gchar *path,
|
103
131
|
gpointer user_data)
|
@@ -282,6 +310,8 @@ rb_gtk3_callback_finder(GIArgInfo *info)
|
|
282
310
|
return rb_gtk3_assistant_page_func_callback;
|
283
311
|
} else if (name_equal(info, "BuilderConnectFunc")) {
|
284
312
|
return rb_gtk3_builder_connect_func_callback;
|
313
|
+
} else if (name_equal(info, "CellLayoutDataFunc")) {
|
314
|
+
return rb_gtk3_cell_layout_data_func_callback;
|
285
315
|
} else if (name_equal(info, "TranslateFunc")) {
|
286
316
|
return rb_gtk3_translate_func_callback;
|
287
317
|
} else if (name_equal(info, "TreeCellDataFunc")) {
|
@@ -400,7 +430,10 @@ Init_gtk3(void)
|
|
400
430
|
rbgobj_register_mark_func(GTK_TYPE_UI_MANAGER, rb_gtk3_ui_manager_mark);
|
401
431
|
#endif
|
402
432
|
|
433
|
+
rbgtk3_cell_layout_init();
|
403
434
|
rbgtk3_container_init();
|
435
|
+
rbgtk3_tree_model_init();
|
436
|
+
rbgtk3_tree_view_init();
|
404
437
|
rbgtk3_widget_init();
|
405
438
|
|
406
439
|
rbgobj_boxed_not_copy_obj(GTK_TYPE_SELECTION_DATA);
|
data/lib/2.0/gtk3.so
CHANGED
Binary file
|
data/lib/2.1/gtk3.so
CHANGED
Binary file
|
data/lib/2.2/gtk3.so
CHANGED
Binary file
|
data/lib/gtk3/builder.rb
CHANGED
@@ -18,12 +18,13 @@ module Gtk
|
|
18
18
|
class Builder
|
19
19
|
alias_method :initialize_raw, :initialize
|
20
20
|
def initialize(options={})
|
21
|
-
|
21
|
+
path = options[:path] || options[:file]
|
22
22
|
resource = options[:resource]
|
23
23
|
string = options[:string]
|
24
24
|
|
25
|
-
if
|
26
|
-
|
25
|
+
if path
|
26
|
+
path = path.to_path if path.respond_to?(:to_path)
|
27
|
+
initialize_new_from_file(path)
|
27
28
|
elsif resource
|
28
29
|
initialize_new_from_resource(resource)
|
29
30
|
elsif string
|
@@ -40,15 +41,57 @@ module Gtk
|
|
40
41
|
add_from_string_raw(string, string.bytesize)
|
41
42
|
end
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
alias_method :add_objects_from_string_raw, :add_objects_from_string
|
45
|
+
def add_objects_from_string(string, object_ids)
|
46
|
+
add_objects_from_string_raw(string, string.bytesize, object_ids)
|
47
|
+
end
|
48
|
+
|
49
|
+
def add(target_or_options={})
|
50
|
+
if target_or_options.is_a?(Hash)
|
51
|
+
options = target_or_options
|
52
|
+
else
|
53
|
+
target = target_or_options
|
54
|
+
options = {}
|
55
|
+
if target.respond_to?(:to_path)
|
56
|
+
options[:path] = target.to_path
|
57
|
+
elsif target.start_with?("<") or target.start_with?(" ")
|
58
|
+
options[:string] = target
|
59
|
+
elsif File.exist?(target)
|
60
|
+
options[:path] = target
|
61
|
+
else
|
62
|
+
options[:resource] = target
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
string = options[:string]
|
67
|
+
path = options[:path] || options[:file]
|
68
|
+
resource = options[:resource]
|
69
|
+
|
70
|
+
object_ids = options[:object_ids]
|
71
|
+
|
72
|
+
if path
|
73
|
+
path = path.to_path if path.respond_to?(:to_path)
|
74
|
+
if object_ids
|
75
|
+
add_objects_from_file(path, object_ids)
|
76
|
+
else
|
77
|
+
add_from_file(path)
|
78
|
+
end
|
79
|
+
elsif resource
|
80
|
+
if object_ids
|
81
|
+
add_objects_from_resource(resource, object_ids)
|
82
|
+
else
|
83
|
+
add_from_resource(resource)
|
84
|
+
end
|
85
|
+
elsif string
|
86
|
+
if object_ids
|
87
|
+
add_objects_from_string(string, object_ids)
|
88
|
+
else
|
89
|
+
add_from_string(string)
|
90
|
+
end
|
50
91
|
else
|
51
|
-
|
92
|
+
message = ":path (:file), :resource or :string " +
|
93
|
+
"must be specified: #{options.inspect}"
|
94
|
+
raise InvalidArgument, message
|
52
95
|
end
|
53
96
|
end
|
54
97
|
|
data/lib/gtk3/container.rb
CHANGED
@@ -25,6 +25,19 @@ module Gtk
|
|
25
25
|
|
26
26
|
include Enumerable
|
27
27
|
|
28
|
+
alias_method :add_raw, :add
|
29
|
+
def add(child, properties={})
|
30
|
+
child.freeze_child_notify
|
31
|
+
begin
|
32
|
+
add_raw(child)
|
33
|
+
properties.each do |key, value|
|
34
|
+
child_set_property(child, key, value)
|
35
|
+
end
|
36
|
+
ensure
|
37
|
+
child.thaw_child_notify
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
28
41
|
def <<(widget)
|
29
42
|
add(widget)
|
30
43
|
self
|
data/lib/gtk3/deprecated.rb
CHANGED
@@ -489,10 +489,10 @@ module Gtk
|
|
489
489
|
define_deprecated_method :render_icon, :raise => "Use '#{self}#render_icon_pixbuf'."
|
490
490
|
end
|
491
491
|
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
492
|
+
class IconSize
|
493
|
+
extend GLib::Deprecatable
|
494
|
+
define_deprecated_const :IconSize, "Gtk::IconSize"
|
495
|
+
end
|
496
496
|
|
497
497
|
class IconTheme
|
498
498
|
extend GLib::Deprecatable
|
data/lib/gtk3/loader.rb
CHANGED
@@ -129,8 +129,10 @@ module Gtk
|
|
129
129
|
require "gtk3/search-bar"
|
130
130
|
require "gtk3/selection-data"
|
131
131
|
require "gtk3/spin-button"
|
132
|
+
require "gtk3/show-uri"
|
132
133
|
require "gtk3/stack"
|
133
134
|
require "gtk3/stock"
|
135
|
+
require "gtk3/stock-item"
|
134
136
|
require "gtk3/style-context"
|
135
137
|
require "gtk3/style-properties"
|
136
138
|
require "gtk3/table"
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Copyright (C) 2015 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 << self
|
19
|
+
alias_method :show_uri_raw, :show_uri
|
20
|
+
def show_uri(uri_or_options)
|
21
|
+
if uri_or_options.is_a?(String)
|
22
|
+
options = {:uri => uri_or_options}
|
23
|
+
else
|
24
|
+
options = uri_or_options
|
25
|
+
end
|
26
|
+
|
27
|
+
screen = options[:screen]
|
28
|
+
uri = options[:uri]
|
29
|
+
timestamp = options[:timestamp] || Gdk::CURRENT_TIME
|
30
|
+
|
31
|
+
show_uri_raw(screen, uri, timestamp)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# Copyright (C) 2015 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 StockItem
|
19
|
+
def [](*args)
|
20
|
+
warn("#{self.class}\##{__method__} is deprecated. " +
|
21
|
+
"Use \#stock_id, \#label, \#modifier, \#keyval and " +
|
22
|
+
"\#translation_domain instead.")
|
23
|
+
to_a[*args]
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_a
|
27
|
+
[
|
28
|
+
stock_id,
|
29
|
+
label,
|
30
|
+
modifier,
|
31
|
+
keyval,
|
32
|
+
translation_domain,
|
33
|
+
]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|