Commit f74f9b27 authored by Benjamin Otte's avatar Benjamin Otte

gdk: Remove GdkPixmap

All iusers of it are gone, so it's now time to let go.
cairo_surface_t is a full replacement, combined with
gdk_window_create_similar_surface().
parent cadcd029
......@@ -240,28 +240,6 @@ GdkScreenClass
gdk_screen_get_type
</SECTION>
<SECTION>
<TITLE>Bitmaps and Pixmaps</TITLE>
<FILE>pixmaps</FILE>
GdkPixmap
gdk_pixmap_new
GdkBitmap
<SUBSECTION Standard>
GDK_PIXMAP
GDK_PIXMAP_GET_CLASS
GDK_PIXMAP_OBJECT
GDK_TYPE_PIXMAP
GDK_IS_PIXMAP
GDK_PIXMAP_CLASS
GDK_IS_PIXMAP_CLASS
<SUBSECTION Private>
gdk_pixmap_get_type
GdkPixmapObject
GdkPixmapObjectClass
</SECTION>
<SECTION>
<TITLE>Pixbufs</TITLE>
<FILE>pixbufs</FILE>
......@@ -1014,17 +992,12 @@ GDK_CURSOR_XCURSOR
GDK_CURSOR_XDISPLAY
GDK_WINDOW_XWINDOW
gdkx_visual_get
gdk_pixmap_foreign_new
gdk_pixmap_foreign_new_for_display
gdk_pixmap_foreign_new_for_screen
gdk_window_foreign_new
gdk_window_foreign_new_for_display
gdk_xid_table_lookup
gdk_xid_table_lookup_for_display
gdk_window_lookup
gdk_window_lookup_for_display
gdk_pixmap_lookup
gdk_pixmap_lookup_for_display
gdk_x11_lookup_xdisplay
gdk_x11_get_server_time
gdk_net_wm_supports
......@@ -1072,7 +1045,6 @@ gdk_x11_get_xatom_name_for_display
<SUBSECTION Private>
GDK_HAVE_WCHAR_H
GDK_HAVE_WCTYPE_H
gdk_x11_pixmap_get_drawable_impl
gdk_x11_window_get_drawable_impl
</SECTION>
......
#include "config.h"
#include <gtk/gtk.h>
/* XPM data of Open-File icon */
static const char * xpm_data[] = {
"16 16 3 1",
" c None",
". c #000000000000",
"X c #FFFFFFFFFFFF",
" ",
" ...... ",
" .XXX.X. ",
" .XXX.XX. ",
" .XXX.XXX. ",
" .XXX..... ",
" .XXXXXXX. ",
" .XXXXXXX. ",
" .XXXXXXX. ",
" .XXXXXXX. ",
" .XXXXXXX. ",
" .XXXXXXX. ",
" .XXXXXXX. ",
" ......... ",
" ",
" "};
/* when invoked (via signal delete_event), terminates the application.
*/
gint close_application( GtkWidget *widget,
GdkEvent *event,
gpointer data )
{
gtk_main_quit ();
return FALSE;
}
/* is invoked when the button is clicked. It just prints a message.
*/
void button_clicked( GtkWidget *widget,
gpointer data ) {
g_print ("button clicked\n");
}
int main( int argc,
char *argv[] )
{
/* GtkWidget is the storage type for widgets */
GtkWidget *window, *pixmapwid, *button;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
/* create the main window, and attach delete_event signal to terminating
the application */
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "delete-event",
G_CALLBACK (close_application), NULL);
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
gtk_widget_show (window);
/* now for the pixmap from gdk */
style = gtk_widget_get_style (window);
pixmap = gdk_pixmap_create_from_xpm_d (window->window, &mask,
&style->bg[GTK_STATE_NORMAL],
(gchar **)xpm_data);
/* a pixmap widget to contain the pixmap */
pixmapwid = gtk_image_new_from_pixmap (pixmap, mask);
gtk_widget_show (pixmapwid);
/* a button to contain the pixmap widget */
button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_container_add (GTK_CONTAINER (window), button);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (button_clicked), NULL);
/* show the window */
gtk_main ();
return 0;
}
......@@ -87,7 +87,6 @@ gdk_public_h_sources = \
gdkkeysyms-compat.h \
gdkpango.h \
gdkpixbuf.h \
gdkpixmap.h \
gdkprivate.h \
gdkproperty.h \
gdkscreen.h \
......@@ -127,7 +126,6 @@ gdk_c_sources = \
gdkoffscreenwindow.c \
gdkpango.c \
gdkpixbuf-drawable.c \
gdkpixmap.c \
gdkrectangle.c \
gdkscreen.c \
gdkselection.c \
......@@ -209,7 +207,6 @@ x11_introspection_files = \
x11/gdkinput.c \
x11/gdkkeys-x11.c \
x11/gdkmain-x11.c \
x11/gdkpixmap-x11.c \
x11/gdkproperty-x11.c \
x11/gdkscreen-x11.c \
x11/gdkselection-x11.c \
......
......@@ -46,7 +46,6 @@
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkpango.h>
#include <gdk/gdkpixbuf.h>
#include <gdk/gdkpixmap.h>
#include <gdk/gdkproperty.h>
#include <gdk/gdkscreen.h>
#include <gdk/gdkselection.h>
......
......@@ -545,14 +545,6 @@ gdk_drawable_set_colormap
#endif
#endif
#if IN_HEADER(__GDK_PIXMAP_X11_H__)
#if IN_FILE(__GDK_PIXMAP_X11_C__)
#ifdef GDK_WINDOWING_X11
gdk_pixmap_impl_x11_get_type G_GNUC_CONST
#endif
#endif
#endif
#if IN_HEADER(__GDK_WINDOW_X11_H__)
#if IN_FILE(__GDK_WINDOW_X11_C__)
#ifdef GDK_WINDOWING_X11
......@@ -815,23 +807,6 @@ gdk_pixbuf_get_from_surface
#endif
#endif
#if IN_HEADER(__GDK_PIXMAP_H__)
#if IN_FILE(__GDK_PIXMAP_C__)
gdk_pixmap_get_type G_GNUC_CONST
gdk_pixmap_new
#endif
#endif
#if IN_HEADER(__GDK_PIXMAP_H__)
#if IN_FILE(__GDK_PIXMAP_X11_C__)
gdk_pixmap_foreign_new
gdk_pixmap_foreign_new_for_display
gdk_pixmap_foreign_new_for_screen
gdk_pixmap_lookup
gdk_pixmap_lookup_for_display
#endif
#endif
#if IN_HEADER(__GDK_SCREEN_H__)
#if IN_FILE(__GDK_SCREEN_C__)
gdk_screen_get_type G_GNUC_CONST
......@@ -1023,7 +998,6 @@ gdk_x11_display_error_trap_pop_ignored
gdk_x11_drawable_get_xdisplay
gdk_x11_drawable_get_xid
gdk_x11_window_get_drawable_impl
gdk_x11_pixmap_get_drawable_impl
#endif
#if IN_FILE(__GDK_MAIN_X11_C__)
......
......@@ -323,11 +323,6 @@ cairo_surface_t * _gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
* Interfaces used by windowing code *
*************************************/
GdkPixmap *_gdk_pixmap_new (GdkDrawable *drawable,
gint width,
gint height,
gint depth);
void _gdk_window_impl_new (GdkWindow *window,
GdkWindow *real_parent,
GdkScreen *screen,
......@@ -448,7 +443,6 @@ GType _gdk_paintable_get_type (void) G_GNUC_CONST;
/* Implementation types */
GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
struct GdkAppLaunchContextPrivate
{
......
......@@ -28,7 +28,6 @@
#include "gdkcolor.h"
#include "gdkwindow.h"
#include "gdkpixbuf.h"
#include "gdkpixmap.h"
#include "gdkinternals.h"
......@@ -53,14 +52,8 @@
*
* If the drawable @src has no colormap (gdk_drawable_get_colormap()
* returns %NULL), then a suitable colormap must be specified.
* Typically a #GdkWindow or a pixmap created by passing a #GdkWindow
* to gdk_pixmap_new() will already have a colormap associated with
* it. If the drawable has a colormap, the @cmap argument will be
* ignored. If the drawable is a bitmap (1 bit per pixel pixmap),
* then a colormap is not required; pixels with a value of 1 are
* assumed to be white, and pixels with a value of 0 are assumed to be
* black. For taking screenshots, gdk_colormap_get_system() returns
* the correct colormap to use.
* If the drawable has a colormap, the @cmap argument will be
* ignored.
*
* If the specified destination pixbuf @dest is %NULL, then this
* function will create an RGB pixbuf with 8 bits per channel and no
......@@ -70,12 +63,6 @@
* and it contains alpha information, then the filled pixels will be
* set to full opacity (alpha = 255).
*
* If the specified drawable is a pixmap, then the requested source
* rectangle must be completely contained within the pixmap, otherwise
* the function will return %NULL. For pixmaps only (not for windows)
* passing -1 for width or height is allowed to mean the full width
* or height of the pixmap.
*
* If the specified drawable is a window, and the window is off the
* screen, then there is no image data in the obscured/offscreen
* regions to be placed in the pixbuf. The contents of portions of the
......@@ -106,7 +93,6 @@ gdk_pixbuf_get_from_drawable (GdkPixbuf *dest,
int dest_x, int dest_y,
int width, int height)
{
int src_width, src_height;
cairo_surface_t *surface;
int depth;
......@@ -155,18 +141,6 @@ gdk_pixbuf_get_from_drawable (GdkPixbuf *dest,
/* Coordinate sanity checks */
if (GDK_IS_PIXMAP (src))
{
gdk_drawable_get_size (src, &src_width, &src_height);
if (width < 0)
width = src_width;
if (height < 0)
height = src_height;
g_return_val_if_fail (src_x >= 0 && src_y >= 0, NULL);
g_return_val_if_fail (src_x + width <= src_width && src_y + height <= src_height, NULL);
}
surface = _gdk_drawable_ref_cairo_surface (src);
dest = gdk_pixbuf_get_from_surface (dest,
surface,
......
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
#include "gdkpixmap.h"
#include "gdkinternals.h"
#include "gdkpixbuf.h"
#include "gdkscreen.h"
static void gdk_pixmap_real_get_size (GdkDrawable *drawable,
gint *width,
gint *height);
static cairo_surface_t *gdk_pixmap_ref_cairo_surface (GdkDrawable *drawable);
static cairo_surface_t *gdk_pixmap_create_cairo_surface (GdkDrawable *drawable,
int width,
int height);
static GdkVisual* gdk_pixmap_real_get_visual (GdkDrawable *drawable);
static gint gdk_pixmap_real_get_depth (GdkDrawable *drawable);
static void gdk_pixmap_real_set_colormap (GdkDrawable *drawable,
GdkColormap *cmap);
static GdkColormap* gdk_pixmap_real_get_colormap (GdkDrawable *drawable);
static GdkScreen* gdk_pixmap_real_get_screen (GdkDrawable *drawable);
static void gdk_pixmap_init (GdkPixmapObject *pixmap);
static void gdk_pixmap_class_init (GdkPixmapObjectClass *klass);
static void gdk_pixmap_finalize (GObject *object);
static gpointer parent_class = NULL;
GType
gdk_pixmap_get_type (void)
{
static GType object_type = 0;
if (!object_type)
object_type = g_type_register_static_simple (GDK_TYPE_DRAWABLE,
"GdkPixmap",
sizeof (GdkPixmapObjectClass),
(GClassInitFunc) gdk_pixmap_class_init,
sizeof (GdkPixmapObject),
(GInstanceInitFunc) gdk_pixmap_init,
0);
return object_type;
}
static void
gdk_pixmap_init (GdkPixmapObject *pixmap)
{
/* 0-initialization is good for all other fields. */
pixmap->impl = g_object_new (_gdk_pixmap_impl_get_type (), NULL);
}
static void
gdk_pixmap_class_init (GdkPixmapObjectClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_pixmap_finalize;
drawable_class->get_depth = gdk_pixmap_real_get_depth;
drawable_class->get_screen = gdk_pixmap_real_get_screen;
drawable_class->get_size = gdk_pixmap_real_get_size;
drawable_class->set_colormap = gdk_pixmap_real_set_colormap;
drawable_class->get_colormap = gdk_pixmap_real_get_colormap;
drawable_class->get_visual = gdk_pixmap_real_get_visual;
drawable_class->ref_cairo_surface = gdk_pixmap_ref_cairo_surface;
drawable_class->create_cairo_surface = gdk_pixmap_create_cairo_surface;
}
static void
gdk_pixmap_finalize (GObject *object)
{
GdkPixmapObject *obj = (GdkPixmapObject *) object;
g_object_unref (obj->impl);
obj->impl = NULL;
G_OBJECT_CLASS (parent_class)->finalize (object);
}
GdkPixmap *
gdk_pixmap_new (GdkDrawable *drawable,
gint width,
gint height,
gint depth)
{
GdkDrawable *source_drawable;
if (drawable)
source_drawable = _gdk_drawable_get_source_drawable (drawable);
else
source_drawable = NULL;
return _gdk_pixmap_new (source_drawable, width, height, depth);
}
static void
gdk_pixmap_real_get_size (GdkDrawable *drawable,
gint *width,
gint *height)
{
g_return_if_fail (GDK_IS_PIXMAP (drawable));
gdk_drawable_get_size (GDK_DRAWABLE (((GdkPixmapObject*)drawable)->impl),
width, height);
}
static GdkVisual*
gdk_pixmap_real_get_visual (GdkDrawable *drawable)
{
GdkColormap *colormap;
g_return_val_if_fail (GDK_IS_PIXMAP (drawable), NULL);
colormap = gdk_drawable_get_colormap (drawable);
return colormap ? gdk_colormap_get_visual (colormap) : NULL;
}
static gint
gdk_pixmap_real_get_depth (GdkDrawable *drawable)
{
gint depth;
g_return_val_if_fail (GDK_IS_PIXMAP (drawable), 0);
depth = GDK_PIXMAP_OBJECT (drawable)->depth;
return depth;
}
static void
gdk_pixmap_real_set_colormap (GdkDrawable *drawable,
GdkColormap *cmap)
{
g_return_if_fail (GDK_IS_PIXMAP (drawable));
gdk_drawable_set_colormap (((GdkPixmapObject*)drawable)->impl, cmap);
}
static GdkColormap*
gdk_pixmap_real_get_colormap (GdkDrawable *drawable)
{
g_return_val_if_fail (GDK_IS_PIXMAP (drawable), NULL);
return gdk_drawable_get_colormap (((GdkPixmapObject*)drawable)->impl);
}
static cairo_surface_t *
gdk_pixmap_ref_cairo_surface (GdkDrawable *drawable)
{
return _gdk_drawable_ref_cairo_surface (((GdkPixmapObject*)drawable)->impl);
}
static cairo_surface_t *
gdk_pixmap_create_cairo_surface (GdkDrawable *drawable,
int width,
int height)
{
return _gdk_drawable_create_cairo_surface (GDK_PIXMAP_OBJECT(drawable)->impl,
width, height);
}
static GdkScreen*
gdk_pixmap_real_get_screen (GdkDrawable *drawable)
{
return gdk_drawable_get_screen (GDK_PIXMAP_OBJECT (drawable)->impl);
}
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#ifndef __GDK_PIXMAP_H__
#define __GDK_PIXMAP_H__
#include <gdk/gdktypes.h>
#include <gdk/gdkdrawable.h>
G_BEGIN_DECLS
typedef struct _GdkPixmapObject GdkPixmapObject;
typedef struct _GdkPixmapObjectClass GdkPixmapObjectClass;
#define GDK_TYPE_PIXMAP (gdk_pixmap_get_type ())
#define GDK_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXMAP, GdkPixmap))
#define GDK_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXMAP, GdkPixmapObjectClass))
#define GDK_IS_PIXMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXMAP))
#define GDK_IS_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXMAP))
#define GDK_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXMAP, GdkPixmapObjectClass))
#define GDK_PIXMAP_OBJECT(object) ((GdkPixmapObject *) GDK_PIXMAP (object))
struct _GdkPixmapObject
{
GdkDrawable parent_instance;
GdkDrawable *GSEAL (impl); /* window-system-specific delegate object */
gint GSEAL (depth);
};
struct _GdkPixmapObjectClass
{
GdkDrawableClass parent_class;
};
GType gdk_pixmap_get_type (void) G_GNUC_CONST;
/* Pixmaps
*/
GdkPixmap* gdk_pixmap_new (GdkDrawable *drawable,
gint width,
gint height,
gint depth);
/* Functions to create/lookup pixmaps from their native equivalents
*/
#ifndef GDK_MULTIHEAD_SAFE
GdkPixmap* gdk_pixmap_foreign_new (GdkNativeWindow anid);
GdkPixmap* gdk_pixmap_lookup (GdkNativeWindow anid);
#endif /* GDK_MULTIHEAD_SAFE */
GdkPixmap* gdk_pixmap_foreign_new_for_display (GdkDisplay *display,
GdkNativeWindow anid);
GdkPixmap* gdk_pixmap_lookup_for_display (GdkDisplay *display,
GdkNativeWindow anid);
GdkPixmap* gdk_pixmap_foreign_new_for_screen (GdkScreen *screen,
GdkNativeWindow anid,
gint width,
gint height,
gint depth);
G_END_DECLS
#endif /* __GDK_PIXMAP_H__ */
......@@ -51,8 +51,8 @@
/**
* GDK_PARENT_RELATIVE:
*
* A special value for #GdkPixmap variables, indicating that the background
* pixmap for a window should be inherited from the parent window.
* A special value, indicating that the background
* for a window should be inherited from the parent window.
*/
#define GDK_PARENT_RELATIVE 1L
......@@ -95,16 +95,11 @@ typedef struct _GdkCursor GdkCursor;
typedef struct _GdkVisual GdkVisual;
typedef struct _GdkDrawable GdkDrawable;
typedef struct _GdkDrawable GdkBitmap;
typedef struct _GdkDrawable GdkPixmap;
/**
* GdkWindow:
*
* An opaque structure representing an onscreen drawable. Pointers to structures
* of type #GdkPixmap, #GdkBitmap, and #GdkWindow can often be used
* interchangeably. The type #GdkDrawable refers generically to any of these
* types.
* An opaque structure representing an onscreen drawable.
*/
typedef struct _GdkDrawable GdkWindow;
typedef struct _GdkDisplay GdkDisplay;
......
......@@ -84,7 +84,6 @@ gdk_OBJECTS = \
gdkpango.obj \
gdkpixbuf-drawable.obj \
gdkpixbuf-render.obj \
gdkpixmap.obj \
gdkrectangle.obj \
gdkscreen.obj \
gdkselection.obj \
......@@ -104,7 +103,6 @@ gdk_public_h_sources = \
gdkkeys.h \
gdkpango.h \
gdkpixbuf.h \
gdkpixmap.h \
gdkproperty.h \
gdkselection.h \
gdktypes.h \
......
......@@ -39,8 +39,6 @@ libgdk_quartz_la_SOURCES = \
gdkinputprivate.h \
gdkkeys-quartz.c \
gdkmain-quartz.c \
gdkpixmap-quartz.c \
gdkpixmap-quartz.h \
gdkprivate-quartz.h \
gdkproperty-quartz.c \
gdkquartz.h \
......
/* gdkpixmap-quartz.c
*
* Copyright (C) 2005 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "gdkpixmap.h"
#include "gdkprivate-quartz.h"
static gpointer parent_class;
static void
gdk_pixmap_impl_quartz_init (GdkPixmapImplQuartz *impl)
{
}
static void
gdk_pixmap_impl_quartz_get_size (GdkDrawable *drawable,
gint *width,
gint *height)
{
if (width)
*width = GDK_PIXMAP_IMPL_QUARTZ (drawable)->width;
if (height)
*height = GDK_PIXMAP_IMPL_QUARTZ (drawable)->height;
}
static CGContextRef
gdk_pixmap_impl_quartz_get_context (GdkDrawable *drawable,
gboolean antialias)
{
GdkPixmapImplQuartz *impl = GDK_PIXMAP_IMPL_QUARTZ (drawable);
CGContextRef cg_context;
size_t height;
cg_context = CGBitmapContextCreate (impl->data,
CGImageGetWidth (impl->image),
CGImageGetHeight (impl->image),
CGImageGetBitsPerComponent (impl->image),
CGImageGetBytesPerRow (impl->image),
CGImageGetColorSpace (impl->image),
CGImageGetBitmapInfo (impl->image));
CGContextSetAllowsAntialiasing (cg_context, antialias);
/* convert coordinates from core graphics to gtk+ */
height = CGImageGetHeight (impl->image);
CGContextTranslateCTM (cg_context, 0, height);
CGContextScaleCTM (cg_context, 1.0, -1.0);
return cg_context;
}
static void
gdk_pixmap_impl_quartz_finalize (GObject *object)
{
GdkPixmapImplQuartz *impl = GDK_PIXMAP_IMPL_QUARTZ (object);
CGImageRelease (impl->image);
_gdk_quartz_drawable_finish (GDK_DRAWABLE (impl));
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gdk_pixmap_impl_quartz_class_init (GdkPixmapImplQuartzClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
GdkDrawableImplQuartzClass *drawable_quartz_class = GDK_DRAWABLE_IMPL_QUARTZ_CLASS (klass);