diff options
author | Daniel Stone <daniel@fooishbar.org> | 2005-06-29 18:46:53 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2005-06-29 18:46:53 +0000 |
commit | caa910e492e4d15208f3d179021687c25a84f36e (patch) | |
tree | 023db68903023ac7077902e4e349ffa7b4e91ca4 /src/xlib.c | |
parent | e67de73f5ca7ae854c18fa1500c8eaf412b44c6c (diff) |
Import Xcursor 1.1.4 from freedesktop.org xlibs tree.
Diffstat (limited to 'src/xlib.c')
-rw-r--r-- | src/xlib.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -1,4 +1,5 @@ /* + * $Id$ * * Copyright © 2002 Keith Packard * @@ -36,6 +37,9 @@ _XcursorFontIsCursor (Display *dpy, Font font) int n; Atom cursor; + if (!dpy || !font) + return XcursorFalse; + if (font == dpy->cursor_font) return XcursorTrue; @@ -86,6 +90,9 @@ XcursorTryShapeCursor (Display *dpy, XColor _Xconst *background) { Cursor cursor = None; + + if (!dpy || !source_font || !mask_font || !foreground || !background) + return 0; if (!XcursorSupportsARGB (dpy) && !XcursorGetThemeCore (dpy)) return None; @@ -120,6 +127,9 @@ XcursorNoticeCreateBitmap (Display *dpy, int replace = 0; XcursorBitmapInfo *bmi; + if (!dpy) + return; + if (!XcursorSupportsARGB (dpy) && !XcursorGetThemeCore (dpy)) return; @@ -160,9 +170,14 @@ XcursorNoticeCreateBitmap (Display *dpy, static XcursorBitmapInfo * _XcursorGetBitmap (Display *dpy, Pixmap bitmap) { - XcursorDisplayInfo *info = _XcursorGetDisplayInfo (dpy); + XcursorDisplayInfo *info; int i; + if (!dpy || !bitmap) + return NULL; + + info = _XcursorGetDisplayInfo (dpy); + if (!info) return 0; LockDisplay (dpy); @@ -233,6 +248,9 @@ XcursorImageHash (XImage *image, int low_addr; Bool bit_swap; + if (!image) + return; + for (i = 0; i < XCURSOR_BITMAP_HASH_SIZE; i++) hash[i] = 0; /* @@ -302,6 +320,9 @@ XcursorNoticePutBitmap (Display *dpy, XImage *image) { XcursorBitmapInfo *bmi; + + if (!dpy || !image) + return; if (!XcursorSupportsARGB (dpy) && !XcursorGetThemeCore (dpy)) return; @@ -383,6 +404,9 @@ XcursorTryShapeBitmapCursor (Display *dpy, int i; Cursor cursor; + if (!dpy || !foreground || !background) + return 0; + if (!XcursorSupportsARGB (dpy) && !XcursorGetThemeCore (dpy)) return None; |