cvs: php-gtk / NEWS /ext/gdkpixbuf .cvsignore Makefile.in config.m4 gdkpixbuf.defs gdkpixbuf.overrides php_gdkpixbuf.c php_gdkpixbuf.h
| From: | Andrei Zmievski | Date: | Fri, 30 Nov 2001 04:34:50 +0000 |
| Subject: | cvs: php-gtk / NEWS /ext/gdkpixbuf .cvsignore Makefile.in config.m4 gdkpixbuf.defs gdkpixbuf.overrides php_gdkpixbuf.c php_gdkpixbuf.h | ||
| Groups: | php.gtk.cvs | ||
| Request: | Send a blank email to php-gtk-cvs+get-350@lists.php.net to get a copy of this message | ||
andrei Thu Nov 29 23:34:50 2001 EDT
Added files:
/php-gtk/ext/gdkpixbuf .cvsignore Makefile.in config.m4
gdkpixbuf.defs gdkpixbuf.overrides
php_gdkpixbuf.c php_gdkpixbuf.h
Modified files:
/php-gtk NEWS
Log:
Implemented gdk-pixbuf extension.
Index: php-gtk/NEWS diff -u php-gtk/NEWS:1.56 php-gtk/NEWS:1.57 --- php-gtk/NEWS:1.56 Thu Nov 29 16:02:11 2001 +++ php-gtk/NEWS Thu Nov 29 23:34:50 2001 @@ -1,3 +1,4 @@ + - implemented gdkpixbuf extension. (Andrei) - added GtkCTree methods find_by_row_data, find_all_by_row_data. (Andrei) - added gtkhtml extension which provides support for GtkHTML, an HTML rendering widget. (Alan Knowles) Index: php-gtk/ext/gdkpixbuf/.cvsignore +++ php-gtk/ext/gdkpixbuf/.cvsignore deps Makefile *.lo *.slo *.la libs libs.mk gen_* *.cache Index: php-gtk/ext/gdkpixbuf/Makefile.in +++ php-gtk/ext/gdkpixbuf/Makefile.in LTLIBRARY_NAME = libgdkpixbuf.la LTLIBRARY_SOURCES = php_gdkpixbuf.c gen_gdkpixbuf.c LTLIBRARY_LIBADD = $(GDK_PIXBUF_SHARED_LIBADD) LTLIBRARY_SHARED_NAME = php_gtk_gdkpixbuf.la LTLIBRARY_SHARED_LIBADD = $(GDK_PIXBUF_SHARED_LIBADD) include $(top_srcdir)/build/dynlib.mk php_gdkpixbuf.o php_gdkpixbuf.lo php_gdkpixbuf.slo: gen_ce_gdkpixbuf.h gen_gdkpixbuf.c: gdkpixbuf.defs gdkpixbuf.overrides $(PHP) -q $(top_srcdir)/generator/generator.php -o $(srcdir)/gdkpixbuf.overrides -p gdk_pixbuf -c GdkPixbuf -r $(top_srcdir)/ext/gtk%2b/gdk.defs $(srcdir)/gdkpixbuf.defs b> gen_gdkpixbuf.c gen_ce_gdkpixbuf.h: gen_gdkpixbuf.c grep -h "^PHP_GTK_EXPORT_CE" gen_gdkpixbuf.c | sed -e "s!^!extern !" > gen_ce_gdkpixbuf.h Index: php-gtk/ext/gdkpixbuf/config.m4 +++ php-gtk/ext/gdkpixbuf/config.m4 dnl $Id: config.m4,v 1.1 2001/11/30 04:34:50 andrei Exp $ dnl config.m4 for gdkpixbuf module dnl PHP_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS dnl AC_DEFUN(PHP_PATH_GDK_PIXBUF, [dnl dnl Get the cflags and libraries from the gdk-pixbuf-config script dnl AC_ARG_WITH(gdk-pixbuf-prefix,[ --with-gdk-pixbuf-prefix=PFX Prefix where GDK_PIXBUF is installed (optional)], gdk_pixbuf_prefix="$withval", gdk_pixbuf_prefix="") AC_ARG_WITH(gdk-pixbuf-exec-prefix,[ --with-gdk-pixbuf-exec-prefix=PFX Exec prefix where GDK_PIXBUF is installed (optional)], gdk_pixbuf_exec_prefix="$withval", gdk_pixbuf_exec_prefix="") AC_ARG_ENABLE(gdk_pixbuftest, [ --disable-gdk_pixbuftest Do not try to compile and run a test GDK_PIXBUF program], , enable_gdk_pixbuftest=yes) if test x$gdk_pixbuf_exec_prefix != x ; then gdk_pixbuf_args="$gdk_pixbuf_args --exec-prefix=$gdk_pixbuf_exec_prefix" if test x${GDK_PIXBUF_CONFIG+set} = xset ; then GDK_PIXBUF_CONFIG=$gdk_pixbuf_exec_prefix/gdk-pixbuf-config fi fi if test x$gdk_pixbuf_prefix != x ; then gdk_pixbuf_args="$gdk_pixbuf_args --prefix=$gdk_pixbuf_prefix" if test x${GDK_PIXBUF_CONFIG+set} = xset ; then GDK_PIXBUF_CONFIG=$gdk_pixbuf_prefix/bin/gdk-pixbuf-config fi fi AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no) min_gdk_pixbuf_version=ifelse([$1], ,0.2.5,$1) AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version) no_gdk_pixbuf="" if test "$GDK_PIXBUF_CONFIG" = "no" ; then no_gdk_pixbuf=yes else GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags` GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs` gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gdk_pixbuftest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS" LIBS="$LIBS $GDK_PIXBUF_LIBS" dnl dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity dnl checks the results of gdk-pixbuf-config to some extent dnl rm -f conf.gdk_pixbuftest AC_TRY_RUN([ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <gdk-pixbuf/gdk-pixbuf.h> char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gdk_pixbuftest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_gdk_pixbuf_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gdk_pixbuf_version"); exit(1); } if (($gdk_pixbuf_major_version > major) || (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) || (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro))) { return 0; } else { printf("\n*** 'gdk-pixbuf-config --version' returned %d.%d.%d, but the minimum version\n", $gdk_pixbuf_major_version, $gdk_pixbuf_minor_version, $gdk_pixbuf_micro_version); printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n"); printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gdk_pixbuf" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GDK_PIXBUF_CONFIG" = "no" ; then echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found" echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the" echo "*** full path to gdk-pixbuf-config." else if test -f conf.gdk_pixbuftest ; then : else echo "*** Could not run GDK_PIXBUF test program, checking why..." CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS" LIBS="$LIBS $GDK_PIXBUF_LIBS" AC_TRY_LINK([ #include <stdio.h> #include <gdk-pixbuf/gdk-pixbuf.h> ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong" echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GDK_PIXBUF was incorrectly installed" echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you" echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GDK_PIXBUF_CFLAGS="" GDK_PIXBUF_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GDK_PIXBUF_CFLAGS) AC_SUBST(GDK_PIXBUF_LIBS) rm -f conf.gdk_pixbuftest ]) PHP_GTK_ARG_ENABLE(gdkpixbuf,for GdkPixbuf support, [ --enable-gdkpixbuf Enable GdkPixbuf support]) if test "$PHP_GTK_GDKPIXBUF" != "no"; then PHP_PATH_GDK_PIXBUF(0.11.0,have_gdkpixbuf=yes,have_gdkpixbuf=no) if test "$have_gdkpixbuf" != "yes"; then AC_MSG_ERROR(Unable to locate gdk-pixbuf) else AC_DEFINE(HAVE_GDKPIXBUF,1,[gdk-pixbuf support]) PHP_EVAL_INCLINE($GDK_PIXBUF_CFLAGS) PHP_EVAL_LIBLINE($GDK_PIXBUF_LIBS, GDK_PIXBUF_SHARED_LIBADD) PHP_SUBST(GDK_PIXBUF_SHARED_LIBADD) PHP_GTK_EXTENSION(gdkpixbuf, $php_gtk_ext_shared) fi fi Index: php-gtk/ext/gdkpixbuf/gdkpixbuf.defs +++ php-gtk/ext/gdkpixbuf/gdkpixbuf.defs ;; -*- scheme -*- ; object definitions ... (object Pixbuf (in-module Gdk) (c-name GdkPixbuf) ) ;; Enumerations and flags ... (enum Colorspace (in-module Gdk) (c-name GdkColorspace) (value (name ) (c-name GDK_COLORSPACE_RGB)) ) (enum PixbufAlphaMode (in-module Gdk) (c-name GdkPixbufAlphaMode) (value (name bilevel) (c-name GDK_PIXBUF_ALPHA_BILEVEL)) (value (name full) (c-name GDK_PIXBUF_ALPHA_FULL)) ) (enum InterpType (in-module Gdk) (c-name GdkInterpType) (value (name nearest) (c-name GDK_INTERP_NEAREST)) (value (name tiles) (c-name GDK_INTERP_TILES)) (value (name bilinear) (c-name GDK_INTERP_BILINEAR)) (value (name hyper) (c-name GDK_INTERP_HYPER)) ) (enum PixbufFrameAction (in-module Gdk) (c-name GdkPixbufFrameAction) (value (name retain) (c-name GDK_PIXBUF_FRAME_RETAIN)) (value (name dispose) (c-name GDK_PIXBUF_FRAME_DISPOSE)) (value (name revert) (c-name GDK_PIXBUF_FRAME_REVERT)) ) ;; From /usr/include/gdk-pixbuf/gdk-pixbuf.h (method unref (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_unref) (return-type none) ) (method set_last_unref_handler (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_set_last_unref_handler) (return-type none) (parameter (type-and-name GdkPixbufLastUnref last_unref_fn)) (parameter (type-and-name gpointer last_unref_fn_data)) ) (method finalize (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_finalize) (return-type none) ) (method get_colorspace (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_colorspace) (return-type GdkColorspace) ) (method get_n_channels (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_n_channels) (return-type int) ) (method get_has_alpha (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_has_alpha) (return-type gboolean) ) (method get_bits_per_sample (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_bits_per_sample) (return-type int) ) (method get_pixels (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_pixels) (return-type guchar*) ) (method get_width (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_width) (return-type int) ) (method get_height (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_height) (return-type int) ) (method get_rowstride (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_rowstride) (return-type int) ) (function gdk_pixbuf_new (c-name gdk_pixbuf_new) (is-constructor-of GdkPixbuf) (return-type GdkPixbuf*) (parameter (type-and-name GdkColorspace colorspace)) (parameter (type-and-name gboolean has_alpha)) (parameter (type-and-name int bits_per_sample)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) ) (method copy (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_copy) (return-type GdkPixbuf*) ) (function gdk_pixbuf_new_from_file (c-name gdk_pixbuf_new_from_file) (return-type GdkPixbuf*) (parameter (type-and-name const-char* filename)) ) (function gdk_pixbuf_new_from_data (c-name gdk_pixbuf_new_from_data) (return-type GdkPixbuf*) (parameter (type-and-name const-guchar* data)) (parameter (type-and-name GdkColorspace colorspace)) (parameter (type-and-name gboolean has_alpha)) (parameter (type-and-name int bits_per_sample)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name int rowstride)) (parameter (type-and-name GdkPixbufDestroyNotify destroy_fn)) (parameter (type-and-name gpointer destroy_fn_data)) ) (function gdk_pixbuf_new_from_xpm_data (c-name gdk_pixbuf_new_from_xpm_data) (return-type GdkPixbuf*) (parameter (type-and-name const-char** data)) ) (method add_alpha (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_add_alpha) (return-type GdkPixbuf*) (parameter (type-and-name gboolean substitute_color)) (parameter (type-and-name guchar r)) (parameter (type-and-name guchar g)) (parameter (type-and-name guchar b)) ) (method copy_area (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_copy_area) (return-type none) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name GdkPixbuf* dest_pixbuf)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) ) (method render_threshold_alpha (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_render_threshold_alpha) (return-type none) (parameter (type-and-name GdkBitmap* bitmap)) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name int alpha_threshold)) ) (method render_to_drawable (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_render_to_drawable) (return-type none) (parameter (type-and-name GdkDrawable* drawable)) (parameter (type-and-name GdkGC* gc)) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name GdkRgbDither dither)) (parameter (type-and-name int x_dither)) (parameter (type-and-name int y_dither)) ) (method render_to_drawable_alpha (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_render_to_drawable_alpha) (return-type none) (parameter (type-and-name GdkDrawable* drawable)) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name GdkPixbufAlphaMode alpha_mode)) (parameter (type-and-name int alpha_threshold)) (parameter (type-and-name GdkRgbDither dither)) (parameter (type-and-name int x_dither)) (parameter (type-and-name int y_dither)) ) (method render_pixmap_and_mask (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_render_pixmap_and_mask) (return-type none) (parameter (type-and-name GdkPixmap** pixmap_return)) (parameter (type-and-name GdkBitmap** mask_return)) (parameter (type-and-name int alpha_threshold)) ) (method get_from_drawable (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_from_drawable) (return-type GdkPixbuf*) (parameter (type-and-name GdkDrawable* src)) (parameter (type-and-name GdkColormap* cmap)) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) ) (method scale (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_scale) (return-type none) (parameter (type-and-name GdkPixbuf* dest)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name double offset_x)) (parameter (type-and-name double offset_y)) (parameter (type-and-name double scale_x)) (parameter (type-and-name double scale_y)) (parameter (type-and-name GdkInterpType interp_type)) ) (method composite (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_composite) (return-type none) (parameter (type-and-name GdkPixbuf* dest)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name double offset_x)) (parameter (type-and-name double offset_y)) (parameter (type-and-name double scale_x)) (parameter (type-and-name double scale_y)) (parameter (type-and-name GdkInterpType interp_type)) (parameter (type-and-name int overall_alpha)) ) (method composite_color (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_composite_color) (return-type none) (parameter (type-and-name GdkPixbuf* dest)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name double offset_x)) (parameter (type-and-name double offset_y)) (parameter (type-and-name double scale_x)) (parameter (type-and-name double scale_y)) (parameter (type-and-name GdkInterpType interp_type)) (parameter (type-and-name int overall_alpha)) (parameter (type-and-name int check_x)) (parameter (type-and-name int check_y)) (parameter (type-and-name int check_size)) (parameter (type-and-name guint32 color1)) (parameter (type-and-name guint32 color2)) ) (method scale_simple (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_scale_simple) (return-type GdkPixbuf*) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name GdkInterpType interp_type)) ) (method composite_color_simple (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_composite_color_simple) (return-type GdkPixbuf*) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name GdkInterpType interp_type)) (parameter (type-and-name int overall_alpha)) (parameter (type-and-name int check_size)) (parameter (type-and-name guint32 color1)) (parameter (type-and-name guint32 color2)) ) (function gdk_pixbuf_animation_new_from_file (c-name gdk_pixbuf_animation_new_from_file) (return-type GdkPixbufAnimation*) (parameter (type-and-name const-char* filename)) ) (method ref (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_ref) (return-type GdkPixbufAnimation*) ) (method unref (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_unref) (return-type none) ) (method get_width (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_get_width) (return-type int) ) (method get_height (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_get_height) (return-type int) ) (method get_frames (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_get_frames) (return-type GList*) ) (method get_num_frames (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_get_num_frames) (return-type int) ) (method get_pixbuf (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_pixbuf) (return-type GdkPixbuf*) ) (method get_x_offset (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_x_offset) (return-type int) ) (method get_y_offset (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_y_offset) (return-type int) ) (method get_delay_time (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_delay_time) (return-type int) ) (method get_action (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_action) (return-type GdkPixbufFrameAction) ) (function gdk_pixbuf_preinit (c-name gdk_pixbuf_preinit) (return-type none) (parameter (type-and-name gpointer app)) (parameter (type-and-name gpointer modinfo)) ) (function gdk_pixbuf_postinit (c-name gdk_pixbuf_postinit) (return-type none) (parameter (type-and-name gpointer app)) (parameter (type-and-name gpointer modinfo)) ) Index: php-gtk/ext/gdkpixbuf/gdkpixbuf.overrides +++ php-gtk/ext/gdkpixbuf/gdkpixbuf.overrides /* vim: set ft=cpp: */ %% headers #include "php_gdkpixbuf.h" %% ignore gdk_pixbuf_preinit gdk_pixbuf_postinit Index: php-gtk/ext/gdkpixbuf/php_gdkpixbuf.c +++ php-gtk/ext/gdkpixbuf/php_gdkpixbuf.c /* * PHP-GTK - The PHP language bindings for GTK+ * * Copyright (C) 2001 Andrei Zmievski <andrei@php.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 */ /* $Id: php_gdkpixbuf.c,v 1.1 2001/11/30 04:34:50 andrei Exp $ */ #include "php_gdkpixbuf.h" #if HAVE_GDKPIXBUF #ifdef PHP_GTK_COMPILE_DL_GDKPIXBUF PHP_GTK_GET_EXTENSION(gdkpixbuf) #endif int le_gdk_pixbuf; static void release_gdk_pixbuf_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) { GdkPixbuf *obj = (GdkPixbuf *)rsrc->ptr; zval **wrapper_ptr; if (zend_hash_index_find(&php_gtk_type_hash, (long)obj, (void **)&wrapper_ptr) == SUCCESS) { zval_ptr_dtor(wrapper_ptr); } gdk_pixbuf_unref(obj); } zval *php_gdk_pixbuf_new(GdkPixbuf *pixbuf) { zval *result; zval **wrapper_ptr; TSRMLS_FETCH(); if (!pixbuf) { MAKE_STD_ZVAL(result); ZVAL_NULL(result); return result; } if (zend_hash_index_find(&php_gtk_type_hash, (long)pixbuf, (void **)&wrapper_ptr) == SUCCESS) { zval_add_ref(wrapper_ptr); return *wrapper_ptr; } MAKE_STD_ZVAL(result); object_init_ex(result, gdk_pixbuf_ce); gdk_pixbuf_ref(pixbuf); php_gtk_set_object(result, pixbuf, le_gdk_pixbuf); return result; } PHP_GTK_XINIT_FUNCTION(gdkpixbuf) { le_gdk_pixbuf = zend_register_list_destructors_ex(release_gdk_pixbuf_rsrc, NULL, "GdkPixbuf", module_number); php_gdk_pixbuf_register_constants(module_number TSRMLS_CC); php_gdk_pixbuf_register_classes(); gdk_rgb_init(); return SUCCESS; } php_gtk_ext_entry gdkpixbuf_ext_entry = { "gdkpixbuf", PHP_GTK_XINIT(gdkpixbuf), NULL, }; #endif /* HAVE_GDKPIXBUF */ Index: php-gtk/ext/gdkpixbuf/php_gdkpixbuf.h +++ php-gtk/ext/gdkpixbuf/php_gdkpixbuf.h /* * PHP-GTK - The PHP language bindings for GTK+ * * Copyright (C) 2001 Andrei Zmievski <andrei@php.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 */ /* $Id: php_gdkpixbuf.h,v 1.1 2001/11/30 04:34:50 andrei Exp $ */ #ifndef PHP_GDKPIXBUF_H #define PHP_GDKPIXBUF_H #include "php_gtk.h" #if HAVE_GDKPIXBUF #include <gdk-pixbuf/gdk-pixbuf.h> extern int le_gdk_pixbuf; #include "gen_ce_gdkpixbuf.h" extern php_gtk_ext_entry gdkpixbuf_ext_entry; #define gdkpixbuf_ext_ptr &gdkpixbuf_ext_entry void php_gdkpixbuf_register_constants(int module_number TSRMLS_DC); void php_gdkpixbuf_register_classes(); zval *php_gdk_pixbuf_new(GdkPixbuf *pixbuf); #define PHP_GDK_PIXBUF_GET(w) PHP_GTK_GET_GENERIC(w, GdkPixbuf*, le_gdk_pixbuf) #else #define gdkpixbuf_ext_ptr NULL #endif /* HAVE_GDKPIXBUF */ #define php_gtk_ext_gdkpixbuf_ptr gdkpixbuf_ext_ptr #endif /* PHP_GDKPIXBUF_H */
Index: php-gtk/NEWS diff -u php-gtk/NEWS:1.56 php-gtk/NEWS:1.57 --- php-gtk/NEWS:1.56 Thu Nov 29 16:02:11 2001 +++ php-gtk/NEWS Thu Nov 29 23:34:50 2001 @@ -1,3 +1,4 @@ + - implemented gdkpixbuf extension. (Andrei) - added GtkCTree methods find_by_row_data, find_all_by_row_data. (Andrei) - added gtkhtml extension which provides support for GtkHTML, an HTML rendering widget. (Alan Knowles) Index: php-gtk/ext/gdkpixbuf/.cvsignore +++ php-gtk/ext/gdkpixbuf/.cvsignore deps Makefile *.lo *.slo *.la libs libs.mk gen_* *.cache Index: php-gtk/ext/gdkpixbuf/Makefile.in +++ php-gtk/ext/gdkpixbuf/Makefile.in LTLIBRARY_NAME = libgdkpixbuf.la LTLIBRARY_SOURCES = php_gdkpixbuf.c gen_gdkpixbuf.c LTLIBRARY_LIBADD = $(GDK_PIXBUF_SHARED_LIBADD) LTLIBRARY_SHARED_NAME = php_gtk_gdkpixbuf.la LTLIBRARY_SHARED_LIBADD = $(GDK_PIXBUF_SHARED_LIBADD) include $(top_srcdir)/build/dynlib.mk php_gdkpixbuf.o php_gdkpixbuf.lo php_gdkpixbuf.slo: gen_ce_gdkpixbuf.h gen_gdkpixbuf.c: gdkpixbuf.defs gdkpixbuf.overrides $(PHP) -q $(top_srcdir)/generator/generator.php -o $(srcdir)/gdkpixbuf.overrides -p gdk_pixbuf -c GdkPixbuf -r $(top_srcdir)/ext/gtk%2b/gdk.defs $(srcdir)/gdkpixbuf.defs b> gen_gdkpixbuf.c gen_ce_gdkpixbuf.h: gen_gdkpixbuf.c grep -h "^PHP_GTK_EXPORT_CE" gen_gdkpixbuf.c | sed -e "s!^!extern !" > gen_ce_gdkpixbuf.h Index: php-gtk/ext/gdkpixbuf/config.m4 +++ php-gtk/ext/gdkpixbuf/config.m4 dnl $Id: config.m4,v 1.1 2001/11/30 04:34:50 andrei Exp $ dnl config.m4 for gdkpixbuf module dnl PHP_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS dnl AC_DEFUN(PHP_PATH_GDK_PIXBUF, [dnl dnl Get the cflags and libraries from the gdk-pixbuf-config script dnl AC_ARG_WITH(gdk-pixbuf-prefix,[ --with-gdk-pixbuf-prefix=PFX Prefix where GDK_PIXBUF is installed (optional)], gdk_pixbuf_prefix="$withval", gdk_pixbuf_prefix="") AC_ARG_WITH(gdk-pixbuf-exec-prefix,[ --with-gdk-pixbuf-exec-prefix=PFX Exec prefix where GDK_PIXBUF is installed (optional)], gdk_pixbuf_exec_prefix="$withval", gdk_pixbuf_exec_prefix="") AC_ARG_ENABLE(gdk_pixbuftest, [ --disable-gdk_pixbuftest Do not try to compile and run a test GDK_PIXBUF program], , enable_gdk_pixbuftest=yes) if test x$gdk_pixbuf_exec_prefix != x ; then gdk_pixbuf_args="$gdk_pixbuf_args --exec-prefix=$gdk_pixbuf_exec_prefix" if test x${GDK_PIXBUF_CONFIG+set} = xset ; then GDK_PIXBUF_CONFIG=$gdk_pixbuf_exec_prefix/gdk-pixbuf-config fi fi if test x$gdk_pixbuf_prefix != x ; then gdk_pixbuf_args="$gdk_pixbuf_args --prefix=$gdk_pixbuf_prefix" if test x${GDK_PIXBUF_CONFIG+set} = xset ; then GDK_PIXBUF_CONFIG=$gdk_pixbuf_prefix/bin/gdk-pixbuf-config fi fi AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no) min_gdk_pixbuf_version=ifelse([$1], ,0.2.5,$1) AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version) no_gdk_pixbuf="" if test "$GDK_PIXBUF_CONFIG" = "no" ; then no_gdk_pixbuf=yes else GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags` GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs` gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_gdk_pixbuftest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS" LIBS="$LIBS $GDK_PIXBUF_LIBS" dnl dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity dnl checks the results of gdk-pixbuf-config to some extent dnl rm -f conf.gdk_pixbuftest AC_TRY_RUN([ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <gdk-pixbuf/gdk-pixbuf.h> char* my_strdup (char *str) { char *new_str; if (str) { new_str = malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gdk_pixbuftest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_gdk_pixbuf_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gdk_pixbuf_version"); exit(1); } if (($gdk_pixbuf_major_version > major) || (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) || (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro))) { return 0; } else { printf("\n*** 'gdk-pixbuf-config --version' returned %d.%d.%d, but the minimum version\n", $gdk_pixbuf_major_version, $gdk_pixbuf_minor_version, $gdk_pixbuf_micro_version); printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n"); printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gdk_pixbuf" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GDK_PIXBUF_CONFIG" = "no" ; then echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found" echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the" echo "*** full path to gdk-pixbuf-config." else if test -f conf.gdk_pixbuftest ; then : else echo "*** Could not run GDK_PIXBUF test program, checking why..." CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS" LIBS="$LIBS $GDK_PIXBUF_LIBS" AC_TRY_LINK([ #include <stdio.h> #include <gdk-pixbuf/gdk-pixbuf.h> ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong" echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GDK_PIXBUF was incorrectly installed" echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you" echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GDK_PIXBUF_CFLAGS="" GDK_PIXBUF_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GDK_PIXBUF_CFLAGS) AC_SUBST(GDK_PIXBUF_LIBS) rm -f conf.gdk_pixbuftest ]) PHP_GTK_ARG_ENABLE(gdkpixbuf,for GdkPixbuf support, [ --enable-gdkpixbuf Enable GdkPixbuf support]) if test "$PHP_GTK_GDKPIXBUF" != "no"; then PHP_PATH_GDK_PIXBUF(0.11.0,have_gdkpixbuf=yes,have_gdkpixbuf=no) if test "$have_gdkpixbuf" != "yes"; then AC_MSG_ERROR(Unable to locate gdk-pixbuf) else AC_DEFINE(HAVE_GDKPIXBUF,1,[gdk-pixbuf support]) PHP_EVAL_INCLINE($GDK_PIXBUF_CFLAGS) PHP_EVAL_LIBLINE($GDK_PIXBUF_LIBS, GDK_PIXBUF_SHARED_LIBADD) PHP_SUBST(GDK_PIXBUF_SHARED_LIBADD) PHP_GTK_EXTENSION(gdkpixbuf, $php_gtk_ext_shared) fi fi Index: php-gtk/ext/gdkpixbuf/gdkpixbuf.defs +++ php-gtk/ext/gdkpixbuf/gdkpixbuf.defs ;; -*- scheme -*- ; object definitions ... (object Pixbuf (in-module Gdk) (c-name GdkPixbuf) ) ;; Enumerations and flags ... (enum Colorspace (in-module Gdk) (c-name GdkColorspace) (value (name ) (c-name GDK_COLORSPACE_RGB)) ) (enum PixbufAlphaMode (in-module Gdk) (c-name GdkPixbufAlphaMode) (value (name bilevel) (c-name GDK_PIXBUF_ALPHA_BILEVEL)) (value (name full) (c-name GDK_PIXBUF_ALPHA_FULL)) ) (enum InterpType (in-module Gdk) (c-name GdkInterpType) (value (name nearest) (c-name GDK_INTERP_NEAREST)) (value (name tiles) (c-name GDK_INTERP_TILES)) (value (name bilinear) (c-name GDK_INTERP_BILINEAR)) (value (name hyper) (c-name GDK_INTERP_HYPER)) ) (enum PixbufFrameAction (in-module Gdk) (c-name GdkPixbufFrameAction) (value (name retain) (c-name GDK_PIXBUF_FRAME_RETAIN)) (value (name dispose) (c-name GDK_PIXBUF_FRAME_DISPOSE)) (value (name revert) (c-name GDK_PIXBUF_FRAME_REVERT)) ) ;; From /usr/include/gdk-pixbuf/gdk-pixbuf.h (method unref (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_unref) (return-type none) ) (method set_last_unref_handler (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_set_last_unref_handler) (return-type none) (parameter (type-and-name GdkPixbufLastUnref last_unref_fn)) (parameter (type-and-name gpointer last_unref_fn_data)) ) (method finalize (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_finalize) (return-type none) ) (method get_colorspace (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_colorspace) (return-type GdkColorspace) ) (method get_n_channels (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_n_channels) (return-type int) ) (method get_has_alpha (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_has_alpha) (return-type gboolean) ) (method get_bits_per_sample (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_bits_per_sample) (return-type int) ) (method get_pixels (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_pixels) (return-type guchar*) ) (method get_width (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_width) (return-type int) ) (method get_height (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_height) (return-type int) ) (method get_rowstride (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_rowstride) (return-type int) ) (function gdk_pixbuf_new (c-name gdk_pixbuf_new) (is-constructor-of GdkPixbuf) (return-type GdkPixbuf*) (parameter (type-and-name GdkColorspace colorspace)) (parameter (type-and-name gboolean has_alpha)) (parameter (type-and-name int bits_per_sample)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) ) (method copy (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_copy) (return-type GdkPixbuf*) ) (function gdk_pixbuf_new_from_file (c-name gdk_pixbuf_new_from_file) (return-type GdkPixbuf*) (parameter (type-and-name const-char* filename)) ) (function gdk_pixbuf_new_from_data (c-name gdk_pixbuf_new_from_data) (return-type GdkPixbuf*) (parameter (type-and-name const-guchar* data)) (parameter (type-and-name GdkColorspace colorspace)) (parameter (type-and-name gboolean has_alpha)) (parameter (type-and-name int bits_per_sample)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name int rowstride)) (parameter (type-and-name GdkPixbufDestroyNotify destroy_fn)) (parameter (type-and-name gpointer destroy_fn_data)) ) (function gdk_pixbuf_new_from_xpm_data (c-name gdk_pixbuf_new_from_xpm_data) (return-type GdkPixbuf*) (parameter (type-and-name const-char** data)) ) (method add_alpha (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_add_alpha) (return-type GdkPixbuf*) (parameter (type-and-name gboolean substitute_color)) (parameter (type-and-name guchar r)) (parameter (type-and-name guchar g)) (parameter (type-and-name guchar b)) ) (method copy_area (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_copy_area) (return-type none) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name GdkPixbuf* dest_pixbuf)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) ) (method render_threshold_alpha (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_render_threshold_alpha) (return-type none) (parameter (type-and-name GdkBitmap* bitmap)) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name int alpha_threshold)) ) (method render_to_drawable (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_render_to_drawable) (return-type none) (parameter (type-and-name GdkDrawable* drawable)) (parameter (type-and-name GdkGC* gc)) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name GdkRgbDither dither)) (parameter (type-and-name int x_dither)) (parameter (type-and-name int y_dither)) ) (method render_to_drawable_alpha (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_render_to_drawable_alpha) (return-type none) (parameter (type-and-name GdkDrawable* drawable)) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) (parameter (type-and-name GdkPixbufAlphaMode alpha_mode)) (parameter (type-and-name int alpha_threshold)) (parameter (type-and-name GdkRgbDither dither)) (parameter (type-and-name int x_dither)) (parameter (type-and-name int y_dither)) ) (method render_pixmap_and_mask (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_render_pixmap_and_mask) (return-type none) (parameter (type-and-name GdkPixmap** pixmap_return)) (parameter (type-and-name GdkBitmap** mask_return)) (parameter (type-and-name int alpha_threshold)) ) (method get_from_drawable (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_get_from_drawable) (return-type GdkPixbuf*) (parameter (type-and-name GdkDrawable* src)) (parameter (type-and-name GdkColormap* cmap)) (parameter (type-and-name int src_x)) (parameter (type-and-name int src_y)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int width)) (parameter (type-and-name int height)) ) (method scale (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_scale) (return-type none) (parameter (type-and-name GdkPixbuf* dest)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name double offset_x)) (parameter (type-and-name double offset_y)) (parameter (type-and-name double scale_x)) (parameter (type-and-name double scale_y)) (parameter (type-and-name GdkInterpType interp_type)) ) (method composite (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_composite) (return-type none) (parameter (type-and-name GdkPixbuf* dest)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name double offset_x)) (parameter (type-and-name double offset_y)) (parameter (type-and-name double scale_x)) (parameter (type-and-name double scale_y)) (parameter (type-and-name GdkInterpType interp_type)) (parameter (type-and-name int overall_alpha)) ) (method composite_color (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_composite_color) (return-type none) (parameter (type-and-name GdkPixbuf* dest)) (parameter (type-and-name int dest_x)) (parameter (type-and-name int dest_y)) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name double offset_x)) (parameter (type-and-name double offset_y)) (parameter (type-and-name double scale_x)) (parameter (type-and-name double scale_y)) (parameter (type-and-name GdkInterpType interp_type)) (parameter (type-and-name int overall_alpha)) (parameter (type-and-name int check_x)) (parameter (type-and-name int check_y)) (parameter (type-and-name int check_size)) (parameter (type-and-name guint32 color1)) (parameter (type-and-name guint32 color2)) ) (method scale_simple (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_scale_simple) (return-type GdkPixbuf*) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name GdkInterpType interp_type)) ) (method composite_color_simple (of-object Pixbuf (Gdk)) (c-name gdk_pixbuf_composite_color_simple) (return-type GdkPixbuf*) (parameter (type-and-name int dest_width)) (parameter (type-and-name int dest_height)) (parameter (type-and-name GdkInterpType interp_type)) (parameter (type-and-name int overall_alpha)) (parameter (type-and-name int check_size)) (parameter (type-and-name guint32 color1)) (parameter (type-and-name guint32 color2)) ) (function gdk_pixbuf_animation_new_from_file (c-name gdk_pixbuf_animation_new_from_file) (return-type GdkPixbufAnimation*) (parameter (type-and-name const-char* filename)) ) (method ref (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_ref) (return-type GdkPixbufAnimation*) ) (method unref (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_unref) (return-type none) ) (method get_width (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_get_width) (return-type int) ) (method get_height (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_get_height) (return-type int) ) (method get_frames (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_get_frames) (return-type GList*) ) (method get_num_frames (of-object PixbufAnimation (Gdk)) (c-name gdk_pixbuf_animation_get_num_frames) (return-type int) ) (method get_pixbuf (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_pixbuf) (return-type GdkPixbuf*) ) (method get_x_offset (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_x_offset) (return-type int) ) (method get_y_offset (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_y_offset) (return-type int) ) (method get_delay_time (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_delay_time) (return-type int) ) (method get_action (of-object PixbufFrame (Gdk)) (c-name gdk_pixbuf_frame_get_action) (return-type GdkPixbufFrameAction) ) (function gdk_pixbuf_preinit (c-name gdk_pixbuf_preinit) (return-type none) (parameter (type-and-name gpointer app)) (parameter (type-and-name gpointer modinfo)) ) (function gdk_pixbuf_postinit (c-name gdk_pixbuf_postinit) (return-type none) (parameter (type-and-name gpointer app)) (parameter (type-and-name gpointer modinfo)) ) Index: php-gtk/ext/gdkpixbuf/gdkpixbuf.overrides +++ php-gtk/ext/gdkpixbuf/gdkpixbuf.overrides /* vim: set ft=cpp: */ %% headers #include "php_gdkpixbuf.h" %% ignore gdk_pixbuf_preinit gdk_pixbuf_postinit Index: php-gtk/ext/gdkpixbuf/php_gdkpixbuf.c +++ php-gtk/ext/gdkpixbuf/php_gdkpixbuf.c /* * PHP-GTK - The PHP language bindings for GTK+ * * Copyright (C) 2001 Andrei Zmievski <andrei@php.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 */ /* $Id: php_gdkpixbuf.c,v 1.1 2001/11/30 04:34:50 andrei Exp $ */ #include "php_gdkpixbuf.h" #if HAVE_GDKPIXBUF #ifdef PHP_GTK_COMPILE_DL_GDKPIXBUF PHP_GTK_GET_EXTENSION(gdkpixbuf) #endif int le_gdk_pixbuf; static void release_gdk_pixbuf_rsrc(zend_rsrc_list_entry *rsrc TSRMLS_DC) { GdkPixbuf *obj = (GdkPixbuf *)rsrc->ptr; zval **wrapper_ptr; if (zend_hash_index_find(&php_gtk_type_hash, (long)obj, (void **)&wrapper_ptr) == SUCCESS) { zval_ptr_dtor(wrapper_ptr); } gdk_pixbuf_unref(obj); } zval *php_gdk_pixbuf_new(GdkPixbuf *pixbuf) { zval *result; zval **wrapper_ptr; TSRMLS_FETCH(); if (!pixbuf) { MAKE_STD_ZVAL(result); ZVAL_NULL(result); return result; } if (zend_hash_index_find(&php_gtk_type_hash, (long)pixbuf, (void **)&wrapper_ptr) == SUCCESS) { zval_add_ref(wrapper_ptr); return *wrapper_ptr; } MAKE_STD_ZVAL(result); object_init_ex(result, gdk_pixbuf_ce); gdk_pixbuf_ref(pixbuf); php_gtk_set_object(result, pixbuf, le_gdk_pixbuf); return result; } PHP_GTK_XINIT_FUNCTION(gdkpixbuf) { le_gdk_pixbuf = zend_register_list_destructors_ex(release_gdk_pixbuf_rsrc, NULL, "GdkPixbuf", module_number); php_gdk_pixbuf_register_constants(module_number TSRMLS_CC); php_gdk_pixbuf_register_classes(); gdk_rgb_init(); return SUCCESS; } php_gtk_ext_entry gdkpixbuf_ext_entry = { "gdkpixbuf", PHP_GTK_XINIT(gdkpixbuf), NULL, }; #endif /* HAVE_GDKPIXBUF */ Index: php-gtk/ext/gdkpixbuf/php_gdkpixbuf.h +++ php-gtk/ext/gdkpixbuf/php_gdkpixbuf.h /* * PHP-GTK - The PHP language bindings for GTK+ * * Copyright (C) 2001 Andrei Zmievski <andrei@php.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 */ /* $Id: php_gdkpixbuf.h,v 1.1 2001/11/30 04:34:50 andrei Exp $ */ #ifndef PHP_GDKPIXBUF_H #define PHP_GDKPIXBUF_H #include "php_gtk.h" #if HAVE_GDKPIXBUF #include <gdk-pixbuf/gdk-pixbuf.h> extern int le_gdk_pixbuf; #include "gen_ce_gdkpixbuf.h" extern php_gtk_ext_entry gdkpixbuf_ext_entry; #define gdkpixbuf_ext_ptr &gdkpixbuf_ext_entry void php_gdkpixbuf_register_constants(int module_number TSRMLS_DC); void php_gdkpixbuf_register_classes(); zval *php_gdk_pixbuf_new(GdkPixbuf *pixbuf); #define PHP_GDK_PIXBUF_GET(w) PHP_GTK_GET_GENERIC(w, GdkPixbuf*, le_gdk_pixbuf) #else #define gdkpixbuf_ext_ptr NULL #endif /* HAVE_GDKPIXBUF */ #define php_gtk_ext_gdkpixbuf_ptr gdkpixbuf_ext_ptr #endif /* PHP_GDKPIXBUF_H */