1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
29 #include <pango/pangocairo.h>
30 #include <gdk-pixbuf/gdk-pixbuf.h>
32 #include "gdkdrawable.h"
33 #include "gdkinternals.h"
34 #include "gdkwindow.h"
35 #include "gdkscreen.h"
36 #include "gdkpixbuf.h"
39 G_DEFINE_ABSTRACT_TYPE (GdkDrawable, gdk_drawable, G_TYPE_OBJECT)
42 gdk_drawable_class_init (GdkDrawableClass *klass)
47 gdk_drawable_init (GdkDrawable *drawable)
52 * gdk_drawable_get_clip_region:
53 * @drawable: a #GdkDrawable
55 * Computes the region of a drawable that potentially can be written
56 * to by drawing primitives. This region will not take into account
57 * the clip region for the GC, and may also not take into account
58 * other factors such as if the window is obscured by other windows,
59 * but no area outside of this region will be affected by drawing
62 * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
66 gdk_drawable_get_clip_region (GdkDrawable *drawable)
68 g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
70 return GDK_DRAWABLE_GET_CLASS (drawable)->get_clip_region (drawable);
74 * gdk_drawable_get_visible_region:
75 * @drawable: a #GdkDrawable
77 * Computes the region of a drawable that is potentially visible.
78 * This does not necessarily take into account if the window is
79 * obscured by other windows, but no area outside of this region
82 * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
86 gdk_drawable_get_visible_region (GdkDrawable *drawable)
88 g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
90 return GDK_DRAWABLE_GET_CLASS (drawable)->get_visible_region (drawable);
94 * _gdk_drawable_ref_cairo_surface:
95 * @drawable: a #GdkDrawable
97 * Obtains a #cairo_surface_t for the given drawable. If a
98 * #cairo_surface_t for the drawable already exists, it will be
99 * referenced, otherwise a new surface will be created.
101 * Return value: a newly referenced #cairo_surface_t that points
102 * to @drawable. Unref with cairo_surface_destroy()
105 _gdk_drawable_ref_cairo_surface (GdkDrawable *drawable)
107 g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
109 return GDK_DRAWABLE_GET_CLASS (drawable)->ref_cairo_surface (drawable);
112 /************************************************************************/
115 _gdk_drawable_create_cairo_surface (GdkDrawable *drawable,
119 return GDK_DRAWABLE_GET_CLASS (drawable)->create_cairo_surface (drawable,