alan_k Tue Sep 30 02:22:15 2003 EDT
Modified files: (Branch: GTK2)
/php-gtk/main php_gtk.c php_gtk.h
Log:
add more missing files for gtk2 port
Index: php-gtk/main/php_gtk.c
diff -u php-gtk/main/php_gtk.c:1.28.2.1 php-gtk/main/php_gtk.c:1.28.2.1.2.1
--- php-gtk/main/php_gtk.c:1.28.2.1 Thu Dec 26 15:45:31 2002
+++ php-gtk/main/php_gtk.c Tue Sep 30 02:22:15 2003
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: php_gtk.c,v 1.28.2.1 2002/12/26 20:45:31 andrei Exp $: */
+/* $Id: php_gtk.c,v 1.28.2.1.2.1 2003/09/30 06:22:15 alan_k Exp $: */
#include "php_gtk.h"
#include "SAPI.h"
@@ -110,7 +110,8 @@
zend_hash_init_ex(&php_gtk_rsrc_hash, 50, NULL, NULL, 1, 0);
zend_hash_init_ex(&php_gtk_type_hash, 50, NULL, NULL, 1, 0);
zend_hash_init_ex(&php_gtk_prop_desc, 50, NULL, NULL, 1, 0);
-
+ zend_hash_init_ex(&php_gtk_callback_hash, 50, NULL, NULL, 1, 0);
+
zend_unset_timeout(TSRMLS_C);
zend_set_timeout(0);
Index: php-gtk/main/php_gtk.h
diff -u php-gtk/main/php_gtk.h:1.61.2.8 php-gtk/main/php_gtk.h:1.61.2.8.2.1
--- php-gtk/main/php_gtk.h:1.61.2.8 Thu Jul 17 14:59:05 2003
+++ php-gtk/main/php_gtk.h Tue Sep 30 02:22:15 2003
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: php_gtk.h,v 1.61.2.8 2003/07/17 18:59:05 fmk Exp $: */
+/* $Id: php_gtk.h,v 1.61.2.8.2.1 2003/09/30 06:22:15 alan_k Exp $: */
#ifndef _PHP_GTK_H
#define _PHP_GTK_H
@@ -48,10 +48,15 @@
#endif
#include "php_gtk_module.h"
+#include <glib-object.h>
#define PHP_GTK_EXPORT_CE(ce) zend_class_entry *ce
#define PHP_GTK_EXPORT_FUNC(func) func
+
+
#define PHP_GTK_GET_GENERIC(w, type, le) ((type)php_gtk_get_object(w, le))
+
+
#define PHP_GTK_SEPARATE_RETURN(return_value, result) \
{
\
zval *ret;
\
@@ -84,6 +89,19 @@
int ext_started;
void *handle;
};
+
+
+typedef struct _php_gtk_closure php_gtk_closure;
+struct _php_gtk_closure {
+ GClosure closure;
+ zval *callback;
+ char *callback_filename;
+ uint callback_lineno;
+ zval *extra;
+ int pass_object;
+};
+
+
#define PHP_GTK_GET_EXTENSION(name) \
ZEND_DLEXPORT php_gtk_ext_entry *get_extension(void) { return
&name##_ext_entry; }
@@ -98,6 +116,8 @@
extern HashTable php_gtk_prop_setters;
extern HashTable php_gtk_type_hash;
extern HashTable php_gtk_prop_desc;
+extern HashTable php_gtk_callback_hash;
+
/* Function declarations. */
@@ -106,10 +126,7 @@
static inline void php_gtk_set_object(zval *zobj, void *obj, php_gtk_dtor_t
dtor, zend_bool boxed)
{
- php_gtk_object *wrapper;
- TSRMLS_FETCH();
-
- wrapper= (php_gtk_object *) zend_object_store_get_object(zobj
TSRMLS_CC);
+ php_gtk_object *wrapper = (php_gtk_object *)
zend_object_store_get_object(zobj TSRMLS_CC);
wrapper->obj = obj;
wrapper->dtor = dtor;
zend_objects_store_add_ref(zobj TSRMLS_CC);
@@ -119,10 +136,19 @@
}
PHP_GTK_API void *php_gtk_get_object(zval *wrapper, int rsrc_type);
-PHP_GTK_API int php_gtk_get_simple_enum_value(zval *enum_val, int *result);
+int php_gtk_get_simple_enum_value(zval *enum_val, int *result);
PHP_GTK_API int php_gtk_get_enum_value(GtkType enum_type, zval *enum_val, int
*result);
PHP_GTK_API void php_gtk_destroy_notify(gpointer user_data);
-PHP_GTK_API void php_gtk_callback_marshal(GtkObject *o, gpointer data, guint
nargs, GtkArg *args);
+PHP_GTK_API void php_gtk_closure_marshal(
+ GClosure *gobject_closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ // this is the standard signal
parameters..
+ // the first of which is usually the
object..
+ gpointer invocation_hint,
+ gpointer marshal_data
+ );
void php_gtk_handler_marshal(gpointer a, gpointer data, int nargs, GtkArg
*args);
zval *php_gtk_args_as_hash(int nargs, GtkArg *args);
GtkArg *php_gtk_hash_as_args(zval *hash, GtkType type, gint *nargs);
--
PHP-GTK CVS Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|