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 (__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 void (*draw_drawable_with_src) (GdkDrawable *drawable,
221 GdkDrawable *original_src);
223 /* Padding for future expansion */
224 void (*_gdk_reserved7) (void);
225 void (*_gdk_reserved9) (void);
226 void (*_gdk_reserved10) (void);
227 void (*_gdk_reserved11) (void);
228 void (*_gdk_reserved12) (void);
229 void (*_gdk_reserved13) (void);
230 void (*_gdk_reserved14) (void);
231 void (*_gdk_reserved15) (void);
236 double y1, x11, x21, y2, x12, x22;
239 GType gdk_drawable_get_type (void) G_GNUC_CONST;
241 /* Manipulation of drawables
244 #ifndef GDK_DISABLE_DEPRECATED
245 void gdk_drawable_set_data (GdkDrawable *drawable,
248 GDestroyNotify destroy_func);
249 gpointer gdk_drawable_get_data (GdkDrawable *drawable,
251 #endif /* GDK_DISABLE_DEPRECATED */
253 void gdk_drawable_get_size (GdkDrawable *drawable,
256 void gdk_drawable_set_colormap (GdkDrawable *drawable,
257 GdkColormap *colormap);
258 GdkColormap* gdk_drawable_get_colormap (GdkDrawable *drawable);
259 GdkVisual* gdk_drawable_get_visual (GdkDrawable *drawable);
260 gint gdk_drawable_get_depth (GdkDrawable *drawable);
261 GdkScreen* gdk_drawable_get_screen (GdkDrawable *drawable);
262 GdkDisplay* gdk_drawable_get_display (GdkDrawable *drawable);
264 #ifndef GDK_DISABLE_DEPRECATED
265 GdkDrawable* gdk_drawable_ref (GdkDrawable *drawable);
266 void gdk_drawable_unref (GdkDrawable *drawable);
267 #endif /* GDK_DISABLE_DEPRECATED */
271 void gdk_draw_point (GdkDrawable *drawable,
275 void gdk_draw_line (GdkDrawable *drawable,
281 void gdk_draw_rectangle (GdkDrawable *drawable,
288 void gdk_draw_arc (GdkDrawable *drawable,
297 void gdk_draw_polygon (GdkDrawable *drawable,
300 const GdkPoint *points,
302 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
303 /* Used by gtk_default_draw_string () */
304 void gdk_draw_string (GdkDrawable *drawable,
309 const gchar *string);
310 #endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
311 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
312 /* Used by gdk_pixmap_draw_text (), gdk_window_draw_text() */
313 void gdk_draw_text (GdkDrawable *drawable,
320 /* Used by gdk_pixmap_draw_text_wc (), gdk_window_draw_text_wc () */
321 void gdk_draw_text_wc (GdkDrawable *drawable,
326 const GdkWChar *text,
328 #endif /* !GDK_DISABLE_DEPRECATED || GDK_COMPILATION */
329 void gdk_draw_drawable (GdkDrawable *drawable,
338 void gdk_draw_image (GdkDrawable *drawable,
347 void gdk_draw_points (GdkDrawable *drawable,
349 const GdkPoint *points,
351 void gdk_draw_segments (GdkDrawable *drawable,
353 const GdkSegment *segs,
355 void gdk_draw_lines (GdkDrawable *drawable,
357 const GdkPoint *points,
359 void gdk_draw_pixbuf (GdkDrawable *drawable,
361 const GdkPixbuf *pixbuf,
372 void gdk_draw_glyphs (GdkDrawable *drawable,
377 PangoGlyphString *glyphs);
378 void gdk_draw_layout_line (GdkDrawable *drawable,
382 PangoLayoutLine *line);
383 void gdk_draw_layout (GdkDrawable *drawable,
387 PangoLayout *layout);
389 void gdk_draw_layout_line_with_colors (GdkDrawable *drawable,
393 PangoLayoutLine *line,
394 const GdkColor *foreground,
395 const GdkColor *background);
396 void gdk_draw_layout_with_colors (GdkDrawable *drawable,
401 const GdkColor *foreground,
402 const GdkColor *background);
404 void gdk_draw_glyphs_transformed (GdkDrawable *drawable,
406 const PangoMatrix *matrix,
410 PangoGlyphString *glyphs);
411 void gdk_draw_trapezoids (GdkDrawable *drawable,
413 const GdkTrapezoid *trapezoids,
416 #ifndef GDK_DISABLE_DEPRECATED
417 #define gdk_draw_pixmap gdk_draw_drawable
418 #define gdk_draw_bitmap gdk_draw_drawable
419 #endif /* GDK_DISABLE_DEPRECATED */
421 GdkImage* gdk_drawable_get_image (GdkDrawable *drawable,
426 GdkImage *gdk_drawable_copy_to_image (GdkDrawable *drawable,
435 GdkRegion *gdk_drawable_get_clip_region (GdkDrawable *drawable);
436 GdkRegion *gdk_drawable_get_visible_region (GdkDrawable *drawable);
440 #endif /* __GDK_DRAWABLE_H__ */