[perl-Gtk2] Wrap missing gtk+ 2.20 API
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2] Wrap missing gtk+ 2.20 API
- Date: Wed, 29 Dec 2010 17:38:50 +0000 (UTC)
commit 4f5ae83dc3844af0f2edde141e8f34bd3046187c
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Wed Dec 29 18:37:17 2010 +0100
Wrap missing gtk+ 2.20 API
MANIFEST | 21 ++++++++++-
NEWS | 1 +
doctypes | 1 +
maps-2.20 | 6 +++
t/01.GtkWindow.t | 11 +++++-
t/GtkAction.t | 10 +++++-
t/GtkCellRendererSpinner.t | 13 +++++++
t/GtkEntry.t | 17 ++++++++-
t/GtkOffscreenWindow.t | 22 +++++++++++
t/GtkPrintContext.t | 11 +++++-
t/GtkRange.t | 16 ++++++++-
t/GtkSpinner.t | 15 ++++++++
t/GtkStatusIcon.t | 14 ++++++-
t/GtkStatusbar.t | 13 +++++--
t/GtkStyle.t | 9 +++++
t/GtkToolItem.t | 17 ++++++++-
t/GtkToolItemGroup.t | 43 ++++++++++++++++++++++
t/GtkToolPalette.t | 80 ++++++++++++++++++++++++++++++++++++++++++
t/GtkToolShell.t | 16 ++++++++-
t/GtkWidget.t | 21 ++++++++++-
xs/GtkAction.xs | 8 ++++
xs/GtkCellRendererSpinner.xs | 16 ++++++++
xs/GtkEntry.xs | 9 ++++-
xs/GtkOffscreenWindow.xs | 22 +++++++++++
xs/GtkPrintContext.xs | 24 ++++++++++++
xs/GtkRange.xs | 24 ++++++++++++
xs/GtkSpinner.xs | 20 ++++++++++
xs/GtkStatusIcon.xs | 6 +++
xs/GtkStatusbar.xs | 6 +++
xs/GtkStyle.xs | 6 +++
xs/GtkToolItem.xs | 13 +++++++
xs/GtkToolItemGroup.xs | 48 +++++++++++++++++++++++++
xs/GtkToolPalette.xs | 70 ++++++++++++++++++++++++++++++++++++
xs/GtkToolShell.xs | 12 ++++++
xs/GtkWidget.xs | 27 ++++++++++++++
xs/GtkWindow.xs | 8 ++++
xs_files-2.20 | 5 +++
37 files changed, 665 insertions(+), 16 deletions(-)
---
diff --git a/MANIFEST b/MANIFEST
index 242e50a..8916002 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -11,6 +11,7 @@ examples/adding_stock_icons.pl
examples/assistant.pl
examples/attributes.pl
examples/buttonbox.pl
+examples/cairo-clock.pl
examples/cairo-rendering.pl
examples/calendar.pl
examples/cellrenderer_date.pl
@@ -22,6 +23,7 @@ examples/color_snooper.pl
examples/combo_box.pl
examples/customlist.pl
examples/customrenderer.pl
+examples/customtree.pl
examples/dialog.pl
examples/draw_text.pl
examples/file_chooser.pl
@@ -33,6 +35,9 @@ examples/item_factory_demo.pl
examples/layout.pl
examples/linkbutton.pl
examples/multisel.pl
+examples/offscreen_reflection.pl
+examples/offscreen_rotation.pl
+examples/offscreen_scale.pl
examples/plug.pl
examples/rulers.pl
examples/scribble.pl
@@ -94,6 +99,7 @@ maps-2.14
maps-2.16
maps-2.18
maps-2.2
+maps-2.20
maps-2.4
maps-2.6
maps-2.8
@@ -126,6 +132,7 @@ t/GdkDnd.t
t/GdkDrawable.t
t/GdkEvent.t
t/GdkGC.t
+t/GdkImage.t
t/GdkInput.t
t/GdkKeys.t
t/GdkPango.t
@@ -171,6 +178,7 @@ t/GtkCellRendererIface-Chaining.t
t/GtkCellRendererPixbuf.t
t/GtkCellRendererProgress.t
t/GtkCellRendererSpin.t
+t/GtkCellRendererSpinner.t
t/GtkCellRendererText.t
t/GtkCellRendererToggle.t
t/GtkCellView.t
@@ -235,6 +243,7 @@ t/GtkMessageDialog.t
t/GtkMisc.t
t/GtkNotebook.t
t/GtkObject.t
+t/GtkOffscreenWindow.t
t/GtkOptionMenu.t
t/GtkOrientable.t
t/GtkPageSetup.t
@@ -271,7 +280,8 @@ t/GtkSimpleMenu.t
t/GtkSizeGroup.t
t/GtkSocket-GtkPlug.t
t/GtkSpinButton.t
-t/GtkStatusBar.t
+t/GtkSpinner.t
+t/GtkStatusbar.t
t/GtkStatusIcon.t
t/GtkStock.t
t/GtkStyle.t
@@ -291,6 +301,8 @@ t/GtkToggleToolButton.t
t/GtkToolbar.t
t/GtkToolButton.t
t/GtkToolItem.t
+t/GtkToolItemGroup.t
+t/GtkToolPalette.t
t/GtkToolShell.t
t/GtkTooltip.t
t/GtkTooltips.t
@@ -348,6 +360,7 @@ xs/GdkDnd.xs
xs/GdkDrawable.xs
xs/GdkEvent.xs
xs/GdkGC.xs
+xs/GdkImage.xs
xs/GdkInput.xs
xs/GdkKeys.xs
xs/GdkPango.xs
@@ -392,6 +405,7 @@ xs/GtkCellRendererCombo.xs
xs/GtkCellRendererPixbuf.xs
xs/GtkCellRendererProgress.xs
xs/GtkCellRendererSpin.xs
+xs/GtkCellRendererSpinner.xs
xs/GtkCellRendererText.xs
xs/GtkCellRendererToggle.xs
xs/GtkCellView.xs
@@ -462,6 +476,7 @@ xs/GtkMessageDialog.xs
xs/GtkMisc.xs
xs/GtkNotebook.xs
xs/GtkObject.xs
+xs/GtkOffscreenWindow.xs
xs/GtkOptionMenu.xs
xs/GtkOrientable.xs
xs/GtkPageSetup.xs
@@ -497,6 +512,7 @@ xs/GtkShow.xs
xs/GtkSizeGroup.xs
xs/GtkSocket.xs
xs/GtkSpinButton.xs
+xs/GtkSpinner.xs
xs/GtkStatusbar.xs
xs/GtkStatusIcon.xs
xs/GtkStock.xs
@@ -517,6 +533,8 @@ xs/GtkToggleToolButton.xs
xs/GtkToolbar.xs
xs/GtkToolButton.xs
xs/GtkToolItem.xs
+xs/GtkToolItemGroup.xs
+xs/GtkToolPalette.xs
xs/GtkToolShell.xs
xs/GtkTooltip.xs
xs/GtkTooltips.xs
@@ -548,6 +566,7 @@ xs_files-2.14
xs_files-2.16
xs_files-2.18
xs_files-2.2
+xs_files-2.20
xs_files-2.4
xs_files-2.6
xs_files-2.8
diff --git a/NEWS b/NEWS
index 4637c49..3efe968 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
Overview of changes in the next unstable release
================================================
+* Wrap missing gtk+ 2.20 API.
* Wrap gtk+ 2.22 API.
* Gtk2::Notebook: fix invocation of window creation hooks.
* Fix length of Gtk2::Gdk::Pixbuf->get_pixels() return.
diff --git a/doctypes b/doctypes
index d7842b1..4718eca 100644
--- a/doctypes
+++ b/doctypes
@@ -8,6 +8,7 @@
#
# C name description
# ------------ ----------------
+GtkTargetEntry Gtk2::TargetEntry
GtkTargetList Gtk2::TargetList
GdkAtom Gtk2::Gdk::Atom
GdkBitmap Gtk2::Gdk::Bitmap
diff --git a/maps-2.20 b/maps-2.20
new file mode 100644
index 0000000..b12b69c
--- /dev/null
+++ b/maps-2.20
@@ -0,0 +1,6 @@
+GTK_TYPE_CELL_RENDERER_SPINNER GtkCellRendererSpinner GtkObject Gtk2::CellRendererSpinner
+GTK_TYPE_OFFSCREEN_WINDOW GtkOffscreenWindow GtkObject Gtk2::OffscreenWindow
+GTK_TYPE_SPINNER GtkSpinner GtkObject Gtk2::Spinner
+GTK_TYPE_TOOL_ITEM_GROUP GtkToolItemGroup GtkObject Gtk2::ToolItemGroup
+GTK_TYPE_TOOL_PALETTE GtkToolPalette GtkObject Gtk2::ToolPalette Gtk2::ToolPalette
+GTK_TYPE_TOOL_PALETTE_DRAG_TARGETS GtkToolPaletteDragTargets GFlags Gtk2::ToolPaletteDragTargets
diff --git a/t/01.GtkWindow.t b/t/01.GtkWindow.t
index b88254f..528bd1f 100644
--- a/t/01.GtkWindow.t
+++ b/t/01.GtkWindow.t
@@ -10,7 +10,7 @@
#########################
-use Gtk2::TestHelper tests => 116;
+use Gtk2::TestHelper tests => 117;
ok( my $win = Gtk2::Window->new );
ok( $win = Gtk2::Window->new('popup') );
@@ -399,6 +399,15 @@ SKIP: {
is (Gtk2::Window->get_default_icon_name,'gtk-ok', 'get_default_icon_name');
}
+SKIP: {
+ skip 'new 2.20 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ my $window = Gtk2::Window->new;
+ is ($window->get_window_type, 'toplevel');
+ $window->set_mnemonics_visible (TRUE);
+}
+
__END__
diff --git a/t/GtkAction.t b/t/GtkAction.t
index e87c16b..da3777a 100644
--- a/t/GtkAction.t
+++ b/t/GtkAction.t
@@ -5,7 +5,7 @@
use Gtk2::TestHelper
at_least_version => [2, 4, 0, "Action-based menus are new in 2.4"],
- tests => 30, noinit => 0;
+ tests => 31, noinit => 0;
my $action = Gtk2::Action->new (name => 'Open',
label => '_Open',
@@ -155,6 +155,14 @@ SKIP: {
$action->unblock_activate;
}
+SKIP: {
+ skip 'new 2.20 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ $action->set_always_show_image (TRUE);
+ ok ($action->get_always_show_image);
+}
+
__END__
Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkCellRendererSpinner.t b/t/GtkCellRendererSpinner.t
new file mode 100644
index 0000000..f7e63c7
--- /dev/null
+++ b/t/GtkCellRendererSpinner.t
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+use Gtk2::TestHelper
+ tests => 1,
+ noinit => 1,
+ at_least_version => [2, 20, 0, "Gtk2::CellRendererSpinner is new in 2.20"];
+
+my $spinner = Gtk2::CellRendererSpinner->new;
+isa_ok ($spinner, 'Gtk2::CellRendererSpinner');
+
+__END__
+
+Copyright (C) 2010 by the gtk2-perl team (see the file AUTHORS for the
+full list). See LICENSE for more information.
diff --git a/t/GtkEntry.t b/t/GtkEntry.t
index 8912dca..44b45b3 100644
--- a/t/GtkEntry.t
+++ b/t/GtkEntry.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 64;
+use Gtk2::TestHelper tests => 66;
# $Id$
@@ -142,6 +142,21 @@ SKIP: {
}
SKIP: {
+ skip 'new 2.20 stuff', 2
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ my $entry = Gtk2::Entry->new;
+ my $window = Gtk2::Window->new;
+ $window->add ($entry);
+ $entry->realize;
+
+ $entry->set_icon_from_icon_name ('primary', 'gtk-yes');
+ isa_ok ($entry->get_icon_window ('primary'), 'Gtk2::Gdk::Window');
+
+ isa_ok ($entry->get_text_window, 'Gtk2::Gdk::Window');
+}
+
+SKIP: {
skip 'new 2.22 stuff', 1
unless Gtk2->CHECK_VERSION(2, 22, 0);
diff --git a/t/GtkOffscreenWindow.t b/t/GtkOffscreenWindow.t
new file mode 100644
index 0000000..ba2643f
--- /dev/null
+++ b/t/GtkOffscreenWindow.t
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl
+use Gtk2::TestHelper
+ tests => 5,
+ at_least_version => [2, 20, 0, "Gtk2::OffscreenWindow is new in 2.20"];
+
+my $window = Gtk2::OffscreenWindow->new;
+isa_ok ($window, 'Gtk2::OffscreenWindow');
+
+$window->realize;
+
+my $pixmap = $window->get_pixmap;
+isa_ok ($pixmap, 'Gtk2::Gdk::Pixmap');
+isa_ok ($pixmap->get_display, 'Gtk2::Gdk::Display');
+
+my $pixbuf = $window->get_pixbuf;
+isa_ok ($pixbuf, 'Gtk2::Gdk::Pixbuf');
+ok (defined $pixbuf->get_colorspace);
+
+__END__
+
+Copyright (C) 2010 by the gtk2-perl team (see the file AUTHORS for the
+full list). See LICENSE for more information.
diff --git a/t/GtkPrintContext.t b/t/GtkPrintContext.t
index 937a816..4f1f13e 100644
--- a/t/GtkPrintContext.t
+++ b/t/GtkPrintContext.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
use Gtk2::TestHelper
- tests => 10,
+ tests => 11,
at_least_version => [2, 10, 0, "GtkPrintContext is new in 2.10"];
# $Id$
@@ -24,6 +24,15 @@ $op -> signal_connect(begin_print => sub {
isa_ok($context -> create_pango_layout(), "Gtk2::Pango::Layout");
$context -> set_cairo_context($cr, 72, 72);
+
+ SKIP: {
+ skip 'new 2.20 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ my ($top, $bottom, $left, $right) = $context -> get_hard_margins();
+ ok((defined $top && defined $bottom && defined $left && defined $right) ||
+ (!defined $top && !defined $bottom && !defined $left && !defined $right));
+ }
});
$op -> set_n_pages(1);
diff --git a/t/GtkRange.t b/t/GtkRange.t
index 7b80e14..71ed9a7 100644
--- a/t/GtkRange.t
+++ b/t/GtkRange.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# vim: set ft=perl :
use strict;
-use Gtk2::TestHelper tests => 11;
+use Gtk2::TestHelper tests => 15;
# $Id$
@@ -58,6 +58,20 @@ SKIP: {
ok($range -> get_flippable, '[gs]et_flippable');
}
+SKIP: {
+ skip 'new 2.20 stuff', 4
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ $range -> set_min_slider_size(TRUE);
+ ok($range -> get_min_slider_size());
+ my $rect = $range -> get_range_rect();
+ ok(defined $rect -> width() && defined $rect -> height());
+ my ($start, $end) = $range -> get_slider_range();
+ ok(defined $start && defined $end);
+ $range -> set_slider_size_fixed(TRUE);
+ ok($range -> get_slider_size_fixed());
+}
+
__END__
Copyright (C) 2003,2006 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkSpinner.t b/t/GtkSpinner.t
new file mode 100644
index 0000000..01f7017
--- /dev/null
+++ b/t/GtkSpinner.t
@@ -0,0 +1,15 @@
+#!/usr/bin/env perl
+use Gtk2::TestHelper
+ tests => 1,
+ noinit => 1,
+ at_least_version => [2, 20, 0, "Gtk2::Spinner is new in 2.20"];
+
+my $spinner = Gtk2::Spinner->new;
+isa_ok ($spinner, 'Gtk2::Spinner');
+$spinner->start;
+$spinner->stop;
+
+__END__
+
+Copyright (C) 2010 by the gtk2-perl team (see the file AUTHORS for the
+full list). See LICENSE for more information.
diff --git a/t/GtkStatusIcon.t b/t/GtkStatusIcon.t
index 672817b..90c7774 100644
--- a/t/GtkStatusIcon.t
+++ b/t/GtkStatusIcon.t
@@ -157,17 +157,27 @@ SKIP: {
$icon->set_tooltip_text(undef);
is ($icon->get_tooltip_text(), undef);
-
-
}
+# --------------------------------------------------------------------------- #
+
SKIP: {
skip 'new 2.18 stuff', 1
unless Gtk2->CHECK_VERSION(2, 18, 0);
$icon->set_title('my statusicon title');
is ($icon->get_title, 'my statusicon title', '[gs]et_title');
+}
+
+# --------------------------------------------------------------------------- #
+
+SKIP: {
+ skip 'new 2.20 stuff', 0
+ if (TRUE); # See <https://bugzilla.gnome.org/show_bug.cgi?id=638263>.
+ # unless Gtk2->CHECK_VERSION(2, 20, 0);
+ my $icon = Gtk2::StatusIcon->new;
+ $icon->set_name('bla');
}
__END__
diff --git a/t/GtkStatusbar.t b/t/GtkStatusbar.t
index 6f2ec74..38cd07c 100644
--- a/t/GtkStatusbar.t
+++ b/t/GtkStatusbar.t
@@ -1,6 +1,4 @@
-#
-# $Id$
-#
+#!/usr/bin/env perl
use strict;
use warnings;
@@ -12,7 +10,7 @@ use warnings;
#########################
-use Gtk2::TestHelper tests => 9, noinit => 1;
+use Gtk2::TestHelper tests => 10, noinit => 1;
ok( my $sts = Gtk2::Statusbar->new );
@@ -34,6 +32,13 @@ $sts->pop($sts_cid2);
$sts->remove($sts_cid2, $sts_mid1);
SKIP: {
+ skip 'new 2.20 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ isa_ok ($sts->get_message_area, 'Gtk2::Widget');
+}
+
+SKIP: {
skip 'new 2.22 stuff', 0
unless Gtk2->CHECK_VERSION(2, 22, 0);
diff --git a/t/GtkStyle.t b/t/GtkStyle.t
index 787ffbd..cdc834f 100644
--- a/t/GtkStyle.t
+++ b/t/GtkStyle.t
@@ -222,6 +222,15 @@ SKIP: {
);
}
+SKIP: {
+ skip 'new 2.20 stuff', 0
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ $style -> paint_spinner($window -> window(), "normal", undef, undef, undef, 1, 2, 3, 4, 5);
+ my $area = Gtk2::Gdk::Rectangle -> new(1, 2, 3, 4);
+ $style -> paint_spinner($window -> window(), "normal", $area, $button, "detail", 1, 2, 3, 4, 5);
+}
+
# Test that an error is thrown
sub test_die {
diff --git a/t/GtkToolItem.t b/t/GtkToolItem.t
index c30ce8a..5f5a480 100644
--- a/t/GtkToolItem.t
+++ b/t/GtkToolItem.t
@@ -5,7 +5,7 @@
use Gtk2::TestHelper
at_least_version => [2, 4, 0, "Action-based menus are new in 2.4"],
- tests => 19;
+ tests => 23;
my $tool_item = Gtk2::ToolItem->new;
@@ -93,6 +93,21 @@ SKIP: {
$tool_item->toolbar_reconfigured;
}
+SKIP: {
+ skip 'new 2.20 stuff', 4
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ ok (defined $tool_item->get_ellipsize_mode);
+ ok (defined $tool_item->get_text_alignment);
+ ok (defined $tool_item->get_text_orientation);
+
+ my $palette = Gtk2::ToolPalette->new;
+ my $bar = Gtk2::ToolItemGroup->new ('Test');
+ $bar->add ($tool_item);
+ $palette->add ($bar);
+ isa_ok ($tool_item->get_text_size_group, 'Gtk2::SizeGroup');
+}
+
__END__
Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkToolItemGroup.t b/t/GtkToolItemGroup.t
new file mode 100644
index 0000000..4e19455
--- /dev/null
+++ b/t/GtkToolItemGroup.t
@@ -0,0 +1,43 @@
+#!/usr/bin/env perl
+use Gtk2::TestHelper
+ tests => 10,
+ at_least_version => [2, 20, 0, "Gtk2::ToolItemGroup is new in 2.20"];
+
+my $group = Gtk2::ToolItemGroup->new ('Test');
+isa_ok ($group, 'Gtk2::ToolItemGroup');
+
+my $item = Gtk2::ToolItem->new;
+$group->insert ($item, 0);
+$group->set_item_position ($item, 0);
+
+my $window = Gtk2::Window->new;
+$window->add ($group);
+$window->show_all;
+
+my $drop_item = $group->get_drop_item (10, 10);
+ok ((defined $drop_item && $drop_item->isa ('Gtk2::ToolItem')) || !defined $drop_item);
+
+$group->set_collapsed (TRUE);
+ok ($group->get_collapsed);
+
+$group->set_ellipsize ('none');
+is ($group->get_ellipsize, 'none');
+
+$group->set_label ('Test');
+is ($group->get_label, 'Test');
+
+my $label = Gtk2::Label->new ('Test');
+$group->set_label_widget ($label);
+is ($group->get_label_widget, $label);
+
+is ($group->get_item_position ($item), 0);
+is ($group->get_n_items, 1);
+is ($group->get_nth_item (0), $item);
+
+$group->set_header_relief ('normal');
+is ($group->get_header_relief, 'normal');
+
+__END__
+
+Copyright (C) 2010 by the gtk2-perl team (see the file AUTHORS for the
+full list). See LICENSE for more information.
diff --git a/t/GtkToolPalette.t b/t/GtkToolPalette.t
new file mode 100644
index 0000000..ea19767
--- /dev/null
+++ b/t/GtkToolPalette.t
@@ -0,0 +1,80 @@
+#!/usr/bin/env perl
+use Gtk2::TestHelper
+ tests => 10,
+ at_least_version => [2, 20, 0, "Gtk2::ToolPalette is new in 2.20"];
+
+my $palette = Gtk2::ToolPalette->new;
+isa_ok ($palette, 'Gtk2::ToolPalette');
+
+my $group = Gtk2::ToolItemGroup->new ('Test');
+$palette->add ($group);
+
+$palette->set_exclusive ($group, TRUE);
+ok ($palette->get_exclusive ($group));
+
+$palette->set_expand ($group, TRUE);
+ok ($palette->get_expand ($group));
+
+$palette->set_group_position ($group, 0);
+is ($palette->get_group_position ($group), 0);
+
+$palette->set_icon_size ('menu');
+is ($palette->get_icon_size, 'menu');
+$palette->unset_icon_size;
+
+$palette->set_style ('icons');
+is ($palette->get_style, 'icons');
+$palette->unset_style;
+
+my $scroller = Gtk2::ScrolledWindow->new;
+$scroller->add ($palette);
+isa_ok ($palette->get_hadjustment, 'Gtk2::Adjustment');
+isa_ok ($palette->get_vadjustment, 'Gtk2::Adjustment');
+
+my $button = Gtk2::Button->new ('Test');
+$palette->add_drag_dest ($button, 'all', 'groups', 'copy');
+isa_ok (Gtk2::ToolPalette->get_drag_target_group, 'HASH');
+isa_ok (Gtk2::ToolPalette->get_drag_target_item, 'HASH');
+$palette->set_drag_source ('groups');
+
+=comment Interactive d'n'd test:
+
+{
+my $palette = Gtk2::ToolPalette->new;
+my $group = Gtk2::ToolItemGroup->new ('Test');
+my $item = Gtk2::ToolItem->new;
+my $child = Gtk2::Label->new ('TestTest');
+$item->add ($child);
+$group->insert ($item, 0);
+$palette->add ($group);
+
+my $button = Gtk2::Button->new ('Test');
+$palette->add_drag_dest ($button, 'all', 'groups', 'copy');
+
+$button->signal_connect (drag_data_received => sub {
+ my ($button, $context, $x, $y, $selection, $info, $time, $data) = @_;
+ my $palette = $context->get_source_widget->get_ancestor ('Gtk2::ToolPalette');
+ my $group = $palette->get_drag_item ($selection);
+ isa_ok ($group, 'Gtk2::ToolItemGroup');
+});
+
+my $window = Gtk2::Window->new;
+my $vbox = Gtk2::VBox->new;
+$vbox->add ($palette);
+$vbox->add ($button);
+$window->add ($vbox);
+$window->set_default_size (50, 100);
+$window->show_all;
+
+isa_ok ($palette->get_drop_group (10, 10), 'Gtk2::ToolItemGroup');
+isa_ok ($palette->get_drop_item (10, 30), 'Gtk2::ToolItem');
+
+Gtk2->main;
+}
+
+=cut
+
+__END__
+
+Copyright (C) 2010 by the gtk2-perl team (see the file AUTHORS for the
+full list). See LICENSE for more information.
diff --git a/t/GtkToolShell.t b/t/GtkToolShell.t
index 0f1c6a7..8b3f7e0 100644
--- a/t/GtkToolShell.t
+++ b/t/GtkToolShell.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
use Gtk2::TestHelper
- tests => 5,
+ tests => 9,
at_least_version => [2, 14, 0, 'GtkToolShell is new in 2.14'],
;
@@ -17,6 +17,20 @@ ok (defined $toolbar->get_relief_style ());
ok (defined $toolbar->get_style ());
$toolbar->rebuild_menu ();
+SKIP: {
+ skip 'new 2.20 stuff', 4
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ ok (defined $toolbar->get_ellipsize_mode);
+ ok (defined $toolbar->get_text_alignment);
+ ok (defined $toolbar->get_text_orientation);
+
+ my $palette = Gtk2::ToolPalette->new;
+ my $bar = Gtk2::ToolItemGroup->new ('Test');
+ $palette->add ($bar);
+ isa_ok ($bar->get_text_size_group, 'Gtk2::SizeGroup');
+}
+
__END__
Copyright (C) 2008 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkWidget.t b/t/GtkWidget.t
index 1af56fc..b498532 100644
--- a/t/GtkWidget.t
+++ b/t/GtkWidget.t
@@ -6,7 +6,7 @@
use warnings;
use strict;
-use Gtk2::TestHelper tests => 140;
+use Gtk2::TestHelper tests => 144;
# we can't instantiate Gtk2::Widget, it's abstract. use a button instead.
@@ -503,6 +503,25 @@ SKIP: {
}
SKIP: {
+ skip 'new 2.20 stuff', 4
+ unless Gtk2->CHECK_VERSION(2, 20, 0);
+
+ my $widget = Gtk2::Label->new ('Bla');
+ $widget->set_realized (FALSE);
+ ok (!$widget->get_realized);
+ $widget->set_mapped (FALSE);
+ ok (!$widget->get_mapped);
+ my $req = $widget->get_requisition;
+ ok (defined $req->width && defined $req->height);
+ ok (defined $widget->has_rc_style);
+
+ my $window = Gtk2::Window->new;
+ $window->add ($widget);
+ $widget->realize;
+ $widget->style_attach;
+}
+
+SKIP: {
skip 'new 2.22 stuff', 0
unless Gtk2->CHECK_VERSION(2, 22, 0);
diff --git a/xs/GtkAction.xs b/xs/GtkAction.xs
index 7a48e22..4b8c470 100644
--- a/xs/GtkAction.xs
+++ b/xs/GtkAction.xs
@@ -139,6 +139,14 @@ void gtk_action_unblock_activate (GtkAction *action);
#endif
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+gboolean gtk_action_get_always_show_image (GtkAction *action);
+
+void gtk_action_set_always_show_image (GtkAction *action, gboolean always_show);
+
+#endif /* 2.20 */
+
#if GTK_CHECK_VERSION (2, 10, 0)
diff --git a/xs/GtkCellRendererSpinner.xs b/xs/GtkCellRendererSpinner.xs
new file mode 100644
index 0000000..3a8d8f2
--- /dev/null
+++ b/xs/GtkCellRendererSpinner.xs
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2010 by the gtk2-perl team (see the file AUTHORS)
+ *
+ * Licensed under the LGPL, see LICENSE file for more information.
+ *
+ * $Id$
+ */
+
+#include "gtk2perl.h"
+
+MODULE = Gtk2::CellRendererSpinner PACKAGE = Gtk2::CellRendererSpinner PREFIX = gtk_cell_renderer_spinner_
+
+GtkCellRenderer *
+gtk_cell_renderer_spinner_new (class)
+ C_ARGS:
+ /* void */
diff --git a/xs/GtkEntry.xs b/xs/GtkEntry.xs
index fb7ff7e..c27b1e7 100644
--- a/xs/GtkEntry.xs
+++ b/xs/GtkEntry.xs
@@ -289,6 +289,14 @@ gint gtk_entry_get_current_icon_drag_source (GtkEntry *entry);
#endif /* 2.16 */
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+GdkWindow * gtk_entry_get_icon_window (GtkEntry *entry, GtkEntryIconPosition icon_pos);
+
+GdkWindow * gtk_entry_get_text_window (GtkEntry *entry);
+
+#endif /* 2.20 */
+
#if GTK_CHECK_VERSION (2, 22, 0)
gboolean gtk_entry_im_context_filter_keypress (GtkEntry *entry, GdkEvent *event);
@@ -299,7 +307,6 @@ void gtk_entry_reset_im_context (GtkEntry *entry);
#endif /* 2.22 */
-
##
## hey, these are deprecated! is that new as of 2.3.x?
##
diff --git a/xs/GtkOffscreenWindow.xs b/xs/GtkOffscreenWindow.xs
new file mode 100644
index 0000000..1a76d88
--- /dev/null
+++ b/xs/GtkOffscreenWindow.xs
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2010 by the gtk2-perl team (see the file AUTHORS)
+ *
+ * Licensed under the LGPL, see LICENSE file for more information.
+ *
+ * $Id$
+ */
+
+#include "gtk2perl.h"
+
+MODULE = Gtk2::OffscreenWindow PACKAGE = Gtk2::OffscreenWindow PREFIX = gtk_offscreen_window_
+
+GtkWidget *
+gtk_offscreen_window_new (class)
+ C_ARGS:
+ /* void */
+
+# Docs say we don't own the pixmap.
+GdkPixmap_ornull * gtk_offscreen_window_get_pixmap (GtkOffscreenWindow *offscreen);
+
+# Docs say we do own the pixbuf
+GdkPixbuf_noinc_ornull * gtk_offscreen_window_get_pixbuf (GtkOffscreenWindow *offscreen);
diff --git a/xs/GtkPrintContext.xs b/xs/GtkPrintContext.xs
index a036658..38e1b29 100644
--- a/xs/GtkPrintContext.xs
+++ b/xs/GtkPrintContext.xs
@@ -30,3 +30,27 @@ PangoContext_noinc * gtk_print_context_create_pango_context (GtkPrintContext *co
PangoLayout_noinc * gtk_print_context_create_pango_layout (GtkPrintContext *context);
void gtk_print_context_set_cairo_context (GtkPrintContext *context, cairo_t *cr, double dpi_x, double dpi_y);
+
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+# gboolean gtk_print_context_get_hard_margins (GtkPrintContext *context, gdouble *top, gdouble *bottom, gdouble *left, gdouble *right)
+=for apidoc
+=for signature (top, bottom, left, right) = $context->get_hard_margins
+
+Returns an empty list if the hard margins could not be retrieved.
+
+=cut
+void
+gtk_print_context_get_hard_margins (GtkPrintContext *context)
+ PREINIT:
+ gdouble top, bottom, left, right;
+ PPCODE:
+ if (!gtk_print_context_get_hard_margins (context, &top, &bottom, &left, &right))
+ XSRETURN_EMPTY;
+ EXTEND (SP, 4);
+ PUSHs (sv_2mortal (newSVnv (top)));
+ PUSHs (sv_2mortal (newSVnv (bottom)));
+ PUSHs (sv_2mortal (newSVnv (left)));
+ PUSHs (sv_2mortal (newSVnv (right)));
+
+#endif /* 2.20 */
diff --git a/xs/GtkRange.xs b/xs/GtkRange.xs
index 6210f3f..7e091ab 100644
--- a/xs/GtkRange.xs
+++ b/xs/GtkRange.xs
@@ -117,3 +117,27 @@ void gtk_range_set_flippable (GtkRange *range, gboolean flippable);
#endif
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+void gtk_range_set_min_slider_size (GtkRange *range, gboolean min_size);
+
+gint gtk_range_get_min_slider_size (GtkRange *range);
+
+# void gtk_range_get_range_rect (GtkRange *range, GdkRectangle *range_rect)
+GdkRectangle_copy *
+gtk_range_get_range_rect (GtkRange *range)
+ PREINIT:
+ GdkRectangle range_rect;
+ CODE:
+ gtk_range_get_range_rect (range, &range_rect);
+ RETVAL = &range_rect;
+ OUTPUT:
+ RETVAL
+
+void gtk_range_get_slider_range (GtkRange *range, OUTLIST gint slider_start, OUTLIST gint slider_end);
+
+void gtk_range_set_slider_size_fixed (GtkRange *range, gboolean size_fixed);
+
+gboolean gtk_range_get_slider_size_fixed (GtkRange *range);
+
+#endif /* 2.20 */
diff --git a/xs/GtkSpinner.xs b/xs/GtkSpinner.xs
new file mode 100644
index 0000000..6c60122
--- /dev/null
+++ b/xs/GtkSpinner.xs
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2010 by the gtk2-perl team (see the file AUTHORS)
+ *
+ * Licensed under the LGPL, see LICENSE file for more information.
+ *
+ * $Id$
+ */
+
+#include "gtk2perl.h"
+
+MODULE = Gtk2::Spinner PACKAGE = Gtk2::Spinner PREFIX = gtk_spinner_
+
+GtkWidget *
+gtk_spinner_new (class)
+ C_ARGS:
+ /* void */
+
+void gtk_spinner_start (GtkSpinner *spinner);
+
+void gtk_spinner_stop (GtkSpinner *spinner);
diff --git a/xs/GtkStatusIcon.xs b/xs/GtkStatusIcon.xs
index f0c26af..c58e2fd 100644
--- a/xs/GtkStatusIcon.xs
+++ b/xs/GtkStatusIcon.xs
@@ -162,3 +162,9 @@ const gchar * gtk_status_icon_get_title (GtkStatusIcon *status_icon);
#endif /* 2.18 */
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+void gtk_status_icon_set_name (GtkStatusIcon *status_icon, const gchar *name);
+
+#endif /* 2.20 */
+
diff --git a/xs/GtkStatusbar.xs b/xs/GtkStatusbar.xs
index 7751fab..be1ea43 100644
--- a/xs/GtkStatusbar.xs
+++ b/xs/GtkStatusbar.xs
@@ -66,6 +66,12 @@ gtk_statusbar_push (statusbar, context_id, text)
guint context_id
gchar * text
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+GtkWidget* gtk_statusbar_get_message_area (GtkStatusbar *statusbar);
+
+#endif /* 2.20 */
+
#if GTK_CHECK_VERSION (2, 22, 0)
void gtk_statusbar_remove_all (GtkStatusbar *statusbar, guint context_id);
diff --git a/xs/GtkStyle.xs b/xs/GtkStyle.xs
index ab01adc..45090b0 100644
--- a/xs/GtkStyle.xs
+++ b/xs/GtkStyle.xs
@@ -535,6 +535,12 @@ gtk_paint_resize_grip (style, window, state_type, area, widget, detail, edge, x,
gint width
gint height
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+void gtk_paint_spinner (GtkStyle *style, GdkWindow *window, GtkStateType state_type, const GdkRectangle_ornull *area, GtkWidget_ornull *widget, const gchar_ornull *detail, guint step, gint x, gint y, gint width, gint height);
+
+#endif /* 2.20 */
+
MODULE = Gtk2::Style PACKAGE = Gtk2 PREFIX = gtk_
#if GTK_CHECK_VERSION (2, 4, 0)
diff --git a/xs/GtkToolItem.xs b/xs/GtkToolItem.xs
index 4b02c29..972f6bb 100644
--- a/xs/GtkToolItem.xs
+++ b/xs/GtkToolItem.xs
@@ -81,3 +81,16 @@ void gtk_tool_item_set_tooltip_markup (GtkToolItem *tool_item, const gchar_ornul
void gtk_tool_item_toolbar_reconfigured (GtkToolItem *tool_item);
#endif /* 2.14 */
+
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+PangoEllipsizeMode gtk_tool_item_get_ellipsize_mode (GtkToolItem *tool_item);
+
+gfloat gtk_tool_item_get_text_alignment (GtkToolItem *tool_item);
+
+GtkOrientation gtk_tool_item_get_text_orientation (GtkToolItem *tool_item);
+
+# We don't own the size group.
+GtkSizeGroup * gtk_tool_item_get_text_size_group (GtkToolItem *tool_item);
+
+#endif /* 2.20 */
diff --git a/xs/GtkToolItemGroup.xs b/xs/GtkToolItemGroup.xs
new file mode 100644
index 0000000..3ada533
--- /dev/null
+++ b/xs/GtkToolItemGroup.xs
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2010 by the gtk2-perl team (see the file AUTHORS)
+ *
+ * Licensed under the LGPL, see LICENSE file for more information.
+ *
+ * $Id$
+ */
+
+#include "gtk2perl.h"
+
+MODULE = Gtk2::ToolItemGroup PACKAGE = Gtk2::ToolItemGroup PREFIX = gtk_tool_item_group_
+
+GtkWidget *
+gtk_tool_item_group_new (class, const gchar *label)
+ C_ARGS:
+ label
+
+gboolean gtk_tool_item_group_get_collapsed (GtkToolItemGroup *group);
+
+GtkToolItem* gtk_tool_item_group_get_drop_item (GtkToolItemGroup *group, gint x, gint y);
+
+PangoEllipsizeMode gtk_tool_item_group_get_ellipsize (GtkToolItemGroup *group);
+
+gint gtk_tool_item_group_get_item_position (GtkToolItemGroup *group, GtkToolItem *item);
+
+guint gtk_tool_item_group_get_n_items (GtkToolItemGroup *group);
+
+const gchar* gtk_tool_item_group_get_label (GtkToolItemGroup *group);
+
+GtkWidget * gtk_tool_item_group_get_label_widget (GtkToolItemGroup *group);
+
+GtkToolItem* gtk_tool_item_group_get_nth_item (GtkToolItemGroup *group, guint index);
+
+GtkReliefStyle gtk_tool_item_group_get_header_relief (GtkToolItemGroup *group);
+
+void gtk_tool_item_group_insert (GtkToolItemGroup *group, GtkToolItem *item, gint position);
+
+void gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group, gboolean collapsed);
+
+void gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group, PangoEllipsizeMode ellipsize);
+
+void gtk_tool_item_group_set_item_position (GtkToolItemGroup *group, GtkToolItem *item, gint position);
+
+void gtk_tool_item_group_set_label (GtkToolItemGroup *group, const gchar *label);
+
+void gtk_tool_item_group_set_label_widget (GtkToolItemGroup *group, GtkWidget *label_widget);
+
+void gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group, GtkReliefStyle style);
diff --git a/xs/GtkToolPalette.xs b/xs/GtkToolPalette.xs
new file mode 100644
index 0000000..0ce19c5
--- /dev/null
+++ b/xs/GtkToolPalette.xs
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2010 by the gtk2-perl team (see the file AUTHORS)
+ *
+ * Licensed under the LGPL, see LICENSE file for more information.
+ *
+ * $Id$
+ */
+
+#include "gtk2perl.h"
+
+MODULE = Gtk2::ToolPalette PACKAGE = Gtk2::ToolPalette PREFIX = gtk_tool_palette_
+
+GtkWidget *
+gtk_tool_palette_new (class)
+ C_ARGS:
+ /* void */
+
+gboolean gtk_tool_palette_get_exclusive (GtkToolPalette *palette, GtkToolItemGroup *group);
+
+void gtk_tool_palette_set_exclusive (GtkToolPalette *palette, GtkToolItemGroup *group, gboolean exclusive);
+
+gboolean gtk_tool_palette_get_expand (GtkToolPalette *palette, GtkToolItemGroup *group);
+
+void gtk_tool_palette_set_expand (GtkToolPalette *palette, GtkToolItemGroup *group, gboolean expand);
+
+gint gtk_tool_palette_get_group_position (GtkToolPalette *palette, GtkToolItemGroup *group);
+
+void gtk_tool_palette_set_group_position (GtkToolPalette *palette, GtkToolItemGroup *group, gint position);
+
+GtkIconSize gtk_tool_palette_get_icon_size (GtkToolPalette *palette);
+
+void gtk_tool_palette_set_icon_size (GtkToolPalette *palette, GtkIconSize icon_size);
+
+void gtk_tool_palette_unset_icon_size (GtkToolPalette *palette);
+
+GtkToolbarStyle gtk_tool_palette_get_style (GtkToolPalette *palette);
+
+void gtk_tool_palette_set_style (GtkToolPalette *palette, GtkToolbarStyle style);
+
+void gtk_tool_palette_unset_style (GtkToolPalette *palette);
+
+void gtk_tool_palette_add_drag_dest (GtkToolPalette *palette, GtkWidget *widget, GtkDestDefaults flags, GtkToolPaletteDragTargets targets, GdkDragAction actions);
+
+GtkWidget* gtk_tool_palette_get_drag_item (GtkToolPalette *palette, const GtkSelectionData *selection);
+
+# const GtkTargetEntry* gtk_tool_palette_get_drag_target_group (void)
+GtkTargetEntry*
+gtk_tool_palette_get_drag_target_group (class)
+ CODE:
+ RETVAL = (GtkTargetEntry*) gtk_tool_palette_get_drag_target_group ();
+ OUTPUT:
+ RETVAL
+
+# const GtkTargetEntry* gtk_tool_palette_get_drag_target_item (void)
+GtkTargetEntry*
+gtk_tool_palette_get_drag_target_item (class)
+ CODE:
+ RETVAL = (GtkTargetEntry*) gtk_tool_palette_get_drag_target_item ();
+ OUTPUT:
+ RETVAL
+
+GtkToolItemGroup_ornull* gtk_tool_palette_get_drop_group (GtkToolPalette *palette, gint x, gint y);
+
+GtkToolItem_ornull* gtk_tool_palette_get_drop_item (GtkToolPalette *palette, gint x, gint y);
+
+void gtk_tool_palette_set_drag_source (GtkToolPalette *palette, GtkToolPaletteDragTargets targets);
+
+GtkAdjustment* gtk_tool_palette_get_hadjustment (GtkToolPalette *palette);
+
+GtkAdjustment* gtk_tool_palette_get_vadjustment (GtkToolPalette *palette);
diff --git a/xs/GtkToolShell.xs b/xs/GtkToolShell.xs
index 60cd32e..83e2c6b 100644
--- a/xs/GtkToolShell.xs
+++ b/xs/GtkToolShell.xs
@@ -19,3 +19,15 @@ GtkReliefStyle gtk_tool_shell_get_relief_style (GtkToolShell *shell);
GtkToolbarStyle gtk_tool_shell_get_style (GtkToolShell *shell);
void gtk_tool_shell_rebuild_menu (GtkToolShell *shell);
+
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+PangoEllipsizeMode gtk_tool_shell_get_ellipsize_mode (GtkToolShell *shell);
+
+gfloat gtk_tool_shell_get_text_alignment (GtkToolShell *shell);
+
+GtkOrientation gtk_tool_shell_get_text_orientation (GtkToolShell *shell);
+
+GtkSizeGroup_ornull * gtk_tool_shell_get_text_size_group (GtkToolShell *shell);
+
+#endif /* 2.20 */
diff --git a/xs/GtkWidget.xs b/xs/GtkWidget.xs
index 4e1b9d2..aa812ad 100644
--- a/xs/GtkWidget.xs
+++ b/xs/GtkWidget.xs
@@ -1330,6 +1330,33 @@ GdkPixmap_noinc_ornull * gtk_widget_get_snapshot (GtkWidget *widget, GdkRectang
#endif /* 2.14 */
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+void gtk_widget_set_realized (GtkWidget *widget, gboolean realized);
+
+gboolean gtk_widget_get_realized (GtkWidget *widget);
+
+void gtk_widget_set_mapped (GtkWidget *widget, gboolean mapped);
+
+gboolean gtk_widget_get_mapped (GtkWidget *widget);
+
+# void gtk_widget_get_requisition (GtkWidget *widget, GtkRequisition *requisition)
+GtkRequisition_copy *
+gtk_widget_get_requisition (GtkWidget *widget)
+ PREINIT:
+ GtkRequisition requisition;
+ CODE:
+ gtk_widget_get_requisition (widget, &requisition);
+ RETVAL = &requisition;
+ OUTPUT:
+ RETVAL
+
+gboolean gtk_widget_has_rc_style (GtkWidget *widget);
+
+void gtk_widget_style_attach (GtkWidget *style);
+
+#endif /* 2.20 */
+
#if GTK_CHECK_VERSION (2, 22, 0)
gboolean gtk_widget_send_focus_change (GtkWidget *widget, GdkEvent *event);
diff --git a/xs/GtkWindow.xs b/xs/GtkWindow.xs
index b1aeb28..4e783a1 100644
--- a/xs/GtkWindow.xs
+++ b/xs/GtkWindow.xs
@@ -744,6 +744,14 @@ gtk_window_get_default_icon_name (class);
#endif /* 2.16 */
+#if GTK_CHECK_VERSION (2, 20, 0)
+
+GtkWindowType gtk_window_get_window_type (GtkWindow *window);
+
+void gtk_window_set_mnemonics_visible (GtkWindow *window, gboolean setting);
+
+#endif /* 2.20 */
+
MODULE = Gtk2::Window PACKAGE = Gtk2::WindowGroup PREFIX = gtk_window_group_
## GtkWindowGroup * gtk_window_group_new (void)
diff --git a/xs_files-2.20 b/xs_files-2.20
new file mode 100644
index 0000000..50c1171
--- /dev/null
+++ b/xs_files-2.20
@@ -0,0 +1,5 @@
+xs/GtkCellRendererSpinner.xs
+xs/GtkOffscreenWindow.xs
+xs/GtkSpinner.xs
+xs/GtkToolItemGroup.xs
+xs/GtkToolPalette.xs
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]