com gtk/php-gtk: - Silence StyleHelper get_properties handl er. - Finalize GdkEvent read_property handler (until GdkAtom support is implemented): e
xt/gtk+/gdk.overrides ext/gtk+/php_gtk+_types.c

From: Date: Sun, 02 Oct 2005 19:56:15 +0000
Subject: com gtk/php-gtk: - Silence StyleHelper get_properties handl er. - Finalize GdkEvent read_property handler (until GdkAtom support is implemented): e
xt/gtk+/gdk.overrides ext/gtk+/php_gtk+_types.c
Groups: php.gtk.cvs 
Request: Send a blank email to php-gtk-cvs+get-4785@lists.php.net to get a copy of this message
Commit: 95b2268939b2e5b903ec89cac2df5c3e4ccfabdb Author: Andrei Zmievski <andrei@php.net> Sun, 2 Oct 2005 19:56:15 +0000 Parents: 8239f9aa8eeab6741d51f6f778633f523bba802e Branches: master Link: http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=95b2268939b2e5b903ec89cac2df5c3e4ccfabdb Log: - Silence StyleHelper get_properties handler. - Finalize GdkEvent read_property handler (until GdkAtom support is implemented) Changed paths: M ext/gtk+/gdk.overrides M ext/gtk+/php_gtk+_types.c

