>From cb3ce2a76072b5421bce069366430936eb58774e Mon Sep 17 00:00:00 2001 From: Quentin Sculo Date: Tue, 13 Apr 2010 18:57:19 +0200 Subject: [PATCH 01/16] wrap gtk_scale_add_mark and gtk_scale_clear_marks (new in gtk+-2.16) --- t/GtkScale.t | 15 +++++++++++++-- xs/GtkScale.xs | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/t/GtkScale.t b/t/GtkScale.t index f2099c8..f04d1a2 100644 --- a/t/GtkScale.t +++ b/t/GtkScale.t @@ -1,6 +1,6 @@ #!/usr/bin/perl -w use strict; -use Gtk2::TestHelper tests => 6; +use Gtk2::TestHelper tests => 7; # $Id$ @@ -26,7 +26,18 @@ SKIP: { is(@{[$scale -> get_layout_offsets()]}, 2); } +SKIP: { + skip("gtk_scale_add_mark and gtk_scale_clear_marks are new in 2.16", 1) + unless Gtk2->CHECK_VERSION (2, 16, 0); + + # no way to test it other than checking they don't crash + $scale -> add_mark(50,'top','this is the middle'); + $scale -> add_mark(80,'bottom',undef); + $scale -> clear_marks; + ok(1,"add_mark and clear_marks"); +} + __END__ -Copyright (C) 2003 by the gtk2-perl team (see the file AUTHORS for the +Copyright (C) 2003,2010 by the gtk2-perl team (see the file AUTHORS for the full list). See LICENSE for more information. diff --git a/xs/GtkScale.xs b/xs/GtkScale.xs index 69f34bc..52e7692 100644 --- a/xs/GtkScale.xs +++ b/xs/GtkScale.xs @@ -69,3 +69,17 @@ gtk_scale_get_layout (scale) void gtk_scale_get_layout_offsets (GtkScale *scale, OUTLIST gint x, OUTLIST gint y) #endif + +#if GTK_CHECK_VERSION (2, 16, 0) + +## void gtk_scale_add_mark (GtkScale *scale, gdouble value, GtkPositionType position, const gchar *markup) +void +gtk_scale_add_mark (scale, value, position, markup) + GtkScale *scale + gdouble value + GtkPositionType position + const gchar_ornull *markup + +void gtk_scale_clear_marks (GtkScale *scale) + +#endif -- 1.6.4.4