Update for cairo-xlib API change.

2005-05-13  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkdrawable-x11.c: Update for cairo-xlib API change.

        * gdk/x11/gdkpixmap-x11.[ch] gdk/gdk.symbols: Export
        gdk_pixmap_impl_x11_get_type(), needed in gdkdrawable-x11.c.
This commit is contained in:
Owen Taylor 2005-05-14 01:04:15 +00:00 committed by Owen Taylor
parent be9cf0418f
commit c2bd238e88
7 changed files with 45 additions and 12 deletions

View File

@ -1,3 +1,10 @@
2005-05-13 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdrawable-x11.c: Update for cairo-xlib API change.
* gdk/x11/gdkpixmap-x11.[ch] gdk/gdk.symbols: Export
gdk_pixmap_impl_x11_get_type(), needed in gdkdrawable-x11.c.
2005-05-11 Owen Taylor <otaylor@redhat.com>
* tests/testgtk.c (on_alpha_window_expose): Fix to use

View File

@ -1,3 +1,10 @@
2005-05-13 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdrawable-x11.c: Update for cairo-xlib API change.
* gdk/x11/gdkpixmap-x11.[ch] gdk/gdk.symbols: Export
gdk_pixmap_impl_x11_get_type(), needed in gdkdrawable-x11.c.
2005-05-11 Owen Taylor <otaylor@redhat.com>
* tests/testgtk.c (on_alpha_window_expose): Fix to use

View File

@ -1,3 +1,10 @@
2005-05-13 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdrawable-x11.c: Update for cairo-xlib API change.
* gdk/x11/gdkpixmap-x11.[ch] gdk/gdk.symbols: Export
gdk_pixmap_impl_x11_get_type(), needed in gdkdrawable-x11.c.
2005-05-11 Owen Taylor <otaylor@redhat.com>
* tests/testgtk.c (on_alpha_window_expose): Fix to use

View File

@ -608,6 +608,14 @@ gdk_gc_get_screen
#endif
#endif
#if IN_HEADER(__GDK_PIXMAP_X11_H__)
#if IN_FILE(__GDK_PIXMAP_X11_C__)
#ifdef GDK_PIXMAPING_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

View File

@ -1453,18 +1453,14 @@ gdk_x11_ref_cairo_surface (GdkDrawable *drawable)
visual = gdk_drawable_get_visual (drawable);
if (GDK_IS_WINDOW (drawable))
impl->cairo_surface = cairo_xlib_surface_create_for_window_with_visual (GDK_SCREEN_XDISPLAY (impl->screen),
impl->xid,
GDK_VISUAL_XVISUAL (visual));
else if (visual)
impl->cairo_surface = cairo_xlib_surface_create_for_pixmap_with_visual (GDK_SCREEN_XDISPLAY (impl->screen),
impl->xid,
GDK_VISUAL_XVISUAL (visual));
if (visual)
impl->cairo_surface = cairo_xlib_surface_create_with_visual (GDK_SCREEN_XDISPLAY (impl->screen),
impl->xid,
GDK_VISUAL_XVISUAL (visual));
else if (gdk_drawable_get_depth (drawable) == 1)
impl->cairo_surface = cairo_xlib_surface_create_for_pixmap (GDK_SCREEN_XDISPLAY (impl->screen),
impl->xid,
CAIRO_FORMAT_A1);
impl->cairo_surface = cairo_xlib_surface_create (GDK_SCREEN_XDISPLAY (impl->screen),
impl->xid,
CAIRO_FORMAT_A1);
else
{
g_warning ("Using Cairo rendering requires the drawable argument to\n"
@ -1475,6 +1471,12 @@ gdk_x11_ref_cairo_surface (GdkDrawable *drawable)
return NULL;
}
if (GDK_IS_PIXMAP_IMPL_X11 (drawable))
{
GdkPixmapImplX11 *pix_impl = GDK_PIXMAP_IMPL_X11 (drawable);
cairo_xlib_surface_set_size (impl->cairo_surface, pix_impl->width, pix_impl->height);
}
cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
drawable, gdk_x11_cairo_surface_destroy);
}

View File

@ -66,7 +66,7 @@ static void gdk_pixmap_impl_x11_finalize (GObject *object);
static gpointer parent_class = NULL;
static GType
GType
gdk_pixmap_impl_x11_get_type (void)
{
static GType object_type = 0;

View File

@ -63,6 +63,8 @@ struct _GdkPixmapImplX11Class
};
GType gdk_pixmap_impl_x11_get_type (void);
#ifdef __cplusplus
}
#endif /* __cplusplus */