[gtkmm/wip/dboles/Gdk_ImageSurface: 1/2] GdkWindow: Fix create_similar_image_surface return



commit 3814e12fc0bd010db03a49d691e6e3a7b986f79a
Author: Daniel Boles <dboles src gmail com>
Date:   Sat Jun 15 22:30:34 2019 +0100

    GdkWindow: Fix create_similar_image_surface return
    
    This should return a Cairo::ImageSurface, but it returned just a Surface
    
    We can't change the return type of the existing function in 3 because
    that would break ABI, but we can add a new function suffixed _derived
    that returns the correct RefPtr type and deprecate the older symbol.
    
    https://gitlab.gnome.org/GNOME/gtkmm/issues/30

 gdk/src/window.hg | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index eb8e94d0..1c7e2954 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -257,8 +257,14 @@ public:
   #m4 _CONVERSION(`::Cairo::Content',`cairo_content_t',`(cairo_content_t)($3)')
   _WRAP_METHOD(::Cairo::RefPtr< ::Cairo::Surface> create_similar_surface(::Cairo::Content content, int 
width,  int height), gdk_window_create_similar_surface )
 
+  #m4 _CONVERSION(`cairo_surface_t*',`::Cairo::RefPtr< ::Cairo::ImageSurface>',`::Cairo::RefPtr< 
::Cairo::ImageSurface>(new ::Cairo::ImageSurface($3, false /* take reference */))')
   #m4 _CONVERSION(`::Cairo::Format',`cairo_format_t',`(cairo_format_t)($3)')
-    _WRAP_METHOD(::Cairo::RefPtr< ::Cairo::Surface> create_similar_image_surface(::Cairo::Format format, int 
width, int height, int scale), gdk_window_create_similar_image_surface )
+
+  _WRAP_METHOD(::Cairo::RefPtr< ::Cairo::Surface> create_similar_image_surface(::Cairo::Format format, int 
width, int height, int scale), gdk_window_create_similar_image_surface,
+               deprecated "Use create_similar_image_surface_derived(), which returns the correct derived 
type.")
+
+  _WRAP_METHOD(::Cairo::RefPtr< ::Cairo::ImageSurface> create_similar_image_surface_derived(::Cairo::Format 
format, int width, int height, int scale), gdk_window_create_similar_image_surface,
+               newin "3.26")
 
   _WRAP_METHOD(void beep(), gdk_window_beep)
 


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