[gtkmm/wip/dboles/Gdk_ImageSurface: 3/4] GdkWindow: Fix create_similar_image_surface return



commit 9e100a52b133b635a7197608418e7a4726cc9d72
Author: Daniel Boles <dboles src gmail com>
Date:   Thu Jun 20 18:37:10 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 2162d805..3224792a 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -258,7 +258,13 @@ public:
   _WRAP_METHOD(::Cairo::RefPtr< ::Cairo::Surface> create_similar_surface(::Cairo::Content content, int 
width,  int height), gdk_window_create_similar_surface )
 
   #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.")
+
+  #m4 _CONVERSION(`cairo_surface_t*',`::Cairo::RefPtr< ::Cairo::ImageSurface>',`::Cairo::RefPtr< 
::Cairo::ImageSurface>(new ::Cairo::ImageSurface($3, true /* do not take ref */))')
+  _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]