com gtk/php-gtk: - Reflection info for a number of GdkPixbuf methods - Make fill() accept both pixel specification *and* rgba values: ext/gtk+/gdk.overrides

[email protected] (David Soria Parra)
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    f20bc50dbfd27f9d1cb011c8f074ae31271f388f
Author:    Christian Weiske <[email protected]>         Tue, 30 May 2006 08:21:47 +0000
Parents:   4404b94af897e4acc05ca34b3b2aa2af694287e1
Branches:  master

Link:       http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=f20bc50dbfd27f9d1cb011c8f074ae31271f388f

Log:
- Reflection info for a number of GdkPixbuf methods
- Make fill() accept both pixel specification *and*
  rgba values

Changed paths:
  M  ext/gtk+/gdk.overrides


Diff:
f20bc50dbfd27f9d1cb011c8f074ae31271f388f
diff --git a/ext/gtk+/gdk.overrides b/ext/gtk+/gdk.overrides
index 49723b6..02fa7c6 100644
--- a/ext/gtk+/gdk.overrides
+++ b/ext/gtk+/gdk.overrides
@@ -1522,6 +1522,13 @@ PHP_METHOD
 }
 
 %%
+add-arginfo GdkPixbuf new_from_xpm_data
+static
+ZEND_BEGIN_ARG_INFO(ARGINFO_NAME, 0)
+    ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO();
+
+%%
 override gdk_pixbuf_new_from_xpm_data
 PHP_METHOD
 {
@@ -1558,6 +1565,13 @@ PHP_METHOD
 }
 
 %%
+add-arginfo GdkPixbuf new_from_gd
+static
+ZEND_BEGIN_ARG_INFO(ARGINFO_NAME, 0)
+    ZEND_ARG_INFO(0, gd)
+ZEND_END_ARG_INFO();
+
+%%
 add GdkPixbuf new_from_gd ZEND_ACC_PUBLIC|ZEND_ACC_STATIC
 
 #if HAVE_GD_BUNDLED
@@ -1692,7 +1706,7 @@ PHP_METHOD
     if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "")) {
         return;
     }
-    
+
     pixbuf = GDK_PIXBUF(PHPG_GOBJECT(this_ptr));
     pixels = gdk_pixbuf_get_pixels(pixbuf);
     rowstride = gdk_pixbuf_get_rowstride(pixbuf);
@@ -1707,6 +1721,14 @@ PHP_METHOD
 }
 
 %%
+add-arginfo GdkPixbuf get_pixel
+static
+ZEND_BEGIN_ARG_INFO(ARGINFO_NAME, 0)
+    ZEND_ARG_INFO(0, x)
+    ZEND_ARG_INFO(0, y)
+ZEND_END_ARG_INFO();
+
+%%
 add GdkPixbuf get_pixel
 PHP_METHOD
 {
@@ -1769,6 +1791,18 @@ PHP_METHOD
 }
 
 %%
+add-arginfo GdkPixbuf put_pixel
+static
+ZEND_BEGIN_ARG_INFO_EX(ARGINFO_NAME, 0, 0, 3)
+    ZEND_ARG_INFO(0, x)
+    ZEND_ARG_INFO(0, y)
+    ZEND_ARG_INFO(0, pixel_or_red)
+    ZEND_ARG_INFO(0, green)
+    ZEND_ARG_INFO(0, blue)
+    ZEND_ARG_INFO(0, alpha)
+ZEND_END_ARG_INFO();
+
+%%
 add GdkPixbuf put_pixel
 PHP_METHOD
 {
@@ -1835,6 +1869,55 @@ PHP_METHOD
 }
 
 %%
+add-arginfo GdkPixbuf fill
+static
+ZEND_BEGIN_ARG_INFO_EX(ARGINFO_NAME, 0, 0, 1)
+    ZEND_ARG_INFO(0, pixel_or_red)
+    ZEND_ARG_INFO(0, green)
+    ZEND_ARG_INFO(0, blue)
+    ZEND_ARG_INFO(0, alpha)
+ZEND_END_ARG_INFO();
+
+%%
+override gdk_pixbuf_fill
+PHP_METHOD
+{
+    long pixel, r, g, b, a;
+
+    NOT_STATIC_METHOD();
+
+    if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "i|iii", &r, &g, &b, &a)) {
+        return;
+    }
+
+    if (ZEND_NUM_ARGS() == 4) {
+        pixel = 0;
+        pixel += r << 24;
+        pixel += g << 16;
+        pixel += b << 8;
+        pixel += a;
+    } else {
+        pixel = r;
+    }
+
+    gdk_pixbuf_fill(GDK_PIXBUF(PHPG_GOBJECT(this_ptr)), (guint32)pixel);
+}
+
+%%
+add-arginfo GdkPixbuf fill_area
+static
+ZEND_BEGIN_ARG_INFO_EX(ARGINFO_NAME, 0, 0, 5)
+    ZEND_ARG_INFO(0, x)
+    ZEND_ARG_INFO(0, y)
+    ZEND_ARG_INFO(0, width)
+    ZEND_ARG_INFO(0, height)
+    ZEND_ARG_INFO(0, pixel_or_red)
+    ZEND_ARG_INFO(0, green)
+    ZEND_ARG_INFO(0, blue)
+    ZEND_ARG_INFO(0, alpha)
+ZEND_END_ARG_INFO();
+
+%%
 add GdkPixbuf fill_area
 PHP_METHOD
 {
@@ -1944,6 +2027,15 @@ PHP_METHOD
 }
 
 %%
+add-arginfo GdkPixbuf save
+static
+ZEND_BEGIN_ARG_INFO_EX(ARGINFO_NAME, 0, 0, 2)
+    ZEND_ARG_INFO(0, filename)
+    ZEND_ARG_INFO(0, type)
+    ZEND_ARG_INFO(0, options)
+ZEND_END_ARG_INFO();
+
+%%
 override gdk_pixbuf_save
 PHP_METHOD
 {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.