Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / gtkmm2 / gdk / gdkmm / drawable.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GDKMM_DRAWABLE_H
4 #define _GDKMM_DRAWABLE_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* Copyright (C) 1998-2002 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28 #include <gdk/gdkdrawable.h>
29 #include <gdk/gdkrgb.h>
30 #include <pangomm/font.h>
31 #include <pangomm/layout.h>
32 #include <pangomm/layoutline.h>
33 #include <pangomm/glyphstring.h>
34 #include <gdkmm/gc.h>
35 #include <gdkmm/image.h>
36 #include <gdkmm/color.h>
37 #include <gdkmm/region.h>
38 #include <gdkmm/rgbcmap.h>
39 #include <gdkmm/types.h>
40 #include <cairomm/context.h>
41 //#include <gdkmm/pixbuf.h>
42
43
44 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45 typedef struct _GdkDrawable GdkDrawable;
46 typedef struct _GdkDrawableClass GdkDrawableClass;
47 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
48
49
50 namespace Gdk
51 { class Drawable_Class; } // namespace Gdk
52 namespace Gdk
53 {
54
55
56 /** @addtogroup gdkmmEnums Enums and Flags */
57
58 /**
59  * @ingroup gdkmmEnums
60  */
61 enum RgbDither
62 {
63   RGB_DITHER_NONE,
64   RGB_DITHER_NORMAL,
65   RGB_DITHER_MAX
66 };
67
68 } // namespace Gdk
69
70
71 #ifndef DOXYGEN_SHOULD_SKIP_THIS
72 namespace Glib
73 {
74
75 template <>
76 class Value<Gdk::RgbDither> : public Glib::Value_Enum<Gdk::RgbDither>
77 {
78 public:
79   static GType value_type() G_GNUC_CONST;
80 };
81
82 } // namespace Glib
83 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
84
85
86 namespace Gdk
87 {
88
89
90 class GC;
91 class Pixbuf;
92
93 /** Drawing Primitives.
94  * Gdk::Drawable is the base class for all of the objects that accept drawing
95  * commands.  The available drawables include pixmaps, windows, and bitmaps.
96  * Drawable is abstract as there is no such type on the server side.
97  *
98  * To use a drawable, create a concrete Drawable of the type you wish to use
99  * and a Gdk::GC (graphics context) for that Drawable.  With the GC you can
100  * draw lines, text, arcs and such. 
101  *
102  * An alternative is to create a Cairo::Context with get_cairo_context()
103  * while you handle the 'exposed' event of the drawable. For more about
104  * this, please see "Using cairo with GTK+" in the "Common questions" section
105  * of the GTK+ Reference Manual.
106  */
107
108 class Drawable : public Glib::Object
109 {
110   
111 #ifndef DOXYGEN_SHOULD_SKIP_THIS
112
113 public:
114   typedef Drawable CppObjectType;
115   typedef Drawable_Class CppClassType;
116   typedef GdkDrawable BaseObjectType;
117   typedef GdkDrawableClass BaseClassType;
118
119 private:  friend class Drawable_Class;
120   static CppClassType drawable_class_;
121
122 private:
123   // noncopyable
124   Drawable(const Drawable&);
125   Drawable& operator=(const Drawable&);
126
127 protected:
128   explicit Drawable(const Glib::ConstructParams& construct_params);
129   explicit Drawable(GdkDrawable* castitem);
130
131 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
132
133 public:
134   virtual ~Drawable();
135
136 #ifndef DOXYGEN_SHOULD_SKIP_THIS
137   static GType get_type()      G_GNUC_CONST;
138   static GType get_base_type() G_GNUC_CONST;
139 #endif
140
141   ///Provides access to the underlying C GObject.
142   GdkDrawable*       gobj()       { return reinterpret_cast<GdkDrawable*>(gobject_); }
143
144   ///Provides access to the underlying C GObject.
145   const GdkDrawable* gobj() const { return reinterpret_cast<GdkDrawable*>(gobject_); }
146
147   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
148   GdkDrawable* gobj_copy();
149
150 private:
151
152   
153 protected:
154   Drawable();
155
156 public:
157   
158   static Glib::RefPtr<Drawable> create();
159
160
161   /** Fills * @a width  and * @a height  with the size of @a drawable .
162    *  @a width  or @a height  can be <tt>0</tt> if you only want the other one.
163    * 
164    * On the X11 platform, if @a drawable  is a Gdk::Window, the returned
165    * size is the size reported in the most-recently-processed configure
166    * event, rather than the current size on the X server.
167    * @param width Location to store drawable's width, or <tt>0</tt>.
168    * @param height Location to store drawable's height, or <tt>0</tt>.
169    */
170   void get_size(int& width, int& height);
171   
172   /** Obtains the bit depth of the drawable, that is, the number of bits
173    * that make up a pixel in the drawable's visual. Examples are 8 bits
174    * per pixel, 24 bits per pixel, etc.
175    * @return Number of bits per pixel.
176    */
177   int get_depth() const;
178
179   
180   /** Sets the colormap associated with @a drawable . Normally this will
181    * happen automatically when the drawable is created; you only need to
182    * use this function if the drawable-creating function did not have a
183    * way to determine the colormap, and you then use drawable operations
184    * that require a colormap. The colormap for all drawables and
185    * graphics contexts you intend to use together should match. i.e.
186    * when using a Gdk::GC to draw to a drawable, or copying one drawable
187    * to another, the colormaps should match.
188    * @param colormap A Gdk::Colormap.
189    */
190   void set_colormap(const Glib::RefPtr<Colormap>& colormap);
191   
192   /** Gets the colormap for @a drawable , if one is set; returns
193    * <tt>0</tt> otherwise.
194    * @return The colormap, or <tt>0</tt>.
195    */
196   Glib::RefPtr<Colormap> get_colormap();
197   
198   /** Gets the Gdk::Visual describing the pixel format of @a drawable .
199    * @return A Gdk::Visual.
200    */
201   Glib::RefPtr<Visual> get_visual();
202
203   
204   /** Draws a point, using the foreground color and other attributes of 
205    * the Gdk::GC.
206    * @param gc A Gdk::GC.
207    * @param x The x coordinate of the point.
208    * @param y The y coordinate of the point.
209    */
210   void draw_point(const Glib::RefPtr<const GC>& gc, int x, int y);
211   void draw_points(const Glib::RefPtr<const GC>& gc, const Glib::ArrayHandle<Point>& points);
212
213   
214   /** Draws a line, using the foreground color and other attributes of 
215    * the Gdk::GC.
216    * @param gc A Gdk::GC.
217    * @param x1 The x coordinate of the start point.
218    * @param y1 The y coordinate of the start point.
219    * @param x2 The x coordinate of the end point.
220    * @param y2 The y coordinate of the end point.
221    */
222   void draw_line(const Glib::RefPtr<const GC>& gc, int x1, int y1, int x2, int y2);
223   void draw_lines(const Glib::RefPtr<const GC>& gc, const Glib::ArrayHandle<Point>& points);
224
225   
226   /** Draws a rectangular outline or filled rectangle, using the foreground color
227    * and other attributes of the Gdk::GC.
228    * 
229    * A rectangle drawn filled is 1 pixel smaller in both dimensions than a 
230    * rectangle outlined. Calling 
231    * <tt>gdk_draw_rectangle (window, gc, <tt>true</tt>, 0, 0, 20, 20)</tt> 
232    * results in a filled rectangle 20 pixels wide and 20 pixels high. Calling
233    * <tt>gdk_draw_rectangle (window, gc, <tt>false</tt>, 0, 0, 20, 20)</tt> 
234    * results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20),
235    * and (20, 0), which makes it 21 pixels wide and 21 pixels high.
236    * @param gc A Gdk::GC.
237    * @param filled <tt>true</tt> if the rectangle should be filled.
238    * @param x The x coordinate of the left edge of the rectangle.
239    * @param y The y coordinate of the top edge of the rectangle.
240    * @param width The width of the rectangle.
241    * @param height The height of the rectangle.
242    */
243   void draw_rectangle(const Glib::RefPtr<const GC>& gc, bool filled, int x, int y, int width, int height);
244   
245   /** Draws an arc or a filled 'pie slice'. The arc is defined by the bounding
246    * rectangle of the entire ellipse, and the start and end angles of the part 
247    * of the ellipse to be drawn.
248    * @param gc A Gdk::GC.
249    * @param filled <tt>true</tt> if the arc should be filled, producing a 'pie slice'.
250    * @param x The x coordinate of the left edge of the bounding rectangle.
251    * @param y The y coordinate of the top edge of the bounding rectangle.
252    * @param width The width of the bounding rectangle.
253    * @param height The height of the bounding rectangle.
254    * @param angle1 The start angle of the arc, relative to the 3 o'clock position,
255    * counter-clockwise, in 1/64ths of a degree.
256    * @param angle2 The end angle of the arc, relative to @a angle1 , in 1/64ths 
257    * of a degree.
258    */
259   void draw_arc(const Glib::RefPtr<const GC>& gc, bool filled, int x, int y, int width, int height, int angle1, int angle2);
260   void draw_polygon(const Glib::RefPtr<const GC>& gc, bool filled, const Glib::ArrayHandle<Point>& points);
261
262   
263   /** Copies the @a width  x @a height  region of @a src  at coordinates ( @a xsrc ,
264    *  @a ysrc ) to coordinates ( @a xdest , @a ydest ) in @a drawable .
265    *  @a width  and/or @a height  may be given as -1, in which case the entire
266    *  @a src  drawable will be copied.
267    * 
268    * Most fields in @a gc  are not used for this operation, but notably the
269    * clip mask or clip region will be honored.
270    * 
271    * The source and destination drawables must have the same visual and
272    * colormap, or errors will result. (On X11, failure to match
273    * visual/colormap results in a BadMatch error from the X server.)
274    * A common cause of this problem is an attempt to draw a bitmap to
275    * a color drawable. The way to draw a bitmap is to set the bitmap as 
276    * the stipple on the Gdk::GC, set the fill mode to Gdk::STIPPLED, and 
277    * then draw the rectangle.
278    * @param gc A Gdk::GC sharing the drawable's visual and colormap.
279    * @param src The source Gdk::Drawable, which may be the same as @a drawable .
280    * @param xsrc X position in @a src  of rectangle to draw.
281    * @param ysrc Y position in @a src  of rectangle to draw.
282    * @param xdest X position in @a drawable  where the rectangle should be drawn.
283    * @param ydest Y position in @a drawable  where the rectangle should be drawn.
284    * @param width Width of rectangle to draw, or -1 for entire @a src  width.
285    * @param height Height of rectangle to draw, or -1 for entire @a src  height.
286    */
287   void draw_drawable(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<const Drawable>& src, int xsrc, int ysrc, int xdest, int ydest, int width = -1, int height = -1);
288   
289   /** Draws a Gdk::Image onto a drawable.
290    * The depth of the Gdk::Image must match the depth of the Gdk::Drawable.
291    * @param gc A Gdk::GC.
292    * @param image The Gdk::Image to draw.
293    * @param xsrc The left edge of the source rectangle within @a image .
294    * @param ysrc The top of the source rectangle within @a image .
295    * @param xdest The x coordinate of the destination within @a drawable .
296    * @param ydest The y coordinate of the destination within @a drawable .
297    * @param width The width of the area to be copied, or -1 to make the area 
298    * extend to the right edge of @a image .
299    * @param height The height of the area to be copied, or -1 to make the area 
300    * extend to the bottom edge of @a image .
301    */
302   void draw_image(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<const Image>& image, int xsrc, int ysrc, int xdest, int ydest, int width = -1, int height = -1);
303
304   //segs is an array, and this function will be used so little that it doesn't seem worth wrapping it to use a container of C++ types.
305   
306   /** Draws a number of unconnected lines.
307    * @param gc A Gdk::GC.
308    * @param segs An array of Gdk::Segment structures specifying the start and 
309    * end points of the lines to be drawn.
310    * @param nsegs The number of line segments to draw, i.e. the size of the 
311    *  @a segs  array.
312    */
313   void draw_segments(const Glib::RefPtr<const GC>& gc, GdkSegment* segs, int nsegs); // TODO
314
315   //glyphs is not an array. I went down to pango_xft_render in pango and saw that PangoGlyphString here is not an array. -Bryan
316   
317   /** This is a low-level function; 99% of text rendering should be done
318    * using gdk_draw_layout() instead.
319    * 
320    * A glyph is a single image in a font. This function draws a sequence of
321    * glyphs.  To obtain a sequence of glyphs you have to understand a
322    * lot about internationalized text handling, which you don't want to
323    * understand; thus, use gdk_draw_layout() instead of this function,
324    * gdk_draw_layout() handles the details.
325    * @param gc A Gdk::GC.
326    * @param font Font to be used.
327    * @param x X coordinate of baseline origin.
328    * @param y Y coordinate of baseline origin.
329    * @param glyphs The glyph string to draw.
330    */
331   void draw_glyphs(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<const Pango::Font>& font, int x, int y, const Pango::GlyphString& glyphs);
332
333   
334   /** Render a Pango::LayoutLine onto an GDK drawable
335    * 
336    * If the layout's Pango::Context has a transformation matrix set, then
337    *  @a x  and @a y  specify the position of the left edge of the baseline
338    * (left is in before-tranform user coordinates) in after-transform
339    * device coordinates.
340    * @param gc Base graphics to use.
341    * @param x The x position of start of string (in pixels).
342    * @param y The y position of baseline (in pixels).
343    * @param line A Pango::LayoutLine.
344    */
345   void draw_layout_line(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::LayoutLine>& line);
346   
347   /** Render a Pango::LayoutLine onto a Gdk::Drawable, overriding the
348    * layout's normal colors with @a foreground  and/or @a background .
349    *  @a foreground  and @a background  need not be allocated.
350    * 
351    * If the layout's Pango::Context has a transformation matrix set, then
352    *  @a x  and @a y  specify the position of the left edge of the baseline
353    * (left is in before-tranform user coordinates) in after-transform
354    * device coordinates.
355    * @param gc Base graphics to use.
356    * @param x The x position of start of string (in pixels).
357    * @param y The y position of baseline (in pixels).
358    * @param line A Pango::LayoutLine.
359    * @param foreground Foreground override color, or <tt>0</tt> for none.
360    * @param background Background override color, or <tt>0</tt> for none.
361    */
362   void draw_layout_line(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::LayoutLine>& line, const Color& foreground, const Color& background);
363
364   
365   /** Render a Pango::Layout onto a GDK drawable
366    * 
367    * If the layout's Pango::Context has a transformation matrix set, then
368    *  @a x  and @a y  specify the position of the top left corner of the
369    * bounding box (in device space) of the transformed layout.
370    * 
371    * If you're using GTK+, the usual way to obtain a Pango::Layout
372    * is gtk_widget_create_pango_layout().
373    * @param gc Base graphics context to use.
374    * @param x The X position of the left of the layout (in pixels).
375    * @param y The Y position of the top of the layout (in pixels).
376    * @param layout A Pango::Layout.
377    */
378   void draw_layout(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::Layout>& layout);
379   
380   /** Render a Pango::Layout onto a Gdk::Drawable, overriding the
381    * layout's normal colors with @a foreground  and/or @a background .
382    *  @a foreground  and @a background  need not be allocated.
383    * 
384    * If the layout's Pango::Context has a transformation matrix set, then
385    *  @a x  and @a y  specify the position of the top left corner of the
386    * bounding box (in device space) of the transformed layout.
387    * 
388    * If you're using GTK+, the ususal way to obtain a Pango::Layout
389    * is gtk_widget_create_pango_layout().
390    * @param gc Base graphics context to use.
391    * @param x The X position of the left of the layout (in pixels).
392    * @param y The Y position of the top of the layout (in pixels).
393    * @param layout A Pango::Layout.
394    * @param foreground Foreground override color, or <tt>0</tt> for none.
395    * @param background Background override color, or <tt>0</tt> for none.
396    */
397   void draw_layout(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::Layout>& layout, const Color& foreground, const Color& background);
398
399   
400   /** Renders a rectangular portion of a pixbuf to a drawable.  The destination
401    * drawable must have a colormap. All windows have a colormap, however, pixmaps
402    * only have colormap by default if they were created with a non-<tt>0</tt> window 
403    * argument. Otherwise a colormap must be set on them with 
404    * Gdk::Drawable::set_colormap().
405    * 
406    * On older X servers, rendering pixbufs with an alpha channel involves round 
407    * trips to the X server, and may be somewhat slow.
408    * 
409    * The clip mask of @a gc  is ignored, but clip rectangles and clip regions work
410    * fine.
411    * 
412    * If GDK is built with the Sun mediaLib library, the gdk_draw_pixbuf
413    * function is accelerated using mediaLib, which provides hardware
414    * acceleration on Intel, AMD, and Sparc chipsets.  If desired, mediaLib
415    * support can be turned off by setting the GDK_DISABLE_MEDIALIB environment
416    * variable.
417    * 
418    * @newin2p2
419    * @param gc A Gdk::GC, used for clipping, or <tt>0</tt>.
420    * @param pixbuf A Gdk::Pixbuf.
421    * @param src_x Source X coordinate within pixbuf.
422    * @param src_y Source Y coordinates within pixbuf.
423    * @param dest_x Destination X coordinate within drawable.
424    * @param dest_y Destination Y coordinate within drawable.
425    * @param width Width of region to render, in pixels, or -1 to use pixbuf width.
426    * @param height Height of region to render, in pixels, or -1 to use pixbuf height.
427    * @param dither Dithering mode for Gdk::RGB.
428    * @param x_dither X offset for dither.
429    * @param y_dither Y offset for dither.
430    */
431   void draw_pixbuf(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<Pixbuf>& pixbuf,
432     int src_x, int src_y, int dest_x, int dest_y,
433     int width, int height,
434     RgbDither dither, int x_dither, int y_dither);
435
436   // Note: This has no 'refreturn' because get_image() returns a newly created Image object.
437   
438   /** A Gdk::Image stores client-side image data (pixels). In contrast,
439    * Gdk::Pixmap and Gdk::Window are server-side
440    * objects. get_image() obtains the pixels from a
441    * server-side drawable as a client-side Gdk::Image.  The format of a
442    * Gdk::Image depends on the Gdk::Visual of the current display, which
443    * makes manipulating Gdk::Image extremely difficult; therefore, in
444    * most cases you should use the Gdk::Pixbuf::create() method that takes a Gdk::Drawable, 
445    * instead of this lower-level function. A Gdk::Pixbuf contains image data in a
446    * canonicalized RGB format, rather than a display-dependent format.
447    * Of course, there's a convenience vs. speed tradeoff here, so you'll
448    * want to think about what makes sense for your application.
449    * 
450    *  @a x , @a y , @a width , and @a height  define the region of @a drawable  to
451    * obtain as an image.
452    * 
453    * You would usually copy image data to the client side if you intend
454    * to examine the values of individual pixels, for example to darken
455    * an image or add a red tint. It would be prohibitively slow to
456    * make a round-trip request to the windowing system for each pixel,
457    * so instead you get all of them at once, modify them, then copy
458    * them all back at once.
459    * 
460    * If the X server or other windowing system backend is on the local
461    * machine, this function may use shared memory to avoid copying
462    * the image data.
463    * 
464    * If the source drawable is a Gdk::Window and partially offscreen
465    * or obscured, then the obscured portions of the returned image
466    * will contain undefined data.
467    * @param x X coordinate on @a drawable .
468    * @param y Y coordinate on @a drawable .
469    * @param width Width of region to get.
470    * @param height Height or region to get.
471    * @return A Gdk::Image containing the contents of @a drawable .
472    */
473   Glib::RefPtr<Image> get_image(int x, int y, int width, int height) const;
474
475   // gdk_drawable_copy_to_image() returns a new GdkImage when the image parameter is NULL, but that seems to be much the
476   // same as gdk_drawable_get_image().
477   void copy_to_image(const Glib::RefPtr<Image>& image, int src_x, int src_y, int dest_x, int dest_y, int width, int height) const;
478   
479   
480   /** Computes the region of a drawable that potentially can be written
481    * to by drawing primitives. This region will not take into account
482    * the clip region for the GC, and may also not take into account
483    * other factors such as if the window is obscured by other windows,
484    * but no area outside of this region will be affected by drawing
485    * primitives.
486    * @return A Gdk::Region. This must be freed with gdk_region_destroy()
487    * when you are done.
488    */
489   Region get_clip_region() const;
490   
491   /** Computes the region of a drawable that is potentially visible.
492    * This does not necessarily take into account if the window is
493    * obscured by other windows, but no area outside of this region
494    * is visible.
495    * @return A Gdk::Region. This must be freed with gdk_region_destroy()
496    * when you are done.
497    */
498   Region get_visible_region() const;
499
500
501   // **** RGB stuff ****
502
503   
504   void draw_rgb_image(
505                    const Glib::RefPtr<const GC>& gc,
506                    int x, int y, int width, int height,
507                    RgbDither dith, const guchar* rgb_buf, int rowstride);
508
509   
510   void draw_rgb_image_dithalign(
511                    const Glib::RefPtr<const GC>& gc,
512                    int x, int y, int width, int height,
513                    RgbDither dith, const guchar* rgb_buf, int rowstride,
514                    int xdith, int ydith);
515
516   
517   void draw_rgb_32_image(
518                    const Glib::RefPtr<const GC>& gc,
519                    int x, int y, int width, int height,
520                    RgbDither dith, const guchar* rgb_buf, int rowstride);
521
522   
523   /** Like gdk_draw_rgb_32_image(), but allows you to specify the dither
524    * offsets. See gdk_draw_rgb_image_dithalign() for more details.
525    * @param gc A Gdk::GC.
526    * @param x X coordinate on @a drawable  where image should go.
527    * @param y Y coordinate on @a drawable  where image should go.
528    * @param width Width of area of image to draw.
529    * @param height Height of area of image to draw.
530    * @param dith Dithering mode.
531    * @param buf RGB image data.
532    * @param rowstride Rowstride of RGB image data.
533    * @param xdith X dither offset.
534    * @param ydith Y dither offset.
535    */
536   void draw_rgb_32_image_dithalign(
537                    const Glib::RefPtr<const GC>& gc,
538                    int x, int y, int width, int height,
539                    RgbDither dith, const guchar* buf, int rowstride,
540                    int xdith, int ydith);
541
542   
543   void draw_gray_image(
544                    const Glib::RefPtr<const GC>& gc,
545                    int x, int y, int width, int height,
546                    RgbDither dith, const guchar* rgb_buf, int rowstride);
547
548   
549   void draw_indexed_image(
550                    const Glib::RefPtr<const GC>& gc,
551                    int x, int y, int width, int height,
552                    RgbDither dith, const guchar* rgb_buf, int rowstride,
553                    const RgbCmap& cmap);
554
555   
556   /** Gets the Gdk::Screen associated with a Gdk::Drawable.
557    * @return The Gdk::Screen associated with @a drawable 
558    * 
559    * @newin2p2.
560    */
561   Glib::RefPtr<Screen> get_screen();
562   
563   /** Gets the Gdk::Screen associated with a Gdk::Drawable.
564    * @return The Gdk::Screen associated with @a drawable 
565    * 
566    * @newin2p2.
567    */
568   Glib::RefPtr<const Screen> get_screen() const;
569
570   
571   /** Gets the Gdk::Display associated with a Gdk::Drawable.
572    * @return The Gdk::Display associated with @a drawable 
573    * 
574    * @newin2p2.
575    */
576   Glib::RefPtr<Display> get_display();
577   
578   /** Gets the Gdk::Display associated with a Gdk::Drawable.
579    * @return The Gdk::Display associated with @a drawable 
580    * 
581    * @newin2p2.
582    */
583   Glib::RefPtr<const Display> get_display() const;
584
585    
586   /** Creates a Cairo context for drawing to @a drawable .
587    * @return A newly created Cairo context.
588    * 
589    * @newin2p10.
590    */
591   Cairo::RefPtr<Cairo::Context> create_cairo_context();
592
593
594 public:
595
596 public:
597   //C++ methods used to invoke GTK+ virtual functions:
598 #ifdef GLIBMM_VFUNCS_ENABLED
599 #endif //GLIBMM_VFUNCS_ENABLED
600
601 protected:
602   //GTK+ Virtual Functions (override these to change behaviour):
603 #ifdef GLIBMM_VFUNCS_ENABLED
604 #endif //GLIBMM_VFUNCS_ENABLED
605
606   //Default Signal Handlers::
607 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
608 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
609
610
611 };
612
613 } // namespace Gdk
614
615
616 namespace Glib
617 {
618   /** A Glib::wrap() method for this object.
619    * 
620    * @param object The C instance.
621    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
622    * @result A C++ instance that wraps this C instance.
623    *
624    * @relates Gdk::Drawable
625    */
626   Glib::RefPtr<Gdk::Drawable> wrap(GdkDrawable* object, bool take_copy = false);
627 }
628
629
630 #endif /* _GDKMM_DRAWABLE_H */
631