[perl-Gtk2] Wrap overlooked gtk+ 2.14 API
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Gtk2] Wrap overlooked gtk+ 2.14 API
- Date: Thu, 30 Dec 2010 18:55:50 +0000 (UTC)
commit afc15a281bec1de3c27818e8a90a67840df01cdf
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Thu Dec 30 19:31:51 2010 +0100
Wrap overlooked gtk+ 2.14 API
MANIFEST | 7 +++++++
NEWS | 2 +-
maps-2.14 | 2 ++
t/GtkComboBox.t | 15 +++++++++++----
t/GtkHSV.t | 24 ++++++++++++++++++++++++
t/GtkWidget.t | 6 ++++--
xs/GtkComboBox.xs | 8 ++++++++
xs/GtkHSV.xs | 39 +++++++++++++++++++++++++++++++++++++++
xs/GtkWidget.xs | 2 ++
xs_files-2.14 | 1 +
10 files changed, 99 insertions(+), 7 deletions(-)
---
diff --git a/MANIFEST b/MANIFEST
index 8916002..d0680df 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3,6 +3,7 @@ AUTHORS
ChangeLog.pre-git
CodeGen.pm
constants-2.0
+constants-2.18
copyright.pod
devel.pod
doctypes
@@ -154,6 +155,7 @@ t/GtkAccelLabel.t
t/GtkAccelMap.t
t/GtkAction.t
t/GtkActionGroup.t
+t/GtkActivatable.t
t/GtkAdjustment.t
t/GtkAlignment.t
t/GtkArrow.t
@@ -197,6 +199,7 @@ t/GtkDnd.t
t/GtkDrawingArea.t
t/GtkEditable.t
t/GtkEntry.t
+t/GtkEntryBuffer.t
t/GtkEntryCompletion.t
t/GtkEventBox.t
t/GtkExpander.t
@@ -220,6 +223,7 @@ t/GtkHRuler.t
t/GtkHScale.t
t/GtkHScrollbar.t
t/GtkHSeparator.t
+t/GtkHSV.t
t/GtkIconFactory.t
t/GtkIconTheme.t
t/GtkIconView.t
@@ -384,6 +388,7 @@ xs/GtkAccelLabel.xs
xs/GtkAccelMap.xs
xs/GtkAction.xs
xs/GtkActionGroup.xs
+xs/GtkActivatable.xs
xs/GtkAdjustment.xs
xs/GtkAlignment.xs
xs/GtkArrow.xs
@@ -425,6 +430,7 @@ xs/GtkDnd.xs
xs/GtkDrawingArea.xs
xs/GtkEditable.xs
xs/GtkEntry.xs
+xs/GtkEntryBuffer.xs
xs/GtkEntryCompletion.xs
xs/GtkEventBox.xs
xs/GtkExpander.xs
@@ -448,6 +454,7 @@ xs/GtkHRuler.xs
xs/GtkHScale.xs
xs/GtkHScrollbar.xs
xs/GtkHSeparator.xs
+xs/GtkHSV.xs
xs/GtkIconFactory.xs
xs/GtkIconTheme.xs
xs/GtkIconView.xs
diff --git a/NEWS b/NEWS
index 0c423e4..009e107 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
Overview of changes in the next unstable release
================================================
-* Wrap missing gtk+ 2.16, 2.18 and 2.20 API.
+* Wrap missing gtk+ 2.14, 2.16, 2.18 and 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/maps-2.14 b/maps-2.14
index ae76df8..3f6385c 100644
--- a/maps-2.14
+++ b/maps-2.14
@@ -1 +1,3 @@
+GTK_TYPE_HSV GtkHSV GtkObject Gtk2::HSV
+GTK_TYPE_NUMBER_UP_LAYOUT GtkNumberUpLayout GEnum Gtk2::NumberUpLayout
GTK_TYPE_TOOL_SHELL GtkToolShell GInterface Gtk2::ToolShell
diff --git a/t/GtkComboBox.t b/t/GtkComboBox.t
index 9a9eeac..7797f45 100644
--- a/t/GtkComboBox.t
+++ b/t/GtkComboBox.t
@@ -1,9 +1,7 @@
-###!/usr/bin/perl -w
-
-# $Id$
+#!/usr/bin/env perl
use Gtk2::TestHelper
- tests => 27,
+ tests => 28,
at_least_version => [2, 4, 0, "GtkComboBox is new in 2.4"],
;
@@ -135,6 +133,15 @@ SKIP: {
is ($combo_box->get_title, "whee");
}
+SKIP: {
+ skip 'new 2.14 stuff', 1
+ unless Gtk2->CHECK_VERSION(2, 14, 0);
+
+ my $combo_box = Gtk2::ComboBox->new;
+ $combo_box->set_button_sensitivity ('auto');
+ is ($combo_box->get_button_sensitivity, 'auto');
+}
+
__END__
Copyright (C) 2003-2006, 2010 by the gtk2-perl team (see the file AUTHORS for the
diff --git a/t/GtkHSV.t b/t/GtkHSV.t
new file mode 100644
index 0000000..5b2736f
--- /dev/null
+++ b/t/GtkHSV.t
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+use Gtk2::TestHelper
+ tests => 6,
+ noinit => 1,
+ at_least_version => [2, 14, 0, "Gtk2::HSV is new in 2.14"];
+
+my $hsv = Gtk2::HSV->new;
+isa_ok ($hsv, 'Gtk2::HSV');
+
+$hsv->set_color (0, 0, 0);
+is_deeply ([$hsv->get_color], [0, 0, 0]);
+
+$hsv->set_metrics (23, 1);
+is_deeply ([$hsv->get_metrics], [23, 1]);
+
+ok (!$hsv->is_adjusting);
+
+is_deeply ([Gtk2::hsv_to_rgb (0, 0, 0)], [0, 0, 0]);
+is_deeply ([Gtk2::rgb_to_hsv (0, 0, 0)], [0, 0, 0]);
+
+__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/GtkWidget.t b/t/GtkWidget.t
index 4a9b321..d32d52e 100644
--- a/t/GtkWidget.t
+++ b/t/GtkWidget.t
@@ -6,7 +6,7 @@
use warnings;
use strict;
-use Gtk2::TestHelper tests => 157;
+use Gtk2::TestHelper tests => 158;
# we can't instantiate Gtk2::Widget, it's abstract. use a button instead.
@@ -481,7 +481,7 @@ SKIP: {
}
SKIP: {
- skip 'new 2.14 stuff', 3
+ skip 'new 2.14 stuff', 4
unless Gtk2->CHECK_VERSION(2, 14, 0);
my $widget = Gtk2::Label->new ('Bla');
@@ -496,6 +496,8 @@ SKIP: {
isa_ok ($widget->get_snapshot (Gtk2::Gdk::Rectangle->new (0, 0, 1, 1)),
'Gtk2::Gdk::Pixmap');
+ isa_ok ($widget->get_window (), 'Gtk2::Gdk::Window');
+
$window->signal_connect(
delete_event => \&Gtk2::Widget::hide_on_delete);
$window->signal_emit(
diff --git a/xs/GtkComboBox.xs b/xs/GtkComboBox.xs
index a6871b6..eeea547 100644
--- a/xs/GtkComboBox.xs
+++ b/xs/GtkComboBox.xs
@@ -201,3 +201,11 @@ void gtk_combo_box_set_title (GtkComboBox *combo_box, const gchar * title);
const gchar * gtk_combo_box_get_title (GtkComboBox *combo_box);
#endif
+
+#if GTK_CHECK_VERSION (2, 14, 0)
+
+void gtk_combo_box_set_button_sensitivity (GtkComboBox *combo_box, GtkSensitivityType sensitivity);
+
+GtkSensitivityType gtk_combo_box_get_button_sensitivity (GtkComboBox *combo_box);
+
+#endif /* 2.14 */
diff --git a/xs/GtkHSV.xs b/xs/GtkHSV.xs
new file mode 100644
index 0000000..3d3c892
--- /dev/null
+++ b/xs/GtkHSV.xs
@@ -0,0 +1,39 @@
+/*
+ * 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::HSV PACKAGE = Gtk2::HSV PREFIX = gtk_hsv_
+
+GtkWidget *
+gtk_hsv_new (class)
+ C_ARGS:
+ /* void */
+
+void gtk_hsv_set_color (GtkHSV *hsv, double h, double s, double v);
+
+void gtk_hsv_get_color (GtkHSV *hsv, OUTLIST gdouble h, OUTLIST gdouble s, OUTLIST gdouble v);
+
+void gtk_hsv_set_metrics (GtkHSV *hsv, gint size, gint ring_width);
+
+void gtk_hsv_get_metrics (GtkHSV *hsv, OUTLIST gint size, OUTLIST gint ring_width);
+
+gboolean gtk_hsv_is_adjusting (GtkHSV *hsv);
+
+MODULE = Gtk2::HSV PACKAGE = Gtk2 PREFIX = gtk_
+
+=for object Gtk2::HSV
+=cut
+
+=for apidoc __function__
+=cut
+void gtk_hsv_to_rgb (gdouble h, gdouble s, gdouble v, OUTLIST gdouble r, OUTLIST gdouble g, OUTLIST gdouble b);
+
+=for apidoc __function__
+=cut
+void gtk_rgb_to_hsv (gdouble r, gdouble g, gdouble b, OUTLIST gdouble h, OUTLIST gdouble s, OUTLIST gdouble v);
diff --git a/xs/GtkWidget.xs b/xs/GtkWidget.xs
index 1befdfa..c10d780 100644
--- a/xs/GtkWidget.xs
+++ b/xs/GtkWidget.xs
@@ -1326,6 +1326,8 @@ gboolean gtk_widget_get_has_tooltip (GtkWidget *widget);
GdkPixmap_noinc_ornull * gtk_widget_get_snapshot (GtkWidget *widget, GdkRectangle_ornull *clip_rect=NULL);
+GdkWindow_ornull * gtk_widget_get_window (GtkWidget *widget);
+
#endif /* 2.14 */
#if GTK_CHECK_VERSION (2, 18, 0)
diff --git a/xs_files-2.14 b/xs_files-2.14
index 930fc1a..2715ebd 100644
--- a/xs_files-2.14
+++ b/xs_files-2.14
@@ -1,2 +1,3 @@
+xs/GtkHSV.xs
xs/GtkShow.xs
xs/GtkToolShell.xs
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]