[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] gtk_pixbuf_new_from_xpm_data



On Fri, Aug 29, 2003 at 08:04:21PM +0600, Anuradha Ratnaweera wrote:
>
> The attached patch implements
> Gtk2::Gdk::Pixbuf->new_from_xpm_data(@data)
>
> It is against 0.96.


This patch has a couple of spacing inconsistencies.  Here comes the
"corrected" one ;-)

        Anuradha

--

Virtusa Corporation
http://www.virtusa.com

Debian GNU/Linux (kernel 2.6.0-test3)

Having nothing, nothing can he lose.
                -- William Shakespeare, "Henry VI"

diff -Nrua Gtk2-0.96/TODO Gtk2-0.96.new/TODO
--- Gtk2-0.96/TODO	2003-08-20 14:22:02.000000000 +0600
+++ Gtk2-0.96.new/TODO	2003-08-29 19:56:34.000000000 +0600
@@ -14,7 +14,6 @@
 
 gdk_pixbuf_render_pixmap_and_mask_for_colormap
 gdk_pixbuf_render_pixmap_and_mask
-gdk_pixbuf_new_from_data <- how would we do that?
 
 gtk_key_snooper_install/remove
 
diff -Nrua Gtk2-0.96/xs/GdkPixbuf.xs Gtk2-0.96.new/xs/GdkPixbuf.xs
--- Gtk2-0.96/xs/GdkPixbuf.xs	2003-08-18 13:59:59.000000000 +0600
+++ Gtk2-0.96.new/xs/GdkPixbuf.xs	2003-08-29 19:56:13.000000000 +0600
@@ -179,11 +179,22 @@
 #	GdkPixbufDestroyNotify destroy_fn
 #	gpointer destroy_fn_data
 
-### FIXME read data as list of strings on argument stack
-###  GdkPixbuf *gdk_pixbuf_new_from_xpm_data (const char **data) 
-#GdkPixbuf_noinc *
-#gdk_pixbuf_new_from_xpm_data (data)
-#	const char **data
+##  GdkPixbuf *gdk_pixbuf_new_from_xpm_data (const char **data) 
+GdkPixbuf_noinc *
+gdk_pixbuf_new_from_xpm_data (class, data, ...)
+	SV * class
+	SV * data
+	PREINIT:
+		char ** lines;
+		int i;
+	CODE:
+		lines = g_new (char *, items - 1);
+		for (i = 1; i < items; i++)
+			lines[i-1] = SvPV_nolen (ST (i));
+		RETVAL = gdk_pixbuf_new_from_xpm_data (lines);
+		g_free (lines);
+	OUTPUT:
+		RETVAL
 
 ## croaks on error
 ##  GdkPixbuf* gdk_pixbuf_new_from_inline (gint data_length, const guint8 *data, gboolean copy_pixels, GError **error) 

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]