Ardour  9.0-pre0-582-g084a23a80d
gdkdrawable.h
Go to the documentation of this file.
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
18  */
19 
20 /*
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/.
25  */
26 
27 #ifndef __GDK_DRAWABLE_H__
28 #define __GDK_DRAWABLE_H__
29 
30 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
31 #error "Only <gdk/gdk.h> can be included directly."
32 #endif
33 
34 #include <gdk/gdktypes.h>
35 #include <gdk/gdkgc.h>
36 #include <gdk/gdkrgb.h>
37 #include <gdk-pixbuf/gdk-pixbuf.h>
38 
39 #include <cairo.h>
40 
41 G_BEGIN_DECLS
42 
43 typedef struct _GdkDrawableClass GdkDrawableClass;
44 typedef struct _GdkTrapezoid GdkTrapezoid;
45 
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))
52 
54 {
55  GObject parent_instance;
56 };
57 
59 {
60  GObjectClass parent_class;
61 
62  GdkGC *(*create_gc) (GdkDrawable *drawable,
63  GdkGCValues *values,
64  GdkGCValuesMask mask);
65  void (*draw_rectangle) (GdkDrawable *drawable,
66  GdkGC *gc,
67  gboolean filled,
68  gint x,
69  gint y,
70  gint width,
71  gint height);
72  void (*draw_arc) (GdkDrawable *drawable,
73  GdkGC *gc,
74  gboolean filled,
75  gint x,
76  gint y,
77  gint width,
78  gint height,
79  gint angle1,
80  gint angle2);
81  void (*draw_polygon) (GdkDrawable *drawable,
82  GdkGC *gc,
83  gboolean filled,
84  GdkPoint *points,
85  gint npoints);
86  void (*draw_text) (GdkDrawable *drawable,
87  GdkFont *font,
88  GdkGC *gc,
89  gint x,
90  gint y,
91  const gchar *text,
92  gint text_length);
93  void (*draw_text_wc) (GdkDrawable *drawable,
94  GdkFont *font,
95  GdkGC *gc,
96  gint x,
97  gint y,
98  const GdkWChar *text,
99  gint text_length);
100  void (*draw_drawable) (GdkDrawable *drawable,
101  GdkGC *gc,
102  GdkDrawable *src,
103  gint xsrc,
104  gint ysrc,
105  gint xdest,
106  gint ydest,
107  gint width,
108  gint height);
109  void (*draw_points) (GdkDrawable *drawable,
110  GdkGC *gc,
111  GdkPoint *points,
112  gint npoints);
113  void (*draw_segments) (GdkDrawable *drawable,
114  GdkGC *gc,
115  GdkSegment *segs,
116  gint nsegs);
117  void (*draw_lines) (GdkDrawable *drawable,
118  GdkGC *gc,
119  GdkPoint *points,
120  gint npoints);
121 
122  void (*draw_glyphs) (GdkDrawable *drawable,
123  GdkGC *gc,
124  PangoFont *font,
125  gint x,
126  gint y,
127  PangoGlyphString *glyphs);
128 
129  void (*draw_image) (GdkDrawable *drawable,
130  GdkGC *gc,
131  GdkImage *image,
132  gint xsrc,
133  gint ysrc,
134  gint xdest,
135  gint ydest,
136  gint width,
137  gint height);
138 
139  gint (*get_depth) (GdkDrawable *drawable);
140  void (*get_size) (GdkDrawable *drawable,
141  gint *width,
142  gint *height);
143 
144  void (*set_colormap) (GdkDrawable *drawable,
145  GdkColormap *cmap);
146 
147  GdkColormap* (*get_colormap) (GdkDrawable *drawable);
148  GdkVisual* (*get_visual) (GdkDrawable *drawable);
149  GdkScreen* (*get_screen) (GdkDrawable *drawable);
150 
151  GdkImage* (*get_image) (GdkDrawable *drawable,
152  gint x,
153  gint y,
154  gint width,
155  gint height);
156 
157  GdkRegion* (*get_clip_region) (GdkDrawable *drawable);
158  GdkRegion* (*get_visible_region) (GdkDrawable *drawable);
159 
160  GdkDrawable* (*get_composite_drawable) (GdkDrawable *drawable,
161  gint x,
162  gint y,
163  gint width,
164  gint height,
165  gint *composite_x_offset,
166  gint *composite_y_offset);
167 
168  void (*draw_pixbuf) (GdkDrawable *drawable,
169  GdkGC *gc,
170  GdkPixbuf *pixbuf,
171  gint src_x,
172  gint src_y,
173  gint dest_x,
174  gint dest_y,
175  gint width,
176  gint height,
177  GdkRgbDither dither,
178  gint x_dither,
179  gint y_dither);
180  GdkImage* (*_copy_to_image) (GdkDrawable *drawable,
181  GdkImage *image,
182  gint src_x,
183  gint src_y,
184  gint dest_x,
185  gint dest_y,
186  gint width,
187  gint height);
188 
190  GdkGC *gc,
191  PangoMatrix *matrix,
192  PangoFont *font,
193  gint x,
194  gint y,
195  PangoGlyphString *glyphs);
196  void (*draw_trapezoids) (GdkDrawable *drawable,
197  GdkGC *gc,
198  GdkTrapezoid *trapezoids,
199  gint n_trapezoids);
200 
201  cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable);
202 
203  GdkDrawable *(*get_source_drawable) (GdkDrawable *drawable);
204 
205  void (*set_cairo_clip) (GdkDrawable *drawable,
206  cairo_t *cr);
207 
208  cairo_surface_t * (*create_cairo_surface) (GdkDrawable *drawable,
209  int width,
210  int height);
211 
213  GdkGC *gc,
214  GdkDrawable *src,
215  gint xsrc,
216  gint ysrc,
217  gint xdest,
218  gint ydest,
219  gint width,
220  gint height,
221  GdkDrawable *original_src);
222 
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);
232 };
233 
235 {
236  double y1, x11, x21, y2, x12, x22;
237 };
238 
239 GType gdk_drawable_get_type (void) G_GNUC_CONST;
240 
241 /* Manipulation of drawables
242  */
243 
244 #ifndef GDK_DISABLE_DEPRECATED
246  const gchar *key,
247  gpointer data,
248  GDestroyNotify destroy_func);
249 gpointer gdk_drawable_get_data (GdkDrawable *drawable,
250  const gchar *key);
251 #endif /* GDK_DISABLE_DEPRECATED */
252 
254  GdkColormap *colormap);
257 
258 #if !defined (GDK_DISABLE_DEPRECATED)
260  gint *width,
261  gint *height);
265 #endif /* GDK_DISABLE_DEPRECATED */
266 
267 #ifndef GDK_DISABLE_DEPRECATED
270 #endif /* GDK_DISABLE_DEPRECATED */
271 
272 /* Drawing
273  */
274 #ifndef GDK_DISABLE_DEPRECATED
275 void gdk_draw_point (GdkDrawable *drawable,
276  GdkGC *gc,
277  gint x,
278  gint y);
279 void gdk_draw_line (GdkDrawable *drawable,
280  GdkGC *gc,
281  gint x1_,
282  gint y1_,
283  gint x2_,
284  gint y2_);
286  GdkGC *gc,
287  gboolean filled,
288  gint x,
289  gint y,
290  gint width,
291  gint height);
292 void gdk_draw_arc (GdkDrawable *drawable,
293  GdkGC *gc,
294  gboolean filled,
295  gint x,
296  gint y,
297  gint width,
298  gint height,
299  gint angle1,
300  gint angle2);
302  GdkGC *gc,
303  gboolean filled,
304  const GdkPoint *points,
305  gint n_points);
306 void gdk_draw_string (GdkDrawable *drawable,
307  GdkFont *font,
308  GdkGC *gc,
309  gint x,
310  gint y,
311  const gchar *string);
312 void gdk_draw_text (GdkDrawable *drawable,
313  GdkFont *font,
314  GdkGC *gc,
315  gint x,
316  gint y,
317  const gchar *text,
318  gint text_length);
320  GdkFont *font,
321  GdkGC *gc,
322  gint x,
323  gint y,
324  const GdkWChar *text,
325  gint text_length);
327  GdkGC *gc,
328  GdkDrawable *src,
329  gint xsrc,
330  gint ysrc,
331  gint xdest,
332  gint ydest,
333  gint width,
334  gint height);
335 void gdk_draw_image (GdkDrawable *drawable,
336  GdkGC *gc,
337  GdkImage *image,
338  gint xsrc,
339  gint ysrc,
340  gint xdest,
341  gint ydest,
342  gint width,
343  gint height);
344 void gdk_draw_points (GdkDrawable *drawable,
345  GdkGC *gc,
346  const GdkPoint *points,
347  gint n_points);
349  GdkGC *gc,
350  const GdkSegment *segs,
351  gint n_segs);
352 void gdk_draw_lines (GdkDrawable *drawable,
353  GdkGC *gc,
354  const GdkPoint *points,
355  gint n_points);
356 void gdk_draw_pixbuf (GdkDrawable *drawable,
357  GdkGC *gc,
358  const GdkPixbuf *pixbuf,
359  gint src_x,
360  gint src_y,
361  gint dest_x,
362  gint dest_y,
363  gint width,
364  gint height,
365  GdkRgbDither dither,
366  gint x_dither,
367  gint y_dither);
368 
369 void gdk_draw_glyphs (GdkDrawable *drawable,
370  GdkGC *gc,
371  PangoFont *font,
372  gint x,
373  gint y,
374  PangoGlyphString *glyphs);
376  GdkGC *gc,
377  gint x,
378  gint y,
379  PangoLayoutLine *line);
380 void gdk_draw_layout (GdkDrawable *drawable,
381  GdkGC *gc,
382  gint x,
383  gint y,
384  PangoLayout *layout);
385 
387  GdkGC *gc,
388  gint x,
389  gint y,
390  PangoLayoutLine *line,
391  const GdkColor *foreground,
392  const GdkColor *background);
394  GdkGC *gc,
395  gint x,
396  gint y,
397  PangoLayout *layout,
398  const GdkColor *foreground,
399  const GdkColor *background);
400 
402  GdkGC *gc,
403  const PangoMatrix *matrix,
404  PangoFont *font,
405  gint x,
406  gint y,
407  PangoGlyphString *glyphs);
409  GdkGC *gc,
410  const GdkTrapezoid *trapezoids,
411  gint n_trapezoids);
412 
413 #define gdk_draw_pixmap gdk_draw_drawable
414 #define gdk_draw_bitmap gdk_draw_drawable
415 
417  gint x,
418  gint y,
419  gint width,
420  gint height);
422  GdkImage *image,
423  gint src_x,
424  gint src_y,
425  gint dest_x,
426  gint dest_y,
427  gint width,
428  gint height);
429 #endif /* GDK_DISABLE_DEPRECATED */
430 
433 
434 G_END_DECLS
435 
436 #endif /* __GDK_DRAWABLE_H__ */
void gdk_draw_line(GdkDrawable *drawable, GdkGC *gc, gint x1_, gint y1_, gint x2_, gint y2_)
void gdk_draw_pixbuf(GdkDrawable *drawable, GdkGC *gc, const GdkPixbuf *pixbuf, gint src_x, gint src_y, gint dest_x, gint dest_y, gint width, gint height, GdkRgbDither dither, gint x_dither, gint y_dither)
void gdk_draw_point(GdkDrawable *drawable, GdkGC *gc, gint x, gint y)
void gdk_draw_arc(GdkDrawable *drawable, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2)
void gdk_drawable_unref(GdkDrawable *drawable)
void gdk_drawable_set_data(GdkDrawable *drawable, const gchar *key, gpointer data, GDestroyNotify destroy_func)
void gdk_draw_image(GdkDrawable *drawable, GdkGC *gc, GdkImage *image, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height)
GdkVisual * gdk_drawable_get_visual(GdkDrawable *drawable)
void gdk_draw_glyphs(GdkDrawable *drawable, GdkGC *gc, PangoFont *font, gint x, gint y, PangoGlyphString *glyphs)
void gdk_draw_trapezoids(GdkDrawable *drawable, GdkGC *gc, const GdkTrapezoid *trapezoids, gint n_trapezoids)
void gdk_draw_string(GdkDrawable *drawable, GdkFont *font, GdkGC *gc, gint x, gint y, const gchar *string)
void gdk_draw_layout_line_with_colors(GdkDrawable *drawable, GdkGC *gc, gint x, gint y, PangoLayoutLine *line, const GdkColor *foreground, const GdkColor *background)
void gdk_draw_layout(GdkDrawable *drawable, GdkGC *gc, gint x, gint y, PangoLayout *layout)
GdkImage * gdk_drawable_get_image(GdkDrawable *drawable, gint x, gint y, gint width, gint height)
GdkDisplay * gdk_drawable_get_display(GdkDrawable *drawable)
void gdk_draw_segments(GdkDrawable *drawable, GdkGC *gc, const GdkSegment *segs, gint n_segs)
GdkScreen * gdk_drawable_get_screen(GdkDrawable *drawable)
gint gdk_drawable_get_depth(GdkDrawable *drawable)
GdkDrawable * gdk_drawable_ref(GdkDrawable *drawable)
void gdk_draw_rectangle(GdkDrawable *drawable, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height)
GdkRegion * gdk_drawable_get_visible_region(GdkDrawable *drawable)
gpointer gdk_drawable_get_data(GdkDrawable *drawable, const gchar *key)
void gdk_draw_drawable(GdkDrawable *drawable, GdkGC *gc, GdkDrawable *src, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height)
GdkRegion * gdk_drawable_get_clip_region(GdkDrawable *drawable)
void gdk_draw_lines(GdkDrawable *drawable, GdkGC *gc, const GdkPoint *points, gint n_points)
void gdk_draw_layout_with_colors(GdkDrawable *drawable, GdkGC *gc, gint x, gint y, PangoLayout *layout, const GdkColor *foreground, const GdkColor *background)
GType gdk_drawable_get_type(void) G_GNUC_CONST
void gdk_draw_glyphs_transformed(GdkDrawable *drawable, GdkGC *gc, const PangoMatrix *matrix, PangoFont *font, gint x, gint y, PangoGlyphString *glyphs)
GdkColormap * gdk_drawable_get_colormap(GdkDrawable *drawable)
void gdk_draw_layout_line(GdkDrawable *drawable, GdkGC *gc, gint x, gint y, PangoLayoutLine *line)
typedefG_BEGIN_DECLS struct _GdkDrawableClass GdkDrawableClass
Definition: gdkdrawable.h:43
void gdk_draw_text_wc(GdkDrawable *drawable, GdkFont *font, GdkGC *gc, gint x, gint y, const GdkWChar *text, gint text_length)
void gdk_draw_polygon(GdkDrawable *drawable, GdkGC *gc, gboolean filled, const GdkPoint *points, gint n_points)
void gdk_draw_text(GdkDrawable *drawable, GdkFont *font, GdkGC *gc, gint x, gint y, const gchar *text, gint text_length)
void gdk_drawable_get_size(GdkDrawable *drawable, gint *width, gint *height)
GdkImage * gdk_drawable_copy_to_image(GdkDrawable *drawable, GdkImage *image, gint src_x, gint src_y, gint dest_x, gint dest_y, gint width, gint height)
void gdk_draw_points(GdkDrawable *drawable, GdkGC *gc, const GdkPoint *points, gint n_points)
void gdk_drawable_set_colormap(GdkDrawable *drawable, GdkColormap *colormap)
typedefG_BEGIN_DECLS struct _GdkGCValues GdkGCValues
Definition: gdkgc.h:39
GdkGCValuesMask
Definition: gdkgc.h:139
GdkRgbDither
Definition: gdkrgb.h:41
typedefG_BEGIN_DECLS struct _GdkPoint GdkPoint
Definition: gdktypes.h:68
guint32 GdkWChar
Definition: gdktypes.h:78
GtkImageImageData image
Definition: gtkimage.h:1
GtkImagePixbufData pixbuf
Definition: gtkimage.h:2
void(* _gdk_reserved14)(void)
Definition: gdkdrawable.h:230
void(* get_size)(GdkDrawable *drawable, gint *width, gint *height)
Definition: gdkdrawable.h:140
void(* set_colormap)(GdkDrawable *drawable, GdkColormap *cmap)
Definition: gdkdrawable.h:144
void(* _gdk_reserved7)(void)
Definition: gdkdrawable.h:224
void(* draw_points)(GdkDrawable *drawable, GdkGC *gc, GdkPoint *points, gint npoints)
Definition: gdkdrawable.h:109
void(* _gdk_reserved9)(void)
Definition: gdkdrawable.h:225
void(* draw_rectangle)(GdkDrawable *drawable, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height)
Definition: gdkdrawable.h:65
void(* _gdk_reserved15)(void)
Definition: gdkdrawable.h:231
void(* _gdk_reserved13)(void)
Definition: gdkdrawable.h:229
void(* draw_segments)(GdkDrawable *drawable, GdkGC *gc, GdkSegment *segs, gint nsegs)
Definition: gdkdrawable.h:113
void(* draw_drawable_with_src)(GdkDrawable *drawable, GdkGC *gc, GdkDrawable *src, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height, GdkDrawable *original_src)
Definition: gdkdrawable.h:212
void(* draw_text)(GdkDrawable *drawable, GdkFont *font, GdkGC *gc, gint x, gint y, const gchar *text, gint text_length)
Definition: gdkdrawable.h:86
GObjectClass parent_class
Definition: gdkdrawable.h:60
void(* draw_drawable)(GdkDrawable *drawable, GdkGC *gc, GdkDrawable *src, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height)
Definition: gdkdrawable.h:100
void(* set_cairo_clip)(GdkDrawable *drawable, cairo_t *cr)
Definition: gdkdrawable.h:205
void(* draw_trapezoids)(GdkDrawable *drawable, GdkGC *gc, GdkTrapezoid *trapezoids, gint n_trapezoids)
Definition: gdkdrawable.h:196
void(* draw_text_wc)(GdkDrawable *drawable, GdkFont *font, GdkGC *gc, gint x, gint y, const GdkWChar *text, gint text_length)
Definition: gdkdrawable.h:93
void(* draw_polygon)(GdkDrawable *drawable, GdkGC *gc, gboolean filled, GdkPoint *points, gint npoints)
Definition: gdkdrawable.h:81
void(* _gdk_reserved11)(void)
Definition: gdkdrawable.h:227
void(* draw_glyphs_transformed)(GdkDrawable *drawable, GdkGC *gc, PangoMatrix *matrix, PangoFont *font, gint x, gint y, PangoGlyphString *glyphs)
Definition: gdkdrawable.h:189
void(* draw_pixbuf)(GdkDrawable *drawable, GdkGC *gc, GdkPixbuf *pixbuf, gint src_x, gint src_y, gint dest_x, gint dest_y, gint width, gint height, GdkRgbDither dither, gint x_dither, gint y_dither)
Definition: gdkdrawable.h:168
gint(* get_depth)(GdkDrawable *drawable)
Definition: gdkdrawable.h:139
void(* _gdk_reserved10)(void)
Definition: gdkdrawable.h:226
void(* draw_lines)(GdkDrawable *drawable, GdkGC *gc, GdkPoint *points, gint npoints)
Definition: gdkdrawable.h:117
void(* _gdk_reserved12)(void)
Definition: gdkdrawable.h:228
void(* draw_arc)(GdkDrawable *drawable, GdkGC *gc, gboolean filled, gint x, gint y, gint width, gint height, gint angle1, gint angle2)
Definition: gdkdrawable.h:72
void(* draw_glyphs)(GdkDrawable *drawable, GdkGC *gc, PangoFont *font, gint x, gint y, PangoGlyphString *glyphs)
Definition: gdkdrawable.h:122
void(* draw_image)(GdkDrawable *drawable, GdkGC *gc, GdkImage *image, gint xsrc, gint ysrc, gint xdest, gint ydest, gint width, gint height)
Definition: gdkdrawable.h:129
GObject parent_instance
Definition: gdkdrawable.h:55
Definition: gdkgc.h:190
gint height
Definition: xcursors.h:1
gint width
Definition: xcursors.h:1