[DRE-commits] [ruby-gnome2] 06/31: New upstream version 3.0.2
Daisuke Higuchi
dai at moszumanska.debian.org
Mon Oct 10 13:40:17 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 49e1ac24066af09768fd8bfdd4daf466c7b206c2
Author: HIGUCHI Daisuke (VDR dai) <dai at debian.org>
Date: Sun Oct 9 21:56:21 2016 +0900
New upstream version 3.0.2
---
NEWS | 95 ++++++++++
README.md | 3 +-
Rakefile | 26 ++-
build/build-windows.sh | 204 ++++++++++++---------
gdk3/Rakefile | 12 ++
gdk3/lib/gdk3/cairo.rb | 10 +-
gdk3/lib/gdk3/deprecated.rb | 19 +-
gdk3/lib/gdk3/window.rb | 7 +-
glib2/ext/glib2/rbglib.h | 2 +-
.../ext/gobject-introspection/rb-gi-argument.c | 129 ++++++++-----
.../ext/gobject-introspection/rb-gi-loader.c | 12 ++
gstreamer/lib/gst.rb | 1 +
.../lib/gst/type-find-factory.rb | 10 +-
gstreamer/sample/gst-inspect.rb | 21 ++-
gtk3/Rakefile | 5 +
gtk3/lib/gtk3.rb | 6 +-
gtk3/lib/gtk3/calendar.rb | 6 +
gtk3/lib/gtk3/{window.rb => check-menu-item.rb} | 19 +-
gtk3/lib/gtk3/deprecated.rb | 44 ++++-
gtk3/lib/gtk3/dialog.rb | 9 +
gtk3/lib/gtk3/{window.rb => image-menu-item.rb} | 22 ++-
gtk3/lib/gtk3/image.rb | 10 +-
gtk3/lib/gtk3/loader.rb | 3 +
gtk3/lib/gtk3/{calendar.rb => table.rb} | 25 ++-
gtk3/lib/gtk3/text-buffer.rb | 24 ++-
gtk3/lib/gtk3/tree-iter.rb | 6 +-
gtk3/lib/gtk3/tree-model.rb | 5 +
gtk3/lib/gtk3/window.rb | 13 ++
gtk3/sample/misc/application.rb | 6 +-
gtk3/sample/misc/colorchooser.rb | 22 +++
gtk3/sample/misc/colorselection.rb | 23 ---
gtk3/sample/misc/scalebutton.rb | 2 +-
gtk3/sample/misc/tooltips.rb | 2 +-
gtk3/sample/tutorial/exampleapp8/exampleapp.rb | 4 +-
gtk3/sample/tutorial/exampleapp9/exampleapp.rb | 2 +-
.../gtk3/calendar.rb => test/test-calendar.rb} | 18 +-
.../calendar.rb => test/test-check-menu-item.rb} | 26 ++-
gtk3/test/test-gtk-image.rb | 5 +
gtk3/test/test-gtk-tree-iter.rb | 9 +
.../gtk3/calendar.rb => test/test-gtk-window.rb} | 20 +-
rsvg2/Rakefile | 5 +
rsvg2/lib/rsvg2.rb | 43 +++++
42 files changed, 695 insertions(+), 240 deletions(-)
diff --git a/NEWS b/NEWS
index e362e7b..a0bc444 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,101 @@
= NEWS
+== Ruby-GNOME2 3.0.2: 2015-09-13
+
+It is a compatibility improvement release of 3.0.1.
+
+=== Changes
+
+==== Ruby/GObjectIntrospection
+
+ * Improvements
+ * Supported void pointer.
+ [GitHub#540] [Reported by Abby Archer]
+ * Added (({GObjectIntrospection::Loader.instantiate_gobject_pointer})).
+
+==== Ruby/GDK3
+
+ * Improvements
+ * Supported (({Gdk::Window#user_data})).
+ [GitHub#540] [Reported by Abby Archer]
+ * compatibility: (({Cairo::Context#set_source_rgba})) accepts
+ (({nil})) as alpha value.
+ [GitHub#540] [Reported by Abby Archer]
+ * compatibility: Added fallback feature for deprecated
+ (({Gdk::EventScroll::Direction})).
+ * Windows: Added hicolor-icon-theme as fallback theme.
+
+==== Ruby/GTK3
+
+ * Improvements
+ * compatibility: (({Gtk::Window#icon=})) accepts icon file name.
+ [GitHub#540] [Reported by Abby Archer]
+ * compatibility: (({Gtk::Dialog#add_button})) accepts (({Symbol}))
+ as response ID.
+ [GitHub#540] [Reported by Abby Archer]
+ * Deprecated (({Gtk::ColorSelectionDialog})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::TextTag::WrapMode})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::TextBuffer#insert(iter, target, *tags)})) usage.
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::ButtonBox::Style})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::MessageDialog::ButtonsType})).
+ * compatibility: Supported creating an empty image by
+ (({Gtk::Image.new})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::ImageMenuItem.new})) usage.
+ * Supported (({Gtk::TreeIter#next!})).
+ * Supported (({Gtk::TreeModel#get_value})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Alignment::Align})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Widget#get_size_request})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Table.new})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Table#column_spaces})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Table#column_spaces=})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Table#attach})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::ToggleButton.new})).
+ * Windows: Added missing Ruby/RSVG2 dependency.
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Container#each_forall})).
+ * Supported (({nil})) as (({size})) for (({Gtk::Image.new})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Image.new(pixbuf)})).
+ * compatibility: Added fallback feature for deprecated
+ (({Gtk::Toolbar::Style})).
+ * Supported Rubyish (({Gtk::CheckMenuItem.new})).
+ * Fixes
+ * Fixed samples.
+ [GitHub#536][GitHub#541] [Patch by cedlemo]
+ [GitHub#540] [Reported by Abby Archer]
+ * Fixed a bug that (({Gtk::Calendar#date})) returns (({0-11}))
+ range month value.
+
+==== Ruby/RSVG2
+
+ * Improvements
+ * Windows: Added missing Ruby/Pango dependency.
+ * Windows: Updated loaders.cache for gdk-pixbuf automatically.
+
+==== Ruby/GStreamer
+
+ * Improvements
+ * compatibility: (({Gst::TypeFindFactory#extensions})) always
+ returns (({Array})).
+
+=== Thanks
+
+ * cedlemo
+ * Abby Archer
+
== Ruby-GNOME2 3.0.1: 2015-09-11
It is a bug fix release of 3.0.0.
diff --git a/README.md b/README.md
index 39fdf5c..4f51844 100644
--- a/README.md
+++ b/README.md
@@ -115,11 +115,12 @@ current dependencies are:
### Install from GitHub master branch
-You can also install this gem from GitHub master branch.
+You can also install these gems from GitHub master branch.
% git clone https://github.com/ruby-gnome2/ruby-gnome2.git
% cd ruby-gnome2
% gem install rake rake-compiler mechanize pkg-config cairo
+ % rake gem:build
% rake gem:install
### Experimental
diff --git a/Rakefile b/Rakefile
index 5d25540..0d24116 100644
--- a/Rakefile
+++ b/Rakefile
@@ -443,14 +443,30 @@ namespace :gem do
"gem:windows:build:ext",
]
- desc "clean all Windows gems build"
- task :clean do
- windows_gnome2_packages.each do |package|
- rm_rf(File.join(package, "tmp"))
- rm_rf(File.join(package, "vendor"))
+ namespace :clean do
+ desc "clean all Windows gems build"
+ task :gem do
+ windows_gnome2_packages.each do |package|
+ rm_rf(File.join(package, "tmp", "x86-mingw32"))
+ rm_rf(File.join(package, "tmp", "x64-mingw32"))
+ rm_rf(File.join(package, "pkg"))
+ end
+ end
+
+ desc "clean all built dependency software for Windows gems"
+ task :vendor do
+ windows_gnome2_packages.each do |package|
+ rm_rf(File.join(package, "vendor"))
+ end
end
end
+ desc "clean all Windows related build"
+ task :clean => [
+ "gem:windows:clean:gem",
+ "gem:windows:clean:vendor",
+ ]
+
desc "download DLL for Windows all gems"
task :download do
windows_gnome2_packages.each do |package|
diff --git a/build/build-windows.sh b/build/build-windows.sh
index 470751b..d6ffc02 100755
--- a/build/build-windows.sh
+++ b/build/build-windows.sh
@@ -20,83 +20,84 @@ run()
fi
}
-run sudo sed -i'' -e 's,http://us,http://jp,g' /etc/apt/sources.list
-run sudo apt-get update
-
-echo ttf-mscorefonts-installer \
- msttcorefonts/accepted-mscorefonts-eula \
- select true | \
- run sudo debconf-set-selections
-
-run \
- sudo apt-get install -y -V \
- git \
- ruby \
- ruby-dev \
- build-essential \
- pkg-config \
- autoconf \
- libtool \
- gettext \
- intltool \
- gtk-doc-tools \
- libffi-dev \
- libglib2.0-dev \
- libgdk-pixbuf2.0-dev \
- gobject-introspection \
- libgtk2.0-bin \
- flex \
- bison \
- gperf \
- libxml2-utils \
- python-dev \
- wine1.6 \
- mingw-w64 \
- cmake
-
-run git clone file:///pkg-config/.git
-run git clone file:///rcairo/.git rcairo.${DIRECTORY_SUFFIX}
-run git clone file:///ruby-gnome2/.git ruby-gnome2.${DIRECTORY_SUFFIX}
-
-run sudo gem install --no-document \
- rake \
- bundler \
+if [ ! -f ~/setup.timestamp ]; then
+ run sudo sed -i'' -e 's,http://us,http://jp,g' /etc/apt/sources.list
+ run sudo apt-get update
+
+ echo ttf-mscorefonts-installer \
+ msttcorefonts/accepted-mscorefonts-eula \
+ select true | \
+ run sudo debconf-set-selections
+
+ run \
+ sudo apt-get install -y -V \
+ git \
+ ruby \
+ ruby-dev \
+ build-essential \
pkg-config \
- rake-compiler \
- mechanize \
- packnga
-
-if [ ! -d ~/.wine/ ]; then
- run wineboot
- until [ -f ~/.wine/system.reg ]; do
- sleep 1
- done
- wine_home="z:/home/vagrant"
- wine_rcairo="${wine_home}/rcairo.${DIRECTORY_SUFFIX}"
- wine_ruby_gnome2="${wine_home}/ruby-gnome2.${DIRECTORY_SUFFIX}"
- bin_dir="vendor/local/bin"
- path=$(
- (
- echo -n "${wine_rcairo}/${bin_dir};";
- echo -n "${wine_ruby_gnome2}/glib2/${bin_dir};";
- echo -n "${wine_ruby_gnome2}/gdk_pixbuf2/${bin_dir};"
- echo -n "${wine_ruby_gnome2}/pango/${bin_dir};";
- echo -n "${wine_ruby_gnome2}/atk/${bin_dir};";
- echo -n "${wine_ruby_gnome2}/gtk2/${bin_dir};";
- echo -n "${wine_ruby_gnome2}/gdk3/${bin_dir};";
- ) | \
- sed -e 's,/,\\\\\\\\,g')
- run sed -i'' -r \
- -e "s,^(\"PATH\"=str\\(2\\):\"),\\1${path},g" \
- ~/.wine/system.reg
-fi
+ autoconf \
+ libtool \
+ gettext \
+ intltool \
+ gtk-doc-tools \
+ libffi-dev \
+ libglib2.0-dev \
+ libgdk-pixbuf2.0-dev \
+ gobject-introspection \
+ libgtk2.0-bin \
+ flex \
+ bison \
+ gperf \
+ libxml2-utils \
+ python-dev \
+ wine1.6 \
+ mingw-w64 \
+ cmake
+
+ run git clone file:///pkg-config/.git
+ run git clone file:///rcairo/.git rcairo.${DIRECTORY_SUFFIX}
+ run git clone file:///ruby-gnome2/.git ruby-gnome2.${DIRECTORY_SUFFIX}
+
+ run sudo gem install --no-document \
+ rake \
+ bundler \
+ pkg-config \
+ rake-compiler \
+ mechanize \
+ packnga
+
+ if [ ! -d ~/.wine/ ]; then
+ run wineboot
+ until [ -f ~/.wine/system.reg ]; do
+ sleep 1
+ done
+ wine_home="z:/home/vagrant"
+ wine_rcairo="${wine_home}/rcairo.${DIRECTORY_SUFFIX}"
+ wine_ruby_gnome2="${wine_home}/ruby-gnome2.${DIRECTORY_SUFFIX}"
+ bin_dir="vendor/local/bin"
+ path=$(
+ (
+ echo -n "${wine_rcairo}/${bin_dir};";
+ echo -n "${wine_ruby_gnome2}/glib2/${bin_dir};";
+ echo -n "${wine_ruby_gnome2}/gdk_pixbuf2/${bin_dir};"
+ echo -n "${wine_ruby_gnome2}/pango/${bin_dir};";
+ echo -n "${wine_ruby_gnome2}/atk/${bin_dir};";
+ echo -n "${wine_ruby_gnome2}/gtk2/${bin_dir};";
+ echo -n "${wine_ruby_gnome2}/gdk3/${bin_dir};";
+ ) | \
+ sed -e 's,/,\\\\\\\\,g')
+ run sed -i'' -r \
+ -e "s,^(\"PATH\"=str\\(2\\):\"),\\1${path},g" \
+ ~/.wine/system.reg
+ fi
-run wget https://www.opengl.org/registry/api/GL/glext.h
-run sudo install glext.h /usr/share/mingw-w64/include/GL/
-run rm -f glext.h
+ run wget https://www.opengl.org/registry/api/GL/glext.h
+ run sudo install glext.h /usr/share/mingw-w64/include/GL/
+ run rm -f glext.h
-if ! grep -q GL/glext /usr/share/mingw-w64/include/GL/gl.h; then
- cat <<EOF > /tmp/insert.txt
+ if ! grep -q GL/glext /usr/share/mingw-w64/include/GL/gl.h; then
+ cat <<EOF > /tmp/insert.txt
typedef ptrdiff_t GLintptr;
typedef ptrdiff_t GLsizeiptr;
@@ -104,32 +105,53 @@ typedef char GLchar;
#include <GL/glext.h>
EOF
- run sudo sed -i'' -e '/typedef void GLvoid;/ r /tmp/insert.txt' \
- /usr/share/mingw-w64/include/GL/gl.h
- run rm -f /tmp/insert.txt
+ run sudo sed -i'' -e '/typedef void GLvoid;/ r /tmp/insert.txt' \
+ /usr/share/mingw-w64/include/GL/gl.h
+ run rm -f /tmp/insert.txt
+ fi
+
+ run touch ~/setup.timestamp
fi
-sudo chown -R "${USER}:${USER}" /var/lib/gems
+if [ ! -f ~/rake-compiler.timestamp ]; then
+ sudo chown -R "${USER}:${USER}" /var/lib/gems
-for ruby_version in ${ruby_versions}; do
- run rake-compiler cross-ruby HOST="${BUILD_HOST}" VERSION="${ruby_version}"
-done
+ for ruby_version in ${ruby_versions}; do
+ run rake-compiler cross-ruby HOST="${BUILD_HOST}" VERSION="${ruby_version}"
+ done
-run cd ~/rcairo.${DIRECTORY_SUFFIX}
-run rake windows:gcc:dll:bundle windows:zlib:build
+ run touch ~/rake-compiler.timestamp
+fi
-run cd ~/ruby-gnome2.${DIRECTORY_SUFFIX}/glib2
-run rake native:build windows:build
+if [ ! -f ~/native.timestamp ]; then
+ run cd ~/rcairo.${DIRECTORY_SUFFIX}
+ run git pull --rebase
+ run rake windows:gcc:dll:bundle windows:zlib:build
-run cd ~/ruby-gnome2.${DIRECTORY_SUFFIX}/gobject-introspection
-run rake native:build
+ run cd ~/ruby-gnome2.${DIRECTORY_SUFFIX}
+ run git pull --rebase
-run cd ~/rcairo.${DIRECTORY_SUFFIX}
-run rake windows:build
-run rake cross compile native
+ run cd ~/ruby-gnome2.${DIRECTORY_SUFFIX}/glib2
+ run rake native:build windows:build
+
+ run cd ~/ruby-gnome2.${DIRECTORY_SUFFIX}/gobject-introspection
+ run rake native:build
+
+ run touch ~/native.timestamp
+fi
+
+if [ ! -f ~/rcairo.timestamp ]; then
+ run cd ~/rcairo.${DIRECTORY_SUFFIX}
+ run git pull --rebase
+ run rake windows:build
+ run rake cross compile native
+
+ run touch ~/rcairo.timestamp
+fi
run cd ~/ruby-gnome2.${DIRECTORY_SUFFIX}
-run rake gem:windows:build
+run git pull --rebase
+run rake gem:windows:clean:gem gem:windows:build
run mkdir -p /vagrant/pkg
run cp */pkg/*.gem /vagrant/pkg/
diff --git a/gdk3/Rakefile b/gdk3/Rakefile
index a8d0f12..aad7536 100644
--- a/gdk3/Rakefile
+++ b/gdk3/Rakefile
@@ -75,6 +75,18 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
},
},
{
+ :name => "hicolor-icon-theme",
+ :download_base_url => "http://icon-theme.freedesktop.org/releases",
+ :label => "gtk-hi-color-icon-theme",
+ :version => "0.15",
+ :compression_method => "xz",
+ :windows => {
+ :configure_args => [],
+ :build_concurrently => false,
+ :built_file => "share/icons/hicolor/index.theme",
+ }
+ },
+ {
:name => "adwaita-icon-theme",
:download_site => :gnome,
:label => "adwaita-icon-theme",
diff --git a/gdk3/lib/gdk3/cairo.rb b/gdk3/lib/gdk3/cairo.rb
index 3cac1c6..6ca0ff3 100644
--- a/gdk3/lib/gdk3/cairo.rb
+++ b/gdk3/lib/gdk3/cairo.rb
@@ -17,12 +17,12 @@
module Cairo
class Context
if method_defined?(:set_source_color)
- alias_method :set_source_not_gdk_color, :set_source_color
+ alias_method :set_source_color_raw, :set_source_color
def set_source_color(color)
if color.is_a?(Gdk::Color)
set_source_gdk_color(color)
else
- set_source_not_gdk_color(color)
+ set_source_color_raw(color)
end
end
else
@@ -35,16 +35,16 @@ module Cairo
end
if method_defined?(:set_source_rgba)
- alias_method :set_source_not_gdk_rgba, :set_source_rgba
+ alias_method :set_source_rgba_raw, :set_source_rgba
def set_source_rgba(rgba, g=nil, b=nil, a=nil)
case rgba
when Gdk::RGBA
set_source_gdk_rgba(rgba)
when Array
- set_source_not_gdk_rgba(rgba)
+ set_source_rgba_raw(rgba)
else
r = rgba
- set_source_not_gdk_rgba([r, g, b, a])
+ set_source_rgba_raw([r, g, b, a || 1.0])
end
end
else
diff --git a/gdk3/lib/gdk3/deprecated.rb b/gdk3/lib/gdk3/deprecated.rb
index b72d797..77c5116 100644
--- a/gdk3/lib/gdk3/deprecated.rb
+++ b/gdk3/lib/gdk3/deprecated.rb
@@ -1,3 +1,19 @@
+# Copyright (C) 2011-2015 Ruby-GNOME2 Project Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
module Gdk
extend GLib::Deprecatable
define_deprecated_enums :GrabStatus, 'GRAB'
@@ -90,7 +106,8 @@ module Gdk
class EventScroll
extend GLib::Deprecatable
- define_deprecated_enums :ScrollDirection
+ define_deprecated_const :Direction, "Gdk::ScrollDirection"
+ define_deprecated_enums "Gdk::ScrollDirection"
end
class EventSetting
diff --git a/gdk3/lib/gdk3/window.rb b/gdk3/lib/gdk3/window.rb
index 23e2aee..7caeaf9 100644
--- a/gdk3/lib/gdk3/window.rb
+++ b/gdk3/lib/gdk3/window.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Ruby-GNOME2 Project Team
+# Copyright (C) 2014-2015 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -17,5 +17,10 @@
module Gdk
class Window
alias_method :invalidate, :invalidate_rect
+
+ alias_method :user_data_raw, :user_data
+ def user_data
+ Loader.instantiate_gobject_pointer(user_data_raw)
+ end
end
end
diff --git a/glib2/ext/glib2/rbglib.h b/glib2/ext/glib2/rbglib.h
index 03b7023..278bbf1 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 1
+#define RBGLIB_MICRO_VERSION 2
#ifndef RSTRING_PTR
# define RSTRING_PTR(s) (RSTRING(s)->ptr)
diff --git a/gobject-introspection/ext/gobject-introspection/rb-gi-argument.c b/gobject-introspection/ext/gobject-introspection/rb-gi-argument.c
index 117b550..a5e68a8 100644
--- a/gobject-introspection/ext/gobject-introspection/rb-gi-argument.c
+++ b/gobject-introspection/ext/gobject-introspection/rb-gi-argument.c
@@ -1366,67 +1366,70 @@ rb_gi_out_argument_init(GIArgument *argument, GIArgInfo *arg_info)
g_arg_info_load_type(arg_info, &type_info);
type_tag = g_type_info_get_tag(&type_info);
switch (type_tag) {
- case GI_TYPE_TAG_VOID:
+ case GI_TYPE_TAG_VOID:
+ if (g_type_info_is_pointer(&type_info)) {
+ argument->v_pointer = ALLOC(gpointer);
+ }
break;
- case GI_TYPE_TAG_BOOLEAN:
+ case GI_TYPE_TAG_BOOLEAN:
argument->v_pointer = ALLOC(gboolean);
break;
- case GI_TYPE_TAG_INT8:
+ case GI_TYPE_TAG_INT8:
argument->v_pointer = ALLOC(gint8);
break;
- case GI_TYPE_TAG_UINT8:
+ case GI_TYPE_TAG_UINT8:
argument->v_pointer = ALLOC(guint8);
break;
- case GI_TYPE_TAG_INT16:
+ case GI_TYPE_TAG_INT16:
argument->v_pointer = ALLOC(gint16);
break;
- case GI_TYPE_TAG_UINT16:
+ case GI_TYPE_TAG_UINT16:
argument->v_pointer = ALLOC(guint16);
break;
- case GI_TYPE_TAG_INT32:
+ case GI_TYPE_TAG_INT32:
argument->v_pointer = ALLOC(gint32);
break;
- case GI_TYPE_TAG_UINT32:
+ case GI_TYPE_TAG_UINT32:
argument->v_pointer = ALLOC(guint32);
break;
- case GI_TYPE_TAG_INT64:
+ case GI_TYPE_TAG_INT64:
argument->v_pointer = ALLOC(gint64);
break;
- case GI_TYPE_TAG_UINT64:
+ case GI_TYPE_TAG_UINT64:
argument->v_pointer = ALLOC(guint64);
break;
- case GI_TYPE_TAG_FLOAT:
+ case GI_TYPE_TAG_FLOAT:
argument->v_pointer = ALLOC(gfloat);
break;
- case GI_TYPE_TAG_DOUBLE:
+ case GI_TYPE_TAG_DOUBLE:
argument->v_pointer = ALLOC(gdouble);
break;
- case GI_TYPE_TAG_GTYPE:
+ case GI_TYPE_TAG_GTYPE:
argument->v_pointer = ALLOC(GType);
break;
- case GI_TYPE_TAG_UTF8:
- case GI_TYPE_TAG_FILENAME:
+ case GI_TYPE_TAG_UTF8:
+ case GI_TYPE_TAG_FILENAME:
argument->v_pointer = ALLOC(gchar *);
break;
- case GI_TYPE_TAG_ARRAY:
+ case GI_TYPE_TAG_ARRAY:
rb_gi_out_argument_init_array(argument, arg_info, &type_info);
break;
- case GI_TYPE_TAG_INTERFACE:
+ case GI_TYPE_TAG_INTERFACE:
rb_gi_out_argument_init_interface(argument, arg_info, &type_info);
break;
- case GI_TYPE_TAG_GLIST:
- case GI_TYPE_TAG_GSLIST:
- case GI_TYPE_TAG_GHASH:
+ case GI_TYPE_TAG_GLIST:
+ case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
argument->v_pointer = ALLOC(gpointer);
break;
- case GI_TYPE_TAG_ERROR:
+ case GI_TYPE_TAG_ERROR:
argument->v_pointer = ALLOC(GError *);
memset(argument->v_pointer, 0, sizeof(GError *));
break;
- case GI_TYPE_TAG_UNICHAR:
+ case GI_TYPE_TAG_UNICHAR:
argument->v_pointer = ALLOC(gunichar);
break;
- default:
+ default:
g_assert_not_reached();
break;
}
@@ -1448,53 +1451,56 @@ rb_gi_out_argument_to_ruby(GIArgument *argument,
g_arg_info_load_type(arg_info, &type_info);
type_tag = g_type_info_get_tag(&type_info);
switch (type_tag) {
- case GI_TYPE_TAG_VOID:
+ case GI_TYPE_TAG_VOID:
+ if (g_type_info_is_pointer(&type_info)) {
+ normalized_argument.v_pointer = *((gpointer *)(argument->v_pointer));
+ }
break;
- case GI_TYPE_TAG_BOOLEAN:
+ case GI_TYPE_TAG_BOOLEAN:
normalized_argument.v_boolean = *((gboolean *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_INT8:
+ case GI_TYPE_TAG_INT8:
normalized_argument.v_int8 = *((gint8 *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_UINT8:
+ case GI_TYPE_TAG_UINT8:
normalized_argument.v_uint8 = *((guint8 *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_INT16:
+ case GI_TYPE_TAG_INT16:
normalized_argument.v_int16 = *((gint16 *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_UINT16:
+ case GI_TYPE_TAG_UINT16:
normalized_argument.v_uint16 = *((guint16 *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_INT32:
+ case GI_TYPE_TAG_INT32:
normalized_argument.v_int32 = *((gint32 *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_UINT32:
+ case GI_TYPE_TAG_UINT32:
normalized_argument.v_uint32 = *((guint32 *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_INT64:
+ case GI_TYPE_TAG_INT64:
normalized_argument.v_int64 = *((gint64 *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_UINT64:
+ case GI_TYPE_TAG_UINT64:
normalized_argument.v_uint64 = *((guint64 *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_FLOAT:
+ case GI_TYPE_TAG_FLOAT:
normalized_argument.v_float = *((gfloat *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_DOUBLE:
+ case GI_TYPE_TAG_DOUBLE:
normalized_argument.v_double = *((gdouble *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_GTYPE:
+ case GI_TYPE_TAG_GTYPE:
normalized_argument.v_size = *((GType *)(argument->v_pointer));
break;
- case GI_TYPE_TAG_UTF8:
- case GI_TYPE_TAG_FILENAME:
+ case GI_TYPE_TAG_UTF8:
+ case GI_TYPE_TAG_FILENAME:
normalized_argument.v_string = *((gchar **)(argument->v_pointer));
break;
- case GI_TYPE_TAG_ARRAY:
- case GI_TYPE_TAG_INTERFACE:
- case GI_TYPE_TAG_GLIST:
- case GI_TYPE_TAG_GSLIST:
- case GI_TYPE_TAG_GHASH:
+ case GI_TYPE_TAG_ARRAY:
+ case GI_TYPE_TAG_INTERFACE:
+ case GI_TYPE_TAG_GLIST:
+ case GI_TYPE_TAG_GSLIST:
+ case GI_TYPE_TAG_GHASH:
if (g_arg_info_is_caller_allocates(arg_info)) {
duplicate = TRUE;
normalized_argument.v_pointer = argument->v_pointer;
@@ -1502,13 +1508,13 @@ rb_gi_out_argument_to_ruby(GIArgument *argument,
normalized_argument.v_pointer = *((gpointer *)(argument->v_pointer));
}
break;
- case GI_TYPE_TAG_ERROR:
+ case GI_TYPE_TAG_ERROR:
normalized_argument.v_pointer = *((GError **)(argument->v_pointer));
break;
- case GI_TYPE_TAG_UNICHAR:
+ case GI_TYPE_TAG_UNICHAR:
normalized_argument.v_uint32 = *((guint32 *)(argument->v_pointer));
break;
- default:
+ default:
g_assert_not_reached();
break;
}
@@ -2396,6 +2402,34 @@ rb_gi_value_argument_from_ruby_void(GIArgument *argument, GITypeInfo *type_info,
}
}
+static GType
+rb_gi_value_argument_from_ruby_gtype(VALUE rb_argument)
+{
+ ID id_gtype;
+ VALUE rb_gtype;
+
+ if (RB_TYPE_P(rb_argument, RUBY_T_STRING)) {
+ GType gtype;
+ gtype = g_type_from_name(RVAL2CSTR(rb_argument));
+ if (gtype == 0) {
+ rb_raise(rb_eArgError,
+ "unknown GType name: <%s>",
+ RVAL2CSTR(rb_argument));
+ }
+ return gtype;
+ }
+
+ CONST_ID(id_gtype, "gtype");
+
+ if (rb_respond_to(rb_argument, id_gtype)) {
+ rb_gtype = rb_funcall(rb_argument, id_gtype, 0);
+ } else {
+ rb_gtype = rb_argument;
+ }
+
+ return NUM2ULONG(rb_gtype);
+}
+
GIArgument *
rb_gi_value_argument_from_ruby(GIArgument *argument, GITypeInfo *type_info,
VALUE rb_argument, VALUE self)
@@ -2443,8 +2477,7 @@ rb_gi_value_argument_from_ruby(GIArgument *argument, GITypeInfo *type_info,
argument->v_double = NUM2DBL(rb_argument);
break;
case GI_TYPE_TAG_GTYPE:
- /* TODO: support GLib::Type and String as GType name. */
- argument->v_size = NUM2ULONG(rb_argument);
+ argument->v_size = rb_gi_value_argument_from_ruby_gtype(rb_argument);
break;
case GI_TYPE_TAG_UTF8:
/* TODO: support UTF-8 convert like rb_argument.encode("UTF-8"). */
diff --git a/gobject-introspection/ext/gobject-introspection/rb-gi-loader.c b/gobject-introspection/ext/gobject-introspection/rb-gi-loader.c
index ffdd2b0..aaee2d7 100644
--- a/gobject-introspection/ext/gobject-introspection/rb-gi-loader.c
+++ b/gobject-introspection/ext/gobject-introspection/rb-gi-loader.c
@@ -236,6 +236,17 @@ rg_s_reference_gobject(int argc, VALUE *argv, G_GNUC_UNUSED VALUE klass)
return Qnil;
}
+static VALUE
+rg_s_instantiate_gobject_pointer(G_GNUC_UNUSED VALUE klass,
+ VALUE rb_gobject_pointer)
+{
+ GObject *gobject;
+
+ gobject = GUINT_TO_POINTER(NUM2ULONG(rb_gobject_pointer));
+
+ return GOBJ2RVAL(gobject);
+}
+
void
rb_gi_loader_init(VALUE rb_mGI)
{
@@ -253,4 +264,5 @@ rb_gi_loader_init(VALUE rb_mGI)
RG_DEF_SMETHOD(register_constant_rename_map, 2);
RG_DEF_SMETHOD(start_callback_dispatch_thread, 0);
RG_DEF_SMETHOD(reference_gobject, -1);
+ RG_DEF_SMETHOD(instantiate_gobject_pointer, 1);
}
diff --git a/gstreamer/lib/gst.rb b/gstreamer/lib/gst.rb
index da6daa7..cd0e752 100644
--- a/gstreamer/lib/gst.rb
+++ b/gstreamer/lib/gst.rb
@@ -70,6 +70,7 @@ module Gst
require "gst/plugin-feature"
require "gst/registry"
require "gst/structure"
+ require "gst/type-find-factory"
init_base
init_controller
end
diff --git a/gtk3/lib/gtk3/calendar.rb b/gstreamer/lib/gst/type-find-factory.rb
similarity index 83%
copy from gtk3/lib/gtk3/calendar.rb
copy to gstreamer/lib/gst/type-find-factory.rb
index 32367ee..24abb83 100644
--- a/gtk3/lib/gtk3/calendar.rb
+++ b/gstreamer/lib/gst/type-find-factory.rb
@@ -14,11 +14,11 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-module Gtk
- class Calendar
- alias_method :select_month_raw, :select_month
- def select_month(month, year)
- select_month_raw(month - 1, year)
+module Gst
+ class TypeFindFactory
+ alias_method :extensions_raw, :extensions
+ def extensions
+ extensions_raw || []
end
end
end
diff --git a/gstreamer/sample/gst-inspect.rb b/gstreamer/sample/gst-inspect.rb
index b6e86be..3203938 100755
--- a/gstreamer/sample/gst-inspect.rb
+++ b/gstreamer/sample/gst-inspect.rb
@@ -84,7 +84,19 @@ class Inspector
def print_element(name)
factory = Gst::ElementFactory.find(name)
- print_element_factory(factory, false)
+ if factory
+ print_element_factory(factory, false)
+ else
+ registry = Gst::Registry.get
+ type_find_factory = registry.find_feature(name, Gst::TypeFindFactory)
+ if type_find_factory
+ # TODO
+ else
+ plugin = registry.find_plugin(name)
+ print_plugin_info(plugin)
+ # TODO: print_plugin_features(plugin)
+ end
+ end
end
private
@@ -123,10 +135,7 @@ class Inspector
"")
end
- def print_plugin_info(name)
- return if name.nil?
- registry = Gst::Registry.get
- plugin = registry.find_plugin(name)
+ def print_plugin_info(plugin)
return if plugin.nil?
puts("Plugin Details:",
@@ -430,7 +439,7 @@ class Inspector
prefix(print_names ? "#{factory.name}: " : "") do
print_factory_details_info(factory)
- print_plugin_info(factory.plugin.name)
+ print_plugin_info(factory.plugin)
print_hierarchy(element)
print_interfaces(element)
diff --git a/gtk3/Rakefile b/gtk3/Rakefile
index 1d93e96..6f1952d 100644
--- a/gtk3/Rakefile
+++ b/gtk3/Rakefile
@@ -17,5 +17,10 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
]
package.windows.packages = []
package.windows.dependencies = []
+ package.cross_compiling do |spec|
+ if /mingw|mswin/ =~ spec.platform.to_s
+ spec.add_runtime_dependency("rsvg2", ">= #{package.version}")
+ end
+ end
end
package_task.define
diff --git a/gtk3/lib/gtk3.rb b/gtk3/lib/gtk3.rb
index c1ee550..1901ed6 100644
--- a/gtk3/lib/gtk3.rb
+++ b/gtk3/lib/gtk3.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2014 Ruby-GNOME2 Project Team
+# Copyright (C) 2006-2015 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -26,6 +26,10 @@ GLib.prepend_dll_path(vendor_bin_dir)
vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
+if vendor_dir.exist?
+ require "rsvg2"
+end
+
require "gtk3/loader"
module Gtk
diff --git a/gtk3/lib/gtk3/calendar.rb b/gtk3/lib/gtk3/calendar.rb
index 32367ee..5f24118 100644
--- a/gtk3/lib/gtk3/calendar.rb
+++ b/gtk3/lib/gtk3/calendar.rb
@@ -20,5 +20,11 @@ module Gtk
def select_month(month, year)
select_month_raw(month - 1, year)
end
+
+ alias_method :date_raw, :date
+ def date
+ year, month, day = date_raw
+ [year, month + 1, day]
+ end
end
end
diff --git a/gtk3/lib/gtk3/window.rb b/gtk3/lib/gtk3/check-menu-item.rb
similarity index 72%
copy from gtk3/lib/gtk3/window.rb
copy to gtk3/lib/gtk3/check-menu-item.rb
index 496e54b..742cd3a 100644
--- a/gtk3/lib/gtk3/window.rb
+++ b/gtk3/lib/gtk3/check-menu-item.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Ruby-GNOME2 Project Team
+# Copyright (C) 2015 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -15,14 +15,19 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
module Gtk
- class Window
+ class CheckMenuItem
alias_method :initialize_raw, :initialize
- def initialize(type=:toplevel)
- if type.is_a?(String)
- initialize_raw(:toplevel)
- self.title = type
+ def initialize(options={})
+ label = options[:label]
+
+ if label
+ if options[:use_underline]
+ initialize_new_with_mnemonic(label)
+ else
+ initialize_new_with_label(label)
+ end
else
- initialize_raw(type)
+ initialize_raw
end
end
end
diff --git a/gtk3/lib/gtk3/deprecated.rb b/gtk3/lib/gtk3/deprecated.rb
index d24a05d..0b69558 100644
--- a/gtk3/lib/gtk3/deprecated.rb
+++ b/gtk3/lib/gtk3/deprecated.rb
@@ -10,6 +10,7 @@ module Gtk
define_deprecated_const :FontSelectionDialog, :raise => "Use 'Gtk::FontChooserDialog' instead."
remove_const(:ColorSelection)
define_deprecated_const :ColorSelection, :raise => "Use 'Gtk::ColorChooserWidget' instead."
+ remove_const(:ColorSelectionDialog)
define_deprecated_const :ColorSelectionDialog, :raise => "Use 'Gtk::ColorChooserDialog' instead."
define_deprecated_const :GammaCurve, :raise => "Don't use this widget anymore."
define_deprecated_const :HRuler, :raise => "Don't use this widget anymore."
@@ -113,6 +114,11 @@ module Gtk
end
end
+ class Alignment
+ extend GLib::Deprecatable
+ define_deprecated_const :Align, "Gtk::Align"
+ end
+
class Arrow
extend GLib::Deprecatable
define_deprecated_enums :Type
@@ -187,7 +193,8 @@ module Gtk
class ButtonBox
extend GLib::Deprecatable
- define_deprecated_enums :Style
+ define_deprecated_const :Style, "Gtk::ButtonBoxStyle"
+ define_deprecated_enums "Gtk::ButtonBoxStyle", "STYLE"
end
class Calendar
@@ -223,12 +230,12 @@ module Gtk
define_deprecated_method :get_size_of_row, :raise => "Use Gtk::Widget#get_preferred_size."
end
- class ColorSelectionDialog
+ class CheckMenuItem
extend GLib::Deprecatable
- define_deprecated_method :colorsel, :color_selection
define_deprecated_method_by_hash_args :initialize,
- 'title', ':title => nil' do |_self, title|
- [{:title => title}]
+ "label, use_underline=false",
+ ":label => label, :use_underline => use_underline" do |_self, label, use_underline|
+ [{:label => label, :use_underline => use_underline}]
end
end
@@ -253,6 +260,7 @@ module Gtk
class Container
extend GLib::Deprecatable
define_deprecated_singleton_method :child_property, :find_child_property
+ define_deprecated_method :each_forall, :each_all
end
class Dialog
@@ -515,12 +523,17 @@ module Gtk
end
when Symbol
[{:stock => image, :size => size}]
+ when Gdk::Pixbuf
+ [{:pixbuf => image}]
when Gtk::IconSet
[{:icon_set => image, :size => size}]
when Gio::Icon
[{:icon => image, :size => size}]
else
- [image]
+ message =
+ "Image must be String, Symbol, Gdk::Pixbuf, Gtk::IconSet or " +
+ "Gio::Icon: #{image.inspect}"
+ raise ArgumentError, message
end
end
end
@@ -583,7 +596,8 @@ module Gtk
class MessageDialog
extend GLib::Deprecatable
- define_deprecated_enums :ButtonsType, 'BUTTONS'
+ define_deprecated_const :ButtonsType, "Gtk::ButtonsType"
+ define_deprecated_enums "Gtk::ButtonsType", "BUTTONS"
define_deprecated_const :Type, 'Gtk::MessageType'
define_deprecated_enums 'Gtk::MessageType'
define_deprecated_method_by_hash_args :initialize,
@@ -842,7 +856,8 @@ module Gtk
class TextTag
extend GLib::Deprecatable
- define_deprecated_enums :WrapMode, 'WRAP'
+ define_deprecated_const :WrapMode, "Gtk::WrapMode"
+ define_deprecated_enums "Gtk::WrapMode", "WRAP"
end
class TextView
@@ -860,8 +875,19 @@ module Gtk
end
end
+ class ToggleButton
+ extend GLib::Deprecatable
+ define_deprecated_method_by_hash_args :initialize,
+ 'label=nil, use_underline=nil',
+ ':label => label, :use_underline => use_underline', 0 do
+ |_self, label, use_underline|
+ [{:label => label, :use_underline => use_underline}]
+ end
+ end
+
class Toolbar
extend GLib::Deprecatable
+ define_deprecated_const :Style, "Gtk::ToolbarStyle"
define_deprecated_method :append, :warn => "Don't use this method."
define_deprecated_method :prepend, :warn => "Don't use this method."
define_deprecated_method :item_index, :get_item_index
@@ -977,6 +1003,7 @@ module Gtk
class Widget
extend GLib::Deprecatable
+ define_deprecated_const :Align, "Gtk::Align"
define_deprecated_const :HelpType, "Gtk::WidgetHelpType"
define_deprecated_enums :WidgetHelpType, 'HELP'
define_deprecated_const :TextDirection, "Gtk::TextDIrection"
@@ -995,6 +1022,7 @@ module Gtk
define_deprecated_method :set_flags, :warn => "Use the proper method."
alias :flags= :set_flags
define_deprecated_method :unset_flags, :warn => "Use the proper method."
+ define_deprecated_method :get_size_request, :size_request
define_deprecated_method :no_window?, :warn => "Use '#{self}#has_window?'." do |_self|
!_self.has_window?
end
diff --git a/gtk3/lib/gtk3/dialog.rb b/gtk3/lib/gtk3/dialog.rb
index a82369a..2c4bb45 100644
--- a/gtk3/lib/gtk3/dialog.rb
+++ b/gtk3/lib/gtk3/dialog.rb
@@ -54,6 +54,15 @@ module Gtk
end
end
+ alias_method :add_button_raw, :add_button
+ def add_button(text, response_id)
+ case response_id
+ when Symbol
+ response_id = ResponseType.new(response_id)
+ end
+ add_button_raw(text, response_id)
+ end
+
if method_defined?(:use_header_bar)
alias_method :use_header_bar_raw, :use_header_bar
undef_method :use_header_bar
diff --git a/gtk3/lib/gtk3/window.rb b/gtk3/lib/gtk3/image-menu-item.rb
similarity index 66%
copy from gtk3/lib/gtk3/window.rb
copy to gtk3/lib/gtk3/image-menu-item.rb
index 496e54b..75a73f7 100644
--- a/gtk3/lib/gtk3/window.rb
+++ b/gtk3/lib/gtk3/image-menu-item.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Ruby-GNOME2 Project Team
+# Copyright (C) 2015 Ruby-GNOME2 Project Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -15,14 +15,22 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
module Gtk
- class Window
+ class ImageMenuItem
alias_method :initialize_raw, :initialize
- def initialize(type=:toplevel)
- if type.is_a?(String)
- initialize_raw(:toplevel)
- self.title = type
+ def initialize(options={})
+ stock = options[:stock] || nil
+ label = options[:label] || nil
+
+ if stock
+ initialize_new_from_stock(stock)
+ elsif label
+ if options[:use_underline]
+ initialize_new_with_mnemonic(label)
+ else
+ initialize_new_with_label(label)
+ end
else
- initialize_raw(type)
+ initialize_raw
end
end
end
diff --git a/gtk3/lib/gtk3/image.rb b/gtk3/lib/gtk3/image.rb
index 6fe3492..703566c 100644
--- a/gtk3/lib/gtk3/image.rb
+++ b/gtk3/lib/gtk3/image.rb
@@ -24,6 +24,9 @@ module Gtk
# Gdk::Pixbuf, Gdk::PixbufAnimation, Cairo::Surface,
# Fixnum}
#
+ # @example Create an empty image.
+ # image = Gtk::Image.new
+ #
# @example Create an image from a file.
# image = Gtk::Image.new :file => 'path/to/the/image.png'
#
@@ -84,7 +87,10 @@ module Gtk
case size
when String, Symbol
- size = Gtk.icon_size_from_name("gtk-#{size}")
+ size_name = size.to_s.gsub(/_/, "-")
+ size = Gtk.icon_size_from_name("gtk-#{size_name}")
+ else
+ size ||= Gtk::IconSize::BUTTON
end
if stock
@@ -106,7 +112,7 @@ module Gtk
elsif surface
initialize_new_from_surface(surface)
else
- raise ArgumentError, "Invalid arguments."
+ initialize_raw
end
end
end
diff --git a/gtk3/lib/gtk3/loader.rb b/gtk3/lib/gtk3/loader.rb
index dd08ed1..9417bc3 100644
--- a/gtk3/lib/gtk3/loader.rb
+++ b/gtk3/lib/gtk3/loader.rb
@@ -99,6 +99,7 @@ module Gtk
require "gtk3/builder"
require "gtk3/calendar"
require "gtk3/cell-layout"
+ require "gtk3/check-menu-item"
require "gtk3/clipboard"
require "gtk3/color-chooser-dialog"
require "gtk3/combo-box"
@@ -112,6 +113,7 @@ module Gtk
require "gtk3/icon-theme"
require "gtk3/icon-view"
require "gtk3/image"
+ require "gtk3/image-menu-item"
require "gtk3/label"
require "gtk3/level-bar"
require "gtk3/list-store"
@@ -130,6 +132,7 @@ module Gtk
require "gtk3/stock"
require "gtk3/style-context"
require "gtk3/style-properties"
+ require "gtk3/table"
require "gtk3/target-list"
require "gtk3/target-entry"
require "gtk3/text-buffer"
diff --git a/gtk3/lib/gtk3/calendar.rb b/gtk3/lib/gtk3/table.rb
similarity index 52%
copy from gtk3/lib/gtk3/calendar.rb
copy to gtk3/lib/gtk3/table.rb
index 32367ee..db20c22 100644
--- a/gtk3/lib/gtk3/calendar.rb
+++ b/gtk3/lib/gtk3/table.rb
@@ -15,10 +15,27 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
module Gtk
- class Calendar
- alias_method :select_month_raw, :select_month
- def select_month(month, year)
- select_month_raw(month - 1, year)
+ class Table
+ alias_method :initialize_raw, :initialize
+ def initialize(n_rows, n_columns, homogeneous=false)
+ initialize_raw(n_rows, n_columns, homogeneous)
+ end
+
+ alias_method :default_column_spacing, :default_col_spacing
+
+ def column_spacings(column)
+ get_col_spacings(column)
+ end
+ alias_method :set_column_spacings, :set_col_spacings
+ alias_method :column_spacings=, :col_spacings=
+
+ alias_method :attach_raw, :attach
+ def attach(child, left, right, top, bottom,
+ x_options=nil, y_options=nil,
+ x_space=nil, y_space=nil)
+ attach_raw(child, left, right, top, bottom,
+ x_options, y_options,
+ x_space || 0, y_space || 0)
end
end
end
diff --git a/gtk3/lib/gtk3/text-buffer.rb b/gtk3/lib/gtk3/text-buffer.rb
index 05fcc6c..c94659b 100644
--- a/gtk3/lib/gtk3/text-buffer.rb
+++ b/gtk3/lib/gtk3/text-buffer.rb
@@ -66,7 +66,29 @@ module Gtk
alias_method :insert_raw, :insert
alias_method :insert_pixbuf_raw, :insert_pixbuf
alias_method :insert_child_anchor_raw, :insert_child_anchor
- def insert(iter, target, options={})
+ def insert(iter, target, *args)
+ options = nil
+ tags = nil
+ case args.size
+ when 0
+ options = {}
+ when 1
+ case args.first
+ when Hash
+ options = args.first
+ else
+ tags = args
+ end
+ else
+ tags = args
+ end
+ if options.nil?
+ signature_prefix = "#{self.class}\##{__method__}(iter, target"
+ warn("#{signature_prefix}, *tags) style has been deprecated. " +
+ "Use #{signature_prefix}, options={:tags => tags}) style instead.")
+ options = {:tags => tags}
+ end
+
interactive = options[:interactive]
default_editable = options[:default_editable]
tags = options[:tags]
diff --git a/gtk3/lib/gtk3/tree-iter.rb b/gtk3/lib/gtk3/tree-iter.rb
index af0f964..269dfd5 100644
--- a/gtk3/lib/gtk3/tree-iter.rb
+++ b/gtk3/lib/gtk3/tree-iter.rb
@@ -25,7 +25,7 @@ module Gtk
end
def get_value(column)
- @model.get_value(self, column).value
+ @model.get_value(self, column)
end
alias_method :[], :get_value
@@ -43,6 +43,10 @@ module Gtk
@model.get_path(self)
end
+ def next!
+ @model.iter_next(self)
+ end
+
def ==(other)
other.is_a?(self.class) and
@model == other.model and
diff --git a/gtk3/lib/gtk3/tree-model.rb b/gtk3/lib/gtk3/tree-model.rb
index f141f09..e93784a 100644
--- a/gtk3/lib/gtk3/tree-model.rb
+++ b/gtk3/lib/gtk3/tree-model.rb
@@ -43,6 +43,11 @@ module Gtk
end
end
+ alias_method :get_value_raw, :get_value
+ def get_value(iter, column)
+ get_value_raw(iter, column).value
+ end
+
private
def setup_iter(iter)
iter.model = self
diff --git a/gtk3/lib/gtk3/window.rb b/gtk3/lib/gtk3/window.rb
index 496e54b..a55618d 100644
--- a/gtk3/lib/gtk3/window.rb
+++ b/gtk3/lib/gtk3/window.rb
@@ -25,5 +25,18 @@ module Gtk
initialize_raw(type)
end
end
+
+ alias_method :set_icon_raw, :set_icon
+ def set_icon(icon_or_file_name)
+ case icon_or_file_name
+ when String
+ set_icon_from_file(icon_or_file_name)
+ else
+ set_icon_raw(icon_or_file_name)
+ end
+ end
+
+ remove_method :icon=
+ alias_method :icon=, :set_icon
end
end
diff --git a/gtk3/sample/misc/application.rb b/gtk3/sample/misc/application.rb
old mode 100644
new mode 100755
index 6564bfc..60cb7b8
--- a/gtk3/sample/misc/application.rb
+++ b/gtk3/sample/misc/application.rb
@@ -7,7 +7,11 @@
=end
require "gtk3"
-myapp = Gtk::Application.new("org.gtk.example", :flags_none)
+myapp = Gtk::Application.new("org.gtk.example", :handles_command_line)
+myapp.signal_connect "command-line" do |app, command_line|
+ app.activate
+ 0
+end
myapp.signal_connect "activate" do |app|
win = Gtk::ApplicationWindow.new(app)
diff --git a/gtk3/sample/misc/colorchooser.rb b/gtk3/sample/misc/colorchooser.rb
new file mode 100644
index 0000000..7e26bb1
--- /dev/null
+++ b/gtk3/sample/misc/colorchooser.rb
@@ -0,0 +1,22 @@
+=begin
+ colorchooser.rb - Gtk::ColorChooserWidget sample script.
+
+ Copyright (c) 2015 Ruby-GNOME2 Project Team
+ This program is licenced under the same licence as Ruby-GNOME2.
+=end
+
+require "gtk3"
+
+color_selection = Gtk::ColorChooserWidget.new
+color_selection.use_alpha = true
+color_selection.signal_connect "color-activated" do |widget, color|
+ p color.to_s
+end
+
+window = Gtk::Window.new
+window.border_width = 10
+window.add(color_selection)
+window.show_all
+window.signal_connect("destroy") {Gtk.main_quit}
+
+Gtk.main
diff --git a/gtk3/sample/misc/colorselection.rb b/gtk3/sample/misc/colorselection.rb
deleted file mode 100644
index 9f85678..0000000
--- a/gtk3/sample/misc/colorselection.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-=begin
- colorselection.rb - Gtk::ColorSelection sample script.
-
- Copyright (C) 2005-2015 Masao Mutoh
- This program is licenced under the same licence as Ruby-GNOME2.
-=end
-
-require "gtk3"
-
-color_selection = Gtk::ColorSelection.new
-color_selection.has_palette = true
-color_selection.signal_connect("color_changed") do |widget|
- unless widget.adjusting?
- p widget.current_rgba.to_s
- end
-end
-
-window = Gtk::Window.new
-window.add(color_selection)
-window.show_all
-window.signal_connect("destroy") {Gtk.main_quit}
-
-Gtk.main
diff --git a/gtk3/sample/misc/scalebutton.rb b/gtk3/sample/misc/scalebutton.rb
old mode 100644
new mode 100755
index 8e10424..573d782
--- a/gtk3/sample/misc/scalebutton.rb
+++ b/gtk3/sample/misc/scalebutton.rb
@@ -22,7 +22,7 @@ box.hexpand = true
window.add(box)
# see here for an explication on icons order
# https://developer.gnome.org/gtk3/stable/GtkScaleButton.html#GtkScaleButton--icons
-scale.set_icons(%w(gtk-goto-bottom gtk-goto-top gtk-execute))
+scale.set_icons(%w(go-bottom go-top system-run))
scale.signal_connect("value-changed") { |_widget, value| puts "value changed: #{value}" }
window.show_all
diff --git a/gtk3/sample/misc/tooltips.rb b/gtk3/sample/misc/tooltips.rb
index 537a9ed..61bd8a6 100755
--- a/gtk3/sample/misc/tooltips.rb
+++ b/gtk3/sample/misc/tooltips.rb
@@ -25,7 +25,7 @@ def treeview_query_tooltip(treeview, keyboard_tip, x, y, tooltip)
else
bin_x, bin_y = treeview.convert_widget_to_bin_window_coords(x, y)
# Mouse mode
- path = treeview.get_path_at_pos(bin_x, bin_y)
+ path, = treeview.get_path_at_pos(bin_x, bin_y)
if not path
return false
end
diff --git a/gtk3/sample/tutorial/exampleapp8/exampleapp.rb b/gtk3/sample/tutorial/exampleapp8/exampleapp.rb
index 9526819..7562484 100644
--- a/gtk3/sample/tutorial/exampleapp8/exampleapp.rb
+++ b/gtk3/sample/tutorial/exampleapp8/exampleapp.rb
@@ -157,8 +157,8 @@ class ExampleAppWindow < Gtk::ApplicationWindow
sidebar,
"reveal-child",
Gio::SettingsBindFlags::DEFAULT)
- sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec, an_application|
- update_words(an_application)
+ sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec|
+ update_words(self)
end
builder = Gtk::Builder.new(:resource => "/org/gtk/exampleapp/gears-menu.ui")
menu = builder.get_object("menu")
diff --git a/gtk3/sample/tutorial/exampleapp9/exampleapp.rb b/gtk3/sample/tutorial/exampleapp9/exampleapp.rb
index ad90420..c9086c1 100644
--- a/gtk3/sample/tutorial/exampleapp9/exampleapp.rb
+++ b/gtk3/sample/tutorial/exampleapp9/exampleapp.rb
@@ -174,7 +174,7 @@ class ExampleAppWindow < Gtk::ApplicationWindow
sidebar,
"reveal-child",
Gio::SettingsBindFlags::DEFAULT)
- sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec, _application|
+ sidebar.signal_connect "notify::reveal-child" do |_sidebar, _gparamspec|
update_words(self)
end
builder = Gtk::Builder.new(:resource => "/org/gtk/exampleapp/gears-menu.ui")
diff --git a/gtk3/lib/gtk3/calendar.rb b/gtk3/test/test-calendar.rb
similarity index 74%
copy from gtk3/lib/gtk3/calendar.rb
copy to gtk3/test/test-calendar.rb
index 32367ee..dcc9734 100644
--- a/gtk3/lib/gtk3/calendar.rb
+++ b/gtk3/test/test-calendar.rb
@@ -14,11 +14,17 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-module Gtk
- class Calendar
- alias_method :select_month_raw, :select_month
- def select_month(month, year)
- select_month_raw(month - 1, year)
- end
+class TestGtkCalendar < Test::Unit::TestCase
+ include GtkTestUtils
+
+ def setup
+ @calendar = Gtk::Calendar.new
+ end
+
+ test "accessor" do
+ @calendar.select_month(12, 2015)
+ @calendar.select_day(31)
+ assert_equal([2015, 12, 31],
+ @calendar.date)
end
end
diff --git a/gtk3/lib/gtk3/calendar.rb b/gtk3/test/test-check-menu-item.rb
similarity index 58%
copy from gtk3/lib/gtk3/calendar.rb
copy to gtk3/test/test-check-menu-item.rb
index 32367ee..8a834f1 100644
--- a/gtk3/lib/gtk3/calendar.rb
+++ b/gtk3/test/test-check-menu-item.rb
@@ -14,11 +14,27 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-module Gtk
- class Calendar
- alias_method :select_month_raw, :select_month
- def select_month(month, year)
- select_month_raw(month - 1, year)
+class TestGtkCheckMenuItem < Test::Unit::TestCase
+ include GtkTestUtils
+
+ sub_test_case(".new") do
+ test "no argument" do
+ item = Gtk::CheckMenuItem.new
+ assert_equal("", item.label)
+ end
+
+ test ":label" do
+ label = "_Button"
+ button = Gtk::CheckMenuItem.new(:label => label)
+ assert_equal(label, button.label)
+ end
+
+ test ":use_underline" do
+ button = Gtk::CheckMenuItem.new(:label => "_Button",
+ :use_underline => true)
+ assert do
+ button.use_underline?
+ end
end
end
end
diff --git a/gtk3/test/test-gtk-image.rb b/gtk3/test/test-gtk-image.rb
index cebfaaf..162195c 100644
--- a/gtk3/test/test-gtk-image.rb
+++ b/gtk3/test/test-gtk-image.rb
@@ -2,6 +2,11 @@ class TestGtkImage < Test::Unit::TestCase
include GtkTestUtils
sub_test_case ".new" do
+ test "empty" do
+ image = Gtk::Image.new
+ assert_equal(nil, image.pixbuf)
+ end
+
test "stock" do
image = Gtk::Image.new(:stock => Gtk::Stock::GO_FORWARD,
:size => :dialog)
diff --git a/gtk3/test/test-gtk-tree-iter.rb b/gtk3/test/test-gtk-tree-iter.rb
index 37b7fdd..a24e025 100644
--- a/gtk3/test/test-gtk-tree-iter.rb
+++ b/gtk3/test/test-gtk-tree-iter.rb
@@ -50,4 +50,13 @@ class TestGtkTreeIter < Test::Unit::TestCase
assert_equal("string", @iter[0])
end
end
+
+ test "#next!" do
+ next_iter = @model.append
+ @iter.values = ["first"]
+ next_iter.values = ["second"]
+ assert_equal("first", @iter[0])
+ @iter.next!
+ assert_equal("second", @iter[0])
+ end
end
diff --git a/gtk3/lib/gtk3/calendar.rb b/gtk3/test/test-gtk-window.rb
similarity index 69%
copy from gtk3/lib/gtk3/calendar.rb
copy to gtk3/test/test-gtk-window.rb
index 32367ee..bda69ca 100644
--- a/gtk3/lib/gtk3/calendar.rb
+++ b/gtk3/test/test-gtk-window.rb
@@ -14,11 +14,21 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-module Gtk
- class Calendar
- alias_method :select_month_raw, :select_month
- def select_month(month, year)
- select_month_raw(month - 1, year)
+class TestGtkWindow < Test::Unit::TestCase
+ include GtkTestUtils
+
+ def setup
+ @window = Gtk::Window.new
+ end
+
+ sub_test_case "#icon=" do
+ test "String" do
+ @window.icon = fixture_path("gnome-logo-icon.png")
+ end
+
+ test "Gdk::Pixbuf" do
+ icon = Gdk::Pixbuf.new(fixture_path("gnome-logo-icon.png"))
+ @window.icon = icon
end
end
end
diff --git a/rsvg2/Rakefile b/rsvg2/Rakefile
index 9185c54..418983e 100644
--- a/rsvg2/Rakefile
+++ b/rsvg2/Rakefile
@@ -34,6 +34,11 @@ package_task = GNOME2::Rake::PackageTask.new do |package|
package.windows.gobject_introspection_dependencies = [
"gdk_pixbuf2",
]
+ package.cross_compiling do |spec|
+ if /mingw|mswin/ =~ spec.platform.to_s
+ spec.add_runtime_dependency("pango", ">= #{package.version}")
+ end
+ end
package.external_packages = [
{
:name => "libcroco",
diff --git a/rsvg2/lib/rsvg2.rb b/rsvg2/lib/rsvg2.rb
index badddab..e566fff 100644
--- a/rsvg2/lib/rsvg2.rb
+++ b/rsvg2/lib/rsvg2.rb
@@ -1,3 +1,19 @@
+# Copyright (C) 2004-2015 Ruby-GNOME2 Project Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
require "glib2"
require "gdk_pixbuf2"
require "cairo"
@@ -6,6 +22,33 @@ base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
vendor_dir = base_dir + "vendor" + "local"
vendor_bin_dir = vendor_dir + "bin"
GLib.prepend_dll_path(vendor_bin_dir)
+
+if vendor_dir.exist?
+ require "pango"
+
+ gdk_pixbuf2_spec = Gem.loaded_specs["gdk_pixbuf2"]
+ gdk_pixbuf2_base_dir = Pathname.new(gdk_pixbuf2_spec.gem_dir)
+ gdk_pixbuf2_module_dir =
+ gdk_pixbuf2_base_dir + "vendor" + "local" + "lib" +
+ "gdk-pixbuf-2.0" + "2.10.0"
+ gdk_pixbuf2_loaders_cache_path = gdk_pixbuf2_module_dir + "loaders.cache"
+ need_loaders_cache_update = false
+ if gdk_pixbuf2_loaders_cache_path.exist?
+ gdk_pixbuf2_loaders_cache_path.open do |cache|
+ need_loaders_cache_update = cache.each_line.none? do |line|
+ /\A"svg"/ === line
+ end
+ end
+ else
+ need_loaders_cache_update = true
+ end
+ if need_loaders_cache_update
+ pid = spawn("gdk-pixbuf-query-loaders.exe",
+ :out => [gdk_pixbuf2_loaders_cache_path.to_s, "w"])
+ Process.waitpid(pid)
+ end
+end
+
begin
major, minor, = RUBY_VERSION.split(/\./)
require "#{major}.#{minor}/rsvg2.so"
--
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