[gtkmm] Update for the latest gtk+4 (Gdk::Paintable etc.)



commit f4c869abf01b8cde349c2d5f4790d4c6fe8638a9
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Mar 29 11:21:16 2018 +0200

    Update for the latest gtk+4 (Gdk::Paintable etc.)
    
    * gdk/src/gltexture.[ccg|hg]:
    * gdk/src/paintable.[ccg|hg]:
    * gdk/src/snapshot.[ccg|hg]: New files.
    * gdk/src/surface.[ccg|hg]: Gdk::Window has been renamed. It's now called
    Gdk::Surface, because GdkWindow has been renamed.
    
    Gtk::Snapshot is now a Glib::Object, because GtkSnapshot is a GObject.
    
    Gdk::Texture implements the Gdk::Paintable interface.

 .gitignore                               |   10 +-
 demos/gtk-demo/demowindow.cc             |    2 +-
 demos/gtk-demo/example_change_display.cc |    4 +-
 gdk/gdkmm.h                              |    5 +-
 gdk/gdkmm/general.cc                     |    8 +-
 gdk/gdkmm/general.h                      |   18 +-
 gdk/src/device.ccg                       |   14 +-
 gdk/src/device.hg                        |   36 ++--
 gdk/src/display.ccg                      |    2 +-
 gdk/src/display.hg                       |   10 +-
 gdk/src/dragcontext.ccg                  |    2 +-
 gdk/src/dragcontext.hg                   |   10 +-
 gdk/src/drawcontext.ccg                  |    2 +-
 gdk/src/drawcontext.hg                   |    8 +-
 gdk/src/drawingcontext.ccg               |    2 +-
 gdk/src/drawingcontext.hg                |   18 +-
 gdk/src/event.ccg                        |    2 +-
 gdk/src/event.hg                         |    8 +-
 gdk/src/events.ccg                       |   12 +-
 gdk/src/events.hg                        |   58 ++----
 gdk/src/filelist.am                      |    7 +-
 gdk/src/glcontext.hg                     |    6 +-
 gdk/src/gltexture.ccg                    |   35 +++
 gdk/src/gltexture.hg                     |   62 ++++++
 gdk/src/paintable.ccg                    |   20 ++
 gdk/src/paintable.hg                     |   66 ++++++
 gdk/src/seat.ccg                         |    6 +-
 gdk/src/seat.hg                          |   14 +-
 gdk/src/snapshot.ccg                     |   17 ++
 gdk/src/snapshot.hg                      |   39 ++++
 gdk/src/{window.ccg => surface.ccg}      |   28 +--
 gdk/src/surface.hg                       |  308 +++++++++++++++++++++++++++
 gdk/src/texture.ccg                      |   19 --
 gdk/src/texture.hg                       |   18 +--
 gdk/src/window.hg                        |  337 ------------------------------
 gtk/gtkmm/widgetcustomsnapshot.cc        |    6 +-
 gtk/gtkmm/widgetcustomsnapshot.h         |    4 +-
 gtk/src/aboutdialog.hg                   |   10 +-
 gtk/src/cellarea.hg                      |    6 +-
 gtk/src/cellrenderer.hg                  |    6 +-
 gtk/src/cellrendererpixbuf.hg            |    2 -
 gtk/src/entry.ccg                        |    2 +-
 gtk/src/entry.hg                         |   12 +-
 gtk/src/frame.hg                         |   15 +-
 gtk/src/iconinfo.ccg                     |    1 -
 gtk/src/iconinfo.hg                      |    1 -
 gtk/src/icontheme.ccg                    |    1 -
 gtk/src/icontheme.hg                     |    4 -
 gtk/src/iconview.ccg                     |    1 -
 gtk/src/iconview.hg                      |    4 +-
 gtk/src/image.ccg                        |    1 -
 gtk/src/image.hg                         |   23 +-
 gtk/src/layout.hg                        |    1 -
 gtk/src/menu.hg                          |    6 +-
 gtk/src/range.hg                         |    2 +-
 gtk/src/selectiondata.ccg                |    1 -
 gtk/src/selectiondata.hg                 |    5 -
 gtk/src/snapshot.ccg                     |   31 +---
 gtk/src/snapshot.hg                      |   53 ++---
 gtk/src/stylecontext.ccg                 |    1 +
 gtk/src/stylecontext.hg                  |    3 +-
 gtk/src/textview.hg                      |    4 +-
 gtk/src/tooltip.hg                       |    4 +-
 gtk/src/treeview.ccg                     |    1 -
 gtk/src/treeview.hg                      |    2 +-
 gtk/src/treeviewcolumn.hg                |    1 -
 gtk/src/widget.ccg                       |    8 +-
 gtk/src/widget.hg                        |   50 ++---
 gtk/src/window.ccg                       |    3 +-
 gtk/src/window.hg                        |   10 +-
 tools/m4/convert_gdk.m4                  |   38 ++--
 tools/m4/convert_gtk.m4                  |    3 +-
 72 files changed, 831 insertions(+), 708 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6e3b3ae..e643415 100644
--- a/.gitignore
+++ b/.gitignore
@@ -87,8 +87,12 @@ gdk/gdkmm/frametimings.cc
 gdk/gdkmm/frametimings.h
 gdk/gdkmm/glcontext.cc
 gdk/gdkmm/glcontext.h
+gdk/gdkmm/gltexture.cc
+gdk/gdkmm/gltexture.h
 gdk/gdkmm/monitor.cc
 gdk/gdkmm/monitor.h
+gdk/gdkmm/paintable.cc
+gdk/gdkmm/paintable.h
 gdk/gdkmm/pixbuf.cc
 gdk/gdkmm/pixbuf.h
 gdk/gdkmm/pixbufanimation.cc
@@ -105,14 +109,16 @@ gdk/gdkmm/rgba.cc
 gdk/gdkmm/rgba.h
 gdk/gdkmm/seat.cc
 gdk/gdkmm/seat.h
+gdk/gdkmm/snapshot.cc
+gdk/gdkmm/snapshot.h
+gdk/gdkmm/surface.cc
+gdk/gdkmm/surface.h
 gdk/gdkmm/texture.cc
 gdk/gdkmm/texture.h
 gdk/gdkmm/timecoord.cc
 gdk/gdkmm/timecoord.h
 gdk/gdkmm/types.cc
 gdk/gdkmm/types.h
-gdk/gdkmm/window.cc
-gdk/gdkmm/window.h
 gdk/gdkmm/wrap_init.cc
 gdk/gdkmmconfig.h
 gdk/stamp-h2
diff --git a/demos/gtk-demo/demowindow.cc b/demos/gtk-demo/demowindow.cc
index 2e23d3b..2446cab 100644
--- a/demos/gtk-demo/demowindow.cc
+++ b/demos/gtk-demo/demowindow.cc
@@ -398,7 +398,7 @@ void DemoWindow::add_data_tabs(const std::string& filename)
     Gtk::Widget* widget = nullptr;
     auto image = new Gtk::Image();
     image->set_from_resource(resource_name);
-    if (image->get_surface())
+    if (image->get_paintable())
     {
       widget = image;
     }
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index 2406de7..23bf508 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -294,7 +294,7 @@ Gtk::Window* Example_ChangeDisplay::query_for_toplevel(
   Gtk::Window* toplevel = nullptr;
   auto seat = device->get_seat();
 
-  if (seat && seat->grab(pPopup->get_window(), Gdk::Seat::Capabilities::ALL_POINTING,
+  if (seat && seat->grab(pPopup->get_surface(), Gdk::Seat::Capabilities::ALL_POINTING,
       false, cursor) == Gdk::GrabStatus::SUCCESS)
   {
     m_popup_clicked = false;
@@ -324,7 +324,7 @@ Gtk::Widget* Example_ChangeDisplay::find_toplevel_at_pointer(const Glib::RefPtr<
   if (!device)
     return nullptr;
 
-  auto refPointerWindow = device->get_window_at_position();
+  auto refPointerWindow = device->get_surface_at_position();
   if (refPointerWindow)
   {
     // The user data field of a GdkWindow is used to store a pointer
diff --git a/gdk/gdkmm.h b/gdk/gdkmm.h
index 88c8981..033dd1d 100644
--- a/gdk/gdkmm.h
+++ b/gdk/gdkmm.h
@@ -22,7 +22,7 @@
 #define _GDKMM_GDKMM_H_
 
 #include <gdkmm/types.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 #include <gdkmm/pixbuf.h>
 #include <gdkmm/pixbufanimation.h>
 #include <gdkmm/pixbufformat.h>
@@ -34,6 +34,7 @@
 #include <gdkmm/events.h>
 #include <gdkmm/frameclock.h>
 #include <gdkmm/glcontext.h>
+#include <gdkmm/gltexture.h>
 #include <gdkmm/rectangle.h>
 #include <gdkmm/devicetool.h>
 #include <gdkmm/display.h>
@@ -43,5 +44,7 @@
 #include <gdkmm/monitor.h>
 #include <gdkmm/general.h>
 #include <gdkmm/contentformatsbuilder.h>
+#include <gdkmm/paintable.h>
+#include <gdkmm/snapshot.h>
 
 #endif /* _GDKMM_GDKMM_H_ */
diff --git a/gdk/gdkmm/general.cc b/gdk/gdkmm/general.cc
index 2f42789..99bddb5 100644
--- a/gdk/gdkmm/general.cc
+++ b/gdk/gdkmm/general.cc
@@ -63,17 +63,17 @@ bool get_clip_rectangle(const ::Cairo::RefPtr< ::Cairo::Context >& context)
 }
 
 ::Cairo::RefPtr< ::Cairo::Surface> create_surface_from_pixbuf(const Glib::RefPtr<const Gdk::Pixbuf>& pixbuf,
-  int scale, const Glib::RefPtr<Gdk::Window>& for_window)
+  int scale, const Glib::RefPtr<Gdk::Surface>& for_surface)
 {
   return Gdk::Cairo::wrap(gdk_cairo_surface_create_from_pixbuf(
-    pixbuf->gobj(), scale, for_window ? for_window->gobj() : nullptr), true);
+    pixbuf->gobj(), scale, for_surface ? for_surface->gobj() : nullptr), true);
 }
 
 void draw_from_gl(const ::Cairo::RefPtr< ::Cairo::Context >& context,
-  const Glib::RefPtr<Gdk::Window>& window, int source, int source_type,
+  const Glib::RefPtr<Gdk::Surface>& surface, int source, int source_type,
   int buffer_scale, int x, int y, int width, int height)
 {
-  gdk_cairo_draw_from_gl(context->cobj(), window->gobj(), source, source_type,
+  gdk_cairo_draw_from_gl(context->cobj(), surface->gobj(), source, source_type,
     buffer_scale, x, y, width, height);
 }
 
diff --git a/gdk/gdkmm/general.h b/gdk/gdkmm/general.h
index aae46c0..91567af 100644
--- a/gdk/gdkmm/general.h
+++ b/gdk/gdkmm/general.h
@@ -22,7 +22,7 @@
 #include <gdkmm/rectangle.h>
 #include <gdkmm/rgba.h>
 #include <gdkmm/glcontext.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 #include <cairomm/context.h>
 #include <cairomm/region.h>
 #include <cairomm/surface.h>
@@ -111,15 +111,15 @@ bool get_clip_rectangle(const ::Cairo::RefPtr< ::Cairo::Context >& context);
 /** Creates an image surface with the same contents as the pixbuf.
  *
  * @param pixbuf A Gdk::Pixbuf.
- * @param scale The scale of the new surface, or 0 to use same as @a for_window.
- * @param for_window The window this will be drawn to, or an empty
- *        Glib::RefPtr<Gdk::Window> if none.
+ * @param scale The scale of the new surface, or 0 to use same as @a for_surface.
+ * @param for_surface The surface this will be drawn to, or an empty
+ *        Glib::RefPtr<Gdk::Surface> if none.
  * @returns A new cairo surface.
  *
  * @newin{3,92}
  */
 ::Cairo::RefPtr< ::Cairo::Surface> create_surface_from_pixbuf(const Glib::RefPtr<const Gdk::Pixbuf>& pixbuf,
-  int scale, const Glib::RefPtr<Gdk::Window>& for_window = {});
+  int scale, const Glib::RefPtr<Gdk::Surface>& for_surface = {});
 
 /** This is the main way to draw GL content in gtkmm.
  * It takes a render buffer ID (@a source_type == GL_RENDERBUFFER) or a texture id
@@ -128,9 +128,9 @@ bool get_clip_rectangle(const ::Cairo::RefPtr< ::Cairo::Context >& context);
  * @a x, @a y, @a width and @a height will be drawn at the current (0,0) position
  * of the cairo context.
  *
- * This will work for *all* cairo contexts, as long as @a window is realized, but the
+ * This will work for *all* cairo contexts, as long as @a surface is realized, but the
  * fallback implementation that reads back the pixels from the buffer may be
- * used in the general case. In the case of direct drawing to a window with
+ * used in the general case. In the case of direct drawing to a surface with
  * no special effects applied to @a context it will however use a more efficient
  * approach.
  *
@@ -140,7 +140,7 @@ bool get_clip_rectangle(const ::Cairo::RefPtr< ::Cairo::Context >& context);
  * Calling this may change the current GL context.
  *
  * @param context A cairo context.
- * @param window The window we're rendering for (not necessarily into).
+ * @param surface The surface we're rendering for (not necessarily into).
  * @param source The GL ID of the source buffer.
  * @param source_type The type of the @a source.
  * @param buffer_scale The scale-factor that the @a source buffer is allocated for.
@@ -152,7 +152,7 @@ bool get_clip_rectangle(const ::Cairo::RefPtr< ::Cairo::Context >& context);
  * @newin{3,92}
  */
 void draw_from_gl(const ::Cairo::RefPtr< ::Cairo::Context >& context,
-  const Glib::RefPtr<Gdk::Window>& window, int source, int source_type,
+  const Glib::RefPtr<Gdk::Surface>& surface, int source, int source_type,
   int buffer_scale, int x, int y, int width, int height);
 
 /** Uploads the contents of a %Cairo surface to a GL texture target.
diff --git a/gdk/src/device.ccg b/gdk/src/device.ccg
index 1300fd1..08e3230 100644
--- a/gdk/src/device.ccg
+++ b/gdk/src/device.ccg
@@ -20,21 +20,21 @@
 #include <gdkmm/devicetool.h>
 #include <gdkmm/display.h>
 #include <gdkmm/seat.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 
 using Type = Gdk::Device::Type;
 
 namespace Gdk
 {
 
-std::vector<TimeCoord> Device::get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop) 
const
+std::vector<TimeCoord> Device::get_history(const Glib::RefPtr<Surface>& surface, guint32 start, guint32 
stop) const
 {
   GdkTimeCoord** coords = nullptr;
   int events_count = 0;
 
   // we don't care about returned value - false means that either getting history is unsupported or no 
motion events happened.
   // it is undistinguishable.
-  gdk_device_get_history(const_cast<GdkDevice*>(gobj()), Glib::unwrap(window), start, stop, &coords, 
&events_count);
+  gdk_device_get_history(const_cast<GdkDevice*>(gobj()), Glib::unwrap(surface), start, stop, &coords, 
&events_count);
   return Glib::ArrayHandler<TimeCoord, TimeCoordPtrTraits>::array_to_vector(coords, events_count, 
Glib::OWNERSHIP_DEEP);
 }
 
@@ -48,17 +48,17 @@ void Device::get_position(double& x, double& y) const
   gdk_device_get_position_double(const_cast<GdkDevice*>(gobj()), &x, &y);
 }
 
-Glib::RefPtr<Window> Device::get_window_at_position()
+Glib::RefPtr<Surface> Device::get_surface_at_position()
 {
-  auto retvalue = Glib::wrap(gdk_device_get_window_at_position(gobj(), nullptr, nullptr));
+  auto retvalue = Glib::wrap(gdk_device_get_surface_at_position(gobj(), nullptr, nullptr));
   if(retvalue)
     retvalue->reference(); //The function does not do a ref for us.
   return retvalue;
 }
 
-Glib::RefPtr<const Window> Device::get_window_at_position() const
+Glib::RefPtr<const Surface> Device::get_surface_at_position() const
 {
-  return const_cast<Device*>(this)->get_window_at_position();
+  return const_cast<Device*>(this)->get_surface_at_position();
 }
 
 std::vector<std::string> Device::list_axes() const
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index 3d7f34f..8f80a27 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -40,7 +40,7 @@ _WRAP_ENUM(GrabStatus, GdkGrabStatus)
 class DeviceTool;
 class Display;
 class Seat;
-class Window;
+class Surface;
 
 /** A Gdk::Device instance contains a detailed description of an extended input device.
  */
@@ -65,7 +65,7 @@ public:
   _WRAP_METHOD(void set_key(guint index_, guint keyval, ModifierType modifiers), gdk_device_set_key)
   _WRAP_METHOD(AxisUse get_axis_use(guint index_) const, gdk_device_get_axis_use)
   _WRAP_METHOD(void set_axis_use(guint index_, AxisUse use), gdk_device_set_axis_use)
-  _WRAP_METHOD(void get_state(const Glib::RefPtr<Window>& window, double& axes, ModifierType& mask), 
gdk_device_get_state)
+  _WRAP_METHOD(void get_state(const Glib::RefPtr<Surface>& surface, double& axes, ModifierType& mask), 
gdk_device_get_state)
 
   /** Obtains the motion history for a device.
    * Given a starting and ending timestamp, this will return all events
@@ -73,12 +73,12 @@ public:
    * Some windowing systems do not support motion history, in which case, false will be returned.
    * (This is not distinguishable from the case where motion history is supported and no events were found.)
    *
-   * @param window The window with respect to which which the event coordinates will be reported.
+   * @param surface The surface with respect to which which the event coordinates will be reported.
    * @param start Starting timestamp for range of events to return.
    * @param stop Ending timestamp for the range of events to return.
    * @result A vector of TimeCoord.
    */
-  std::vector<TimeCoord> get_history(const Glib::RefPtr<Window>& window, guint32 start, guint32 stop) const;
+  std::vector<TimeCoord> get_history(const Glib::RefPtr<Surface>& surface, guint32 start, guint32 stop) 
const;
   _IGNORE(gdk_device_get_history)
 
 #m4 _CONVERSION(`GList*',`std::vector<Glib::RefPtr<Gdk::Device> 
',`Glib::ListHandler<Glib::RefPtr<Gdk::Device> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
@@ -135,15 +135,15 @@ public:
   void get_position(double& x, double& y) const;
   _IGNORE(gdk_device_get_position_double)
 
-  _WRAP_METHOD(Glib::RefPtr<Window> get_window_at_position(int& win_x, int& win_y), 
gdk_device_get_window_at_position, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Window> get_window_at_position(int& win_x, int& win_y) const, 
gdk_device_get_window_at_position, refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_surface_at_position(int& win_x, int& win_y), 
gdk_device_get_surface_at_position, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_surface_at_position(int& win_x, int& win_y) const, 
gdk_device_get_surface_at_position, refreturn, constversion)
 
   //TODO: Would this be ambiguous? Test it.
-  //_WRAP_METHOD(Glib::RefPtr<Window> get_window_at_position(double& win_x, double& win_y), 
gdk_device_get_window_at_position_double, refreturn)
-  //_WRAP_METHOD(Glib::RefPtr<const Window> get_window_at_position(double& win_x, double& win_y) const, 
gdk_device_get_window_at_position_double, refreturn, constversion)
+  //_WRAP_METHOD(Glib::RefPtr<Surface> get_surface_at_position(double& win_x, double& win_y), 
gdk_device_get_surface_at_position_double, refreturn)
+  //_WRAP_METHOD(Glib::RefPtr<const Surface> get_surface_at_position(double& win_x, double& win_y) const, 
gdk_device_get_surface_at_position_double, refreturn, constversion)
 
