perl-Gtk2 r2152 - in trunk: . t xs



Author: tsch
Date: Sun Mar  8 17:01:28 2009
New Revision: 2152
URL: http://svn.gnome.org/viewvc/perl-Gtk2?rev=2152&view=rev

Log:
Remove the get_property() alias for Gtk2::Style::get() so that calling
get_property() on a Gtk2::Style resolves to Glib::Object::get_property().


Modified:
   trunk/ChangeLog
   trunk/t/GtkStyle.t
   trunk/xs/GtkStyle.xs

Modified: trunk/t/GtkStyle.t
==============================================================================
--- trunk/t/GtkStyle.t	(original)
+++ trunk/t/GtkStyle.t	Sun Mar  8 17:01:28 2009
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 # vim: set ft=perl expandtab shiftwidth=2 softtabstop=2 :
 use strict;
-use Gtk2::TestHelper tests => 125;
+use Gtk2::TestHelper tests => 124;
 use Carp;
 
 # $Id$
@@ -135,7 +135,7 @@
 }
 
 SKIP: {
-  skip("get_property is new in 2.16", 12)
+  skip("get is new in 2.16", 12)
     unless (Gtk2->CHECK_VERSION(2, 15, 0)); # FIXME 2.16
 
   # Test different properties (gint, gboolean, gchar* and GObject)
@@ -143,28 +143,28 @@
 
   # get gboolean
   is (
-    $style -> get_property('Gtk2::TreeView', 'allow-rules'),
+    $style -> get('Gtk2::TreeView', 'allow-rules'),
     $treeview -> style_get_property('allow-rules'),
     "get_property gboolean"
   );
 
   # get gint
   is (
-    $style -> get_property('Gtk2::TreeView', 'expander-size'),
+    $style -> get('Gtk2::TreeView', 'expander-size'),
     $treeview -> style_get_property('expander-size'),
     "get_property gint"
   );
 
   # get gchar*
   is (
-    $style -> get_property('Gtk2::TreeView', 'grid_line-pattern'),
+    $style -> get('Gtk2::TreeView', 'grid_line-pattern'),
     $treeview -> style_get_property('grid_line-pattern'),
     "get_property gchar*"
   );
 
   # get GObject (a color)
   is (
-    $style -> get_property('Gtk2::TreeView', 'even-row-color'),
+    $style -> get('Gtk2::TreeView', 'even-row-color'),
     $treeview -> style_get_property('even-row-color'),
     "get_property GObject*"
   );
@@ -188,9 +188,8 @@
   # Make sure that Glib::GObject::get() and Gtk2::Style::get() can coexist.
   my $custom_style = Custom::Style -> new();
   is ($custom_style -> Glib::Object::get('perl-string'), 'empty');
-  is ($custom_style -> Glib::Object::get_property('perl-string'), 'empty');
-  is ($style -> get('Gtk2::Button', 'image-spacing'), 2);
-  is ($style -> get_property('Gtk2::Button', 'image-spacing'), 2);
+  is ($custom_style -> get_property('perl-string'), 'empty');
+  is ($custom_style -> get('Gtk2::Button', 'image-spacing'), 2);
 
 
 
@@ -259,5 +258,5 @@
 
 __END__
 
-Copyright (C) 2003-2006 by the gtk2-perl team (see the file AUTHORS for the
+Copyright (C) 2003-2009 by the gtk2-perl team (see the file AUTHORS for the
 full list).  See LICENSE for more information.

Modified: trunk/xs/GtkStyle.xs
==============================================================================
--- trunk/xs/GtkStyle.xs	(original)
+++ trunk/xs/GtkStyle.xs	Sun Mar  8 17:01:28 2009
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003-2006 by the gtk2-perl team (see the file AUTHORS)
+ * Copyright (c) 2003-2009 by the gtk2-perl team (see the file AUTHORS)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -575,38 +575,27 @@
 
 #if GTK_CHECK_VERSION (2, 15, 0) /* FIXME 2.16 */
 
-=for apidoc Gtk2::Style::get
-=for signature $style->get (widget_package, ...)
-=for signature $style->get_property (widget_package, ...)
+=for apidoc
+=for signature list = $style->get (widget_package, ...)
 =for arg widget_package (string) widget package name (ex: 'Gtk2::TreeView')
 =for arg ... (list) list of property names
 
 Fetch and return the values for the style properties named in I<...> for a
 widget of type I<widget_package>.
 
-I<get_property> is an alias for I<get>.
-
-B<Note>: These methods shadow I<Glib::Object::get> and
-I<Glib::Object::get_property>. This shouldn't be a problem since I<Gtk2::Style>
-defines no properties (as of gtk+ 2.16).  If you have a class that's derived
-from Gtk2::Style and adds a property or if a new version of gtk+ adds a
-property to I<Gtk2::Style>, the property can be accessed by fully qualifying
-the method name:
+B<Note>: This method shadows I<Glib::Object::get>. This shouldn't be a problem
+since I<Gtk2::Style> defines no properties (as of gtk+ 2.16).  If you have a
+class that's derived from Gtk2::Style and adds a property or if a new version
+of gtk+ adds a property to I<Gtk2::Style>, the property can be accessed with
+I<get_property> which still resolves to I<Glib::Object::get_property>:
 
-	my $value = $style->Glib::Object::get('property');
-
-=cut
+	my $value = $style->get_property('property');
 
-=for apidoc Gtk2::Style::get_property __hide__
 =cut
-
 void
 gtk_style_get (style, widget_package, ...)
-    GtkStyle	*style
-    const char	*widget_package
-    ALIAS:
-	Gtk2::Style::get = 0
-	Gtk2::Style::get_property = 1
+	GtkStyle *style
+	const char *widget_package
     PREINIT:
 	int i;
 	GType widget_type;
@@ -615,7 +604,6 @@
 	/* Use CODE: instead of PPCODE: so we can handle the stack ourselves in
 	 * order to avoid that xsubs called by gtk_style_get_property overwrite
 	 * what we put on the stack. */
-	PERL_UNUSED_VAR (ix);
 
 	widget_type = gperl_type_from_package (widget_package);
 	if (widget_type == 0)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]