[DRE-commits] [ruby-gnome2] 16/31: New upstream version 3.0.7
Daisuke Higuchi
dai at moszumanska.debian.org
Mon Oct 10 13:40:19 UTC 2016
This is an automated email from the git hooks/post-receive script.
dai pushed a commit to branch exp/debian
in repository ruby-gnome2.
commit 1162ba9a2b39dafc37a4de9aa7e2b15914b7dc40
Author: HIGUCHI Daisuke (VDR dai) <dai at debian.org>
Date: Sun Oct 9 21:56:46 2016 +0900
New upstream version 3.0.7
---
NEWS | 25 +++++++++++++++++++++++++
glib2/ext/glib2/rbglib.h | 2 +-
glib2/ext/glib2/rbgobj_enums.c | 2 +-
glib2/ext/glib2/rbgobj_signal.c | 21 ++++-----------------
glib2/lib/glib2.rb | 11 ++++++++++-
gtk3/lib/gtk3/tree-view.rb | 24 ++++++++++++++++++++++++
gtk3/test/test-gtk-tree-view.rb | 27 +++++++++++++++++++++++++++
7 files changed, 92 insertions(+), 20 deletions(-)
diff --git a/NEWS b/NEWS
index 819e232..c5f8c72 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,31 @@
= NEWS
+== Ruby-GNOME2 3.0.7: 2015-10-06
+
+It is a bug fix release of 3.0.6.
+
+=== Changes
+
+==== Ruby/GLib2
+
+ * Fixes
+ * Fixed a bug that `xxx_yyy` enum name isn't accepted.
+ [ruby-gnome2-devel-en][Reported by Detlef Reichl]
+ * Fixed a bug that internal Ruby API is used.
+ [ruby-gnome2-devel-en][Reported by Detlef Reichl]
+
+==== Ruby/GTK3
+
+ * Improvements
+ * Added backward compatibility API to
+ (({Gtk::TreeView#insert_column})).
+ [ruby-gnome2-devel-en][Reported by Detlef Reichl]
+
+=== Thanks
+
+ * Detlef Reichl
+
== Ruby-GNOME2 3.0.6: 2015-10-04
It is a bug fix release of 3.0.5.
diff --git a/glib2/ext/glib2/rbglib.h b/glib2/ext/glib2/rbglib.h
index c502c23..a13687f 100644
--- a/glib2/ext/glib2/rbglib.h
+++ b/glib2/ext/glib2/rbglib.h
@@ -36,7 +36,7 @@ extern "C" {
#define RBGLIB_MAJOR_VERSION 3
#define RBGLIB_MINOR_VERSION 0
-#define RBGLIB_MICRO_VERSION 6
+#define RBGLIB_MICRO_VERSION 7
#ifndef RSTRING_PTR
# define RSTRING_PTR(s) (RSTRING(s)->ptr)
diff --git a/glib2/ext/glib2/rbgobj_enums.c b/glib2/ext/glib2/rbgobj_enums.c
index cf15f4c..d5378d9 100644
--- a/glib2/ext/glib2/rbgobj_enums.c
+++ b/glib2/ext/glib2/rbgobj_enums.c
@@ -298,7 +298,7 @@ rg_initialize(int argc, VALUE *argv, VALUE self)
if (!p->info) {
gchar *nick;
nick = rbg_name_to_nick(name);
- p->info = g_enum_get_value_by_nick(p->gclass, name);
+ p->info = g_enum_get_value_by_nick(p->gclass, nick);
g_free(nick);
}
if (!p->info) {
diff --git a/glib2/ext/glib2/rbgobj_signal.c b/glib2/ext/glib2/rbgobj_signal.c
index 3009fbe..48b664e 100644
--- a/glib2/ext/glib2/rbgobj_signal.c
+++ b/glib2/ext/glib2/rbgobj_signal.c
@@ -168,20 +168,13 @@ gobj_s_signal_new(int argc, VALUE* argv, VALUE self)
signal_flags = NUM2INT(rbsignal_flags);
{
- VALUE factory;
VALUE proc;
ID method_id;
method_id = rb_to_id(rb_str_concat(rb_str_new2(default_handler_method_prefix), rbsignal_name));
- factory = ruby_eval_string_from_file(
- "lambda{|klass, id|\n"
- " lambda{|instance,*args|\n"
- " klass.instance_method(id).bind(instance).call(*args)\n"
- " }\n"
- "}\n",
- __FILE__);
- proc = rb_funcall(factory, rb_intern("call"), 2, self, ID2SYM(method_id));
+ proc = rb_funcall(mMetaInterface, rb_intern("signal_callback"), 2,
+ self, ID2SYM(method_id));
class_closure = g_rclosure_new(proc, Qnil, NULL);
/* TODO: Should this be done even if something below it fails? */
@@ -630,14 +623,8 @@ gobj_s_method_added(VALUE klass, VALUE id)
}
{
- VALUE f = ruby_eval_string_from_file(
- "lambda{|klass, id|\n"
- " lambda{|instance,*args|\n"
- " klass.instance_method(id).bind(instance).call(*args)\n"
- " }\n"
- "}\n",
- __FILE__);
- VALUE proc = rb_funcall(f, rb_intern("call"), 2, klass, id);
+ VALUE proc = rb_funcall(mMetaInterface, rb_intern("signal_callback"), 2,
+ klass, id);
GClosure* rclosure = g_rclosure_new(proc, Qnil,
rbgobj_get_signal_func(signal_id));
g_rclosure_attach((GClosure *)rclosure, klass);
diff --git a/glib2/lib/glib2.rb b/glib2/lib/glib2.rb
index b7b73be..6b1123e 100644
--- a/glib2/lib/glib2.rb
+++ b/glib2/lib/glib2.rb
@@ -116,7 +116,16 @@ rescue LoadError
end
module GLib
-
+ module MetaInterface
+ class << self
+ def signal_callback(klass, id)
+ lambda do |instance, *args|
+ klass.instance_method(id).bind(instance).call(*args)
+ end
+ end
+ end
+ end
+
class Type
def decendants
diff --git a/gtk3/lib/gtk3/tree-view.rb b/gtk3/lib/gtk3/tree-view.rb
index 5a86ae5..5492f4d 100644
--- a/gtk3/lib/gtk3/tree-view.rb
+++ b/gtk3/lib/gtk3/tree-view.rb
@@ -37,5 +37,29 @@ module Gtk
targets = ensure_drag_targets(targets)
enable_model_drag_dest_raw(targets, actions)
end
+
+ alias_method :insert_column_raw, :insert_column
+ def insert_column(*args, &block)
+ case args.size
+ when 2
+ column, position = args
+ insert_column_raw(column, position)
+ when 3
+ position, title, cell = args
+ insert_column_with_data_func(position, title, cell, &block)
+ when 4
+ position, title, cell, attributes = args
+ column = TreeViewColumn.new
+ column.sizing = :fixed if fixed_height_mode?
+ column.title = title
+ column.pack_start(cell, true)
+ attributes.each do |name, column_id|
+ column.add_attribute(cell, name, column_id)
+ end
+ insert_column_raw(column, position)
+ else
+ raise ArgumentError, "wrong number of arguments (#{args.size} for 2..4)"
+ end
+ end
end
end
diff --git a/gtk3/test/test-gtk-tree-view.rb b/gtk3/test/test-gtk-tree-view.rb
index 5b9537d..e02a2d3 100644
--- a/gtk3/test/test-gtk-tree-view.rb
+++ b/gtk3/test/test-gtk-tree-view.rb
@@ -101,5 +101,32 @@ class TestGtkTreeView < Test::Unit::TestCase
@view.row_expanded?(parent.path)
end
end
+
+ sub_test_case "#insert_column" do
+ def setup
+ @store = Gtk::TreeStore.new(String)
+ @view = Gtk::TreeView.new(@store)
+ end
+
+ test "column, position" do
+ column = Gtk::TreeViewColumn.new("Label",
+ Gtk::CellRendererText.new,
+ :text => 0)
+ @view.insert_column(column, 0)
+ assert_equal([column], @view.columns)
+ end
+
+ test "position, title, cell" do
+ @view.insert_column(0, "Label", Gtk::CellRendererText.new) do
+ end
+ assert_equal(["Label"], @view.columns.collect(&:title))
+ end
+
+ test "position, title, cell, attributes" do
+ @view.insert_column(0, "Label", Gtk::CellRendererText.new,
+ :text => 0)
+ assert_equal(["Label"], @view.columns.collect(&:title))
+ end
+ end
end
end
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-gnome2.git
More information about the Pkg-ruby-extras-commits
mailing list