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/.
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
31 #ifndef __GDK_DRAWABLE_H__
32 #define __GDK_DRAWABLE_H__
34 #include <gdk/gdktypes.h>
35 #include <gdk/gdkgc.h>
36 #include <gdk/gdkrgb.h>
37 #include <gdk-pixbuf/gdk-pixbuf.h>
43 typedef struct _GdkDrawableClass GdkDrawableClass;
44 typedef struct _GdkTrapezoid GdkTrapezoid;
46 #define GDK_TYPE_DRAWABLE (gdk_drawable_get_type ())
47 #define GDK_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAWABLE, GdkDrawable))
48 #define GDK_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAWABLE, GdkDrawableClass))
49 #define GDK_IS_DRAWABLE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAWABLE))
50 #define GDK_IS_DRAWABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAWABLE))
51 #define GDK_DRAWABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAWABLE, GdkDrawableClass))
55 GObject parent_instance;
58 struct _GdkDrawableClass
60 GObjectClass parent_class;
62 GdkGC *(*create_gc) (GdkDrawable *drawable,
64 GdkGCValuesMask mask);
65 void (*draw_rectangle) (GdkDrawable *drawable,
72 void (*draw_arc) (GdkDrawable *drawable,
81 void (*draw_polygon) (GdkDrawable *drawable,
86 void (*draw_text) (GdkDrawable *drawable,
93 void (*draw_text_wc) (GdkDrawable *drawable,
100 void (*draw_drawable) (GdkDrawable *drawable,
109 void (*draw_points) (GdkDrawable *drawable,
113 void (*draw_segments) (GdkDrawable *drawable,
117 void (*draw_lines) (GdkDrawable *drawable,
122 void (*draw_glyphs) (GdkDrawable *drawable,
127 PangoGlyphString *glyphs);
129 void (*draw_image) (GdkDrawable *drawable,
139 gint (*get_depth) (GdkDrawable *drawable);
140 void (*get_size) (GdkDrawable *drawable,
144 void (*set_colormap) (GdkDrawable *drawable,
147 GdkColormap* (*get_colormap) (GdkDrawable *drawable);
148 GdkVisual* (*get_visual) (GdkDrawable *drawable);
149 GdkScreen* (*get_screen) (GdkDrawable *drawable);
151 GdkImage* (*get_image) (GdkDrawable *drawable,
157 GdkRegion* (*get_clip_region) (GdkDrawable *drawable);
158 GdkRegion* (*get_visible_region) (GdkDrawable *drawable);
160 GdkDrawable* (*get_composite_drawable) (GdkDrawable *drawable,
165 gint *composite_x_offset,
166 gint *composite_y_offset);
168 void (*draw_pixbuf) (GdkDrawable *drawable,
180 GdkImage* (*_copy_to_image) (GdkDrawable *drawable,
189 void (*draw_glyphs_transformed) (GdkDrawable *drawable,
195 PangoGlyphString *glyphs);
196 void (*draw_trapezoids) (GdkDrawable *drawable,
198 GdkTrapezoid *trapezoids,
201 cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable);
203 GdkDrawable *(*get_source_drawable) (GdkDrawable *drawable);
205 void (*set_cairo_clip) (GdkDrawable *drawable,
208 cairo_surface_t * (*create_cairo_surface) (GdkDrawable *drawable,
212 /* Padding for future expansion */
213 void (*_gdk_reserved7) (void);
214 void (*_gdk_reserved9) (void);
215 void (*_gdk_reserved10) (void);
216 void (*_gdk_reserved11) (void);
217 void (*_gdk_reserved12) (void);
218 void (*_gdk_reserved13) (void);
219 void (*_gdk_reserved14) (void);
220 void (*_gdk_reserved15) (void);
221 void (*_gdk_reserved16) (void);
226 double y1, x11, x21, y2, x12, x22;
229 GType gdk_drawable_get_type (void) G_GNUC_CONST;
231 /* Manipulation of drawables
234 #ifndef GDK_DISABLE_DEPRECATED
235 void gdk_drawable_set_data (GdkDrawable *drawable,
238 GDestroyNotify destroy_func);
239 gpointer gdk_drawable_get_data (GdkDrawable *drawable,
241 #endif /* GDK_DISABLE_DEPRECATED */
243 void gdk_drawable_get_size (GdkDrawable *drawable,
246 void gdk_drawable_set_colormap (GdkDrawable *drawable,
247 GdkColormap *colormap);
248 GdkColormap* gdk_drawable_get_colormap (GdkDrawable *drawable);
249 GdkVisual* gdk_drawable_get_visual (GdkDrawable *drawable);
250 gint gdk_drawable_get_depth (GdkDrawable *drawable);
251 GdkScreen* gdk_drawable_get_screen (GdkDrawable *drawable);
252 GdkDisplay* gdk_drawable_get_display (GdkDrawable *drawable);
254 #ifndef GDK_DISABLE_DEPRECATED
255 GdkDrawable* gdk_drawable_ref (GdkDrawable *drawable);
256 void gdk_drawable_unref (GdkDrawable *drawable);
257 #endif /* GDK_DISABLE_DEPRECATED */
261 void gdk_draw_point (GdkDrawable *drawable,
265 void gdk_draw_line (GdkDrawable *drawable,
271 void gdk_draw_rectangle (GdkDrawable *drawable,
278 void gdk_draw_arc (GdkDrawable *drawable,
287 void gdk_draw_polygon (GdkDrawable *drawable,
290 const GdkPoint *points,
292 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
293 /* Used by gtk_default_draw_string () */
294 void gdk_draw_string (GdkDrawable *drawable,
299 const gchar *string);
300 #endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
301 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
302 /* Used by gdk_pixmap_draw_text (), gdk_window_draw_text() */
303 void gdk_draw_text (GdkDrawable *drawable,
310 /* Used by gdk_pixmap_draw_text_wc (), gdk_window_draw_text_wc () */
311 void gdk_draw_text_wc (GdkDrawable *drawable,
316 const GdkWChar *text,
318 #endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
319 void gdk_draw_drawable (GdkDrawable *drawable,
328 void gdk_draw_image (GdkDrawable *drawable,
337 void gdk_draw_points (GdkDrawable *drawable,
339 const GdkPoint *points,
341 void gdk_draw_segments (GdkDrawable *drawable,
343 const GdkSegment *segs,
345 void gdk_draw_lines (GdkDrawable *drawable,
347 const GdkPoint *points,
349 void gdk_draw_pixbuf (GdkDrawable *drawable,
351 const GdkPixbuf *pixbuf,
362 void gdk_draw_glyphs (GdkDrawable *drawable,
367 PangoGlyphString *glyphs);
368 void gdk_draw_layout_line (GdkDrawable *drawable,
372 PangoLayoutLine *line);
373 void gdk_draw_layout (GdkDrawable *drawable,
377 PangoLayout *layout);
379 void gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
383 PangoLayoutLine *line,
384 const GdkColor *foreground,
385 const GdkColor *background);
386 void gdk_draw_layout_with_colors (GdkDrawable *drawable,
391 const GdkColor *foreground,
392 const GdkColor *background);
394 void gdk_draw_glyphs_transformed (GdkDrawable *drawable,
396 const PangoMatrix *matrix,
400 PangoGlyphString *glyphs);
401 void gdk_draw_trapezoids (GdkDrawable *drawable,
403 const GdkTrapezoid *trapezoids,
406 #ifndef GDK_DISABLE_DEPRECATED
407 #define gdk_draw_pixmap gdk_draw_drawable
408 #define gdk_draw_bitmap gdk_draw_drawable
409 #endif /* GDK_DISABLE_DEPRECATED */
411 GdkImage* gdk_drawable_get_image (GdkDrawable *drawable,
416 GdkImage *gdk_drawable_copy_to_image (GdkDrawable *drawable,
425 GdkRegion *gdk_drawable_get_clip_region (GdkDrawable *drawable);
426 GdkRegion *gdk_drawable_get_visible_region (GdkDrawable *drawable);
430 #endif /* __GDK_DRAWABLE_H__ */