-  /** Obtains the window underneath the device.
-   * Returns an empty RefPtr if the window tree under the device is not known to GDK (for example, belongs 
to another application).
+  /** Obtains the surface underneath the device.
+   * Returns an empty RefPtr if the surface tree under the device is not known to GDK (for example, belongs 
to another application).
    *
    * As a slave device coordinates are those of its master pointer, This
    * function may not be called on devices of type Gdk::Device::Type::SLAVE,
@@ -151,12 +151,12 @@ public:
    *
    * @newin{3,0}
    *
-   * @return The Gdk::Window under the device position.
+   * @return The Gdk::Surface under the device position.
    */
-  Glib::RefPtr<Window> get_window_at_position();
+  Glib::RefPtr<Surface> get_surface_at_position();
 
-  /** Obtains the window underneath the device.
-   * Returns an empty RefPtr if the window tree under the device is not known to GDK (for example, belongs 
to another application).
+  /** Obtains the surface underneath the device.
+   * Returns an empty RefPtr if the surface tree under the device is not known to GDK (for example, belongs 
to another application).
    *
    * As a slave device coordinates are those of its master pointer, This
    * function may not be called on devices of type Gdk::Device::Type::SLAVE,
@@ -164,12 +164,12 @@ public:
    *
    * @newin{3,0}
    *
-   * @return The Gdk::Window under the device position.
+   * @return The Gdk::Surface under the device position.
    */
-  Glib::RefPtr<const Window> get_window_at_position() const;
+  Glib::RefPtr<const Surface> get_surface_at_position() const;
 
-  _WRAP_METHOD(Glib::RefPtr<Window> get_last_event_window(), gdk_device_get_last_event_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Window> get_last_event_window() const, gdk_device_get_last_event_window, 
refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_last_event_surface(), gdk_device_get_last_event_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_last_event_surface() const, 
gdk_device_get_last_event_surface, refreturn, constversion)
 
   _WRAP_METHOD(Glib::ustring get_vendor_id() const, gdk_device_get_vendor_id)
   _WRAP_METHOD(Glib::ustring get_product_id(), gdk_device_get_product_id)
diff --git a/gdk/src/display.ccg b/gdk/src/display.ccg
index 4af2dfc..164f99e 100644
--- a/gdk/src/display.ccg
+++ b/gdk/src/display.ccg
@@ -22,7 +22,7 @@
 #include <gdkmm/clipboard.h>
 #include <gdkmm/seat.h>
 #include <gdkmm/monitor.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 #include <gdk/gdk.h>
 
 namespace Gdk
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index cc88971..f14da60 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -34,7 +34,7 @@ class Clipboard;
 class Device;
 class Seat;
 class Monitor;
-class Window;
+class Surface;
 
  /** Gdk::Display object's purpose is two fold:
  *   To grab/ungrab keyboard focus and mouse pointer
@@ -79,8 +79,8 @@ public:
 
   _WRAP_METHOD(void flush(), gdk_display_flush)
 
-  _WRAP_METHOD(Glib::RefPtr<Window> get_default_group(), gdk_display_get_default_group, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Window> get_default_group() const, gdk_display_get_default_group, 
refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_default_group(), gdk_display_get_default_group, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_default_group() const, gdk_display_get_default_group, 
refreturn, constversion)
 
   _WRAP_METHOD(Glib::RefPtr<Clipboard> get_clipboard(), gdk_display_get_clipboard, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Clipboard> get_clipboard() const, gdk_display_get_clipboard, refreturn, 
constversion)
@@ -111,8 +111,8 @@ public:
   _WRAP_METHOD(Glib::RefPtr<const Monitor> get_primary_monitor() const, gdk_display_get_primary_monitor, 
refreturn, constversion)
   _WRAP_METHOD(Glib::RefPtr<Monitor> get_monitor_at_point(int x, int y), gdk_display_get_monitor_at_point, 
refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Monitor> get_monitor_at_point(int x, int y) const, 
gdk_display_get_monitor_at_point, refreturn, constversion)
-  _WRAP_METHOD(Glib::RefPtr<Monitor> get_monitor_at_window(const Glib::RefPtr<Window>& window), 
gdk_display_get_monitor_at_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Monitor> get_monitor_at_window(const Glib::RefPtr<Window>& window) const, 
gdk_display_get_monitor_at_window, refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Monitor> get_monitor_at_surface(const Glib::RefPtr<Surface>& surface), 
gdk_display_get_monitor_at_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Monitor> get_monitor_at_surface(const Glib::RefPtr<Surface>& surface) 
const, gdk_display_get_monitor_at_surface, refreturn, constversion)
 
   template <class ValueType>
   bool get_setting(const Glib::ustring& name, ValueType& value) const;
diff --git a/gdk/src/dragcontext.ccg b/gdk/src/dragcontext.ccg
index f33273c..2cacc78 100644
--- a/gdk/src/dragcontext.ccg
+++ b/gdk/src/dragcontext.ccg
@@ -19,7 +19,7 @@
 #include <glibmm/vectorutils.h>
 
 #include <gdkmm/contentformats.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <glibmm/utility.h> //For Glib::make_unique_ptr_gfree<>.
diff --git a/gdk/src/dragcontext.hg b/gdk/src/dragcontext.hg
index 68eaf32..7f01152 100644
--- a/gdk/src/dragcontext.hg
+++ b/gdk/src/dragcontext.hg
@@ -64,15 +64,13 @@ public:
 
   // void set_icon(Gtk::Widget* widget, int hot_x, int hot_y) - see Gtk::Widget::set_as_icon().
 
-  _WRAP_METHOD(void set_icon(const ::Cairo::RefPtr< ::Cairo::Surface>& surface), gtk_drag_set_icon_surface)
-
   _WRAP_METHOD(void set_icon_name(const Glib::ustring& name, int hot_x, int hot_y), gtk_drag_set_icon_name)
   _WRAP_METHOD(void set_icon(), gtk_drag_set_icon_default)
 
-  _WRAP_METHOD(Glib::RefPtr<Window> get_source_window(), gdk_drag_context_get_source_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Window> get_source_window() const, gdk_drag_context_get_source_window, 
refreturn, constversion)
-  _WRAP_METHOD(Glib::RefPtr<Window> get_dest_window(), gdk_drag_context_get_dest_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Window> get_dest_window() const, gdk_drag_context_get_dest_window, 
refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_source_surface(), gdk_drag_context_get_source_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_source_surface() const, gdk_drag_context_get_source_surface, 
refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_dest_surface(), gdk_drag_context_get_dest_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_dest_surface() const, gdk_drag_context_get_dest_surface, 
refreturn, constversion)
 
   _WRAP_METHOD(Glib::RefPtr<Device> get_device(), gdk_drag_context_get_device, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Device> get_device() const, gdk_drag_context_get_device, refreturn, 
constversion)
diff --git a/gdk/src/drawcontext.ccg b/gdk/src/drawcontext.ccg
index 2364a3b..0d8e63b 100644
--- a/gdk/src/drawcontext.ccg
+++ b/gdk/src/drawcontext.ccg
@@ -15,4 +15,4 @@
  */
 
 #include <gdkmm/display.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
diff --git a/gdk/src/drawcontext.hg b/gdk/src/drawcontext.hg
index fe82f7f..8fc7445 100644
--- a/gdk/src/drawcontext.hg
+++ b/gdk/src/drawcontext.hg
@@ -23,7 +23,7 @@ _PINCLUDE(glibmm/private/object_p.h)
 namespace Gdk
 {
 class Display;
-class Window;
+class Surface;
 
 /** Drawing context base class.
  *
@@ -46,11 +46,11 @@ protected:
 public:
   _WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_draw_context_get_display, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_draw_context_get_display, refreturn, 
constversion)
-  _WRAP_METHOD(Glib::RefPtr<Window> get_window(), gdk_draw_context_get_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Window> get_window() const, gdk_draw_context_get_window, refreturn, 
constversion)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_surface(), gdk_draw_context_get_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_surface() const, gdk_draw_context_get_surface, refreturn, 
constversion)
 
   _WRAP_PROPERTY("display", Glib::RefPtr<Display>)
-  _WRAP_PROPERTY("window", Glib::RefPtr<Window>)
+  _WRAP_PROPERTY("surface", Glib::RefPtr<Surface>)
 
   // There are no signals or vfuncs.
 };
diff --git a/gdk/src/drawingcontext.ccg b/gdk/src/drawingcontext.ccg
index 8cb0dc6..013dce5 100644
--- a/gdk/src/drawingcontext.ccg
+++ b/gdk/src/drawingcontext.ccg
@@ -16,4 +16,4 @@
 
 #include <gdkmm/cairoutils.h>
 #include <gdkmm/drawcontext.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
diff --git a/gdk/src/drawingcontext.hg b/gdk/src/drawingcontext.hg
index 9b5b868..5b690fb 100644
--- a/gdk/src/drawingcontext.hg
+++ b/gdk/src/drawingcontext.hg
@@ -25,18 +25,18 @@ _PINCLUDE(glibmm/private/object_p.h)
 namespace Gdk
 {
 class DrawContext;
-class Window;
+class Surface;
 
-/** Drawing context for GDK windows.
+/** Drawing context for GDK surfaces.
  *
  * Gdk::DrawingContext is an object that represents the current drawing
- * state of a Gdk::Window.
+ * state of a Gdk::Surface.
  *
- * It's possible to use a Gdk::DrawingContext to draw on a Gdk::Window
+ * It's possible to use a Gdk::DrawingContext to draw on a Gdk::Surface
  * via rendering API like Cairo or OpenGL.
  *
- * A Gdk::DrawingContext can only be created by calling Gdk::Window::begin_draw_frame()
- * and will be valid until a call to Gdk::Window::end_draw_frame().
+ * A Gdk::DrawingContext can only be created by calling Gdk::Surface::begin_draw_frame()
+ * and will be valid until a call to Gdk::Surface::end_draw_frame().
  *
  * @newin{3,22}
  */
@@ -48,8 +48,8 @@ protected:
   _CTOR_DEFAULT()
 
 public:
-  _WRAP_METHOD(Glib::RefPtr<Window> get_window(), gdk_drawing_context_get_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Window> get_window() const, gdk_drawing_context_get_window, refreturn, 
constversion)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_surface(), gdk_drawing_context_get_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_surface() const, gdk_drawing_context_get_surface, refreturn, 
constversion)
 
   _WRAP_METHOD(Glib::RefPtr<DrawContext> get_paint_context(), gdk_drawing_context_get_paint_context, 
refreturn,)
   _WRAP_METHOD(Glib::RefPtr<const DrawContext> get_paint_context() const, 
gdk_drawing_context_get_paint_context, refreturn, constversion)
@@ -64,7 +64,7 @@ public:
 
   _WRAP_METHOD(static Glib::RefPtr<DrawingContext> get_drawing_context_from_cairo_context(const 
::Cairo::RefPtr< ::Cairo::Context>& cr), gdk_cairo_get_drawing_context, refreturn)
 
-  _WRAP_PROPERTY("window", Glib::RefPtr<Window>)
+  _WRAP_PROPERTY("surface", Glib::RefPtr<Surface>)
   _WRAP_PROPERTY("clip", ::Cairo::RefPtr< ::Cairo::Region>, newin "3,92")
   _WRAP_PROPERTY("paint-context", Glib::RefPtr<DrawContext>)
 
diff --git a/gdk/src/event.ccg b/gdk/src/event.ccg
index 3776511..157b0e7 100644
--- a/gdk/src/event.ccg
+++ b/gdk/src/event.ccg
@@ -18,7 +18,7 @@
 #include <gdkmm/device.h>
 #include <gdkmm/display.h>
 #include <gdkmm/seat.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 
 using Type = Gdk::Event::Type;
 
diff --git a/gdk/src/event.hg b/gdk/src/event.hg
index 0bfa5ed..add1263 100644
--- a/gdk/src/event.hg
+++ b/gdk/src/event.hg
@@ -44,7 +44,7 @@ namespace Gdk
 class Device;
 class Display;
 class Seat;
-class Window;
+class Surface;
 
 /** Functions for handling events from the window system.
  *
@@ -72,8 +72,8 @@ public:
 
   _WRAP_METHOD(Type get_event_type() const, gdk_event_get_event_type)
 
-  _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_window(), gdk_event_get_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_window() const, gdk_event_get_window, refreturn, 
constversion)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Surface> get_surface(), gdk_event_get_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Surface> get_surface() const, gdk_event_get_surface, refreturn, 
constversion)
 
   /**
    * Returns @c true if the event was sent explicitly (e.g. using @c XSendEvent)
@@ -114,7 +114,7 @@ public:
     gdk_event_get_pointer_emulated, gdk_event_get_crossing_mode,
     gdk_event_get_crossing_detail, gdk_event_get_focus_in,
     gdk_event_get_drag_context,
-    gdk_event_get_grab_window, gdk_event_get_touchpad_gesture_phase,
+    gdk_event_get_grab_surface, gdk_event_get_touchpad_gesture_phase,
     gdk_event_get_touchpad_gesture_n_fingers, gdk_event_get_touchpad_deltas,
     gdk_event_get_touchpad_angle_delta, gdk_event_get_touchpad_scale,
     gdk_event_get_pad_group_mode, gdk_event_get_pad_button, gdk_event_get_pad_axis_value)
diff --git a/gdk/src/events.ccg b/gdk/src/events.ccg
index b497921..f8732eb 100644
--- a/gdk/src/events.ccg
+++ b/gdk/src/events.ccg
@@ -332,16 +332,16 @@ guint32 EventProximity::get_time() const
 
 // *** EventGrabBroken ***
 
-Glib::RefPtr<Gdk::Window> EventGrabBroken::get_grab_window()
+Glib::RefPtr<Gdk::Surface> EventGrabBroken::get_grab_surface()
 {
-  GdkWindow* window = nullptr;
-  gdk_event_get_grab_window(Event::gobj(), &window);
-  return Glib::wrap(window, true);
+  GdkSurface* surface = nullptr;
+  gdk_event_get_grab_surface(Event::gobj(), &surface);
+  return Glib::wrap(surface, true);
 }
 
-Glib::RefPtr<const Gdk::Window> EventGrabBroken::get_grab_window() const
+Glib::RefPtr<const Gdk::Surface> EventGrabBroken::get_grab_surface() const
 {
-  return const_cast<EventGrabBroken*>(this)->get_grab_window();
+  return const_cast<EventGrabBroken*>(this)->get_grab_surface();
 }
 
 // *** EventTouchpadSwipe ***
diff --git a/gdk/src/events.hg b/gdk/src/events.hg
index 8b57956..5628e6e 100644
--- a/gdk/src/events.hg
+++ b/gdk/src/events.hg
@@ -21,8 +21,8 @@ _CC_INCLUDE(gdk/gdk.h)
 #include <gdkmm/event.h>
 #include <gdkmm/enums.h>
 #include <gdkmm/rectangle.h>
+#include <gdkmm/surface.h>
 #include <gdkmm/types.h>
-#include <gdkmm/window.h>
 
 // All subclasses of Gdk::Event.
 //
@@ -103,7 +103,7 @@ public:
   _IGNORE(gdk_event_get_string) dnl// The retrieved struct member is deprecated.
 
   // Belong to the base class:
-  _IGNORE(gdk_event_get_event_type, gdk_event_get_window, gdk_event_is_sent,
+  _IGNORE(gdk_event_get_event_type, gdk_event_get_surface, gdk_event_is_sent,
     gdk_event_get_seat, gdk_event_handler_set, gdk_event_set_device, gdk_event_get_device,
     gdk_event_set_source_device, gdk_event_get_source_device, gdk_event_set_display,
     gdk_event_get_display)
@@ -308,7 +308,7 @@ public:
   bool get_pointer_emulated() const;
 };
 
-/** Generated when the mouse pointer leaves or enters the window.
+/** Generated when the mouse pointer leaves or enters the surface.
  *
  * get_event_type() will return one of Gdk::Event::Type::LEAVE_NOTIFY or
  * Gdk::Event::Type::ENTER_NOTIFY.
@@ -326,15 +326,6 @@ public:
    */
   guint32 get_time() const;
 
