diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-06-14 20:43:20 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-06-14 20:43:20 +0000 |
commit | daab95c294c90116db63c91979c96d444318c17b (patch) | |
tree | 21e0b0b072b687ba398035a89c89589f2b5e5afa /gdk | |
parent | 920b5749b3a8b98bf85c9aca34340466c7cde1de (diff) | |
download | gdk-pixbuf-daab95c294c90116db63c91979c96d444318c17b.tar.gz |
Add a stub for the no-Xcursor case. (noticed by Luis Villa)
2005-06-14 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkcursor-x11.c (gdk_cursor_new_from_name): Add a
stub for the no-Xcursor case. (noticed by Luis Villa)
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/x11/gdkcursor-x11.c | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index b9c27fe2a..3373ecdcf 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -312,6 +312,34 @@ gdk_cursor_get_display (GdkCursor *cursor) #if defined(HAVE_XCURSOR) && defined(HAVE_XFIXES) && XFIXES_MAJOR >= 2 +#if 0 +XcursorComments * +load_comments (const char *file, + const char *theme) +{ + FILE *f = 0; + XcursorImages *images = 0; + XcursorComments *comments = 0; + + if (theme) + f = XcursorScanTheme (theme, file); + if (!f) + f = XcursorScanTheme ("default", file); + if (f == XCURSOR_SCAN_CORE) + return 0; + if (f) + { + XcursorFileLoad (f, &comments, &images); + fclose (f); + + if (images) + XcursorImagesDestroy (images); + } + + return comments; +} +#endif + /** * gdk_cursor_get_image: * @cursor: a #GdkCursor @@ -333,13 +361,15 @@ gdk_cursor_get_image (GdkCursor *cursor) GdkCursorPrivate *private; XcursorImages *images = NULL; XcursorImage *image; + XcursorComments *comments; Atom atom; gint size; gchar buf[32]; guchar *data; GdkPixbuf *pixbuf; gchar *theme; - + gint i, j; + g_return_val_if_fail (cursor != NULL, NULL); private = (GdkCursorPrivate *) cursor; @@ -376,7 +406,30 @@ gdk_cursor_get_image (GdkCursor *cursor) gdk_pixbuf_set_option (pixbuf, "x_hot", buf); g_snprintf (buf, 32, "%d", image->yhot); gdk_pixbuf_set_option (pixbuf, "y_hot", buf); - + +#if 0 + comments = load_comments (images->name, theme); + + j = 0; + for (i = 0; i < comments->ncomment; i++) + { + switch (comments->comments[i].comment_type) + { + case XCURSOR_COMMENT_COPYRIGHT: + gdk_pixbuf_set_option (pixbuf, "copyright", comments->comments[i].comment); + break; + case XCURSOR_COMMENT_LICENSE: + gdk_pixbuf_set_option (pixbuf, "license", comments->comments[i].comment); + break; + default: + g_snprintf (buf, 32, "comment%d", j++); + gdk_pixbuf_set_option (pixbuf, buf, comments->comments[i].comment); + break; + } + } + XcursorCommentsDestroy (comments); +#endif + XcursorImagesDestroy (images); return pixbuf; @@ -687,6 +740,15 @@ gdk_cursor_new_from_pixbuf (GdkDisplay *display, return cursor; } +GdkCursor* +gdk_cursor_new_from_name (GdkDisplay *display, + const gchar *name) +{ + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); + + return NULL; +} + gboolean gdk_display_supports_cursor_alpha (GdkDisplay *display) { |