summaryrefslogtreecommitdiff
path: root/gdk/gdkpixmap.c
diff options
context:
space:
mode:
authorOwen Taylor <owt1@cornell.edu>1998-03-01 23:38:01 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-03-01 23:38:01 +0000
commitade3020098a314600796289b2121cc883073b23b (patch)
treeb91c5064fb962b65ce9fb62d62b0ff336cead885 /gdk/gdkpixmap.c
parentaf18ab4305fbf3f913bd57988d3e845d794ae8b5 (diff)
downloadgtk+-ade3020098a314600796289b2121cc883073b23b.tar.gz
Make sure either the window or the depth is given when creating a pixmap.
Sun Mar 1 17:40:58 1998 Owen Taylor <owt1@cornell.edu> * gdk/gdkpixmap.c: Make sure either the window or the depth is given when creating a pixmap.
Diffstat (limited to 'gdk/gdkpixmap.c')
-rw-r--r--gdk/gdkpixmap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c
index 48b072b91c..ab131e6aca 100644
--- a/gdk/gdkpixmap.c
+++ b/gdk/gdkpixmap.c
@@ -43,6 +43,8 @@ gdk_pixmap_new (GdkWindow *window,
GdkWindowPrivate *private;
GdkWindowPrivate *window_private;
+ g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
+
if (!window)
window = (GdkWindow*) &gdk_root_parent;
@@ -132,6 +134,7 @@ gdk_pixmap_create_from_data (GdkWindow *window,
g_return_val_if_fail (data != NULL, NULL);
g_return_val_if_fail (fg != NULL, NULL);
g_return_val_if_fail (bg != NULL, NULL);
+ g_return_val_if_fail ((window != NULL) || (depth != -1), NULL);
if (!window)
window = (GdkWindow*) &gdk_root_parent;
@@ -368,8 +371,7 @@ gdk_pixmap_create_from_xpm (GdkWindow *window,
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
- if (!window)
- window = (GdkWindow*) &gdk_root_parent;
+ g_return_val_if_fail (window != NULL, NULL);
infile = fopen (filename, "rb");
if (infile != NULL)
@@ -529,8 +531,7 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window,
_GdkPixmapColor *colors = NULL, *color = NULL;
gulong index;
- if (!window)
- window = (GdkWindow*) &gdk_root_parent;
+ g_return_val_if_fail (window != NULL, NULL);
i = 0;
buffer = data[i++];