diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 1997-12-06 20:53:46 +0000 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1997-12-06 20:53:46 +0000 |
commit | a51d944e25a2d5aa2ed6cc1ce371f652591bceaf (patch) | |
tree | b7427883c7b6bc2439c0546f3a7965f3e7e55b6b /gdk/gdkcursor.c | |
parent | a7f427d7d9d7a97f8c23f6d50413ea513cdbc39d (diff) | |
download | gtk+-a51d944e25a2d5aa2ed6cc1ce371f652591bceaf.tar.gz |
Add support for pixmap cursors -mig
Diffstat (limited to 'gdk/gdkcursor.c')
-rw-r--r-- | gdk/gdkcursor.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index 22bfd250b1..b9b33ee519 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -38,6 +38,37 @@ gdk_cursor_new (GdkCursorType cursor_type) return cursor; } +GdkCursor* +gdk_cursor_new_from_pixmap (GdkPixmap *source, GdkPixmap *mask, GdkColor *fg, GdkColor *bg, int x, int y) +{ + GdkCursorPrivate *private; + GdkCursor *cursor; + Pixmap source_pixmap, mask_pixmap; + Cursor xcursor; + XColor xfg, xbg; + + source_pixmap = ((GdkPixmapPrivate *) source)->xwindow; + mask_pixmap = ((GdkPixmapPrivate *) mask)->xwindow; + + xfg.pixel = fg->pixel; + xfg.red = fg->red; + xfg.blue = fg->blue; + xfg.green = fg->green; + xbg.pixel = bg->pixel; + xbg.red = bg->red; + xbg.blue = bg->blue; + xbg.green = bg->green; + + xcursor = XCreatePixmapCursor (gdk_display, source_pixmap, mask_pixmap, &xfg, &xbg, x, y); + private = g_new (GdkCursorPrivate, 1); + private->xdisplay = gdk_display; + private->xcursor = xcursor; + cursor = (GdkCursor *) private; + cursor->type = GDK_CURSOR_IS_PIXMAP; + + return cursor; +} + void gdk_cursor_destroy (GdkCursor *cursor) { |