cvs: php-gtk /generator arg_types.php definitions.php generator.php override.php scheme.php templates.php /src php_gtk_types.c
| From: | Andrei Zmievski | Date: | Tue, 06 Feb 2001 03:56:52 +0000 |
| Subject: | cvs: php-gtk /generator arg_types.php definitions.php generator.php override.php scheme.php templates.php /src php_gtk_types.c | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-9@lists.php.net to get a copy of this message | ||
andrei Mon Feb 5 19:56:52 2001 EDT
Modified files:
/php-gtk/generator arg_types.php definitions.php generator.php
override.php scheme.php templates.php
/php-gtk/src php_gtk_types.c
Log:
* Added a couple of GdkWindow methods.
* Added GdkPixmap, GdkBitmap, and GdkDrawable handling.
Index: php-gtk/generator/arg_types.php diff -u php-gtk/generator/arg_types.php:1.5 php-gtk/generator/arg_types.php:1.6 --- php-gtk/generator/arg_types.php:1.5 Sun Feb 4 20:26:58 2001 +++ php-gtk/generator/arg_types.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /*======================================================================*\ Function: convert_typename @@ -532,6 +551,9 @@ $matcher->register_boxed('GdkEvent', 'gdk_event'); $matcher->register_boxed('GdkWindow', 'gdk_window'); +$matcher->register('GdkPixmap*', $matcher->get('GdkWindow*')); +$matcher->register('GdkBitmap*', $matcher->get('GdkWindow*')); +$matcher->register('GdkDrawable*', $matcher->get('GdkWindow*')); $matcher->register_boxed('GdkColor', 'gdk_color'); $matcher->register_boxed('GdkColormap', 'gdk_colormap'); Index: php-gtk/generator/definitions.php diff -u php-gtk/generator/definitions.php:1.1.1.1 php-gtk/generator/definitions.php:1.2 --- php-gtk/generator/definitions.php:1.1.1.1 Mon Jan 29 14:15:59 2001 +++ php-gtk/generator/definitions.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ class Enum_Def { var $def_type = 'enum'; Index: php-gtk/generator/generator.php diff -u php-gtk/generator/generator.php:1.4 php-gtk/generator/generator.php:1.5 --- php-gtk/generator/generator.php:1.4 Sat Feb 3 16:41:23 2001 +++ php-gtk/generator/generator.php Mon Feb 5 19:56:52 2001 @@ -1,5 +1,25 @@ <?php /* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* * Significant portions of this generator are based on the pygtk code generator * developed by James Henstridge <jamesh@daa.com.au>. * Index: php-gtk/generator/override.php diff -u php-gtk/generator/override.php:1.2 php-gtk/generator/override.php:1.3 --- php-gtk/generator/override.php:1.2 Fri Feb 2 22:56:17 2001 +++ php-gtk/generator/override.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ class Overrides { var $ignores = array(); Index: php-gtk/generator/scheme.php diff -u php-gtk/generator/scheme.php:1.2 php-gtk/generator/scheme.php:1.3 --- php-gtk/generator/scheme.php:1.2 Sat Feb 3 16:41:23 2001 +++ php-gtk/generator/scheme.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ require "definitions.php"; Index: php-gtk/generator/templates.php diff -u php-gtk/generator/templates.php:1.1.1.1 php-gtk/generator/templates.php:1.2 --- php-gtk/generator/templates.php:1.1.1.1 Mon Jan 29 14:15:59 2001 +++ php-gtk/generator/templates.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ $function_tpl = " PHP_FUNCTION(wrap_%s) Index: php-gtk/src/php_gtk_types.c diff -u php-gtk/src/php_gtk_types.c:1.5 php-gtk/src/php_gtk_types.c:1.6 --- php-gtk/src/php_gtk_types.c:1.5 Sun Feb 4 20:26:58 2001 +++ php-gtk/src/php_gtk_types.c Mon Feb 5 19:56:52 2001 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: php_gtk_types.c,v 1.5 2001/02/05 04:26:58 andrei Exp $ */ +/* $Id: php_gtk_types.c,v 1.6 2001/02/06 03:56:52 andrei Exp $ */ #include "php_gtk.h" @@ -208,6 +208,43 @@ /* GdkWindow */ +PHP_FUNCTION(gdk_window_raise) +{ + if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "")) + return; + + gdk_window_raise(PHP_GDK_WINDOW_GET(this_ptr)); +} + +PHP_FUNCTION(gdk_window_lower) +{ + if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "")) + return; + + gdk_window_lower(PHP_GDK_WINDOW_GET(this_ptr)); +} + +PHP_FUNCTION(gdk_window_get_pointer) +{ + guint32 deviceid; + gdouble x = 0.0, y = 0.0, pressure = 0.0, xtilt = 0.0, ytilt = 0.0; + GdkModifierType mask = 0; + + if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "i", &deviceid)) + return; + + gdk_input_window_get_pointer(PHP_GDK_WINDOW_GET(this_ptr), deviceid, &x, &y, &pressure, &xtilt, &ytilt, &mask); + *return_value = * php_gtk_build_value("(dddddi)", x, y, pressure, xtilt, ytilt, mask); +} + +static function_entry php_gdk_window_functions[] = { + /* TODO implement other functions similar to PyGtk */ + {"raise", PHP_FN(gdk_window_raise), NULL}, + {"lower", PHP_FN(gdk_window_lower), NULL}, + {"get_pointer", PHP_FN(gdk_window_get_pointer), NULL}, + {NULL, NULL, NULL} +}; + zval *php_gdk_window_new(GdkWindow *obj) { zval *result; @@ -593,7 +630,7 @@ INIT_CLASS_ENTRY(ce, "gdkevent", NULL); gdk_event_ce = zend_register_internal_class_ex(&ce, NULL, NULL); - INIT_OVERLOADED_CLASS_ENTRY(ce, "gdkwindow", NULL, NULL, php_gtk_get_property, NULL); + INIT_OVERLOADED_CLASS_ENTRY(ce, "gdkwindow", php_gdk_window_functions, NULL, php_gtk_get_property, NULL); gdk_window_ce = zend_register_internal_class_ex(&ce, NULL, NULL); INIT_OVERLOADED_CLASS_ENTRY(ce, "gdkcolor", php_gdk_color_functions, NULL, php_gtk_get_property, php_gtk_set_property);
Index: php-gtk/generator/arg_types.php diff -u php-gtk/generator/arg_types.php:1.5 php-gtk/generator/arg_types.php:1.6 --- php-gtk/generator/arg_types.php:1.5 Sun Feb 4 20:26:58 2001 +++ php-gtk/generator/arg_types.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ /*======================================================================*\ Function: convert_typename @@ -532,6 +551,9 @@ $matcher->register_boxed('GdkEvent', 'gdk_event'); $matcher->register_boxed('GdkWindow', 'gdk_window'); +$matcher->register('GdkPixmap*', $matcher->get('GdkWindow*')); +$matcher->register('GdkBitmap*', $matcher->get('GdkWindow*')); +$matcher->register('GdkDrawable*', $matcher->get('GdkWindow*')); $matcher->register_boxed('GdkColor', 'gdk_color'); $matcher->register_boxed('GdkColormap', 'gdk_colormap'); Index: php-gtk/generator/definitions.php diff -u php-gtk/generator/definitions.php:1.1.1.1 php-gtk/generator/definitions.php:1.2 --- php-gtk/generator/definitions.php:1.1.1.1 Mon Jan 29 14:15:59 2001 +++ php-gtk/generator/definitions.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ class Enum_Def { var $def_type = 'enum'; Index: php-gtk/generator/generator.php diff -u php-gtk/generator/generator.php:1.4 php-gtk/generator/generator.php:1.5 --- php-gtk/generator/generator.php:1.4 Sat Feb 3 16:41:23 2001 +++ php-gtk/generator/generator.php Mon Feb 5 19:56:52 2001 @@ -1,5 +1,25 @@ <?php /* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* * Significant portions of this generator are based on the pygtk code generator * developed by James Henstridge <jamesh@daa.com.au>. * Index: php-gtk/generator/override.php diff -u php-gtk/generator/override.php:1.2 php-gtk/generator/override.php:1.3 --- php-gtk/generator/override.php:1.2 Fri Feb 2 22:56:17 2001 +++ php-gtk/generator/override.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ class Overrides { var $ignores = array(); Index: php-gtk/generator/scheme.php diff -u php-gtk/generator/scheme.php:1.2 php-gtk/generator/scheme.php:1.3 --- php-gtk/generator/scheme.php:1.2 Sat Feb 3 16:41:23 2001 +++ php-gtk/generator/scheme.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ require "definitions.php"; Index: php-gtk/generator/templates.php diff -u php-gtk/generator/templates.php:1.1.1.1 php-gtk/generator/templates.php:1.2 --- php-gtk/generator/templates.php:1.1.1.1 Mon Jan 29 14:15:59 2001 +++ php-gtk/generator/templates.php Mon Feb 5 19:56:52 2001 @@ -1,4 +1,23 @@ <?php +/* + * PHP-GTK - The PHP language bindings for GTK+ + * + * Copyright (C) 2001 Andrei Zmievski <andrei@ispi.net> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ $function_tpl = " PHP_FUNCTION(wrap_%s) Index: php-gtk/src/php_gtk_types.c diff -u php-gtk/src/php_gtk_types.c:1.5 php-gtk/src/php_gtk_types.c:1.6 --- php-gtk/src/php_gtk_types.c:1.5 Sun Feb 4 20:26:58 2001 +++ php-gtk/src/php_gtk_types.c Mon Feb 5 19:56:52 2001 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: php_gtk_types.c,v 1.5 2001/02/05 04:26:58 andrei Exp $ */ +/* $Id: php_gtk_types.c,v 1.6 2001/02/06 03:56:52 andrei Exp $ */ #include "php_gtk.h" @@ -208,6 +208,43 @@ /* GdkWindow */ +PHP_FUNCTION(gdk_window_raise) +{ + if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "")) + return; + + gdk_window_raise(PHP_GDK_WINDOW_GET(this_ptr)); +} + +PHP_FUNCTION(gdk_window_lower) +{ + if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "")) + return; + + gdk_window_lower(PHP_GDK_WINDOW_GET(this_ptr)); +} + +PHP_FUNCTION(gdk_window_get_pointer) +{ + guint32 deviceid; + gdouble x = 0.0, y = 0.0, pressure = 0.0, xtilt = 0.0, ytilt = 0.0; + GdkModifierType mask = 0; + + if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "i", &deviceid)) + return; + + gdk_input_window_get_pointer(PHP_GDK_WINDOW_GET(this_ptr), deviceid, &x, &y, &pressure, &xtilt, &ytilt, &mask); + *return_value = * php_gtk_build_value("(dddddi)", x, y, pressure, xtilt, ytilt, mask); +} + +static function_entry php_gdk_window_functions[] = { + /* TODO implement other functions similar to PyGtk */ + {"raise", PHP_FN(gdk_window_raise), NULL}, + {"lower", PHP_FN(gdk_window_lower), NULL}, + {"get_pointer", PHP_FN(gdk_window_get_pointer), NULL}, + {NULL, NULL, NULL} +}; + zval *php_gdk_window_new(GdkWindow *obj) { zval *result; @@ -593,7 +630,7 @@ INIT_CLASS_ENTRY(ce, "gdkevent", NULL); gdk_event_ce = zend_register_internal_class_ex(&ce, NULL, NULL); - INIT_OVERLOADED_CLASS_ENTRY(ce, "gdkwindow", NULL, NULL, php_gtk_get_property, NULL); + INIT_OVERLOADED_CLASS_ENTRY(ce, "gdkwindow", php_gdk_window_functions, NULL, php_gtk_get_property, NULL); gdk_window_ce = zend_register_internal_class_ex(&ce, NULL, NULL); INIT_OVERLOADED_CLASS_ENTRY(ce, "gdkcolor", php_gdk_color_functions, NULL, php_gtk_get_property, php_gtk_set_property);