diff options
author | Benjamin Otte <otte@redhat.com> | 2010-08-12 15:43:23 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-09-26 15:02:59 +0200 |
commit | 6218c16ff8d8fecb28c58ed723acf71752cb6f79 (patch) | |
tree | fd573cb64a5d4e384ba84c9dc8aaf3adbe35cb93 /gdk/quartz/gdkcursor-quartz.c | |
parent | 0178bff5c06134e8727eb964c773a7a1557d1d0a (diff) | |
download | gtk+-6218c16ff8d8fecb28c58ed723acf71752cb6f79.tar.gz |
API: Remove gdk_cursor_new_from_pixmap()
gdk_cursor_new_from_pixbuf() is the proper replacement.
Diffstat (limited to 'gdk/quartz/gdkcursor-quartz.c')
-rw-r--r-- | gdk/quartz/gdkcursor-quartz.c | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/gdk/quartz/gdkcursor-quartz.c b/gdk/quartz/gdkcursor-quartz.c index dcd4220031..96dc7704e0 100644 --- a/gdk/quartz/gdkcursor-quartz.c +++ b/gdk/quartz/gdkcursor-quartz.c @@ -237,91 +237,6 @@ gdk_cursor_new_for_display (GdkDisplay *display, return gdk_quartz_cursor_new_from_nscursor (nscursor, cursor_type); } -GdkCursor* -gdk_cursor_new_from_pixmap (GdkPixmap *source, - GdkPixmap *mask, - const GdkColor *fg, - const GdkColor *bg, - gint x, - gint y) -{ - NSBitmapImageRep *bitmap_rep; - NSImage *image; - NSCursor *nscursor; - GdkCursor *cursor; - int width, height; - gint tmp_x, tmp_y; - guchar *dst_data, *mask_data, *src_data; - guchar *mask_start, *src_start; - int dst_stride; - - g_return_val_if_fail (GDK_IS_PIXMAP (source), NULL); - g_return_val_if_fail (GDK_IS_PIXMAP (mask), NULL); - g_return_val_if_fail (fg != NULL, NULL); - g_return_val_if_fail (bg != NULL, NULL); - - GDK_QUARTZ_ALLOC_POOL; - - gdk_drawable_get_size (source, &width, &height); - - bitmap_rep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL - pixelsWide:(NSInteger)width pixelsHigh:(NSInteger)height - bitsPerSample:8 samplesPerPixel:4 - hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace - bytesPerRow:0 bitsPerPixel:0]; - - dst_stride = [bitmap_rep bytesPerRow]; - mask_start = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (mask)->impl)->data; - src_start = GDK_PIXMAP_IMPL_QUARTZ (GDK_PIXMAP_OBJECT (source)->impl)->data; - - for (tmp_y = 0; tmp_y < height; tmp_y++) - { - dst_data = [bitmap_rep bitmapData] + tmp_y * dst_stride; - mask_data = mask_start + tmp_y * width; - src_data = src_start + tmp_y * width; - - for (tmp_x = 0; tmp_x < width; tmp_x++) - { - if (*mask_data++) - { - const GdkColor *color; - - if (*src_data++) - color = fg; - else - color = bg; - - *dst_data++ = (color->red >> 8) & 0xff; - *dst_data++ = (color->green >> 8) & 0xff; - *dst_data++ = (color->blue >> 8) & 0xff; - *dst_data++ = 0xff; - - } - else - { - *dst_data++ = 0x00; - *dst_data++ = 0x00; - *dst_data++ = 0x00; - *dst_data++ = 0x00; - - src_data++; - } - } - } - image = [[NSImage alloc] init]; - [image addRepresentation:bitmap_rep]; - [bitmap_rep release]; - - nscursor = [[NSCursor alloc] initWithImage:image hotSpot:NSMakePoint(x, y)]; - [image release]; - - cursor = gdk_quartz_cursor_new_from_nscursor (nscursor, GDK_CURSOR_IS_PIXMAP); - - GDK_QUARTZ_RELEASE_POOL; - - return cursor; -} - static NSImage * _gdk_quartz_pixbuf_to_ns_image (GdkPixbuf *pixbuf) { |