Fw: [PHP-GTK-DEV] [PATCH] GtkNotebook-related stuff

From: Date: Sat, 17 Sep 2005 17:22:33 +0000
Subject: Fw: [PHP-GTK-DEV] [PATCH] GtkNotebook-related stuff
Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1660@lists.php.net to get a copy of this message
OK, a little more background info for this patch. I made that change to phpg_gvalue_to_zval(), which is only called from two places in PHP-GTK 2 source. One is the signal marshaller, phpg_closure_marshal(), i.e. all GTK signal parameter values are checked this way. The signals potentially affected by this patch, apart from the switch-page signal in GtkNotebook which is fixed by it, are: insert-text signal (GtkEditable) files-added signal (GtkFileSystem) toggle-size-request signal (GtkMenuItem) path-clicked signal (GtkPathBar) input signal (GtkSpinButton) all of which contain a gpointer type parameter. The other place is gtk_tree_model_get_value(), which is unlikely to be broken by the patch (because there isn't a way to set a gpointer as a value for a GtkTreeModel). If anyone has any scripts handy for testing the other signals there, please let me know. I've no idea how to test GtkFileSystem :) - Steph ----- Original Message ----- From: "Steph" <steph@zend.com> To: "Andrei" <andrei@gravitonic.com> Cc: "PHP-GTK dev" <php-gtk-dev@lists.php.net> Sent: Saturday, September 17, 2005 4:10 PM Subject: [PHP-GTK-DEV] [PATCH] GtkNotebook-related stuff > Hi Andrei, > > I know this isn't a brilliant attempt, but it allows the signal that was > prevented from working, to work. > > It seems safer to return a long than anything else. > > I can't find a way to check what the pointer's actually pointing _to_, > otherwise it'd be able to cope with strings, objects, arrays, etc. But as > far as I recollect, the only place the lack of gpointer support hurt PHP-GTK > 1 was in this single GtkNotebook signal. All the PHP-GTK 2 demo and test > scripts I have at my disposal still work with the patch applied. > > Should I commit it, or does it require further investigation? > > - Steph > ---------------------------------------------------------------------------- ---- > -- > PHP-GTK Development Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

Index: main/phpg_gvalue.c =================================================================== RCS file: /repository/php-gtk/main/phpg_gvalue.c,v retrieving revision 1.23 diff -u -r1.23 phpg_gvalue.c --- main/phpg_gvalue.c 2 Sep 2005 09:16:55 -0000 1.23 +++ main/phpg_gvalue.c 16 Sep 2005 19:46:16 -0000 @@ -173,6 +173,13 @@ break; } + case G_TYPE_POINTER: + { + MAKE_ZVAL_IF_NULL(*value); + ZVAL_LONG(*value, (long)g_value_get_pointer(gval)); + break; + } + default: php_error(E_WARNING, "PHP-GTK internal error: unsupported type %s", g_type_name(G_VALUE_TYPE(gval))); MAKE_STD_ZVAL(*value);
« previous php.gtk.dev (#1660) next »