Index: demos/pixbuf-demo.c
===================================================================
RCS file: /cvs/gnome/gtk+/demos/pixbuf-demo.c,v
retrieving revision 1.13
diff -u -r1.13 pixbuf-demo.c
--- demos/pixbuf-demo.c	1 Feb 2003 01:47:01 -0000	1.13
+++ demos/pixbuf-demo.c	22 Apr 2004 11:40:58 -0000
@@ -80,6 +80,7 @@
 		images[i] = gdk_pixbuf_new_from_file (image_names[i], NULL);
 		if (!images[i])
 			return FALSE;
+		gdk_pixbuf_mirror (images[i]);
 	}
 
 	return TRUE;
Index: gdk-pixbuf/gdk-pixbuf-scale.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/gdk-pixbuf-scale.c,v
retrieving revision 1.10
diff -u -r1.10 gdk-pixbuf-scale.c
--- gdk-pixbuf/gdk-pixbuf-scale.c	30 Jul 2002 03:09:39 -0000	1.10
+++ gdk-pixbuf/gdk-pixbuf-scale.c	22 Apr 2004 11:40:58 -0000
@@ -294,3 +294,49 @@
 
   return dest;
 }
+
+/**
+ * gdk_pixbuf_mirror:
+ * @pixbuf: a #GdkPixbuf
+ *
+ * Mirrors the supplied #GdkPixbuf along the vertical axis. The #GdkPixbuf
+ * is modified in-place. Copy the #GdkPixbuf before-hand with gdk_pixbuf_copy()
+ * if you wish to keep the original image.
+ *
+ * This function is useful to modify icons for use in Right-To-Left languages.
+ *
+ **/
+void
+gdk_pixbuf_mirror (GdkPixbuf *pixbuf)
+{
+	int i, j, rowstride, offset, right;
+	guchar *pixels;
+	int width, height, size;
+	guint32 tmp;
+
+	pixels = gdk_pixbuf_get_pixels (pixbuf);
+	g_return_if_fail (pixels != NULL);
+
+	width = gdk_pixbuf_get_width (pixbuf);
+	height = gdk_pixbuf_get_height (pixbuf);
+	rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+	size = height * width * sizeof (guint32);
+
+	for (i = 0; i < size; i += rowstride)
+	{
+		for (j = 0; j < rowstride; j += sizeof(guint32))
+		{
+			offset = i + j;
+			right = i + (((width - 1) * sizeof(guint32)) - j);
+
+			if (right <= offset)
+				break;
+
+			memcpy (&tmp, pixels + offset, sizeof(guint32));
+			memcpy (pixels + offset, pixels + right,
+					sizeof(guint32));
+			memcpy (pixels + right, &tmp, sizeof(guint32));
+		}
+	}
+}
+
Index: gdk-pixbuf/gdk-pixbuf.h
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/gdk-pixbuf.h,v
retrieving revision 1.71
diff -u -r1.71 gdk-pixbuf.h
--- gdk-pixbuf/gdk-pixbuf.h	7 Jan 2004 01:57:42 -0000	1.71
+++ gdk-pixbuf/gdk-pixbuf.h	22 Apr 2004 11:40:58 -0000
@@ -296,6 +296,8 @@
 					      guint32          color1,
 					      guint32          color2);
 
+void gdk_pixbuf_mirror		(GdkPixbuf *pixbuf);
+
 
 
 /* Animation support */