95b2268939b2e5b903ec89cac2df5c3e4ccfabdb diff --git a/ext/gtk+/gdk.overrides b/ext/gtk+/gdk.overrides index 9871afa..13351c7 100644 --- a/ext/gtk+/gdk.overrides +++ b/ext/gtk+/gdk.overrides @@ -278,6 +278,8 @@ PHP_METHOD %% {{{ GdkEvent +%% {{{ read_property handler + %% override-handler GdkEvent read_property static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int type TSRMLS_DC) @@ -306,9 +308,6 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int case GDK_EXPOSE: if (!strcmp(name, "area")) { phpg_gboxed_new(&result, GDK_TYPE_RECTANGLE, &event->expose.area, TRUE, TRUE TSRMLS_CC); - } else if (!strcmp(name, "region")) { /* GdkRegion is a struct */ - ALLOC_ZVAL(result); - ZVAL_NULL(result); } else if (!strcmp(name, "count")) { ALLOC_ZVAL(result); ZVAL_LONG(result, event->expose.count); @@ -344,7 +343,7 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int ZVAL_BOOL(result, event->motion.is_hint); } else if (!strcmp(name, "device")) { ALLOC_ZVAL(result); - phpg_gobject_new(&result, (GObject*)event->motion.device TSRMLS_CC); + phpg_gobject_new(&result, (GObject *)event->motion.device TSRMLS_CC); } else if (!strcmp(name, "x_root")) { ALLOC_ZVAL(result); ZVAL_DOUBLE(result, event->motion.x_root); @@ -386,7 +385,7 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int ZVAL_LONG(result, event->button.button); } else if (!strcmp(name, "device")) { ALLOC_ZVAL(result); - phpg_gobject_new(&result, (GObject*)event->button.device TSRMLS_CC); + phpg_gobject_new(&result, (GObject *)event->button.device TSRMLS_CC); } else if (!strcmp(name, "x_root")) { ALLOC_ZVAL(result); ZVAL_DOUBLE(result, event->button.x_root); @@ -423,11 +422,7 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int case GDK_LEAVE_NOTIFY: if (!strcmp(name, "subwindow")) { ALLOC_ZVAL(result); - if (event->crossing.subwindow) { - phpg_gobject_new(&result, (GObject *)event->crossing.subwindow TSRMLS_CC); - } else { - ZVAL_NULL(result); - } + phpg_gobject_new(&result, (GObject *)event->crossing.subwindow TSRMLS_CC); } else if (!strcmp(name, "time")) { ALLOC_ZVAL(result); ZVAL_LONG(result, event->crossing.time); @@ -486,7 +481,7 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int break; case GDK_PROPERTY_NOTIFY: - if (!strcmp(name, "atom")) { /* GdkAtom is a struct */ + if (!strcmp(name, "atom")) { /* TODO GdkAtom is a struct */ ALLOC_ZVAL(result); ZVAL_NULL(result); } else if (!strcmp(name, "time")) { @@ -501,21 +496,21 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int case GDK_SELECTION_CLEAR: case GDK_SELECTION_REQUEST: case GDK_SELECTION_NOTIFY: - if (!strcmp(name, "selection")) { /* GdkAtom is a struct */ + if (!strcmp(name, "selection")) { /* TODO GdkAtom is a struct */ ALLOC_ZVAL(result); ZVAL_NULL(result); - } else if (!strcmp(name, "target")) { /* GdkAtom */ + } else if (!strcmp(name, "target")) { /* TODO GdkAtom */ ALLOC_ZVAL(result); ZVAL_NULL(result); - } else if (!strcmp(name, "property")) { /* GdkAtom */ + } else if (!strcmp(name, "property")) { /* TODO GdkAtom */ ALLOC_ZVAL(result); ZVAL_NULL(result); } else if (!strcmp(name, "time")) { ALLOC_ZVAL(result); ZVAL_LONG(result, event->selection.time); - } else if (!strcmp(name, "requestor")) { /* GdkNativeWindow can be either pointer or uint */ + } else if (!strcmp(name, "requestor")) { ALLOC_ZVAL(result); - ZVAL_NULL(result); + ZVAL_LONG(result, event->selection.requestor); } break; @@ -526,7 +521,7 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int ZVAL_LONG(result, event->proximity.time); } else if (!strcmp(name, "device")) { ALLOC_ZVAL(result); - phpg_gobject_new(&result, (GObject*)event->proximity.device TSRMLS_CC); + phpg_gobject_new(&result, (GObject *)event->proximity.device TSRMLS_CC); } break; @@ -538,7 +533,7 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int case GDK_DROP_FINISHED: if (!strcmp(name, "context")) { /* GdkDragContext is a struct */ ALLOC_ZVAL(result); - ZVAL_NULL(result); + phpg_gobject_new(&result, (GObject *)event->dnd.context TSRMLS_CC); } else if (!strcmp(name, "time")) { ALLOC_ZVAL(result); ZVAL_LONG(result, event->dnd.time); @@ -552,7 +547,7 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int break; case GDK_CLIENT_EVENT: - if (!strcmp(name, "message_type")) { /* GdkAtom is a struct */ + if (!strcmp(name, "message_type")) { /* TODO GdkAtom is a struct */ ALLOC_ZVAL(result); ZVAL_NULL(result); } else if (!strcmp(name, "data_format")) { @@ -560,7 +555,7 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int ZVAL_LONG(result, event->client.data_format); } else if (!strcmp(name, "data.b")) { ALLOC_ZVAL(result); - ZVAL_STRINGL(result, event->client.data.b, 20, 1); + ZVAL_STRINGL(result, event->client.data.b, 20, 1); /* Why 20? */ } break; @@ -623,13 +618,13 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int break; case GDK_OWNER_CHANGE: - if (!strcmp(name, "owner")) { /* GdkNativeWindow can be pointer or uint ??! */ + if (!strcmp(name, "owner")) { ALLOC_ZVAL(result); ZVAL_NULL(result); } else if (!strcmp(name, "reason")) { ALLOC_ZVAL(result); ZVAL_LONG(result, event->owner_change.reason); - } else if (!strcmp(name, "selection")) { /* GdkAtom is a struct */ + } else if (!strcmp(name, "selection")) { /* TODO GdkAtom is a struct */ ALLOC_ZVAL(result); ZVAL_NULL(result); } else if (!strcmp(name, "time")) { @@ -670,6 +665,8 @@ static zval* phpg_gdkevent_read_property_handler(zval *object, zval *member, int return result; } +%% }}} + %% override-handler GdkEvent get_properties HashTable* phpg_gdkevent_get_properties_handler(zval *object TSRMLS_DC) @@ -843,7 +840,7 @@ PHP_METHOD } if (mask) { - phpg_gobject_new(&php_mask, (GObject*)mask TSRMLS_CC); + phpg_gobject_new(&php_mask, (GObject *)mask TSRMLS_CC); gdk_bitmap_unref(mask); } else { MAKE_STD_ZVAL(php_mask); diff --git a/ext/gtk+/php_gtk+_types.c b/ext/gtk+/php_gtk+_types.c index 557498e..3d33618 100644 --- a/ext/gtk+/php_gtk+_types.c +++ b/ext/gtk+/php_gtk+_types.c @@ -305,6 +305,7 @@ static HashTable* style_helper_get_properties(zval *object TSRMLS_DC) zval offset; style_helper *sh = (style_helper *) zend_object_store_get_object(object TSRMLS_CC); + /* offset.type = IS_LONG; for (i = 0; i < STYLE_NUM_STATES; i++) { offset.value.lval = i; @@ -312,6 +313,7 @@ static HashTable* style_helper_get_properties(zval *object TSRMLS_DC) INIT_PZVAL(result); zend_hash_index_update(sh->properties, i, &result, sizeof(zval *), NULL); } + */ return sh->properties; }
« previous php.gtk.cvs (#4785) next »