-  /*
-   * Returns the window that was entered or left.
-   */
-  //Glib::RefPtr<Gdk::Window> get_subwindow(); //TODO: Remove? There is no corresponding gtk+ function.
-  /*
-   * Returns the window that was entered or left.
-   */
-  //Glib::RefPtr<const Gdk::Window> get_subwindow() const;
-
   /**
    * Returns a bit mask representing the state of the modifier keys (e.g.
    * Control, Shift and Alt) and the pointer buttons.
@@ -359,14 +350,9 @@ public:
    */
   NotifyType get_crossing_detail() const;
   _IGNORE(gdk_event_get_crossing_detail)
-
-  /*
-   * Returns @c true if the window was the focus window, @c false otherwise
-   */
-  //bool get_focus() const; //TODO: Remove? There is no corresponding gtk+ function.
 };
 
-/** Generated when all or part of a window becomes visible and needs to be
+/** Generated when all or part of a surface becomes visible and needs to be
  * redrawn.
  *
  * get_event_type() will return one of Gdk::Event::Type::EXPOSE, Gdk::Event::Type::DAMAGE.
@@ -413,13 +399,13 @@ class EventFocus : public Event
 public:
 
   /**
-   * @c true if the window gained focus, @c false if lost
+   * @c true if the surface gained focus, @c false if lost
    */
   bool get_focus_in() const;
   _IGNORE(gdk_event_get_focus_in)
 };
 
-/** Generated when the position or size of a window changes.
+/** Generated when the position or size of a surface changes.
  *
  * get_event_type() will return Gdk::Event::Type::CONFIGURE.
  *
@@ -432,17 +418,17 @@ class EventConfigure : public Event
 public:
 
   /**
-   * Extract the event window relative x/y coordinates from an event.
-   * @param[out] x_win The new X coordinate of the window, relative to its parent.
-   * @param[out] y_win The new Y coordinate of the window, relative to its parent.
+   * Extract the event surface relative x/y coordinates from an event.
+   * @param[out] x_win The new X coordinate of the surface, relative to its parent.
+   * @param[out] y_win The new Y coordinate of the surface, relative to its parent.
    */
   void get_coords(double& x_win, double& y_win) const;
 
   /*
-   * Returns the new width of the window
+   * Returns the new width of the surface
    */
   /*
-   * Returns the new height of the window
+   * Returns the new height of the surface
    */
   //void get_size(int& width, int& Height) const; //TODO: Remove? There is no corresponding gtk+ function.
 
@@ -472,12 +458,12 @@ public:
    */
   guint32 get_time() const;
 
-  /** Extract the root window relative x/y coordinates from an event.
+  /** Extract the root surface relative x/y coordinates from an event.
    * Only meaningful if get_event_type() returns Gdk::Event::Type::DRAG_MOTION
    * orGdk::Event::Type::DROP_START.
    *
-   * @param[out] x_root Location to put root window x coordinate.
-   * @param[out] y_root Location to put root window y coordinate.
+   * @param[out] x_root Location to put root surface x coordinate.
+   * @param[out] y_root Location to put root surface y coordinate.
    */
   void get_root_coords(double& x_root, double& y_root) const;
 
@@ -517,7 +503,7 @@ public:
 };
 
 /** Generated when a pointer or keyboard grab is broken. On X11, this happens
- * when the grab window becomes unviewable (i.e. it or one of its ancestors is
+ * when the grab surface becomes unviewable (i.e. it or one of its ancestors is
  * unmapped), or if the same application grabs the pointer or keyboard again.
  * Note that implicit grabs (which are initiated by button presses) can also
  * cause Gdk::EventGrabBroken events.
@@ -543,21 +529,21 @@ public:
    */
   //bool is_implicit() const; //TODO Remove? There is no corresponding gtk+ function.
 
-  /** Gets the new grab window if this event is caused by another grab in
+  /** Gets the new grab surface if this event is caused by another grab in
    * the same application.
    *
    * @returns If this event is caused by another grab in the same application
-   *          then the new grab window, else Glib::RefPtr<Gdk::Window>(nullptr).
+   *          then the new grab surface, else Glib::RefPtr<Gdk::Surface>(nullptr).
    */
-  Glib::RefPtr<Gdk::Window> get_grab_window();
-  /** Gets the new grab window if this event is caused by another grab in
+  Glib::RefPtr<Gdk::Surface> get_grab_surface();
+  /** Gets the new grab surface if this event is caused by another grab in
    * the same application.
    *
    * @returns If this event is caused by another grab in the same application
-   *          then the new grab window, else Glib::RefPtr<const Gdk::Window>(nullptr).
+   *          then the new grab surface, else Glib::RefPtr<const Gdk::Surface>(nullptr).
    */
