[gtkmm/gtkmm-2-24] Drawable: Deprecate the draw_*() methods.



commit 539eb7ee8639ab3acb89ac72d86450487491943c
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jan 14 16:17:11 2011 +0100

    Drawable: Deprecate the draw_*() methods.
    
    * gdk/src/drawable.[hg|ccg]: Deprecate the draw_*() methods.

 ChangeLog            |    6 +++++
 gdk/src/drawable.ccg |    2 +
 gdk/src/drawable.hg  |   56 +++++++++++++++++++++++++++++++++-----------------
 3 files changed, 45 insertions(+), 19 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a96490f..e8affbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-01-14  Murray Cumming  <murrayc murrayc com>
 
+	Drawable: Deprecate the draw_*() methods.
+
+	* gdk/src/drawable.[hg|ccg]: Deprecate the draw_*() methods.
+
+2011-01-14  Murray Cumming  <murrayc murrayc com>
+
 	Window: Correct my broken begin_drag() implementation.
 
 	* gdk/src/window.ccg: gdk_drag_begin() takes a GList*, not an array.
diff --git a/gdk/src/drawable.ccg b/gdk/src/drawable.ccg
index 1bbb003..2d9876c 100644
--- a/gdk/src/drawable.ccg
+++ b/gdk/src/drawable.ccg
@@ -26,6 +26,7 @@
 namespace Gdk
 {
 
+_DEPRECATE_IFDEF_START
 void Drawable::draw_points(const Glib::RefPtr<const GC>& gc, const Glib::ArrayHandle<Point>& points)
 {
   // Don't assume the reinterpret_cast<> works everywhere.  Gdk::Point is *special*.
@@ -53,6 +54,7 @@ void Drawable::draw_polygon(const Glib::RefPtr<const GC>& gc, bool filled,
       reinterpret_cast<GdkPoint*>(const_cast<Point*>(points.data())),
       points.size());
 }
+_DEPRECATE_IFDEF_END
 
 void Drawable::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
 {
diff --git a/gdk/src/drawable.hg b/gdk/src/drawable.hg
index fc8ab03..f896143 100644
--- a/gdk/src/drawable.hg
+++ b/gdk/src/drawable.hg
@@ -76,40 +76,54 @@ public:
   _WRAP_METHOD(Glib::RefPtr<Colormap> get_colormap(), gdk_drawable_get_colormap, refreturn)
   _WRAP_METHOD(Glib::RefPtr<Visual> get_visual(), gdk_drawable_get_visual, refreturn)
 
-  _WRAP_METHOD(void draw_point(const Glib::RefPtr<const GC>& gc, int x, int y), gdk_draw_point)
+  _WRAP_METHOD(void draw_point(const Glib::RefPtr<const GC>& gc, int x, int y), gdk_draw_point, deprecated)
+  
+  _DEPRECATE_IFDEF_START
+  //TODO: Mention C++ API in the deprecation comment.
+  /** @deprecated Use n_points calls to cairo_rectangle() and cairo_fill() instead.
+   */
   void draw_points(const Glib::RefPtr<const GC>& gc, const Glib::ArrayHandle<Point>& points);
+  _DEPRECATE_IFDEF_END
 
-  _WRAP_METHOD(void draw_line(const Glib::RefPtr<const GC>& gc, int x1, int y1, int x2, int y2), gdk_draw_line)
+  _WRAP_METHOD(void draw_line(const Glib::RefPtr<const GC>& gc, int x1, int y1, int x2, int y2), gdk_draw_line, deprecated)
+  
+  _DEPRECATE_IFDEF_START
+  //TODO: Mention C++ API in the deprecation comment.
+  /** @deprecated Use cairo_line_to() and cairo_stroke() instead. See the documentation of gdk_draw_line() for notes on line drawing with Cairo.
+   */
   void draw_lines(const Glib::RefPtr<const GC>& gc, const Glib::ArrayHandle<Point>& points);
+  _DEPRECATE_IFDEF_END
 
-  _WRAP_METHOD(void draw_rectangle(const Glib::RefPtr<const GC>& gc, bool filled, int x, int y, int width, int height), gdk_draw_rectangle)
-  _WRAP_METHOD(void draw_arc(const Glib::RefPtr<const GC>& gc, bool filled, int x, int y, int width, int height, int angle1, int angle2), gdk_draw_arc)
+  _WRAP_METHOD(void draw_rectangle(const Glib::RefPtr<const GC>& gc, bool filled, int x, int y, int width, int height), gdk_draw_rectangle, deprecated)
+  _WRAP_METHOD(void draw_arc(const Glib::RefPtr<const GC>& gc, bool filled, int x, int y, int width, int height, int angle1, int angle2), gdk_draw_arc, deprecated)
   void draw_polygon(const Glib::RefPtr<const GC>& gc, bool filled, const Glib::ArrayHandle<Point>& points);
 
-  _WRAP_METHOD(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), gdk_draw_drawable)
-  _WRAP_METHOD(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), gdk_draw_image)
+  _WRAP_METHOD(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), gdk_draw_drawable, deprecated)
+  _WRAP_METHOD(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), gdk_draw_image, deprecated)
 
   //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.
   //Note: The segs parameter was made const in GTK+ 2.16, but we can't change that in our C++ API. TODO: Change it when we can do an ABI break.
 #m4 _CONVERSION(`GdkSegment*',`const GdkSegment*',`($3)')
-  _WRAP_METHOD(void draw_segments(const Glib::RefPtr<const GC>& gc, GdkSegment* segs, int nsegs), gdk_draw_segments) // TODO
+  _WRAP_METHOD(void draw_segments(const Glib::RefPtr<const GC>& gc, GdkSegment* segs, int nsegs), gdk_draw_segments, deprecated) // TODO
 
   //glyphs is not an array. I went down to pango_xft_render in pango and saw that PangoGlyphString here is not an array. -Bryan
