Re: GtkPlug for Windows
| From: | Steph Fox | Date: | Sat, 27 Jan 2007 06:26:11 +0000 |
| Subject: | Re: GtkPlug for Windows | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-3593@lists.php.net to get a copy of this message | ||
Erm, in GTK+ 2.6 gtkplug and gtksocket headers weren't even part of the win32 distribution :) that's why they're both on ignore in PHP-GTK 2.
Will look into it, but this is going to be after the weekend I think... since it means getting hold of two more sets of GTK libs, headers and runtime here...
----- Original Message ----- From: "Elizabeth Smith" <emsmith@elizabethmariesmith.com>
To: <php-gtk-dev@lists.php.net>
Sent: Thursday, January 25, 2007 3:51 PM
Subject: [PHP-GTK-DEV] GtkPlug for Windows
Morning, As of Gtk+ 2.8 gtkplug and gtksocket work on windows. I don't know if anyone has tested the current gtkplug constructor override but I found it didn't work (at least on windows). The attached diff adds the construct method (which is different from new and doesn't create and object). The diff also changes the original override to call gtk_plug_new. If you send new GtkPlug a socket_id of 0 you can later call GtkPlug->construct with a new socket_id. It would be nice if there was a way to mark something in the generator relevant for a specific library version - then php-gtk2 could build against 2.6, 2.8 and 2.10. Anyway, the attachment replaces the current gtkplug constructor override and adds the construct method, it also removes the win32 ignores - that part may need to be omitted until there's a way to mark items by gtk lib version or the requirement for php-gtk2 is raised from 2.6. Also I'm sending a couple demos to use with the new functions. (Thanks to Leon Pegg for writing them :) Thanks, Elizabeth Smith--------------------------------------------------------------------------------
Index: gtk.overrides =================================================================== RCS file: /repository/php-gtk/ext/gtk+/gtk.overrides,v retrieving revision 1.235 diff -u -r1.235 gtk.overrides --- gtk.overrides 23 Jan 2007 18:26:08 -0000 1.235 +++ gtk.overrides 25 Jan 2007 15:47:05 -0000 @@ -234,10 +234,6 @@ ignore--------------------------------------------------------------------------------GtkArgFlags GtkPrivateFlags-%% -ignore-win32- GtkPlug - GtkSocket%% }}} %% {{{ constants @@ -4119,6 +4115,38 @@ {gulong socket_id; zval *display = NULL; + GtkWidget *wrapped_obj = NULL;++ if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "i|O", &socket_id, &display)) + PHPG_THROW_CONSTRUCT_EXCEPTION(GtkPlug);++ if (display) { + wrapped_obj = gtk_plug_new_for_display(GDK_DISPLAY(PHPG_GOBJECT(display)), socket_id); + } else { + wrapped_obj = gtk_plug_new(socket_id); + }++ if (!wrapped_obj) { + PHPG_THROW_CONSTRUCT_EXCEPTION(GtkPlug); + }++ phpg_gobject_new(&this_ptr, (GObject *) wrapped_obj TSRMLS_CC);+} + +%% +add-arginfo GtkPlug construct +static +ZEND_BEGIN_ARG_INFO_EX(ARGINFO_NAME, 0, 0, 1)+ ZEND_ARG_INFO(0, socket_id) + ZEND_ARG_OBJ_INFO(0, display, GdkDisplay, 1)+ZEND_END_ARG_INFO(); + +%% +add GtkPlug construct +PHP_METHOD +{+ gulong socket_id; + zval *display = NULL; GObject *wrapped_obj = NULL;if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "i|O", &socket_id, &display))@@ -4136,8 +4164,9 @@if (!wrapped_obj) { PHPG_THROW_CONSTRUCT_EXCEPTION(GtkPlug); }-}+ phpg_gobject_new(&this_ptr, (GObject *) wrapped_obj TSRMLS_CC);+} %% }}} %% {{{ GtkPixmap
-- PHP-GTK Development Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php