[perl-Gtk2] Wrap gtk+ 2.22 API
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2] Wrap gtk+ 2.22 API
- Date: Mon, 27 Dec 2010 23:11:20 +0000 (UTC)
commit 288d237f9a4df4b1349f789eb592c9e55195694e
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Tue Dec 28 00:09:10 2010 +0100
Wrap gtk+ 2.22 API
NEWS | 1 +
t/GtkAssistant.t | 7 +++++++
t/GtkButton.t | 12 +++++++++++-
t/GtkEntry.t | 17 ++++++++++++++++-
t/GtkExpander.t | 10 +++++++++-
t/GtkFontSelection.t | 9 ++++++++-
t/GtkIconView.t | 19 ++++++++++++++++++-
t/GtkMessageDialog.t | 9 ++++++++-
t/GtkNotebook.t | 10 +++++++++-
t/GtkStatusbar.t | 7 +++++++
t/GtkTable.t | 10 +++++++++-
t/GtkTextView.t | 15 ++++++++++++++-
t/GtkViewport.t | 16 +++++++++++++---
t/GtkWidget.t | 11 +++++++++++
xs/GtkAssistant.xs | 6 ++++++
xs/GtkButton.xs | 8 +++++++-
xs/GtkEntry.xs | 10 ++++++++++
xs/GtkExpander.xs | 7 +++++++
xs/GtkFontSelection.xs | 6 ++++++
xs/GtkIconView.xs | 14 +++++++++++++-
xs/GtkMessageDialog.xs | 6 ++++++
xs/GtkNotebook.xs | 8 ++++++++
xs/GtkStatusbar.xs | 5 +++++
xs/GtkTable.xs | 6 ++++++
xs/GtkTextView.xs | 13 +++++++++++++
xs/GtkTreeModel.xs | 1 +
xs/GtkViewport.xs | 6 ++++++
xs/GtkWidget.xs | 6 ++++++
28 files changed, 241 insertions(+), 14 deletions(-)
---
diff --git a/NEWS b/NEWS
index 15443fa..4637c49 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
Overview of changes in the next unstable release
================================================
+* Wrap gtk+ 2.22 API.
* Gtk2::Notebook: fix invocation of window creation hooks.
* Fix length of Gtk2::Gdk::Pixbuf->get_pixels() return.
* Allow Gtk2::Buildable implementations to return undef from
diff --git a/t/GtkAssistant.t b/t/GtkAssistant.t
index 32e798f..6101322 100644
--- a/t/GtkAssistant.t
+++ b/t/GtkAssistant.t
@@ -74,3 +74,10 @@ $assistant->set_forward_page_func (\&page_func);
sub page_func {
ok (1);
}
+
+SKIP: {
+ skip 'new 2.22 stuff', 0
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+ my $assistant = Gtk2::Assistant->new;
+ $assistant->commit;
+}
diff --git a/t/GtkButton.t b/t/GtkButton.t
index 0d0d80b..b96db79 100644
--- a/t/GtkButton.t
+++ b/t/GtkButton.t
@@ -9,7 +9,7 @@
#########################
-use Gtk2::TestHelper tests => 39;
+use Gtk2::TestHelper tests => 40;
ok( my $button = Gtk2::Button->new("Not Yet") );
ok(1);
@@ -111,6 +111,16 @@ SKIP: {
is ($button->get_image_position, "left");
}
+SKIP: {
+ skip 'new 2.22 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+ my $button = Gtk2::Button->new ('gtk-quit');
+ my $window = Gtk2::Window->new;
+ $window->add ($button);
+ $button->realize;
+ isa_ok ($button->get_event_window, 'Gtk2::Gdk::Window');
+}
+
__END__
Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkEntry.t b/t/GtkEntry.t
index d6fc564..8912dca 100644
--- a/t/GtkEntry.t
+++ b/t/GtkEntry.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 63;
+use Gtk2::TestHelper tests => 64;
# $Id$
@@ -141,6 +141,21 @@ SKIP: {
test_icon_methods('secondary');
}
+SKIP: {
+ skip 'new 2.22 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ my $entry = Gtk2::Entry->new;
+ my $window = Gtk2::Window->new;
+ $window->add ($entry);
+ $entry->realize;
+ my $event = Gtk2::Gdk::Event->new ('key-press');
+ $event->window ($entry->window);
+ ok (defined $entry->im_context_filter_keypress ($event));
+
+ $entry->reset_im_context;
+}
+
sub test_icon_methods {
my ($icon_pos) = @_;
diff --git a/t/GtkExpander.t b/t/GtkExpander.t
index 705a0a1..b56ba03 100644
--- a/t/GtkExpander.t
+++ b/t/GtkExpander.t
@@ -3,7 +3,7 @@
# $Id$
use Gtk2::TestHelper
- tests => 14,
+ tests => 15,
at_least_version => [2, 4, 0, "GtkExpander is new in 2.4"],
;
@@ -51,6 +51,14 @@ my $label = Gtk2::Label->new ('foo');
$expander->set_label_widget ($label);
is ($expander->get_label_widget, $label);
+SKIP: {
+ skip 'new 2.22 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ $expander->set_label_fill (TRUE);
+ ok ($expander->get_label_fill);
+}
+
__END__
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkFontSelection.t b/t/GtkFontSelection.t
index 3bc8216..f236945 100644
--- a/t/GtkFontSelection.t
+++ b/t/GtkFontSelection.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 22;
+use Gtk2::TestHelper tests => 23;
# $Id$
@@ -48,6 +48,13 @@ SKIP: {
isa_ok($fs -> get_size_list(), 'Gtk2::Widget');
}
+SKIP: {
+ skip 'new 2.22 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ isa_ok($dialog -> get_font_selection(), 'Gtk2::FontSelection');
+}
+
__END__
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkIconView.t b/t/GtkIconView.t
index fef497f..644d737 100644
--- a/t/GtkIconView.t
+++ b/t/GtkIconView.t
@@ -14,7 +14,7 @@
use strict;
use warnings;
-use Gtk2::TestHelper tests => 57,
+use Gtk2::TestHelper tests => 60,
at_least_version => [2, 6, 0, "GtkIconView is new in 2.6"],
;
@@ -273,6 +273,23 @@ SKIP: {
$win->destroy;
}
+SKIP: {
+ skip 'new 2.22 stuff', 3
+ unless Gtk2->CHECK_VERSION (2, 22, 0);
+
+ my $win = Gtk2::Window->new;
+ my $model = create_store ();
+ fill_store ($model, get_pixbufs ($win));
+ my $iview = Gtk2::IconView->new_with_model ($model);
+ my $path = Gtk2::TreePath->new_first;
+
+ ok (defined $iview->get_item_column ($path));
+ ok (defined $iview->get_item_row ($path));
+
+ $iview->set_item_orientation ('vertical');
+ is ($iview->get_item_orientation, 'vertical');
+}
+
sub create_store
{
my $store = Gtk2::ListStore->new (qw/Glib::String Gtk2::Gdk::Pixbuf
diff --git a/t/GtkMessageDialog.t b/t/GtkMessageDialog.t
index 87fa559..4409d61 100644
--- a/t/GtkMessageDialog.t
+++ b/t/GtkMessageDialog.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 7;
+use Gtk2::TestHelper tests => 8;
# $Id$
@@ -90,6 +90,13 @@ SKIP: {
is ($dialog -> get_image(), $image);
}
+SKIP: {
+ skip 'new 2.22 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ isa_ok ($dialog -> get_message_area(), 'Gtk2::Widget');
+}
+
__END__
Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkNotebook.t b/t/GtkNotebook.t
index c0b54fa..2ec052c 100644
--- a/t/GtkNotebook.t
+++ b/t/GtkNotebook.t
@@ -5,7 +5,7 @@
# - rm
#########################
-use Gtk2::TestHelper tests => 64;
+use Gtk2::TestHelper tests => 66;
my $win = Gtk2::Window->new;
@@ -135,6 +135,14 @@ SKIP: {
is ($nb->get_action_widget('end'), $button, '[gs]et_action_widget');
}
+SKIP: {
+ skip 'new 2.22 stuff', 2
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ ok (defined $nb->get_tab_hborder);
+ ok (defined $nb->get_tab_vborder);
+}
+
$win->show_all;
ok(1);
run_main sub {
diff --git a/t/GtkStatusbar.t b/t/GtkStatusbar.t
index 417f5ec..6f2ec74 100644
--- a/t/GtkStatusbar.t
+++ b/t/GtkStatusbar.t
@@ -33,6 +33,13 @@ $sts->pop($sts_cid1);
$sts->pop($sts_cid2);
$sts->remove($sts_cid2, $sts_mid1);
+SKIP: {
+ skip 'new 2.22 stuff', 0
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ $sts->remove_all ($sts_cid1);
+}
+
ok(1);
__END__
diff --git a/t/GtkTable.t b/t/GtkTable.t
index a7ada8d..4aaf62c 100644
--- a/t/GtkTable.t
+++ b/t/GtkTable.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 5;
+use Gtk2::TestHelper tests => 6;
# $Id$
@@ -29,6 +29,14 @@ is($table -> get_default_col_spacing(), 5);
$table -> set_homogeneous(0);
ok(! $table -> get_homogeneous());
+SKIP: {
+ skip 'new 2.22 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ my ($w, $h) = $table -> get_size();
+ ok (defined $w && defined $h);
+}
+
__END__
Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkTextView.t b/t/GtkTextView.t
index b3cc0dc..ea86eb3 100644
--- a/t/GtkTextView.t
+++ b/t/GtkTextView.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 45;
+use Gtk2::TestHelper tests => 48;
# $Id$
@@ -136,6 +136,19 @@ SKIP: {
isa_ok ($iter, 'Gtk2::TextIter', 'get_iter_at_position in scalar context');
}
+SKIP: {
+ skip 'new 2.22 stuff', 3
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ my $event = Gtk2::Gdk::Event->new ('key-press');
+ $event->window ($view->window);
+ ok (defined $view->im_context_filter_keypress ($event));
+ $view->reset_im_context;
+
+ isa_ok ($view->get_hadjustment, 'Gtk2::Adjustment');
+ isa_ok ($view->get_vadjustment, 'Gtk2::Adjustment');
+}
+
__END__
Copyright (C) 2003-2005 by the gtk2-perl team (see the file AUTHORS for
diff --git a/t/GtkViewport.t b/t/GtkViewport.t
index 069bf99..d20abba 100644
--- a/t/GtkViewport.t
+++ b/t/GtkViewport.t
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
-use Gtk2::TestHelper tests => 7, noinit => 1;
+use Gtk2::TestHelper tests => 8;
# $Id$
@@ -24,12 +24,22 @@ isa_ok($viewport, "Gtk2::Viewport");
$viewport -> set_shadow_type("etched-in");
is($viewport -> get_shadow_type(), "etched-in");
+my $window = Gtk2::Window->new;
+$window->add ($viewport);
+$viewport->realize;
+
SKIP: {
skip "new 2.20 stuff", 1
unless Gtk2->CHECK_VERSION(2, 20, 0);
- is ($viewport->get_bin_window, undef,
- 'get_bin_window() undef when unrealized');
+ isa_ok ($viewport->get_bin_window, 'Gtk2::Gdk::Window');
+}
+
+SKIP: {
+ skip "new 2.22 stuff", 1
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ isa_ok ($viewport->get_view_window, 'Gtk2::Gdk::Window');
}
__END__
diff --git a/t/GtkWidget.t b/t/GtkWidget.t
index aefb9b8..1af56fc 100644
--- a/t/GtkWidget.t
+++ b/t/GtkWidget.t
@@ -502,6 +502,17 @@ SKIP: {
delete_event => Gtk2::Gdk::Event->new ('key-press'));
}
+SKIP: {
+ skip 'new 2.22 stuff', 0
+ unless Gtk2->CHECK_VERSION(2, 22, 0);
+
+ my $widget = Gtk2::Label->new ('Bla');
+ my $event = Gtk2::Gdk::Event->new ('focus-change');
+ $event->in (TRUE);
+ $event->window ($widget->window);
+ $widget->send_focus_change ($event);
+}
+
__END__
Copyright (C) 2003-2006, 2010 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/xs/GtkAssistant.xs b/xs/GtkAssistant.xs
index d689319..0a62534 100644
--- a/xs/GtkAssistant.xs
+++ b/xs/GtkAssistant.xs
@@ -146,3 +146,9 @@ void gtk_assistant_add_action_widget (GtkAssistant *assistant, GtkWidget *child)
void gtk_assistant_remove_action_widget (GtkAssistant *assistant, GtkWidget *child);
void gtk_assistant_update_buttons_state (GtkAssistant *assistant);
+
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+void gtk_assistant_commit (GtkAssistant *assistant);
+
+#endif /* 2.22 */
diff --git a/xs/GtkButton.xs b/xs/GtkButton.xs
index 2e713f0..23fed3a 100644
--- a/xs/GtkButton.xs
+++ b/xs/GtkButton.xs
@@ -164,10 +164,16 @@ GtkWidget_ornull * gtk_button_get_image (GtkButton *button)
#endif
-#if GTK_CHECK_VERSION(2,9,2)
+#if GTK_CHECK_VERSION(2,10,0)
void gtk_button_set_image_position (GtkButton *button, GtkPositionType position);
GtkPositionType gtk_button_get_image_position (GtkButton *button);
#endif
+
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+GdkWindow_ornull * gtk_button_get_event_window (GtkButton *button);
+
+#endif /* 2.22 */
diff --git a/xs/GtkEntry.xs b/xs/GtkEntry.xs
index d2b3355..fb7ff7e 100644
--- a/xs/GtkEntry.xs
+++ b/xs/GtkEntry.xs
@@ -289,6 +289,16 @@ gint gtk_entry_get_current_icon_drag_source (GtkEntry *entry);
#endif /* 2.16 */
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+gboolean gtk_entry_im_context_filter_keypress (GtkEntry *entry, GdkEvent *event);
+ C_ARGS:
+ entry, (GdkEventKey *) event
+
+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/GtkExpander.xs b/xs/GtkExpander.xs
index a3d8df3..31febc6 100644
--- a/xs/GtkExpander.xs
+++ b/xs/GtkExpander.xs
@@ -47,3 +47,10 @@ void gtk_expander_set_label_widget (GtkExpander *expander, GtkWidget *label_widg
GtkWidget *gtk_expander_get_label_widget (GtkExpander *expander);
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+void gtk_expander_set_label_fill (GtkExpander *expander, gboolean label_fill);
+
+gboolean gtk_expander_get_label_fill (GtkExpander *expander);
+
+#endif /* 2.22 */
diff --git a/xs/GtkFontSelection.xs b/xs/GtkFontSelection.xs
index 86e71e8..17e3843 100644
--- a/xs/GtkFontSelection.xs
+++ b/xs/GtkFontSelection.xs
@@ -166,3 +166,9 @@ const gchar *
gtk_font_selection_dialog_get_preview_text (fsd)
GtkFontSelectionDialog * fsd
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+GtkWidget * gtk_font_selection_dialog_get_font_selection (GtkFontSelectionDialog *fsd);
+
+#endif /* 2.22 */
+
diff --git a/xs/GtkIconView.xs b/xs/GtkIconView.xs
index 4c4c231..63816eb 100644
--- a/xs/GtkIconView.xs
+++ b/xs/GtkIconView.xs
@@ -275,7 +275,7 @@ GdkPixmap_noinc *gtk_icon_view_create_drag_icon (GtkIconView *icon_view, GtkTree
#endif /* 2.8.0 */
-#if GTK_CHECK_VERSION (2, 11, 0)
+#if GTK_CHECK_VERSION (2, 12, 0)
void gtk_icon_view_convert_widget_to_bin_window_coords (GtkIconView *icon_view, gint wx, gint wy, OUTLIST gint bx, OUTLIST gint by);
@@ -318,3 +318,15 @@ gint gtk_icon_view_get_item_padding (GtkIconView *icon_view);
#endif
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+gint gtk_icon_view_get_item_row (GtkIconView *icon_view, GtkTreePath *path);
+
+gint gtk_icon_view_get_item_column (GtkIconView *icon_view, GtkTreePath *path);
+
+void gtk_icon_view_set_item_orientation (GtkIconView *icon_view, GtkOrientation orientation);
+
+GtkOrientation gtk_icon_view_get_item_orientation (GtkIconView *icon_view);
+
+#endif /* 2.22 */
+
diff --git a/xs/GtkMessageDialog.xs b/xs/GtkMessageDialog.xs
index 03851a4..7dc7862 100644
--- a/xs/GtkMessageDialog.xs
+++ b/xs/GtkMessageDialog.xs
@@ -194,3 +194,9 @@ void gtk_message_dialog_set_image (GtkMessageDialog *dialog, GtkWidget *image);
GtkWidget* gtk_message_dialog_get_image (GtkMessageDialog *dialog);
#endif /* 2.14 */
+
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+GtkWidget * gtk_message_dialog_get_message_area (GtkMessageDialog *message_dialog);
+
+#endif /* 2.22 */
diff --git a/xs/GtkNotebook.xs b/xs/GtkNotebook.xs
index e5167a7..e7b327c 100644
--- a/xs/GtkNotebook.xs
+++ b/xs/GtkNotebook.xs
@@ -465,3 +465,11 @@ GtkWidget_ornull* gtk_notebook_get_action_widget (GtkNotebook *notebook, GtkPack
#endif /* 2.20 */
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+guint16 gtk_notebook_get_tab_hborder (GtkNotebook *notebook);
+
+guint16 gtk_notebook_get_tab_vborder (GtkNotebook *notebook);
+
+#endif /* 2.22 */
+
diff --git a/xs/GtkStatusbar.xs b/xs/GtkStatusbar.xs
index 2eeb54b..7751fab 100644
--- a/xs/GtkStatusbar.xs
+++ b/xs/GtkStatusbar.xs
@@ -66,3 +66,8 @@ gtk_statusbar_push (statusbar, context_id, text)
guint context_id
gchar * text
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+void gtk_statusbar_remove_all (GtkStatusbar *statusbar, guint context_id);
+
+#endif /* 2.22 */
diff --git a/xs/GtkTable.xs b/xs/GtkTable.xs
index 7ba4537..4fa8d28 100644
--- a/xs/GtkTable.xs
+++ b/xs/GtkTable.xs
@@ -172,3 +172,9 @@ gtk_table_set_homogeneous (table, homogeneous)
gboolean
gtk_table_get_homogeneous (table)
GtkTable * table
+
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+void gtk_table_get_size (GtkTable *table, OUTLIST guint rows, OUTLIST guint columns);
+
+#endif /* 2.22 */
diff --git a/xs/GtkTextView.xs b/xs/GtkTextView.xs
index e6837c1..689272b 100644
--- a/xs/GtkTextView.xs
+++ b/xs/GtkTextView.xs
@@ -404,3 +404,16 @@ GtkTextBuffer *
gtk_text_view_get_buffer (text_view)
GtkTextView * text_view
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+GtkAdjustment* gtk_text_view_get_hadjustment (GtkTextView *text_view);
+
+GtkAdjustment* gtk_text_view_get_vadjustment (GtkTextView *text_view);
+
+gboolean gtk_text_view_im_context_filter_keypress (GtkTextView *text_view, GdkEvent *event);
+ C_ARGS:
+ text_view, (GdkEventKey *) event
+
+void gtk_text_view_reset_im_context (GtkTextView *text_view);
+
+#endif /* 2.22 */
diff --git a/xs/GtkTreeModel.xs b/xs/GtkTreeModel.xs
index aeacba3..91a65c9 100644
--- a/xs/GtkTreeModel.xs
+++ b/xs/GtkTreeModel.xs
@@ -742,6 +742,7 @@ gint
gtk_tree_path_get_depth (path)
GtkTreePath *path
+# gint * gtk_tree_path_get_indices_with_depth (GtkTreePath *path, gint *depth);
=for apidoc
Returns a list of integers describing the current indices of I<$path>.
=cut
diff --git a/xs/GtkViewport.xs b/xs/GtkViewport.xs
index 5fcc2bf..863f75b 100644
--- a/xs/GtkViewport.xs
+++ b/xs/GtkViewport.xs
@@ -70,3 +70,9 @@ GdkWindow_ornull*
gtk_viewport_get_bin_window (GtkViewport *viewport)
#endif /* 2.20 */
+
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+GdkWindow_ornull * gtk_viewport_get_view_window (GtkViewport *viewport);
+
+#endif /* 2.22 */
diff --git a/xs/GtkWidget.xs b/xs/GtkWidget.xs
index c2a06e1..4e1b9d2 100644
--- a/xs/GtkWidget.xs
+++ b/xs/GtkWidget.xs
@@ -1329,3 +1329,9 @@ gboolean gtk_widget_get_has_tooltip (GtkWidget *widget);
GdkPixmap_noinc_ornull * gtk_widget_get_snapshot (GtkWidget *widget, GdkRectangle_ornull *clip_rect=NULL);
#endif /* 2.14 */
+
+#if GTK_CHECK_VERSION (2, 22, 0)
+
+gboolean gtk_widget_send_focus_change (GtkWidget *widget, GdkEvent *event);
+
+#endif /* 2.22 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]