-  _WRAP_METHOD(void draw_glyphs(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<const Pango::Font>& font, int x, int y, const Pango::GlyphString& glyphs), gdk_draw_glyphs)
+  _WRAP_METHOD(void draw_glyphs(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<const Pango::Font>& font, int x, int y, const Pango::GlyphString& glyphs), gdk_draw_glyphs, deprecated)
 
-  _WRAP_METHOD(void draw_layout_line(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::LayoutLine>& line), gdk_draw_layout_line)
-  _WRAP_METHOD(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), gdk_draw_layout_line_with_colors)
+  _WRAP_METHOD(void draw_layout_line(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::LayoutLine>& line), gdk_draw_layout_line, deprecated)
+  _WRAP_METHOD(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), gdk_draw_layout_line_with_colors, deprecated)
 
-  _WRAP_METHOD(void draw_layout(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::Layout>& layout), gdk_draw_layout)
-  _WRAP_METHOD(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), gdk_draw_layout_with_colors)
+  _WRAP_METHOD(void draw_layout(const Glib::RefPtr<const GC>& gc, int x, int y, const Glib::RefPtr<const Pango::Layout>& layout), gdk_draw_layout, deprecated)
+  _WRAP_METHOD(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), gdk_draw_layout_with_colors, deprecated)
 
 //Note: The pixbuf parameter was made const in GTK+ 2.16, but we can't change that in our C++ API. TODO: Change it when we can do an ABI break.
 #m4 _CONVERSION(`const Glib::RefPtr<Pixbuf>&',`const GdkPixbuf*',`Glib::unwrap($3)')
   _WRAP_METHOD(void draw_pixbuf(const Glib::RefPtr<const GC>& gc, const Glib::RefPtr<Pixbuf>& pixbuf,
     int src_x, int src_y, int dest_x, int dest_y,
     int width, int height,
-    RgbDither dither, int x_dither, int y_dither), gdk_draw_pixbuf)
+    RgbDither dither, int x_dither, int y_dither), gdk_draw_pixbuf, deprecated)
 
+  _DEPRECATE_IFDEF_START
+  //TODO: Mention C++ API in the deprecation comment.
   /** Renders a rectangular portion of a pixbuf to a drawable.  The destination
    * drawable must have a colormap. All windows have a colormap, however, pixmaps
    * only have colormap by default if they were created with a non-<tt>0</tt> window
@@ -136,11 +150,15 @@ public:
    * @param dither Dithering mode for Gdk::RGB.
    * @param x_dither X offset for dither.
    * @param y_dither Y offset for dither.
+   *
+   * @deprecated Use gdk_cairo_set_source_pixbuf() and cairo_paint() 
+   * or cairo_rectangle() and cairo_fill() instead.
    */
   void draw_pixbuf(const Glib::RefPtr<Pixbuf>& pixbuf,
     int src_x, int src_y, int dest_x, int dest_y,
     int width, int height,
     RgbDither dither, int x_dither, int y_dither);
+  _DEPRECATE_IFDEF_END
 
   // Note: This has no 'refreturn' because get_image() returns a newly created Image object.
   _WRAP_METHOD(Glib::RefPtr<Image> get_image(int x, int y, int width, int height) const, gdk_drawable_get_image)
@@ -160,40 +178,40 @@ public:
                    const Glib::RefPtr<const GC>& gc,
                    int x, int y, int width, int height,
                    RgbDither dith, const guchar* rgb_buf, int rowstride),
-               gdk_draw_rgb_image)
+               gdk_draw_rgb_image, deprecated)
 
   _WRAP_METHOD(void draw_rgb_image_dithalign(
                    const Glib::RefPtr<const GC>& gc,
                    int x, int y, int width, int height,
                    RgbDither dith, const guchar* rgb_buf, int rowstride,
                    int xdith, int ydith),
-               gdk_draw_rgb_image_dithalign)
+               gdk_draw_rgb_image_dithalign, deprecated)
 
   _WRAP_METHOD(void draw_rgb_32_image(
                    const Glib::RefPtr<const GC>& gc,
                    int x, int y, int width, int height,
                    RgbDither dith, const guchar* rgb_buf, int rowstride),
-               gdk_draw_rgb_32_image)
+               gdk_draw_rgb_32_image, deprecated)
 
   _WRAP_METHOD(void draw_rgb_32_image_dithalign(
                    const Glib::RefPtr<const GC>& gc,
                    int x, int y, int width, int height,
                    RgbDither dith, const guchar* buf, int rowstride,
                    int xdith, int ydith),
-               gdk_draw_rgb_32_image_dithalign)
+               gdk_draw_rgb_32_image_dithalign, deprecated)
 
   _WRAP_METHOD(void draw_gray_image(
                    const Glib::RefPtr<const GC>& gc,
                    int x, int y, int width, int height,
                    RgbDither dith, const guchar* rgb_buf, int rowstride),
-               gdk_draw_gray_image)
+               gdk_draw_gray_image, deprecated)
 
   _WRAP_METHOD(void draw_indexed_image(
                    const Glib::RefPtr<const GC>& gc,
                    int x, int y, int width, int height,
                    RgbDither dith, const guchar* rgb_buf, int rowstride,
                    const RgbCmap& cmap),
-               gdk_draw_indexed_image)
+               gdk_draw_indexed_image, deprecated)
 
   _WRAP_METHOD(Glib::RefPtr<Screen> get_screen(), gdk_drawable_get_screen, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Screen> get_screen() const, gdk_drawable_get_screen, refreturn, constversion)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]