[PATCH] gdk/gdkpixmap.[ch]: state constness of `data` in create pixmap routines
- From: Ben Stewart <ben stewart+gtkdev tucuxi org>
- To: gtk-devel-list gnome org
- Subject: [PATCH] gdk/gdkpixmap.[ch]: state constness of `data` in create pixmap routines
- Date: Wed, 23 Jun 2010 02:12:51 +1000
Hi all,
The attached patch file resolves an issue where const char * data cannot
be passed to the GDK create pixmap from XPM routines.
Apologies in advance if this is not the correct venue to submit a patch
- this is the first one I have submitted to the GTK+ project.
Cheers,
Ben
--------
Alter prototypes in gdk/gdkpixmap.[ch] to state constness of `data'
The routines to create a pixmap from a string of XPM data do not alter
the source data, yet the interface is not currently marked as 'const
gchar**'.
The public interface for the following routines are affected by the
patch, however this should not affect any software calling into the GDK
library.
- gdk_pixmap_colormap_create_from_xpm_d()
- gdk_pixmap_create_from_xpm_d()
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index 2adb33f..c4f7b13 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -720,7 +720,7 @@ gdk_pixmap_colormap_create_from_xpm_d (GdkDrawable *drawable,
GdkColormap *colormap,
GdkBitmap **mask,
const GdkColor *transparent_color,
- gchar **data)
+ const gchar **data)
{
GdkPixbuf *pixbuf;
GdkPixmap *pixmap;
@@ -763,7 +763,7 @@ GdkPixmap*
gdk_pixmap_create_from_xpm_d (GdkDrawable *drawable,
GdkBitmap **mask,
const GdkColor *transparent_color,
- gchar **data)
+ const gchar **data)
{
return gdk_pixmap_colormap_create_from_xpm_d (drawable, NULL, mask,
transparent_color, data);
diff --git a/gdk/gdkpixmap.h b/gdk/gdkpixmap.h
index 736872c..75b6c47 100644
--- a/gdk/gdkpixmap.h
+++ b/gdk/gdkpixmap.h
@@ -94,12 +94,12 @@ GdkPixmap* gdk_pixmap_colormap_create_from_xpm (GdkDrawable *drawable,
GdkPixmap* gdk_pixmap_create_from_xpm_d (GdkDrawable *drawable,
GdkBitmap **mask,
const GdkColor *transparent_color,
- gchar **data);
+ const gchar **data);
GdkPixmap* gdk_pixmap_colormap_create_from_xpm_d (GdkDrawable *drawable,
GdkColormap *colormap,
GdkBitmap **mask,
const GdkColor *transparent_color,
- gchar **data);
+ const gchar **data);
/* Functions to create/lookup pixmaps from their native equivalents
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]