-  Glib::RefPtr<const Gdk::Window> get_grab_window() const;
-  _IGNORE(gdk_event_get_grab_window)
+  Glib::RefPtr<const Gdk::Surface> get_grab_surface() const;
+  _IGNORE(gdk_event_get_grab_surface)
 };
 
 /** Generated during touchpad swipe gestures.
diff --git a/gdk/src/filelist.am b/gdk/src/filelist.am
index a26545e..dfc7c43 100644
--- a/gdk/src/filelist.am
+++ b/gdk/src/filelist.am
@@ -32,7 +32,9 @@ gdkmm_files_any_hg =          \
        frameclock.hg           \
        frametimings.hg \
        glcontext.hg            \
+       gltexture.hg            \
        monitor.hg \
+       paintable.hg            \
        pixbuf.hg               \
        pixbufanimation.hg      \
        pixbufanimationiter.hg  \
@@ -41,10 +43,11 @@ gdkmm_files_any_hg =                \
        rectangle.hg            \
        rgba.hg                 \
        seat.hg         \
+       snapshot.hg             \
+       surface.hg              \
        texture.hg              \
        timecoord.hg            \
-       types.hg                \
-       window.hg
+       types.hg
 
 gdkmm_files_deprecated_hg =
 
diff --git a/gdk/src/glcontext.hg b/gdk/src/glcontext.hg
index 620213f..cba9ffb 100644
--- a/gdk/src/glcontext.hg
+++ b/gdk/src/glcontext.hg
@@ -18,7 +18,7 @@
 #include <gdkmmconfig.h>
 #include <gdkmm/drawcontext.h>
 #include <gdkmm/display.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 
 _DEFS(gdkmm,gdk)
 _PINCLUDE(gdkmm/private/drawcontext_p.h)
@@ -44,8 +44,8 @@ protected:
 public:
   _WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_gl_context_get_display, refreturn, newin "3,18")
   _WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_gl_context_get_display, refreturn, 
constversion, newin "3,18")
-  _WRAP_METHOD(Glib::RefPtr<Window> get_window(), gdk_gl_context_get_window, refreturn, newin "3,18")
-  _WRAP_METHOD(Glib::RefPtr<const Window> get_window() const, gdk_gl_context_get_window, refreturn, 
constversion, newin "3,18")
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_surface(), gdk_gl_context_get_surface, refreturn, newin "3,18")
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_surface() const, gdk_gl_context_get_surface, refreturn, 
constversion, newin "3,18")
   _WRAP_METHOD(Glib::RefPtr<GLContext> get_shared_context(), gdk_gl_context_get_shared_context, refreturn, 
newin "3,18")
   _WRAP_METHOD(Glib::RefPtr<const GLContext> get_shared_context() const, gdk_gl_context_get_shared_context, 
refreturn, constversion, newin "3,18")
   _WRAP_METHOD(void get_version(int& major, int& minor) const, gdk_gl_context_get_version, newin "3,18")
diff --git a/gdk/src/gltexture.ccg b/gdk/src/gltexture.ccg
new file mode 100644
index 0000000..1cf1dcc
--- /dev/null
+++ b/gdk/src/gltexture.ccg
@@ -0,0 +1,35 @@
+/* Copyright (C) 2018 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gdkmm/glcontext.h>
+
+namespace
+{
+void GLTexture_destroy_callback(void* data)
+{
+  auto the_slot = static_cast<Gdk::GLTexture::SlotGLReleased*>(data);
+  try
+  {
+    (*the_slot)();
+  }
+  catch (...)
+  {
+    Glib::exception_handlers_invoke();
+  }
+  delete the_slot;
+}
+
+} // anonymous namespace
diff --git a/gdk/src/gltexture.hg b/gdk/src/gltexture.hg
new file mode 100644
index 0000000..c1bb3e8
--- /dev/null
+++ b/gdk/src/gltexture.hg
@@ -0,0 +1,62 @@
+/* Copyright (C) 2018 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gdkmm/texture.h>
+
+_DEFS(gdkmm,gdk)
+_PINCLUDE(gdkmm/private/texture_p.h)
+
+namespace Gdk
+{
+class GLContext;
+
+/** Pixel data.
+ *
+ * %Gdk::GLTexture is the basic element used to refer to pixel data.
+ * It is primarily meant for pixel data that will not change over
+ * multiple frames, and will be used for a long time.
+ *
+ * You cannot get your pixel data back once you've uploaded it.
+ *
+ * %Gdk::GLTexture is an immutable object: That means you cannot change
+ * anything about it.
+ *
+ * @newin{3,94}
+ */
+class GLTexture : public Gdk::Texture
+{
+  _CLASS_GOBJECT(GLTexture, GdkGLTexture, GDK_GL_TEXTURE, Gdk::Texture, GdkTexture)
+
+protected:
+  _CTOR_DEFAULT()
+
+public:
+  /** For instance,
+   * void on_gl_resources_released();
+   */
+  using SlotGLReleased = sigc::slot<void()>;
+
+  // gdk_gl_texture_new() does more than call g_object_new().
+  _WRAP_METHOD(static Glib::RefPtr<Texture> create(const Glib::RefPtr<GLContext>& context,
+    guint id, int width, int height, const SlotGLReleased& slot{destroy} = {}),
+    gdk_gl_texture_new, slot_name slot, slot_callback GLTexture_destroy_callback)
+
+  _WRAP_METHOD(void release(), gdk_gl_texture_release)
+
+  // There are no public signals, properties or vfuncs.
+};
+
+} // namespace Gdk
diff --git a/gdk/src/paintable.ccg b/gdk/src/paintable.ccg
new file mode 100644
index 0000000..e2717f6
--- /dev/null
+++ b/gdk/src/paintable.ccg
@@ -0,0 +1,20 @@
+/* Copyright (C) 2018 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gdk/gdk.h>
+#include <gdkmm/snapshot.h>
+
+using Flags = Gdk::Paintable::Flags;
diff --git a/gdk/src/paintable.hg b/gdk/src/paintable.hg
new file mode 100644
index 0000000..44ea22f
--- /dev/null
+++ b/gdk/src/paintable.hg
@@ -0,0 +1,66 @@
+/* Copyright (C) 2018 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/interface.h>
+
+_DEFS(gdkmm,gdk)
+_PINCLUDE(glibmm/private/interface_p.h)
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+extern "C"
+{
+typedef struct _GtkPaintableInterface GtkPaintableInterface;
+}
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
+namespace Gdk
+{
+class Snapshot;
+
+/** An interface for a paintable region.
+ *
+ *
+ * @newin{3,94}
+ */
+class Paintable : public Glib::Interface
+{
+  _CLASS_INTERFACE(Paintable, GdkPaintable, GDK_PAINTABLE, GtkPaintableInterface)
+
+public:
+  _WRAP_ENUM(Flags, GdkPaintableFlags)
+
+  _WRAP_METHOD(void snapshot(const Glib::RefPtr<Gdk::Snapshot>& snapshot, double width, double height), 
gdk_paintable_snapshot)
+  _WRAP_METHOD(Glib::RefPtr<const Paintable> get_current_image() const, gdk_paintable_get_current_image)
+  _WRAP_METHOD(Flags get_flags() const, gdk_paintable_get_flags)
+  _WRAP_METHOD(int get_intrinsic_width() const, gdk_paintable_get_intrinsic_width)
+  _WRAP_METHOD(int get_intrinsic_height() const, gdk_paintable_get_intrinsic_height)
+  _WRAP_METHOD(double get_intrinsic_aspect_ratio() const, gdk_paintable_get_intrinsic_aspect_ratio)
+  _WRAP_METHOD(void compute_concrete_size(double specified_width, double specified_height,
+    double default_width, double default_height,
+    double& concrete_width, double& concrete_height) const, gdk_paintable_compute_concrete_size)
+  _WRAP_METHOD(void invalidate_contents(), gdk_paintable_invalidate_contents)
+  _WRAP_METHOD(void invalidate_size(), gdk_paintable_invalidate_size)
+
+  // no_default_handler because the wrapped C signals have no default handlers.
+  _WRAP_SIGNAL(void invalidate_contents(), "invalidate-contents", no_default_handler)
+  _WRAP_SIGNAL(void invalidate_size(), "invalidate-size", no_default_handler)
+
+  //TODO: Add vfuncs
+
+  // There are no properties.
+};
+
+} // namespace Gdk
diff --git a/gdk/src/seat.ccg b/gdk/src/seat.ccg
index 4f293c9..d88e0a6 100644
--- a/gdk/src/seat.ccg
+++ b/gdk/src/seat.ccg
@@ -16,20 +16,20 @@
 
 #include <gdkmm/devicetool.h>
 #include <gdkmm/display.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 
 using Capabilities = Gdk::Seat::Capabilities;
 
 namespace
 {
 
-void Seat_grab_callback(GdkSeat*, GdkWindow* window, gpointer user_data)
+void Seat_grab_callback(GdkSeat*, GdkSurface* surface, gpointer user_data)
 {
   auto slot = static_cast<Gdk::Seat::SlotGrabPrepare*>(user_data);
 
   try
   {
-    (*slot)(Glib::wrap(window, true));
+    (*slot)(Glib::wrap(surface, true));
   }
   catch(...)
   {
diff --git a/gdk/src/seat.hg b/gdk/src/seat.hg
index d0e02c0..3afca85 100644
--- a/gdk/src/seat.hg
+++ b/gdk/src/seat.hg
@@ -28,7 +28,7 @@ namespace Gdk
 
 class DeviceTool;
 class Display;
-class Window;
+class Surface;
 
 /** A Gdk::Seat object represents a collection of input devices that belong to a user.
  *
@@ -45,19 +45,19 @@ public:
   _WRAP_ENUM(Capabilities, GdkSeatCapabilities)
 
   /** For instance,<br>
-   *   void on_grab_prepare(const Glib::RefPtr<Gdk::Window>& window);
+   *   void on_grab_prepare(const Glib::RefPtr<Gdk::Surface>& surface);
    *
-   * Type of the callback used to set up @a window so it can be
-   * grabbed. A typical action would be ensuring the window is
+   * Type of the callback used to set up @a surface so it can be
+   * grabbed. A typical action would be ensuring the surface is
    * visible, although there's room for other initialization actions.
    *
-   * @param window The Gdk::Window being grabbed.
+   * @param surface The Gdk::Surface being grabbed.
    *
    * @newin{3,20}
    */
-  typedef sigc::slot<void(const Glib::RefPtr<Window>&)> SlotGrabPrepare;
+  typedef sigc::slot<void(const Glib::RefPtr<Surface>&)> SlotGrabPrepare;
 
-  _WRAP_METHOD(GrabStatus grab(const Glib::RefPtr<Window>& window,
+  _WRAP_METHOD(GrabStatus grab(const Glib::RefPtr<Surface>& surface,
                Capabilities capabilities,
                bool owner_events,
                const Glib::RefPtr<Cursor>& cursor = Glib::RefPtr<Cursor>(),
diff --git a/gdk/src/snapshot.ccg b/gdk/src/snapshot.ccg
new file mode 100644
index 0000000..871f66f
--- /dev/null
+++ b/gdk/src/snapshot.ccg
@@ -0,0 +1,17 @@
+/* Copyright (C) 2018 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <gdk/gdk.h>
diff --git a/gdk/src/snapshot.hg b/gdk/src/snapshot.hg
new file mode 100644
index 0000000..9832a2c
--- /dev/null
+++ b/gdk/src/snapshot.hg
@@ -0,0 +1,39 @@
+/* Copyright (C) 2018 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/object.h>
+
+_DEFS(gdkmm,gdk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gdk
+{
+
+/** Auxiliary object for snapshots.
+ *
+ * @see Gtk::Snapshot
+ *
+ * @newin{3,94}
+ */
+class Snapshot : public Glib::Object
+{
+  _CLASS_GOBJECT(Snapshot, GdkSnapshot, GDK_SNAPSHOT, Glib::Object, GObject)
+
+public:
+  // This class is almost empty
+};
+
+} // namespace Gdk
diff --git a/gdk/src/window.ccg b/gdk/src/surface.ccg
similarity index 65%
rename from gdk/src/window.ccg
rename to gdk/src/surface.ccg
index a8fc02b..db744bc 100644
--- a/gdk/src/window.ccg
+++ b/gdk/src/surface.ccg
@@ -25,37 +25,33 @@
 #include <gdkmm/drawcontext.h>
 #include <gdkmm/drawingcontext.h>
 #include <gdkmm/frameclock.h>
+#include <gdkmm/monitor.h>
 
-using Type = Gdk::Window::Type;
-using State = Gdk::Window::State;
-using TypeHint = Gdk::Window::TypeHint;
+using Type = Gdk::Surface::Type;
+using State = Gdk::Surface::State;
+using TypeHint = Gdk::Surface::TypeHint;
 
 namespace Gdk
 {
 
-void Window::set_cursor()
+void Surface::set_cursor()
 {
-  gdk_window_set_cursor(gobj(), nullptr);
+  gdk_surface_set_cursor(gobj(), nullptr);
 }
 
-void Window::set_device_cursor(const Glib::RefPtr<Gdk::Device>& device)
+void Surface::unset_icon()
 {
-  gdk_window_set_device_cursor(gobj(), Glib::unwrap(device), nullptr);
+  gdk_surface_set_icon_name(gobj(), nullptr); /* See GDK docs */
 }
 
-void Window::unset_icon()
+void Surface::invalidate()
 {
-  gdk_window_set_icon_name(gobj(), nullptr); /* See GDK docs */
+  gdk_surface_invalidate_rect(gobj(), nullptr);
 }
 
-void Window::invalidate(bool invalidate_children)
+void Surface::restack(bool above)
 {
-  gdk_window_invalidate_rect(gobj(), nullptr, invalidate_children);
-}
-
-void Window::restack(bool above)
-{
-  gdk_window_restack(gobj(), nullptr, above);
+  gdk_surface_restack(gobj(), nullptr, above);
 }
 
 } // namespace Gdk
diff --git a/gdk/src/surface.hg b/gdk/src/surface.hg
new file mode 100644
index 0000000..7e6ef77
--- /dev/null
+++ b/gdk/src/surface.hg
@@ -0,0 +1,308 @@
+/* Copyright(C) 1998-2010 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License or(at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+_CONFIGINCLUDE(gdkmmconfig.h)
+
+#include <glibmm/object.h>
+#include <gdkmm/dragcontext.h>
+#include <gdkmm/types.h>
+#include <cairomm/region.h>
+#include <cairomm/pattern.h>
+#include <gdkmm/device.h>
+#include <gdkmm/event.h>
+#include <gdkmm/rectangle.h>
+#include <gdkmm/rgba.h>
+#include <cairomm/context.h>
+#include <gdk/gdk.h>
+
+_DEFS(gdkmm,gdk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gdk
+{
+
+_WRAP_ENUM(WMDecoration, GdkWMDecoration)
+_WRAP_ENUM(WMFunction, GdkWMFunction)
+_WRAP_ENUM(SurfaceEdge, GdkSurfaceEdge)
+_WRAP_ENUM(Gravity, GdkGravity)
+_WRAP_ENUM(AnchorHints, GdkAnchorHints)
+_WRAP_ENUM(FullscreenMode, GdkFullscreenMode,
+  s#^CURRENT_MONITOR$#ON_CURRENT_MONITOR#,
+  s#^ALL_MONITORS$#ON_ALL_MONITORS#)
+
+class ContentProvider;
+class Cursor;
+class GLContext;
+class DrawContext;
+class DrawingContext;
+class FrameClock;
+class Monitor;
+
+/** A Gdk::Surface is a rectangular region on the screen. It's a low-level object, used to implement 
high-level objects such
+ * as Gtk::Widget and Gtk::Window on the GTK+ level. A Gtk::Window is a toplevel window, the thing a user 
might think of as
+ * a "window" with a titlebar and so on; a Gtk::Window may contain many Gdk::Surfaces. For example, each 
Gtk::Button has a
+ * Gdk::Surface associated with it.
+ */
+class Surface : public Glib::Object
+{
+  _CLASS_GOBJECT(Surface, GdkSurface, GDK_SURFACE, Glib::Object, GObject)
+  _STRUCT_NOT_HIDDEN
+  _IGNORE(gdk_surface_destroy, gdk_surface_is_destroyed)
+
+public:
+  _WRAP_ENUM(Type, GdkSurfaceType)
+  _WRAP_ENUM(State, GdkSurfaceState)
+  _WRAP_ENUM(Hints, GdkSurfaceHints)
+  _WRAP_ENUM(TypeHint, GdkSurfaceTypeHint)
+
+  // _WRAP_CREATE() would not be very useful here.
+  // The gdk_surface_new_*() functions do more than call g_object_new().
+  // And we can't make one hand-coded constructor for each gdk_surface_new_*()
+  // function, because some of them have identical prototypes.
+  _WRAP_METHOD(static Glib::RefPtr<Surface> create_toplevel(const Glib::RefPtr<Display>& display,
+    int width, int height), gdk_surface_new_toplevel)
+  _WRAP_METHOD(static Glib::RefPtr<Surface> create_popup(const Glib::RefPtr<Display>& display,
+    const Rectangle& position), gdk_surface_new_popup)
+  //TODO: Wrap or ignore? The documentation says: You most likely do not want to use this function.
+  //_WRAP_METHOD(static Glib::RefPtr<Surface> create_temp(const Glib::RefPtr<Display>& display), 
gdk_surface_new_temp)
+  _WRAP_METHOD(static Glib::RefPtr<Surface> create_child(const Glib::RefPtr<Surface>& parent,
+    const Rectangle& position), gdk_surface_new_child)
+
+  _WRAP_METHOD(Type get_surface_type() const, gdk_surface_get_surface_type)
+
+  _WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_surface_get_display, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_surface_get_display, refreturn, 
constversion)
+
+  _WRAP_METHOD(void show(), gdk_surface_show)
+  _WRAP_METHOD(void hide(), gdk_surface_hide)
+  _WRAP_METHOD(void withdraw(), gdk_surface_withdraw)
+  _WRAP_METHOD(void show_unraised(), gdk_surface_show_unraised)
+  _WRAP_METHOD(void move(int x, int y), gdk_surface_move)
+  _WRAP_METHOD(void resize(int width, int height), gdk_surface_resize)
+  _WRAP_METHOD(void move_resize(int x, int y, int width, int height), gdk_surface_move_resize)
+  _WRAP_METHOD(void raise(), gdk_surface_raise)
+  _WRAP_METHOD(void lower(), gdk_surface_lower)
+
+  _WRAP_METHOD(void restack(const Glib::RefPtr<Surface>& sibling, bool above), gdk_surface_restack)
+
+  /** Changes the position of this surface in the Z-order (stacking order). This
+   * either raises (if @a above is true) or lowers the surface.
+   *
+   * If this is a toplevel, the window manager may choose to deny the
+   * request to move the surface in the Z-order. restack() only
+   * requests the restack but does not guarantee it.
+   *
+   * @param above Whether to raise or lower the surface.
+   *
+   * @newin{2,18}
+   */
+  void restack(bool above);
+
+  _WRAP_METHOD(void focus(guint32 timestamp), gdk_surface_focus)
+  _WRAP_METHOD(void set_user_data(gpointer user_data), gdk_surface_set_user_data)
+
+  _WRAP_METHOD(void input_shape_combine_region(const ::Cairo::RefPtr< ::Cairo::Region>& shape_region, int 
offset_x, int offset_y), gdk_surface_input_shape_combine_region)
+  _WRAP_METHOD(void set_child_input_shapes(), gdk_surface_set_child_input_shapes)
+  _WRAP_METHOD(void merge_child_input_shapes(), gdk_surface_merge_child_input_shapes)
+
+  _WRAP_METHOD(void set_pass_through(bool pass_through = true), gdk_surface_set_pass_through)
+  _WRAP_METHOD(bool get_pass_through() const, gdk_surface_get_pass_through)
+
+  _WRAP_METHOD(bool is_visible() const, gdk_surface_is_visible)
+  _WRAP_METHOD(bool is_viewable() const, gdk_surface_is_viewable)
+  _WRAP_METHOD(bool is_input_only() const, gdk_surface_is_input_only)
+  _WRAP_METHOD(State get_state() const, gdk_surface_get_state)
+  _WRAP_METHOD(bool has_native() const, gdk_surface_has_native)
+  _WRAP_METHOD(void set_type_hint(TypeHint hint), gdk_surface_set_type_hint)
+  _WRAP_METHOD(TypeHint get_type_hint(), gdk_surface_get_type_hint)
+  _WRAP_METHOD(bool get_modal_hint() const, gdk_surface_get_modal_hint)
+  _WRAP_METHOD(void set_modal_hint(bool modal = true), gdk_surface_set_modal_hint)
+  _WRAP_METHOD(void set_geometry_hints(const Geometry& geometry, Hints geom_mask), 
gdk_surface_set_geometry_hints)
+  _WRAP_METHOD(void set_title(const Glib::ustring& title), gdk_surface_set_title)
+  _WRAP_METHOD(void set_role(const Glib::ustring& role), gdk_surface_set_role)
+  _WRAP_METHOD(void set_startup_id(const Glib::ustring& startup_id), gdk_surface_set_startup_id)
+  _WRAP_METHOD(void set_transient_for(const Glib::RefPtr<Surface>& parent), gdk_surface_set_transient_for)
+
+  _WRAP_METHOD(void set_cursor(const Glib::RefPtr<Cursor>& cursor), gdk_surface_set_cursor)
+
+  /** Use the parent surface's cursor.
+   * For top-level windows this means that it will use the default cursor for the ROOT window.
+   */
+  void set_cursor();
+
+  _WRAP_METHOD(void set_device_cursor(const Glib::RefPtr<Device>& device, const Glib::RefPtr<Cursor>& 
cursor), gdk_surface_set_device_cursor)
+
+  _WRAP_METHOD(Glib::RefPtr<Cursor> get_device_cursor(const Glib::RefPtr<Device>& device), 
gdk_surface_get_device_cursor, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Cursor> get_device_cursor(const Glib::RefPtr<const Device>& device) const, 
gdk_surface_get_device_cursor, refreturn)
+
+
+  _WRAP_METHOD(Glib::RefPtr<Cursor> get_cursor(), gdk_surface_get_cursor, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Cursor> get_cursor() const, gdk_surface_get_cursor, refreturn, 
constversion)
+
+  _WRAP_METHOD(void get_user_data(gpointer* data), gdk_surface_get_user_data)
+  _WRAP_METHOD(void get_geometry(int& x, int& y, int& width, int& height) const, gdk_surface_get_geometry)
+  _WRAP_METHOD(int get_width() const, gdk_surface_get_width)
+  _WRAP_METHOD(int get_height() const, gdk_surface_get_height)
+
+  _WRAP_METHOD(void get_position(int& x, int& y) const, gdk_surface_get_position)
+  _WRAP_METHOD(int get_origin(int& x, int& y) const, gdk_surface_get_origin)
+  _WRAP_METHOD(void get_root_coords(int x, int y, int& root_x, int& root_y), gdk_surface_get_root_coords)
+  _WRAP_METHOD(void coords_to_parent(double x,  double y, double& parent_x, double& parent_y), 
gdk_surface_coords_to_parent)
+  _WRAP_METHOD(void coords_from_parent(double parent_x, double parent_y, double& x, double& y), 
gdk_surface_coords_from_parent)
+
+  _WRAP_METHOD(void get_root_origin(int& x, int& y) const, gdk_surface_get_root_origin)
+
+  _WRAP_METHOD(void get_frame_extents(Rectangle& rect) const, gdk_surface_get_frame_extents)
+
+  _WRAP_METHOD(int get_scale_factor() const, gdk_surface_get_scale_factor)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_parent(), gdk_surface_get_parent, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_parent() const, gdk_surface_get_parent, refreturn, 
constversion)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_toplevel(), gdk_surface_get_toplevel, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_toplevel() const, gdk_surface_get_toplevel, refreturn, 
constversion)
+
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_device_position(const Glib::RefPtr<const Device>& device, int& x, 
int& y, ModifierType& mask) const, gdk_surface_get_device_position, refreturn)
+
+    _WRAP_METHOD(Glib::RefPtr<Surface> get_device_position(const Glib::RefPtr<const Device>& device, double& 
x, double& y, ModifierType& mask) const, gdk_surface_get_device_position_double, refreturn)
+
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<Surface> >',`Glib::ListHandler<Glib::RefPtr<Surface> 
::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+  _WRAP_METHOD(std::vector< Glib::RefPtr<Surface> > get_children(), gdk_surface_get_children)
+#m4 _CONVERSION(`GList*',`std::vector< Glib::RefPtr<const Surface> >',`Glib::ListHandler<Glib::RefPtr<const 
Surface> >::list_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
+  _WRAP_METHOD(std::vector< Glib::RefPtr<const Surface> > get_children() const, gdk_surface_get_children)
+  _IGNORE(gdk_surface_peek_children) //gdk_surface_peek_children() is the same as gdk_surface_get_children() 
with different memory mangement of the list.
+
+  _WRAP_METHOD(EventMask get_events() const, gdk_surface_get_events)
+  _WRAP_METHOD(void set_events(EventMask event_mask), gdk_surface_set_events)
+
+  _WRAP_METHOD(EventMask get_device_events(const Glib::RefPtr<const Device>& device) const, 
gdk_surface_get_device_events)
+  _WRAP_METHOD(void set_device_events(const Glib::RefPtr<Device>& device, EventMask event_mask), 
gdk_surface_set_device_events)
+
+#m4 _CONVERSION(`const 
std::vector<Glib::RefPtr<Texture>>&',`GList*',`Glib::ListHandler<Glib::RefPtr<Texture>>::vector_to_list($3).data()')
+  _WRAP_METHOD(void set_icon_list(const std::vector<Glib::RefPtr<Texture>>& textures), 
gdk_surface_set_icon_list)
+  void unset_icon();
+  _WRAP_METHOD(void set_icon_name(const Glib::ustring& name), gdk_surface_set_icon_name)
+
+  _WRAP_METHOD(void set_group(const Glib::RefPtr<Surface>& leader), gdk_surface_set_group)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_group(), gdk_surface_get_group)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_group() const, gdk_surface_get_group, constversion)
+
+  _WRAP_METHOD(void set_decorations(WMDecoration decorations), gdk_surface_set_decorations)
+  _WRAP_METHOD(bool get_decorations(WMDecoration& decorations) const, gdk_surface_get_decorations)
+  _WRAP_METHOD(void set_functions(WMFunction functions), gdk_surface_set_functions)
+
+  #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_surface_create_similar_surface )
+
+  #m4 _CONVERSION(`::Cairo::Surface::Format',`cairo_format_t',`(cairo_format_t)($3)')
+  _WRAP_METHOD(::Cairo::RefPtr< ::Cairo::ImageSurface> create_similar_image_surface(::Cairo::Surface::Format 
format, int width, int height, int scale), gdk_surface_create_similar_image_surface)
+
+  _WRAP_METHOD(void beep(), gdk_surface_beep)
+
+  _WRAP_METHOD(void iconify(), gdk_surface_iconify)
+  _WRAP_METHOD(void deiconify(), gdk_surface_deiconify)
+  _WRAP_METHOD(void stick(), gdk_surface_stick)
+  _WRAP_METHOD(void unstick(), gdk_surface_unstick)
+  _WRAP_METHOD(void maximize(), gdk_surface_maximize)
+  _WRAP_METHOD(void unmaximize(), gdk_surface_unmaximize)
+  _WRAP_METHOD(void register_dnd(), gdk_surface_register_dnd)
+
+  _WRAP_METHOD(void begin_resize_drag(SurfaceEdge edge, int button, int root_x, int root_y, guint32 
timestamp), gdk_surface_begin_resize_drag)
+
+  _WRAP_METHOD(void resize_drag(SurfaceEdge edge, const Glib::RefPtr<Device>& device, int button, int 
root_x, int root_y, guint32 timestamp), gdk_surface_begin_resize_drag_for_device)
+
+  _WRAP_METHOD(void begin_move_drag(int button, int root_x, int root_y, guint32 timestamp), 
gdk_surface_begin_move_drag)
+
+  _WRAP_METHOD(void begin_move_drag(const Glib::RefPtr<Device>& device, int button, int root_x, int root_y, 
guint32 timestamp), gdk_surface_begin_move_drag_for_device)
+
+  _WRAP_METHOD(Glib::RefPtr<DragContext> drag_begin_from_point(const Glib::RefPtr<Device>& device,
+    const Glib::RefPtr<ContentProvider>& content, DragAction actions, int dx, int dy), gdk_drag_begin)
+
+  _WRAP_METHOD(void invalidate_rect(const Rectangle& rect), gdk_surface_invalidate_rect)
+
+  /** A convenience wrapper around invalidate_region() which
+   * invalidates the whole region. See invalidate_region() for details.
+   */
+  void invalidate();
+
+  _WRAP_METHOD(void invalidate_region(const ::Cairo::RefPtr< ::Cairo::Region>& region), 
gdk_surface_invalidate_region)
+
+  _WRAP_METHOD(void freeze_updates(), gdk_surface_freeze_updates)
+  _WRAP_METHOD(void thaw_updates(), gdk_surface_thaw_updates)
+
+  _WRAP_METHOD(static void constrain_size(const Geometry& geometry, Hints flags,
+    int width, int height, int& new_width, int& new_height), gdk_surface_constrain_size)
+
+  _WRAP_METHOD(void set_skip_taskbar_hint(bool skips_taskbar = true), gdk_surface_set_skip_taskbar_hint)
+  _WRAP_METHOD(void set_skip_pager_hint(bool skips_pager = true), gdk_surface_set_skip_pager_hint)
+
+  _WRAP_METHOD(void set_urgency_hint(bool urgent = true), gdk_surface_set_urgency_hint)
+
+  _WRAP_METHOD(void fullscreen(), gdk_surface_fullscreen)
+  _WRAP_METHOD(void fullscreen_on_monitor(const Glib::RefPtr<Monitor>& monitor), 
gdk_surface_fullscreen_on_monitor)
+  _WRAP_METHOD(void set_fullscreen_mode(FullscreenMode mode), gdk_surface_set_fullscreen_mode)
+  _WRAP_METHOD(FullscreenMode get_fullscreen_mode() const, gdk_surface_get_fullscreen_mode)
+  _WRAP_METHOD(void unfullscreen(), gdk_surface_unfullscreen)
+
+  _WRAP_METHOD(void set_keep_above(bool setting = true), gdk_surface_set_keep_above)
+  _WRAP_METHOD(void set_keep_below(bool setting = true), gdk_surface_set_keep_below)
+
+  _WRAP_METHOD(void set_opacity(double opacity), gdk_surface_set_opacity)
+
+  _WRAP_METHOD(bool get_accept_focus() const, gdk_surface_get_accept_focus)
+  _WRAP_METHOD(void set_accept_focus(bool accept_focus = true), gdk_surface_set_accept_focus)
+
+  _WRAP_METHOD(bool get_focus_on_map() const, gdk_surface_get_focus_on_map)
+  _WRAP_METHOD(void set_focus_on_map(bool focus_on_map), gdk_surface_set_focus_on_map)
+
+  _WRAP_METHOD(void set_support_multidevice(bool support_multidevice = true), 
gdk_surface_set_support_multidevice)
+  _WRAP_METHOD(bool get_support_multidevice(), gdk_surface_get_support_multidevice)
+
+  _WRAP_METHOD(Glib::RefPtr<FrameClock> get_frame_clock(), gdk_surface_get_frame_clock, refreturn, newin 
"3,94")
+  _WRAP_METHOD(Glib::RefPtr<const FrameClock> get_frame_clock() const, gdk_surface_get_frame_clock, 
refreturn, constversion, newin "3,94")
+
+  _WRAP_METHOD(void set_opaque_region(const ::Cairo::RefPtr<const ::Cairo::Region>& region), 
gdk_surface_set_opaque_region)
+
+  _WRAP_METHOD(void set_shadow_width(int left, int right, int top, int bottom), gdk_surface_set_shadow_width)
+
+  _WRAP_METHOD(bool show_window_menu(const Glib::RefPtr<const Event>& event), gdk_surface_show_window_menu)
+
+  /** Creates a new GLContext matching the framebuffer format to the visual of the
+   * Surface. The context is disconnected from any particular surface.
+   *
+   * If the creation of the GLContext failed an error will be thrown.
+   *
+   * Before using the returned GLContext, you will need to call
+   * GLContext::make_current() or GLContext::realize().
+   *
+   * @newin{3,18}
+   *
+   * @return GLContext The newly created context.
+   *
+   * @throws GLError On missing GL implementation or extension required for context creation.
+   */
+  _WRAP_METHOD(Glib::RefPtr<Gdk::GLContext> create_gl_context(), gdk_surface_create_gl_context, errthrow)
+
+  _WRAP_METHOD(Glib::RefPtr<DrawingContext> begin_draw_frame(const Glib::RefPtr<DrawContext>& context{?}, 
const ::Cairo::RefPtr<const ::Cairo::Region>& region), gdk_surface_begin_draw_frame, refreturn)
+  _WRAP_METHOD(void end_draw_frame(const Glib::RefPtr<DrawingContext>& context), gdk_surface_end_draw_frame)
+
+  _IGNORE_SIGNAL("moved-to-rect")dnl// Private
+
+  _WRAP_PROPERTY("cursor", Glib::RefPtr<Cursor>)
+  _WRAP_PROPERTY("display", Glib::RefPtr<Display>)
+  _WRAP_PROPERTY("state", State)
+};
+
+} // namespace Gdk
diff --git a/gdk/src/texture.ccg b/gdk/src/texture.ccg
index e5ba9de..96109a8 100644
--- a/gdk/src/texture.ccg
+++ b/gdk/src/texture.ccg
@@ -15,23 +15,4 @@
  */
 
 #include <giomm/file.h>
-#include <gdkmm/glcontext.h>
 #include <gdkmm/pixbuf.h>
-
-namespace
-{
-void Texture_GL_destroy_callback(void* data)
-{
-  auto the_slot = static_cast<Gdk::Texture::SlotGLReleased*>(data);
-  try
-  {
-    (*the_slot)();
-  }
-  catch (...)
-  {
-    Glib::exception_handlers_invoke();
-  }
-  delete the_slot;
-}
-
-} // anonymous namespace
diff --git a/gdk/src/texture.hg b/gdk/src/texture.hg
index db1d567..cc689c4 100644
--- a/gdk/src/texture.hg
+++ b/gdk/src/texture.hg
@@ -15,6 +15,7 @@
  */
 
 #include <glibmm/object.h>
+#include <gdkmm/paintable.h>
 
 _DEFS(gdkmm,gdk)
 _PINCLUDE(glibmm/private/object_p.h)
@@ -26,7 +27,6 @@ class File;
 
 namespace Gdk
 {
-class GLContext;
 class Pixbuf;
 
 /** Pixel data.
@@ -42,17 +42,16 @@ class Pixbuf;
  *
  * @newin{3,94}
  */
-class Texture : public Glib::Object
+class Texture : public Glib::Object, public Paintable
 {
   _CLASS_GOBJECT(Texture, GdkTexture, GDK_TEXTURE, Glib::Object, GObject)
+  _IMPLEMENTS_INTERFACE(Paintable)
 
 protected:
   _CTOR_DEFAULT()
 
 public:
   // All gdk_texture_new_*() functions do more than call g_object_new().
-  _WRAP_METHOD(static Glib::RefPtr<Texture> create_for_data(
-    const guchar* data, int width, int height, int stride), gdk_texture_new_for_data)
   _WRAP_METHOD(static Glib::RefPtr<Texture> create_for_pixbuf(
     const Glib::RefPtr<Pixbuf>& pixbuf), gdk_texture_new_for_pixbuf)
   _WRAP_METHOD(static Glib::RefPtr<Texture> create_from_resource(
@@ -60,17 +59,6 @@ public:
   _WRAP_METHOD(static Glib::RefPtr<Texture> create_from_file(
     const Glib::RefPtr<Gio::File>& file), gdk_texture_new_from_file, errthrow)
 
-  /** For instance,
-   * void on_gl_resources_released();
-   */
-  using SlotGLReleased = sigc::slot<void()>;
-
-  _WRAP_METHOD(static Glib::RefPtr<Texture> create_for_gl(
-    const Glib::RefPtr<GLContext>& context,
-    guint id, int width, int height, const SlotGLReleased& slot{destroy} = {}),
-    gdk_gl_texture_new, slot_name slot, slot_callback Texture_GL_destroy_callback)
-  _WRAP_METHOD(void release_gl(), gdk_gl_texture_release)
-
   _WRAP_METHOD(int get_width() const, gdk_texture_get_width)
   _WRAP_METHOD(int get_height() const, gdk_texture_get_height)
   _WRAP_METHOD(void download(guchar* data, gsize stride) const, gdk_texture_download)
diff --git a/gtk/gtkmm/widgetcustomsnapshot.cc b/gtk/gtkmm/widgetcustomsnapshot.cc
index 1813c56..881ea84 100644
--- a/gtk/gtkmm/widgetcustomsnapshot.cc
+++ b/gtk/gtkmm/widgetcustomsnapshot.cc
@@ -30,14 +30,14 @@ Glib::ExtraClassInit(class_init_function)
 {
 }
 
-void WidgetCustomSnapshot::snapshot_vfunc(Snapshot& snapshot)
+void WidgetCustomSnapshot::snapshot_vfunc(const Glib::RefPtr<Snapshot>& snapshot)
 {
   const auto base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class 
(The original underlying C class).
   );
 
   if (base && base->snapshot)
-    (*base->snapshot)((BaseObjectType*)gobject_, snapshot.gobj());
+    (*base->snapshot)((BaseObjectType*)gobject_, snapshot->gobj());
 }
 
 // static
@@ -59,7 +59,7 @@ void WidgetCustomSnapshot::snapshot_vfunc_callback(GtkWidget* self, GtkSnapshot*
       try // Trap C++ exceptions which would normally be lost because this is a C callback.
       {
         // Call the virtual member method, which derived classes must override.
-        obj->snapshot_vfunc(*Glib::wrap(snapshot));
+        obj->snapshot_vfunc(Glib::wrap_gtk_snapshot(snapshot, true));
         return;
       }
       catch (...)
diff --git a/gtk/gtkmm/widgetcustomsnapshot.h b/gtk/gtkmm/widgetcustomsnapshot.h
index d115c5e..6ddaad1 100644
--- a/gtk/gtkmm/widgetcustomsnapshot.h
+++ b/gtk/gtkmm/widgetcustomsnapshot.h
@@ -21,7 +21,7 @@
 #include <gtkmm/snapshot.h>
 
 using GtkWidget = struct _GtkWidget;
-using GtkSnapshot = struct _GtkSnapshot;
+//using GtkSnapshot = struct _GtkSnapshot;
 
 namespace Gtk
 {
@@ -76,7 +76,7 @@ public:
 
 protected:
   /// Called when a widget is supposed to create a snapshot of itself.
-  virtual void snapshot_vfunc(Snapshot& snapshot);
+  virtual void snapshot_vfunc(const Glib::RefPtr<Snapshot>& snapshot);
 
 private:
   static void snapshot_vfunc_callback(GtkWidget* self, GtkSnapshot* snapshot);
diff --git a/gtk/src/aboutdialog.hg b/gtk/src/aboutdialog.hg
index 84c3aef..355d2e0 100644
--- a/gtk/src/aboutdialog.hg
+++ b/gtk/src/aboutdialog.hg
@@ -21,7 +21,7 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 #include <vector>
 
 #include <gtkmm/dialog.h>
-#include <gdkmm/texture.h>
+#include <gdkmm/paintable.h>
 
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/dialog_p.h)
@@ -113,9 +113,9 @@ public:
   _WRAP_METHOD(Glib::ustring get_translator_credits() const, gtk_about_dialog_get_translator_credits)
   _WRAP_METHOD(void set_translator_credits(const Glib::ustring& translator_credits), 
gtk_about_dialog_set_translator_credits)
 
-  _WRAP_METHOD(Glib::RefPtr<Gdk::Texture> get_logo(), gtk_about_dialog_get_logo, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gdk::Texture> get_logo() const, gtk_about_dialog_get_logo, refreturn, 
constversion)
-  _WRAP_METHOD(void set_logo(const Glib::RefPtr<const Gdk::Texture>& logo), gtk_about_dialog_set_logo)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Paintable> get_logo(), gtk_about_dialog_get_logo, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Paintable> get_logo() const, gtk_about_dialog_get_logo, refreturn, 
constversion)
+  _WRAP_METHOD(void set_logo(const Glib::RefPtr<const Gdk::Paintable>& logo), gtk_about_dialog_set_logo)
 
   /** Sets the surface to be displayed as logo in the about dialog.
    * The logo is set to the default window icon set with
@@ -147,7 +147,7 @@ public:
   _WRAP_PROPERTY("documenters", std::vector<Glib::ustring>)
   _WRAP_PROPERTY("translator_credits", std::vector<Glib::ustring>)
   _WRAP_PROPERTY("artists", std::vector<Glib::ustring>)
-  _WRAP_PROPERTY("logo", Glib::RefPtr<Gdk::Texture>)
+  _WRAP_PROPERTY("logo", Glib::RefPtr<Gdk::Paintable>)
   _WRAP_PROPERTY("logo_icon_name", Glib::ustring)
   _WRAP_PROPERTY("wrap_license", bool)
 
diff --git a/gtk/src/cellarea.hg b/gtk/src/cellarea.hg
index 2ab6816..9caa48b 100644
--- a/gtk/src/cellarea.hg
+++ b/gtk/src/cellarea.hg
@@ -162,7 +162,7 @@ public:
     GtkCellRendererState flags), gtk_cell_area_event)
 
   _WRAP_METHOD(void snapshot(const Glib::RefPtr<CellAreaContext>& context, Widget& widget,
-     Snapshot& snapshot, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area,
+     const Glib::RefPtr<Gtk::Snapshot>& snapshot, const Gdk::Rectangle& background_area, const 
Gdk::Rectangle& cell_area,
      CellRendererState flags,  bool paint_focus), gtk_cell_area_snapshot)
 
   _WRAP_METHOD(void get_cell_allocation(const Glib::RefPtr<CellAreaContext>& context, Widget& widget, 
CellRenderer& renderer,  const Gdk::Rectangle& cell_area, Gdk::Rectangle& allocation), 
gtk_cell_area_get_cell_allocation)
@@ -244,10 +244,10 @@ protected:
   _WRAP_SIGNAL(void remove_editable(CellRenderer* renderer, CellEditable* editable), "remove-editable", 
no_default_handler)
   _WRAP_SIGNAL(void focus_changed(CellRenderer* renderer, const Glib::ustring& path), "focus-changed", 
no_default_handler)
 
-#m4 _CONVERSION(`GtkSnapshot*',`Snapshot&',`*Glib::wrap($3)')
+#m4 _CONVERSION(`GtkSnapshot*',`const Glib::RefPtr<Gtk::Snapshot>&',`Glib::wrap_gtk_snapshot($3, true)')
 #m4 _CONVERSION(`const GdkRectangle*',`const Gdk::Rectangle&',`Glib::wrap($3)')
   _WRAP_VFUNC(void snapshot(const Glib::RefPtr<CellAreaContext>& context, Widget& widget,
-     Snapshot& snapshot, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area,
+     const Glib::RefPtr<Gtk::Snapshot>& snapshot, const Gdk::Rectangle& background_area, const 
Gdk::Rectangle& cell_area,
      CellRendererState flags,  bool paint_focus), snapshot)
 
 //TODO: Wrap these vfuncs, mentioned in the GtkCellAreaContext overview documentation?
diff --git a/gtk/src/cellrenderer.hg b/gtk/src/cellrenderer.hg
index 7e4f7fc..c3e16a5 100644
--- a/gtk/src/cellrenderer.hg
+++ b/gtk/src/cellrenderer.hg
@@ -65,7 +65,7 @@ public:
   _IGNORE(gtk_cell_renderer_get_aligned_area)
 
   _WRAP_METHOD(void snapshot(
-                  Snapshot& snapshot,
+                  const Glib::RefPtr<Gtk::Snapshot>& snapshot,
                   Widget& widget,
                   const Gdk::Rectangle& background_area,
                   const Gdk::Rectangle& cell_area,
@@ -142,10 +142,10 @@ protected:
   _WRAP_VFUNC(void get_preferred_height(Widget& widget, int& minimum_height, int& natural_height) const, 
get_preferred_height, custom_vfunc_callback)
   _WRAP_VFUNC(void get_preferred_width_for_height(Widget& widget, int height, int& minimum_width, int& 
natural_width) const, get_preferred_width_for_height, custom_vfunc_callback)
 
-#m4 _CONVERSION(`GtkSnapshot*',`Snapshot&',`*Glib::wrap($3)')
+#m4 _CONVERSION(`GtkSnapshot*',`const Glib::RefPtr<Gtk::Snapshot>&',`Glib::wrap_gtk_snapshot($3, true)')
 #m4 _CONVERSION(`const GdkRectangle*',`const Gdk::Rectangle&',`Glib::wrap($3)')
   _WRAP_VFUNC(void snapshot(
-                  Snapshot& snapshot,
+                  const Glib::RefPtr<Gtk::Snapshot>& snapshot,
                   Widget& widget,
                   const Gdk::Rectangle& background_area,
                   const Gdk::Rectangle& cell_area,
diff --git a/gtk/src/cellrendererpixbuf.hg b/gtk/src/cellrendererpixbuf.hg
index e589573..81b8f29 100644
--- a/gtk/src/cellrendererpixbuf.hg
+++ b/gtk/src/cellrendererpixbuf.hg
@@ -18,7 +18,6 @@
 
 #include <gtkmm/cellrenderer.h>
 #include <gdkmm/texture.h>
-#include <gdkmm/value_cairo.h>
 #include <giomm/icon.h>
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/cellrenderer_p.h)
@@ -51,7 +50,6 @@ public:
   _WRAP_PROPERTY("icon_size", Gtk::IconSize)
   _WRAP_PROPERTY("icon-name", Glib::ustring)
   _WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
-  _WRAP_PROPERTY("surface", Cairo::RefPtr<Cairo::Surface>)
   _WRAP_PROPERTY("texture", Glib::RefPtr<Gdk::Texture>)
 
   Glib::PropertyProxy_Base _property_renderable() override;
diff --git a/gtk/src/entry.ccg b/gtk/src/entry.ccg
index 63f0cf9..98ceb20 100644
--- a/gtk/src/entry.ccg
+++ b/gtk/src/entry.ccg
@@ -36,7 +36,7 @@ void Entry::set_icon_from_gicon(const Glib::RefPtr<Gio::Icon>& icon, IconPositio
 void Entry::unset_icon(IconPosition icon_pos)
 {
   //We could use any one of these set_icon_from_* functions:
-  gtk_entry_set_icon_from_texture(gobj(), static_cast<GtkEntryIconPosition>(icon_pos), nullptr);
+  gtk_entry_set_icon_from_paintable(gobj(), static_cast<GtkEntryIconPosition>(icon_pos), nullptr);
 }
 
 void Entry::set_icon_activatable(bool activatable, IconPosition icon_pos)
diff --git a/gtk/src/entry.hg b/gtk/src/entry.hg
index b069bed..fc941e7 100644
--- a/gtk/src/entry.hg
+++ b/gtk/src/entry.hg
@@ -108,7 +108,7 @@ public:
   _WRAP_METHOD(Glib::ustring get_placeholder_text() const, gtk_entry_get_placeholder_text)
   _WRAP_METHOD(void set_placeholder_text(const Glib::ustring& text), gtk_entry_set_placeholder_text)
 
-  _WRAP_METHOD(void set_icon_from_texture(const Glib::RefPtr<Gdk::Texture>& texture{.}, IconPosition 
icon_pos{.} = IconPosition::PRIMARY), gtk_entry_set_icon_from_texture)
+  _WRAP_METHOD(void set_icon_from_paintable(const Glib::RefPtr<Gdk::Paintable>& paintable{.}, IconPosition 
icon_pos{.} = IconPosition::PRIMARY), gtk_entry_set_icon_from_paintable)
 
   _WRAP_METHOD_DOCS_ONLY(gtk_entry_set_icon_from_icon_name)
   void set_icon_from_icon_name(const Glib::ustring& icon_name, IconPosition icon_pos = 
IconPosition::PRIMARY);
@@ -119,7 +119,7 @@ public:
   _IGNORE(gtk_entry_set_icon_from_gicon)
 
   /** Do not show any icon in the specified position.
-   * See set_icon_from_texture(), set_icon_from_icon_name(), and set_icon_from_gicon().
+   * See set_icon_from_paintable(), set_icon_from_icon_name(), and set_icon_from_gicon().
    *
    * @param icon_pos The icon position.
    *
@@ -128,8 +128,8 @@ public:
   void unset_icon(IconPosition icon_pos = IconPosition::PRIMARY);
 
   _WRAP_METHOD(Image::Type get_icon_storage_type(IconPosition icon_pos = IconPosition::PRIMARY) const, 
gtk_entry_get_icon_storage_type)
-  _WRAP_METHOD(Glib::RefPtr<Gdk::Texture> get_icon_texture(IconPosition icon_pos = IconPosition::PRIMARY), 
gtk_entry_get_icon_texture, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gdk::Texture> get_icon_texture(IconPosition icon_pos = 
IconPosition::PRIMARY) const, gtk_entry_get_icon_texture, refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Paintable> get_icon_paintable(IconPosition icon_pos = 
IconPosition::PRIMARY), gtk_entry_get_icon_paintable, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Paintable> get_icon_paintable(IconPosition icon_pos = 
IconPosition::PRIMARY) const, gtk_entry_get_icon_paintable, refreturn, constversion)
   _WRAP_METHOD(Glib::ustring get_icon_name(IconPosition icon_pos = IconPosition::PRIMARY) const, 
gtk_entry_get_icon_name)
   _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_icon_gicon(IconPosition icon_pos = IconPosition::PRIMARY), 
gtk_entry_get_icon_gicon, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gio::Icon> get_icon_gicon(IconPosition icon_pos = IconPosition::PRIMARY) 
const, gtk_entry_get_icon_gicon, refreturn, constversion)
@@ -235,8 +235,8 @@ public:
   _WRAP_PROPERTY("caps-lock-warning", bool)
   _WRAP_PROPERTY("progress-fraction", double)
   _WRAP_PROPERTY("progress-pulse-step", double)
-  _WRAP_PROPERTY("primary-icon-texture", Glib::RefPtr<Gdk::Texture>)
-  _WRAP_PROPERTY("secondary-icon-texture", Glib::RefPtr<Gdk::Texture>)
+  _WRAP_PROPERTY("primary-icon-paintable", Glib::RefPtr<Gdk::Paintable>)
+  _WRAP_PROPERTY("secondary-icon-paintable", Glib::RefPtr<Gdk::Paintable>)
   _WRAP_PROPERTY("primary-icon-name", Glib::ustring)
   _WRAP_PROPERTY("secondary-icon-name", Glib::ustring)
   _WRAP_PROPERTY("primary-icon-gicon", Glib::RefPtr<Gio::Icon>)
diff --git a/gtk/src/frame.hg b/gtk/src/frame.hg
index b1e8d7d..94db668 100644
--- a/gtk/src/frame.hg
+++ b/gtk/src/frame.hg
@@ -58,21 +58,17 @@ public:
   _WRAP_METHOD(Widget* get_label_widget(), gtk_frame_get_label_widget)
   _WRAP_METHOD(const Widget* get_label_widget() const, gtk_frame_get_label_widget, constversion)
 
-  _WRAP_METHOD(void set_label_align(float xalign = 0.0, float yalign = 0.5), gtk_frame_set_label_align)
-  /** Sets the alignment of the frame widget’s label. The
-   * default values for a newly created frame are Gtk::Align::START and Gtk::Align::CENTER.
+  _WRAP_METHOD(void set_label_align(float xalign = 0.0), gtk_frame_set_label_align)
+  /** Sets the X alignment of the frame widget’s label. The
+   * default values for a newly created frame is Gtk::Align::START.
    *
    * @param xalign The position of the label along the top edge
    * of the widget. A value of Gtk::Align::START represents left alignment;
    * Gtk::Align::END represents right alignment.
-   * @param yalign The y alignment of the label. A value of Gtk::Align::START aligns under
-   * the frame; Gtk::Align::END aligns above the frame. If the values are
-   * Gtk::Align::START or Gtk::Align::END the gap in the frame won’t be painted because the label
-   * will be completely above or below the frame.
    */
-  _WRAP_METHOD(void set_label_align(Align xalign, Align yalign = Gtk::Align::CENTER), 
gtk_frame_set_label_align)
+  _WRAP_METHOD(void set_label_align(Align xalign), gtk_frame_set_label_align)
 
-  _WRAP_METHOD(void get_label_align(float& xalign, float& yalign) const, gtk_frame_get_label_align)
+  _WRAP_METHOD(float get_label_align() const, gtk_frame_get_label_align)
 
   /** Sets shadow type of the frame.
    */
@@ -81,7 +77,6 @@ public:
 
   _WRAP_PROPERTY("label", Glib::ustring)
   _WRAP_PROPERTY("label-xalign", double)
-  _WRAP_PROPERTY("label-yalign", double)
   _WRAP_PROPERTY("shadow-type", ShadowType)
   _WRAP_PROPERTY("label-widget", Widget*)
 
diff --git a/gtk/src/iconinfo.ccg b/gtk/src/iconinfo.ccg
index 9f7441d..dd6207a 100644
--- a/gtk/src/iconinfo.ccg
+++ b/gtk/src/iconinfo.ccg
@@ -18,7 +18,6 @@
 #include <glibmm/vectorutils.h>
 
 #include <gtk/gtk.h>
-#include <gdkmm/cairoutils.h>
 #include <gdkmm/texture.h>
 #include <gtkmm/icontheme.h>
 //TODO: Install and use this? #include <giomm/slot_async.h>
diff --git a/gtk/src/iconinfo.hg b/gtk/src/iconinfo.hg
index 572abe9..f872650 100644
--- a/gtk/src/iconinfo.hg
+++ b/gtk/src/iconinfo.hg
@@ -66,7 +66,6 @@ public:
   _WRAP_METHOD(bool is_symbolic() const, gtk_icon_info_is_symbolic)
 
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> load_icon() const, gtk_icon_info_load_icon, errthrow)
-  _WRAP_METHOD(Cairo::RefPtr<const Cairo::Surface> load_surface(const Glib::RefPtr<Gdk::Window>& for_window) 
const, gtk_icon_info_load_surface, errthrow)
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Texture> load_texture() const, gtk_icon_info_load_texture)
 
   _WRAP_METHOD(void load_icon_async(const Gio::SlotAsyncReady& slot{callback}, const 
Glib::RefPtr<Gio::Cancellable>& cancellable{.?}) const,
diff --git a/gtk/src/icontheme.ccg b/gtk/src/icontheme.ccg
index 058fcfb..de6ddda 100644
--- a/gtk/src/icontheme.ccg
+++ b/gtk/src/icontheme.ccg
@@ -16,7 +16,6 @@
  */
 
 #include <glibmm/vectorutils.h>
-#include <gdkmm/cairoutils.h>
 
 #include <gtk/gtk.h> //For gtk_icon_theme_error_get_type().
 
diff --git a/gtk/src/icontheme.hg b/gtk/src/icontheme.hg
index 88375c1..003c212 100644
--- a/gtk/src/icontheme.hg
+++ b/gtk/src/icontheme.hg
@@ -106,10 +106,6 @@ public:
   _WRAP_METHOD(Glib::RefPtr<const Gdk::Pixbuf> load_icon(const Glib::ustring& icon_name, int size,
     int scale, IconLookupFlags flags = (IconLookupFlags)0) const, gtk_icon_theme_load_icon_for_scale, 
errthrow)
 
-  _WRAP_METHOD(Cairo::RefPtr<const Cairo::Surface> load_surface(const Glib::ustring& icon_name,
-    int size, int scale, const Glib::RefPtr<Gdk::Window>& for_window, IconLookupFlags flags = 
(IconLookupFlags)0) const,
-    gtk_icon_theme_load_surface, errthrow)
-
 #m4 _CONVERSION(`GList*',`std::vector<Glib::ustring>',`Glib::ListHandler<Glib::ustring>::list_to_vector($3, 
Glib::OWNERSHIP_DEEP)')
   _WRAP_METHOD(std::vector<Glib::ustring> list_icons(const Glib::ustring& context) const, 
gtk_icon_theme_list_icons)
 
diff --git a/gtk/src/iconview.ccg b/gtk/src/iconview.ccg
index a8908ee..d815537 100644
--- a/gtk/src/iconview.ccg
+++ b/gtk/src/iconview.ccg
@@ -17,7 +17,6 @@
 
 #include <glibmm/vectorutils.h>
 
-#include <gdkmm/cairoutils.h>
 #include <gtkmm/adjustment.h>
 #include <gtk/gtk.h>
 
diff --git a/gtk/src/iconview.hg b/gtk/src/iconview.hg
index 2a7126a..7aad920 100644
--- a/gtk/src/iconview.hg
+++ b/gtk/src/iconview.hg
@@ -320,8 +320,8 @@ public:
   bool get_dest_item_at_pos(int drag_x, int drag_y, DropPosition& pos) const;
   _IGNORE(gtk_icon_view_get_dest_item_at_pos)
 
-  // create_drag_icon() is const because it returns a newly created cairo surface.
-  _WRAP_METHOD(Cairo::RefPtr<Cairo::Surface> create_drag_icon(const TreeModel::Path& path) const, 
gtk_icon_view_create_drag_icon)
+  // create_drag_icon() is const because it returns a newly created Gdk::Paintable.
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Paintable> create_drag_icon(const TreeModel::Path& path) const, 
gtk_icon_view_create_drag_icon)
 
 #m4 _INITIALIZATION(`Gdk::Rectangle&',`GdkRectangle', `$3 = Glib::wrap(&($4))')
   _WRAP_METHOD(bool get_cell_rect(const TreeModel::Path& path, const CellRenderer& cell{?}, Gdk::Rectangle& 
rect{.>>}) const, gtk_icon_view_get_cell_rect)
diff --git a/gtk/src/image.ccg b/gtk/src/image.ccg
index e0375bd..77ab88a 100644
--- a/gtk/src/image.ccg
+++ b/gtk/src/image.ccg
@@ -17,7 +17,6 @@
  */
 
 #include <gtk/gtk.h>
-#include <gdkmm/cairoutils.h>
 
 using Type = Gtk::Image::Type;
 
diff --git a/gtk/src/image.hg b/gtk/src/image.hg
index 1c160d0..b27196b 100644
--- a/gtk/src/image.hg
+++ b/gtk/src/image.hg
@@ -17,7 +17,6 @@
  */
 
 #include <gtkmm/widget.h>
-#include <gdkmm/value_cairo.h>
 #include <giomm/icon.h>
 
 _DEFS(gtkmm,gtk)
@@ -74,26 +73,27 @@ public:
   _WRAP_METHOD(void set(const std::string& filename), gtk_image_set_from_file)
   _WRAP_METHOD(void set_from_resource(const std::string& resource_path), gtk_image_set_from_resource)
   _WRAP_METHOD(void set(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf), gtk_image_set_from_pixbuf)
-  _WRAP_METHOD(void set(const Glib::RefPtr<Gdk::Texture>& texture), gtk_image_set_from_texture)
+  _WRAP_METHOD(void set(const Glib::RefPtr<Gdk::Paintable>& paintable), gtk_image_set_from_paintable)
   _WRAP_METHOD(void set(const Glib::RefPtr<const Gio::Icon>& icon), gtk_image_set_from_gicon)
 
-  _WRAP_METHOD(void set(const Cairo::RefPtr<Cairo::Surface>& surface), gtk_image_set_from_surface)
-
   _WRAP_METHOD(void set_from_icon_name(const Glib::ustring& icon_name), gtk_image_set_from_icon_name)
 
   _WRAP_METHOD(void clear(), gtk_image_clear)
 
   _WRAP_METHOD(Type get_storage_type() const, gtk_image_get_storage_type)
 
-  _WRAP_METHOD(Cairo::RefPtr<Cairo::Surface> get_surface(), gtk_image_get_surface, refreturn)
-  _WRAP_METHOD(Cairo::RefPtr<const Cairo::Surface> get_surface() const, gtk_image_get_surface, refreturn, 
constversion)
-
-  _WRAP_METHOD(Glib::RefPtr<Gdk::Texture> get_texture(), gtk_image_get_texture, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gdk::Texture> get_texture() const, gtk_image_get_texture, refreturn, 
constversion)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Paintable> get_paintable(), gtk_image_get_paintable, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Paintable> get_paintable() const, gtk_image_get_paintable, refreturn, 
constversion)
 
   _WRAP_METHOD(void set_icon_size(IconSize icon_size), gtk_image_set_icon_size)
   _WRAP_METHOD(IconSize get_icon_size() const, gtk_image_get_icon_size)
 
+  _WRAP_METHOD(void set_keep_aspect_ratio(bool keep_aspect_ratio = true), gtk_image_set_keep_aspect_ratio)
+  _WRAP_METHOD(bool get_keep_aspect_ratio() const, gtk_image_get_keep_aspect_ratio)
+
+  _WRAP_METHOD(void set_can_shrink(bool can_shrink = true), gtk_image_set_can_shrink)
+  _WRAP_METHOD(bool get_can_shrink() const, gtk_image_get_can_shrink)
+
   _WRAP_METHOD(Glib::RefPtr<Gio::Icon> get_gicon(), gtk_image_get_gicon, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gio::Icon> get_gicon() const, gtk_image_get_gicon, refreturn, constversion)
   _WRAP_METHOD(Glib::ustring get_icon_name() const, gtk_image_get_icon_name)
@@ -109,8 +109,9 @@ public:
   _WRAP_PROPERTY("gicon", Glib::RefPtr<Gio::Icon>)
   _WRAP_PROPERTY("use-fallback", bool)
   _WRAP_PROPERTY("resource", std::string)
-  _WRAP_PROPERTY("surface", Cairo::RefPtr<Cairo::Surface>)
-  _WRAP_PROPERTY("texture", Glib::RefPtr<Gdk::Texture>)
+  _WRAP_PROPERTY("paintable", Glib::RefPtr<Gdk::Paintable>)
+  _WRAP_PROPERTY("keep-aspect-ratio", bool)
+  _WRAP_PROPERTY("can-shrink", bool)
 };
 
 } //namespace Gtk
diff --git a/gtk/src/layout.hg b/gtk/src/layout.hg
index 05662fb..957de89 100644
--- a/gtk/src/layout.hg
+++ b/gtk/src/layout.hg
@@ -18,7 +18,6 @@
 
 #include <gtkmm/container.h>
 #include <gtkmm/scrollable.h>
-#include <gdkmm/window.h>
 
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/container_p.h)
diff --git a/gtk/src/menu.hg b/gtk/src/menu.hg
index 5c13f15..54bad0f 100644
--- a/gtk/src/menu.hg
+++ b/gtk/src/menu.hg
@@ -19,7 +19,7 @@ _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/menushell_p.h)
 
 #include <gdkmm/monitor.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 #include <gtkmm/menushell.h>
 #include <gtkmm/menuitem.h>
 
@@ -98,7 +98,7 @@ public:
    */
   void popup(guint button, guint32 activate_time, const Glib::RefPtr<Gdk::Device>& device = 
Glib::RefPtr<Gdk::Device>());
 
-  _WRAP_METHOD(void popup_at_rect(const Glib::RefPtr<Gdk::Window>& rect_window,
+  _WRAP_METHOD(void popup_at_rect(const Glib::RefPtr<Gdk::Surface>& rect_surface,
     const Gdk::Rectangle& rect, Gdk::Gravity rect_anchor, Gdk::Gravity menu_anchor,
     const Glib::RefPtr<const Gdk::Event>& trigger_event = {}), gtk_menu_popup_at_rect)
   _WRAP_METHOD(void popup_at_widget(Widget* widget, Gdk::Gravity widget_anchor,
@@ -163,7 +163,7 @@ public:
   _WRAP_PROPERTY("anchor-hints", Gdk::AnchorHints)
   _WRAP_PROPERTY("rect-anchor-dx", int)
   _WRAP_PROPERTY("rect-anchor-dy", int)
-  _WRAP_PROPERTY("menu-type-hint", Gdk::Window::TypeHint)
+  _WRAP_PROPERTY("menu-type-hint", Gdk::Surface::TypeHint)
 
   _WRAP_CHILD_PROPERTY("left-attach", int)
   _WRAP_CHILD_PROPERTY("right-attach", int)
diff --git a/gtk/src/range.hg b/gtk/src/range.hg
index ed1522b..74c1787 100644
--- a/gtk/src/range.hg
+++ b/gtk/src/range.hg
@@ -57,7 +57,7 @@ public:
   _WRAP_METHOD(bool get_slider_size_fixed() const, gtk_range_get_slider_size_fixed)
 
   /** This method returns the area that contains the range's trough
-   * and its steppers, in the widget's Gdk::Window coordinates.
+   * and its steppers, in the widget's Gdk::Surface coordinates.
    *
    * This method is useful mainly for Range subclasses.
    *
diff --git a/gtk/src/selectiondata.ccg b/gtk/src/selectiondata.ccg
index fdb7a21..07f49b4 100644
--- a/gtk/src/selectiondata.ccg
+++ b/gtk/src/selectiondata.ccg
@@ -17,7 +17,6 @@
 
 #include <glibmm/vectorutils.h>
 
-#include <gdkmm/cairoutils.h>
 #include <gtk/gtk.h>
 
 namespace Gtk
diff --git a/gtk/src/selectiondata.hg b/gtk/src/selectiondata.hg
index 9573404..da9fb7c 100644
--- a/gtk/src/selectiondata.hg
+++ b/gtk/src/selectiondata.hg
@@ -98,11 +98,6 @@ public:
   // get_pixbuf() is const because it returns a newly allocated pixbuf.
   _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> get_pixbuf() const, gtk_selection_data_get_pixbuf)
 
-  // The Cairo::Surface can be const because set_surface() copies the data in the surface.
-  _WRAP_METHOD(bool set_surface(const Cairo::RefPtr<const Cairo::Surface>& surface), 
gtk_selection_data_set_surface)
-  // get_surface() is const because it returns a newly allocated cairo surface.
-  _WRAP_METHOD(Cairo::RefPtr<Cairo::Surface> get_surface() const, gtk_selection_data_get_surface)
-
   // The Gdk::Texture can be const because set_texture() copies the data in the texture.
   _WRAP_METHOD(bool set_texture(const Glib::RefPtr<const Gdk::Texture>& texture), 
gtk_selection_data_set_texture)
   // get_texture() is const because it returns a newly allocated texture.
diff --git a/gtk/src/snapshot.ccg b/gtk/src/snapshot.ccg
index 5f9552b..dd59241 100644
--- a/gtk/src/snapshot.ccg
+++ b/gtk/src/snapshot.ccg
@@ -17,20 +17,6 @@
 #include <gtk/gtk.h>
 #include <gdkmm/cairoutils.h>
 
-/* Why reinterpret_cast<Snapshot*>(gobject) is needed:
- *
- * A Snapshot instance is in fact always a GtkSnapshot instance.
- * Unfortunately, GtkSnapshot cannot be a member of Snapshot,
- * because it is an opaque struct. Also, the C interface does not provide
- * any hooks to install a destroy notification handler, thus we cannot
- * wrap it dynamically either.
- *
- * The cast works because Snapshot does not have any member data, and
- * it is impossible to derive from it. This is ensured by using final on the
- * class and by using = delete on the default constructor.
- * This trick is used also in classes declared as _CLASS_OPAQUE_REFCOUNTED.
- */
-
 namespace Gtk
 {
 
@@ -72,24 +58,15 @@ Cairo::RefPtr<Cairo::Context> Snapshot::append_cairo(
   return append_cairo(&rect, name);
 }
 
-GtkSnapshot* Snapshot::gobj()
-{
-  return reinterpret_cast<GtkSnapshot*>(this);
-}
-
-const GtkSnapshot* Snapshot::gobj() const
-{
-  return reinterpret_cast<const GtkSnapshot*>(this);
-}
-
 } //namespace Gtk
 
 namespace Glib
 {
 
-Gtk::Snapshot* wrap(GtkSnapshot* gobject)
+Glib::RefPtr<Gtk::Snapshot> wrap_gtk_snapshot(GtkSnapshot* object, bool take_copy)
 {
-  return reinterpret_cast<Gtk::Snapshot*>(gobject);
+  return Glib::make_refptr_for_instance<Gtk::Snapshot>( dynamic_cast<Gtk::Snapshot*> 
(Glib::wrap_auto((GObject*)(object), take_copy)) );
+  //We use dynamic_cast<> in case of multiple inheritance.
 }
 
-} //namespace Glib
+} /* namespace Glib */
diff --git a/gtk/src/snapshot.hg b/gtk/src/snapshot.hg
index 28b27ff..f161f3a 100644
--- a/gtk/src/snapshot.hg
+++ b/gtk/src/snapshot.hg
@@ -14,9 +14,12 @@
  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <gdkmm/snapshot.h>
+#include <gdkmm/rectangle.h>
 #include <gtkmm/stylecontext.h>
 
 _DEFS(gtkmm,gtk)
+_PINCLUDE(gdkmm/private/snapshot_p.h)
 
 typedef struct _graphene_rect_t graphene_rect_t;
 
@@ -38,14 +41,19 @@ namespace Gtk
  * The node at the top of the stack is the the one that append_node()
  * operates on. Use the push() and pop() functions to change the current node.
  *
- * The only way to obtain a %Snapshot object is as an argument to
- * Gtk::WidgetCustomSnapshot::snapshot_vfunc().
+ * The typical way to obtain a %Snapshot object is as an argument to
+ * Gtk::WidgetCustomSnapshot::snapshot_vfunc(). If you need to create your own
+ *  %Snapshot, use create().
  *
  * @newin{3,90}
  */
-class Snapshot final
+class Snapshot : public Gdk::Snapshot
 {
-  _CLASS_GENERIC(Snapshot, GtkSnapshot)
+  _CLASS_GOBJECT(Snapshot, GtkSnapshot, GTK_SNAPSHOT, Gdk::Snapshot, GdkSnapshot)
+  // GtkSnapshot is typedefed as GdkSnapshot.
+  // GtkSnapshot's wrap function can't be called wrap(). It would be ambiguous
+  // when there is a wrap(GdkSnapshot*, bool)
+  _NO_WRAP_FUNCTION
 
 public:
   //TODO: Add more methods. What shall be done with methods that take Gsk or graphene classes?
@@ -139,34 +147,21 @@ public:
   _WRAP_METHOD(void render_insertion_cursor(const Glib::RefPtr<StyleContext>& context,
     double x, double y, const Glib::RefPtr<Pango::Layout>& layout, int index,
     Pango::Direction direction), gtk_snapshot_render_insertion_cursor)
-
-  ///Provides access to the underlying C instance.
-  GtkSnapshot* gobj();
-
-  ///Provides access to the underlying C instance.
-  const GtkSnapshot* gobj() const;
-
-  Snapshot() = delete;
-
-  // noncopyable
-  Snapshot(const Snapshot&) = delete;
-  Snapshot& operator=(const Snapshot&) = delete;
 };
 
 } // namespace Gtk
 
 namespace Glib
 {
-/** A C++ wrapper for the C object.
- *
- * @param gobject The C instance.
- * @return The C++ wrapper.
- *
- * @relates Gtk::Snapshot
- *
- * @newin{3,90}
- */
-Gtk::Snapshot* wrap(GtkSnapshot* gobject);
-
-} // namespace Glib
-
+  /** A Glib::wrap() method for this object.
+   *
+   * It's not called %wrap() because GtkSnapshot is a typedef of GdkSnapshot.
+   *
+   * @param object The C instance.
+   * @param take_copy False if the result should take ownership of the C instance. True if it should take a 
new copy or ref.
+   * @result A C++ instance that wraps this C instance.
+   *
+   * @relates Gtk::Snapshot
+   */
+  Glib::RefPtr<Gtk::Snapshot> wrap_gtk_snapshot(GtkSnapshot* object, bool take_copy = false);
+}
diff --git a/gtk/src/stylecontext.ccg b/gtk/src/stylecontext.ccg
index 22c1896..e46592c 100644
--- a/gtk/src/stylecontext.ccg
+++ b/gtk/src/stylecontext.ccg
@@ -16,6 +16,7 @@
  */
 
 #include <gdkmm/frameclock.h>
+#include <gdkmm/texture.h>
 #include <gtkmm/widget.h>
 #include <gtk/gtk.h>
 
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
index d76a48b..0ef65f1 100644
--- a/gtk/src/stylecontext.hg
+++ b/gtk/src/stylecontext.hg
@@ -22,8 +22,8 @@ _PINCLUDE(gtk/gtk.h)
 #include <gtkmm/styleprovider.h>
 #include <gtkmm/border.h>
 #include <gtkmm/enums.h>
-#include <gdkmm/window.h>
 #include <gdkmm/display.h>
+#include <gdkmm/rgba.h>
 
 #include <gtkmm/enums.h>
 #include <gtkmm/widgetpath.h>
@@ -35,6 +35,7 @@ _PINCLUDE(gtk/gtk.h)
 namespace Gdk
 {
 class FrameClock;
+class Texture;
 }
 
 namespace Gtk
diff --git a/gtk/src/textview.hg b/gtk/src/textview.hg
index cf78d2c..77a29ff 100644
--- a/gtk/src/textview.hg
+++ b/gtk/src/textview.hg
@@ -134,9 +134,9 @@ public:
   _WRAP_METHOD(void get_line_at_y(TextBuffer::iterator& target_iter, int y, int& line_top), 
gtk_text_view_get_line_at_y)
   _WRAP_METHOD(void get_line_at_y(TextBuffer::const_iterator& target_iter, int y, int& line_top) const, 
gtk_text_view_get_line_at_y)
 
-  _WRAP_METHOD(void buffer_to_window_coords(TextWindowType  win,
+  _WRAP_METHOD(void buffer_to_surface_coords(TextWindowType  win,
                                             int buffer_x, int buffer_y,
-                                            int& window_x, int& window_y) const, 
gtk_text_view_buffer_to_window_coords)
+                                            int& window_x, int& window_y) const, 
gtk_text_view_buffer_to_surface_coords)
   _WRAP_METHOD(void window_to_buffer_coords(TextWindowType  win,
                                             int window_x, int window_y,
                                             int& buffer_x, int& buffer_y) const, 
gtk_text_view_window_to_buffer_coords)
diff --git a/gtk/src/tooltip.hg b/gtk/src/tooltip.hg
index fd6a08f..9b045c4 100644
--- a/gtk/src/tooltip.hg
+++ b/gtk/src/tooltip.hg
@@ -17,7 +17,7 @@
 
 #include <glibmm/object.h>
 #include <giomm/icon.h>
-#include <gdkmm/texture.h>
+#include <gdkmm/paintable.h>
 #include <gtkmm/enums.h>
 #include <gtkmm/widget.h>
 
@@ -89,7 +89,7 @@ public:
    */
   void unset_text();
 
-  _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gdk::Texture>& texture), gtk_tooltip_set_icon)
+  _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gdk::Paintable>& paintable), gtk_tooltip_set_icon)
   _WRAP_METHOD(void set_icon(const Glib::RefPtr<Gio::Icon>& gicon), gtk_tooltip_set_icon_from_gicon)
 
   //TODO: Remove the _from_*() suffixes?
diff --git a/gtk/src/treeview.ccg b/gtk/src/treeview.ccg
index 810ac30..eecbf75 100644
--- a/gtk/src/treeview.ccg
+++ b/gtk/src/treeview.ccg
@@ -17,7 +17,6 @@
 
 #include <climits> // INT_MIN, etc.
 #include <glibmm/vectorutils.h>
-#include <gdkmm/cairoutils.h>
 #include <gdkmm/contentformats.h>
 #include <gtkmm/treeviewcolumn.h>
 #include <gtkmm/treeview_private.h>
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index f7cfddc..0ca6e91 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -629,7 +629,7 @@ public:
    */
   bool get_dest_row_at_pos(int drag_x, int drag_y, TreeModel::Path& path, DropPosition& pos) const;
 
-  _WRAP_METHOD(Cairo::RefPtr<Cairo::Surface> create_row_drag_icon(const TreeModel::Path& path) const, 
gtk_tree_view_create_row_drag_icon)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Paintable> create_row_drag_icon(const TreeModel::Path& path) const, 
gtk_tree_view_create_row_drag_icon)
 
 /* Interactive search */
   _WRAP_METHOD(void set_enable_search(bool enable_search = true), gtk_tree_view_set_enable_search)
diff --git a/gtk/src/treeviewcolumn.hg b/gtk/src/treeviewcolumn.hg
index 661d895..a1a513a 100644
--- a/gtk/src/treeviewcolumn.hg
+++ b/gtk/src/treeviewcolumn.hg
@@ -21,7 +21,6 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 
 #include <gtkmm/treeiter.h>
 #include <gtkmm/button.h>
-#include <gdkmm/window.h>
 #include <gtkmm/treemodel.h>
 #include <gtkmm/celllayout.h>
 #include <gtkmm/buildable.h>
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index ebddab4..ce10d7a 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -347,11 +347,11 @@ Widget* Widget::get_current_modal_grab()
   return Glib::wrap(gtk_grab_get_current());
 }
 
-void Widget::set_window(const Glib::RefPtr<Gdk::Window>& window)
+void Widget::set_surface(const Glib::RefPtr<Gdk::Surface>& surface)
 {
-  gtk_widget_set_window(gobj(), Glib::unwrap(window));
-  if (window)
-    window->reference(); // gtk_widget_set_window does not add a ref.
+  gtk_widget_set_surface(gobj(), Glib::unwrap(surface));
+  if (surface)
+    surface->reference(); // gtk_widget_set_surface does not add a ref.
 }
 
 Allocation Widget::get_clip() const
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index dd35c40..20b8c02 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -31,7 +31,7 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 #include <gtkmm/buildable.h>
 #include <gdkmm/events.h>
 #include <gdkmm/types.h>
-#include <gdkmm/window.h>
+#include <gdkmm/surface.h>
 #include <gdkmm/dragcontext.h>
 #include <gtkmm/enums.h>
 #include <gdkmm/display.h>
@@ -87,7 +87,7 @@ typedef Gdk::Rectangle Allocation;
  * In order to capture events from a widget, the event mask must
  * first be set with ().
  *
- * Only widgets with a Gdk::Window on the server side are allowed to
+ * Only widgets with a Gdk::Surface on the server side are allowed to
  * capture events.
  */
 class Widget
@@ -211,7 +211,7 @@ public:
   _WRAP_METHOD(void set_visible(bool visible = true), gtk_widget_set_visible)
   _WRAP_METHOD(bool get_visible() const, gtk_widget_get_visible)
   _WRAP_METHOD(bool is_visible() const, gtk_widget_is_visible)
-  _WRAP_METHOD(bool get_has_window() const, gtk_widget_get_has_window)
+  _WRAP_METHOD(bool get_has_surface() const, gtk_widget_get_has_surface)
   _WRAP_METHOD(bool get_is_toplevel() const, gtk_widget_is_toplevel)
   _WRAP_METHOD(bool get_is_drawable() const, gtk_widget_is_drawable)
   _WRAP_METHOD(bool get_realized() const, gtk_widget_get_realized)
@@ -220,11 +220,11 @@ public:
   _WRAP_METHOD(void set_child_visible(bool visible = true), gtk_widget_set_child_visible)
   _WRAP_METHOD(bool get_child_visible() const, gtk_widget_get_child_visible)
 
-  _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_window(), gtk_widget_get_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_window() const, gtk_widget_get_window, refreturn, 
constversion)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Surface> get_surface(), gtk_widget_get_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Surface> get_surface() const, gtk_widget_get_surface, refreturn, 
constversion)
 
-  _WRAP_METHOD(void register_window(const Glib::RefPtr<Gdk::Window>& window), gtk_widget_register_window)
-  _WRAP_METHOD(void unregister_window(const Glib::RefPtr<Gdk::Window>& window), gtk_widget_unregister_window)
+  _WRAP_METHOD(void register_surface(const Glib::RefPtr<Gdk::Surface>& surface), gtk_widget_register_surface)
+  _WRAP_METHOD(void unregister_surface(const Glib::RefPtr<Gdk::Surface>& surface), 
gtk_widget_unregister_surface)
 
   _WRAP_METHOD(int get_allocated_width() const, gtk_widget_get_allocated_width)
   _WRAP_METHOD(int get_allocated_height() const, gtk_widget_get_allocated_height)
@@ -267,9 +267,9 @@ public:
   _WRAP_METHOD(Container* get_parent(), gtk_widget_get_parent)
   _WRAP_METHOD(const Container* get_parent() const, gtk_widget_get_parent, constversion)
 
-  _WRAP_METHOD(Glib::RefPtr<Gdk::Window> get_parent_window(), gtk_widget_get_parent_window, refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const Gdk::Window> get_parent_window() const, gtk_widget_get_parent_window, 
refreturn, constversion)
-  _WRAP_METHOD(void set_parent_window(const Glib::RefPtr<const Gdk::Window>& parent_window), 
gtk_widget_set_parent_window)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::Surface> get_parent_surface(), gtk_widget_get_parent_surface, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::Surface> get_parent_surface() const, gtk_widget_get_parent_surface, 
refreturn, constversion)
+  _WRAP_METHOD(void set_parent_surface(const Glib::RefPtr<const Gdk::Surface>& parent_surface), 
gtk_widget_set_parent_surface)
 
   _WRAP_METHOD(bool child_focus(DirectionType direction), gtk_widget_child_focus)
 
@@ -370,7 +370,6 @@ public:
   _WRAP_METHOD(static void set_default_direction(TextDirection dir), gtk_widget_set_default_direction)
   _WRAP_METHOD(static TextDirection get_default_direction(), gtk_widget_get_default_direction)
 
-  _WRAP_METHOD(void shape_combine_region(const Cairo::RefPtr<const Cairo::Region>& region), 
gtk_widget_shape_combine_region)
   _WRAP_METHOD(void input_shape_combine_region(const Cairo::RefPtr<const Cairo::Region>& region), 
gtk_widget_input_shape_combine_region)
 
   _WRAP_METHOD(void set_cursor(const Glib::RefPtr<Gdk::Cursor>& cursor), gtk_widget_set_cursor)
@@ -447,7 +446,6 @@ public:
 
   _WRAP_METHOD(void drag_source_unset(), gtk_drag_source_unset)
 
-  _WRAP_METHOD(void drag_source_set_icon(const Cairo::RefPtr<Cairo::Surface>& surface), 
gtk_drag_source_set_icon_surface)
   _WRAP_METHOD(void drag_source_set_icon(const Glib::ustring& icon_name), gtk_drag_source_set_icon_name)
 
   _WRAP_METHOD(void drag_source_add_text_targets(), gtk_drag_source_add_text_targets)
@@ -582,7 +580,7 @@ public:
   // 2017-06-06: The gtk+ API is not stable yet. See https://bugzilla.gnome.org/show_bug.cgi?id=783445#c2
   //_WRAP_METHOD(void set_focus_child(Widget& child), gtk_widget_set_focus_child)
   //void unset_focus_child();
-  _WRAP_METHOD(void snapshot_child(Widget& child, Snapshot& snapshot), gtk_widget_snapshot_child)
+  _WRAP_METHOD(void snapshot_child(Widget& child, const Glib::RefPtr<Gtk::Snapshot>& snapshot), 
gtk_widget_snapshot_child)
 
   _WRAP_SIGNAL(void show(),"show")
   _WRAP_SIGNAL(void hide(),"hide", custom_c_callback)
@@ -704,7 +702,7 @@ _CONVERSION(`GdkDisplay*',`const Glib::RefPtr<Gdk::Display>&',`Glib::wrap($3, tr
   _WRAP_PROPERTY("has_tooltip", bool)
   _WRAP_PROPERTY("tooltip_markup", Glib::ustring)
   _WRAP_PROPERTY("tooltip_text", Glib::ustring)
-  _WRAP_PROPERTY("window", Glib::RefPtr<Gdk::Window>)
+  _WRAP_PROPERTY("surface", Glib::RefPtr<Gdk::Surface>)
 
   _WRAP_PROPERTY("halign", Align)
   _WRAP_PROPERTY("valign", Align)
@@ -742,8 +740,8 @@ protected:
   // Custom widgets that need the snapshot vfunc must use a custom rendering widget
   // that wraps the snapshot vfunc.
   // https://bugzilla.gnome.org/show_bug.cgi?id=774778
-//#m4 _CONVERSION(`GtkSnapshot*',`Snapshot&',`*Glib::wrap($3)')
-  //_WRAP_VFUNC(void snapshot(Snapshot& snapshot), snapshot)
+//#m4 _CONVERSION(`GtkSnapshot*',`const Glib::RefPtr<Gtk::Snapshot>&',`Glib::wrap_gtk_snapshot($3, true)')
+  //_WRAP_VFUNC(void snapshot(const Glib::RefPtr<Gtk::Snapshot>& snapshot), snapshot)
 
 protected:
   _CTOR_DEFAULT()
@@ -755,15 +753,15 @@ protected:
 
   _WRAP_METHOD(void set_realized(bool realized = true), gtk_widget_set_realized)
 
-  _WRAP_METHOD(void set_has_window(bool has_window = true), gtk_widget_set_has_window)
+  _WRAP_METHOD(void set_has_surface(bool has_surface = true), gtk_widget_set_has_surface)
 
-  /** Sets a widget's window. This function should only be used in a
-   * widget's Gtk::Widget::on_realize() implementation. The %window passed is
-   * usually either a new window created with Gdk::Window::create(), or the
-   * window of its parent widget as returned by get_parent_window().
+  /** Sets a widget's surface. This function should only be used in a
+   * widget's Gtk::Widget::on_realize() implementation. The %surface passed is
+   * usually either a new surface created with Gdk::Surface::create(), or the
+   * surface of its parent widget as returned by get_parent_surface().
    *
-   * Widgets must indicate whether they will create their own Gdk::Window
-   * by calling set_has_window(). This is usually done in the
+   * Widgets must indicate whether they will create their own Gdk::Surface
+   * by calling set_has_surface(). This is usually done in the
    * widget's constructor.
    *
    * This function should only be called by custom widget implementations,
@@ -771,10 +769,10 @@ protected:
    *
    * @newin{2,18}
    *
-   * @param window A Gdk::Window.
+   * @param surface A Gdk::Surface.
    */
-  void set_window(const Glib::RefPtr<Gdk::Window>& window);
-  _IGNORE(gtk_widget_set_window)
+  void set_surface(const Glib::RefPtr<Gdk::Surface>& surface);
+  _IGNORE(gtk_widget_set_surface)
 
   void realize_if_needed();
 
diff --git a/gtk/src/window.ccg b/gtk/src/window.ccg
index ac90cb6..bb71652 100644
--- a/gtk/src/window.ccg
+++ b/gtk/src/window.ccg
@@ -20,7 +20,6 @@
 
 #include <gtkmm/accelgroup.h>
 #include <gdkmm/monitor.h>
-#include <gdkmm/cairoutils.h>
 #include <gtk/gtk.h>
 
 
@@ -44,7 +43,7 @@ Glib::RefPtr<AccelGroup> Window::get_accel_group()
 
 void Window::raise()
 {
-  get_window()->raise();
+  get_surface()->raise();
 }
 
 void Window::set_manage()
diff --git a/gtk/src/window.hg b/gtk/src/window.hg
index 4e6bbd5..080f025 100644
--- a/gtk/src/window.hg
+++ b/gtk/src/window.hg
@@ -68,7 +68,7 @@ public:
   _WRAP_PROPERTY("icon-name", Glib::ustring)
   _WRAP_PROPERTY("display", Glib::RefPtr<Gdk::Display>)
   _WRAP_PROPERTY("is_active", bool)
-  _WRAP_PROPERTY("type_hint", Gdk::Window::TypeHint)
+  _WRAP_PROPERTY("type_hint", Gdk::Surface::TypeHint)
   _WRAP_PROPERTY("skip_taskbar_hint", bool)
   _WRAP_PROPERTY("skip_pager_hint", bool)
   _WRAP_PROPERTY("role", Glib::ustring)
@@ -165,8 +165,8 @@ dnl
   _WRAP_METHOD(Widget* get_attached_to(), gtk_window_get_attached_to)
   _WRAP_METHOD(const Widget* get_attached_to() const, gtk_window_get_attached_to, constversion)
 
-  _WRAP_METHOD(void set_type_hint(Gdk::Window::TypeHint hint), gtk_window_set_type_hint)
-  _WRAP_METHOD(Gdk::Window::TypeHint get_type_hint() const, gtk_window_get_type_hint)
+  _WRAP_METHOD(void set_type_hint(Gdk::Surface::TypeHint hint), gtk_window_set_type_hint)
+  _WRAP_METHOD(Gdk::Surface::TypeHint get_type_hint() const, gtk_window_get_type_hint)
 
   _WRAP_METHOD(void set_skip_taskbar_hint(bool setting = true), gtk_window_set_skip_taskbar_hint)
   _WRAP_METHOD(bool get_skip_taskbar_hint() const, gtk_window_get_skip_taskbar_hint)
@@ -287,7 +287,7 @@ dnl
   _WRAP_METHOD(void fullscreen_on_monitor(const Glib::RefPtr<Gdk::Monitor>& monitor), 
gtk_window_fullscreen_on_monitor)
   _WRAP_METHOD(void close(), gtk_window_close)
 
-  _WRAP_METHOD(void begin_resize_drag(Gdk::WindowEdge edge,
+  _WRAP_METHOD(void begin_resize_drag(Gdk::SurfaceEdge edge,
                    int button, int root_x, int root_y, guint32 timestamp),
                gtk_window_begin_resize_drag)
 
@@ -349,7 +349,7 @@ dnl
   Glib::RefPtr<AccelGroup> get_accel_group();
 
   /** Brings the window to the front.
-   * This is just a more obvious convenience wrapper for get_window()->raise().
+   * This is just a more obvious convenience wrapper for get_surface()->raise().
    */
   void raise();
 
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 342f796..7a34034 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -57,20 +57,19 @@ _CONV_ENUM(Gdk,ModifierIntent)
 _CONV_ENUM(Gdk,NotifyType)
 _CONV_ENUM(Gdk,OverlapType)
 _CONV_ENUM(Gdk,OwnerChange)
+_CONV_INCLASS_ENUM(Gdk,Paintable,Flags)
 _CONV_ENUM(Gdk,PropertyState)
 _CONV_ENUM(Gdk,ScrollDirection)
 _CONV_INCLASS_ENUM(Gdk,Seat,Capabilities)
 _CONV_ENUM(Gdk,SettingAction)
 _CONV_ENUM(Gdk,Status)
 _CONV_ENUM(Gdk,SubpixelLayout)
-_CONV_ENUM(Gdk,SubwindowMode)
+_CONV_ENUM(Gdk,SurfaceEdge)
+_CONV_INCLASS_ENUM(Gdk,Surface,Hints)
+_CONV_INCLASS_ENUM(Gdk,Surface,State)
+_CONV_INCLASS_ENUM(Gdk,Surface,Type)
+_CONV_INCLASS_ENUM(Gdk,Surface,TypeHint)
 _CONV_ENUM(Gdk,TouchpadGesturePhase)
-_CONV_ENUM(Gdk,WindowAttributesType)
-_CONV_ENUM(Gdk,WindowEdge)
-_CONV_INCLASS_ENUM(Gdk,Window,Hints)
-_CONV_INCLASS_ENUM(Gdk,Window,State)
-_CONV_INCLASS_ENUM(Gdk,Window,Type)
-_CONV_INCLASS_ENUM(Gdk,Window,TypeHint)
 _CONV_ENUM(Gdk,WMDecoration)
 _CONV_ENUM(Gdk,WMFunction)
 _CONV_ENUM(Gdk,GrabStatus)
@@ -118,8 +117,8 @@ _CONVERSION(`const Glib::RefPtr<Cursor>&',`GdkCursor*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Cursor>&',`GdkCursor*',__CONVERT_CONST_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Gdk::Cursor>&',`GdkCursor*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Gdk::Cursor>&',`GdkCursor*',__CONVERT_CONST_REFPTR_TO_P)
-_CONVERSION(`const Glib::RefPtr<Gdk::Window>&',`GdkWindow*',__CONVERT_REFPTR_TO_P)
-_CONVERSION(`const Glib::RefPtr<Window>&',`GdkWindow*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Gdk::Surface>&',`GdkSurface*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Surface>&',`GdkSurface*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<GLContext>&',`GdkGLContext*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Gdk::GLContext>&',`GdkGLContext*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<DrawContext>&',`GdkDrawContext*',__CONVERT_REFPTR_TO_P)
@@ -129,6 +128,8 @@ _CONVERSION(`const Glib::RefPtr<Gdk::Bitmap>&',`GdkBitmap*',__CONVERT_REFPTR_TO_
 _CONVERSION(`const Glib::RefPtr<Drawable>&',`GdkDrawable*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Gdk::Drawable>&',`GdkDrawable*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Drawable>&',`GdkDrawable*',__CONVERT_CONST_REFPTR_TO_P_SUN(Drawable))
+_CONVERSION(`const Glib::RefPtr<const Gdk::Paintable>&',`GdkPaintable*',__CONVERT_CONST_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Gdk::Paintable>&',`GdkPaintable*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Pixbuf>&',`GdkPixbuf*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Pixbuf>&',`const GdkPixbuf*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Pixbuf>&',`GdkPixbuf*',__CONVERT_CONST_REFPTR_TO_P_SUN(Pixbuf))
@@ -143,7 +144,9 @@ _CONVERSION(`const Glib::RefPtr<Gdk::Display>&',`GdkDisplay*',__CONVERT_REFPTR_T
 _CONVERSION(`const Glib::RefPtr<Gdk::Device>&',`GdkDevice*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Device>&',`GdkDevice*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Device>&',`GdkDevice*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Device))
+_CONVERSION(`const Glib::RefPtr<Monitor>&',`GdkMonitor*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Gdk::Monitor>&',`GdkMonitor*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Gdk::Snapshot>&',`GdkSnapshot*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Texture>&',`GdkTexture*',__CONVERT_CONST_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Gdk::Texture>&',`GdkTexture*',__CONVERT_CONST_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<Gdk::Texture>&',`GdkTexture*',__CONVERT_REFPTR_TO_P)
@@ -161,12 +164,12 @@ _CONVERSION(`GdkRectangle*',`Gdk::Rectangle*',`&Glib::wrap($3)')
 _CONVERSION(`GdkRectangle*',`const Gdk::Rectangle*',`&Glib::wrap($3)')
 
 # Special treatment for the Sun Forte compiler
-#_CONVERSION(const Glib::RefPtr<const Gdk::Window>&,GdkWindow*,__CONVERT_CONST_REFPTR_TO_P)
+#_CONVERSION(const Glib::RefPtr<const Gdk::Surface>&,GdkSurface*,__CONVERT_CONST_REFPTR_TO_P)
 #_CONVERSION(const Glib::RefPtr<const Gdk::Bitmap>&,GdkBitmap*,__CONVERT_CONST_REFPTR_TO_P)
 
 _CONVERSION(`const Glib::RefPtr<const Gdk::Device>&', 
`GdkDevice*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Device))
-_CONVERSION(`const Glib::RefPtr<const Gdk::Window>&', 
`GdkWindow*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Window))
-_CONVERSION(`const Glib::RefPtr<const Window>&', `GdkWindow*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Window))
+_CONVERSION(`const Glib::RefPtr<const Gdk::Surface>&', 
`GdkSurface*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Surface))
+_CONVERSION(`const Glib::RefPtr<const Surface>&', 
`GdkSurface*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Surface))
 _CONVERSION(`const Glib::RefPtr<const Gdk::GLContext>&', 
`GdkGLContext*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::GLContext))
 _CONVERSION(`const Glib::RefPtr<const GLContext>&', 
`GdkGLContext*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::GLContext))
 _CONVERSION(`const Glib::RefPtr<const Gdk::Bitmap>&', 
`GdkBitmap*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Bitmap))
@@ -175,10 +178,10 @@ _CONVERSION(`const Glib::RefPtr<const Gdk::Bitmap>&', `GdkBitmap*',__CONVERT_CON
 #_CONVERSION(`const Glib::RefPtr<const Display>&', `GdkDrawable*',__CONVERT_CONST_REFPTR_TO_P_SUN(Drawable))
 
 
-_CONVERSION(`GdkWindow*',`Glib::RefPtr<Window>', `Glib::wrap($3)')
-_CONVERSION(`GdkWindow*',`Glib::RefPtr<const Window>', `Glib::wrap($3)')
-_CONVERSION(`GdkWindow*',`Glib::RefPtr<Gdk::Window>', `Glib::wrap($3)')
-_CONVERSION(`GdkWindow*',`Glib::RefPtr<const Gdk::Window>', `Glib::wrap($3)')
+_CONVERSION(`GdkSurface*',`Glib::RefPtr<Surface>', `Glib::wrap($3)')
+_CONVERSION(`GdkSurface*',`Glib::RefPtr<const Surface>', `Glib::wrap($3)')
+_CONVERSION(`GdkSurface*',`Glib::RefPtr<Gdk::Surface>', `Glib::wrap($3)')
+_CONVERSION(`GdkSurface*',`Glib::RefPtr<const Gdk::Surface>', `Glib::wrap($3)')
 _CONVERSION(`GdkGLContext*',`Glib::RefPtr<GLContext>', `Glib::wrap($3)')
 _CONVERSION(`GdkGLContext*',`Glib::RefPtr<const GLContext>', `Glib::wrap($3)')
 _CONVERSION(`GdkGLContext*',`Glib::RefPtr<Gdk::GLContext>', `Glib::wrap($3)')
@@ -211,6 +214,9 @@ _CONVERSION(`GdkDevice*',`Glib::RefPtr<Gdk::Device>', `Glib::wrap($3)')
 _CONVERSION(`GdkDevice*',`Glib::RefPtr<const Device>', `Glib::wrap($3)')
 _CONVERSION(`GdkDevice*',`Glib::RefPtr<const Gdk::Device>', `Glib::wrap($3)')
 
+_CONVERSION(`GdkPaintable*',`Glib::RefPtr<const Paintable>', `Glib::wrap($3)')
+_CONVERSION(`GdkPaintable*',`Glib::RefPtr<Gdk::Paintable>', `Glib::wrap($3)')
+
 _CONVERSION(`GdkSeat*',`Glib::RefPtr<Seat>', `Glib::wrap($3)')
 _CONVERSION(`GdkSeat*',`Glib::RefPtr<Gdk::Seat>', `Glib::wrap($3)')
 _CONVERSION(`GdkSeat*',`Glib::RefPtr<const Seat>', `Glib::wrap($3)')
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 4b0a887..bd57837 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -424,8 +424,7 @@ _CONVERSION(`GtkShortcutsWindow*',`ShortcutsWindow*',__RP2P)
 _CONVERSION(`GtkShortcutsWindow*',`const ShortcutsWindow*',__RP2P)
 _CONVERSION(`ShortcutsWindow&',`GtkShortcutsWindow*',__FR2P)
 
-_CONVERSION(`Snapshot&',`GtkSnapshot*',__FR2P)
-_CONVERSION(`Gtk::Snapshot&',`GtkSnapshot*',__FR2P)
+_CONVERSION(`const Glib::RefPtr<Gtk::Snapshot>&', `GtkSnapshot*', __CONVERT_REFPTR_TO_P)
 
 #FlowBoxChild
 _CONVERSION(`GtkFlowBoxChild*',`FlowBoxChild*',__RP2P)


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