[gtkmm] Gdk, Gtk: Update for the latest gtk4 (Remove Paned::child_property_*(), etc.)



commit 50d2aaf9b63806c25344eab37d865a980a2555ef
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Mon Apr 1 18:49:40 2019 +0200

    Gdk, Gtk: Update for the latest gtk4 (Remove Paned::child_property_*(), etc.)
    
    * gdk/src/device.[ccg|hg]: Remove warp(), get_position(int& x, int& y),
    get_surface_at_position(int& x, int& y).
    Add get_surface_at_position(double& x, double& y).
    * gdk/src/surface.hg: Remove set_role(),
    get_device_position(..., int& x, int& y, ...).
    * gtk/src/actionbar.hg: Remove child property.
    * gtk/src/application.hg: Add signal_query_end().
    * gtk/src/fixed.hg: Remove child properties. Add get_child_position().
    * gtk/src/headerbar.hg:
    * gtk/src/overlay.hg: Remove child properties.
    * gtk/src/paned.hg: Remove child properties.
    Add property_resize_child1/2(), property_shrink_child1/2(),
    * gtk/src/popovermenu.hg: Remove child property. Add add_submenu().
    * gtk/src/searchentry.hg: Add property_placeholder_text(),
    property_actives_default().
    * gtk/src/stylecontext.hg: Remove obsolete _IGNORE().
    * gtk/src/toolbar.hg: Remove child properties.
    * gtk/src/toolitem.hg: Add property_expand_item(), property_homogeneous().
    * gtk/src/window.hg: Remove set/get/property_role(),
    set/get/property_gravity(), move(), get_position().
    * tools/m4/convert_gdk.m4: Remove conversions for GdkGrabOwnership.

 gdk/src/device.ccg      |  7 +------
 gdk/src/device.hg       | 29 +++++------------------------
 gdk/src/surface.hg      |  5 +----
 gtk/src/actionbar.hg    |  2 --
 gtk/src/application.hg  |  2 ++
 gtk/src/fixed.hg        |  4 +---
 gtk/src/headerbar.hg    |  2 --
 gtk/src/overlay.hg      |  3 ---
 gtk/src/paned.hg        |  7 ++++---
 gtk/src/popovermenu.hg  |  3 +--
 gtk/src/searchentry.hg  |  4 +++-
 gtk/src/stylecontext.hg |  1 -
 gtk/src/toolbar.hg      |  3 ---
 gtk/src/toolitem.hg     |  2 ++
 gtk/src/window.hg       | 20 ++------------------
 tools/m4/convert_gdk.m4 |  1 -
 16 files changed, 22 insertions(+), 73 deletions(-)
---
diff --git a/gdk/src/device.ccg b/gdk/src/device.ccg
index 6f3f6ef3..b03f185d 100644
--- a/gdk/src/device.ccg
+++ b/gdk/src/device.ccg
@@ -39,14 +39,9 @@ std::vector<TimeCoord> Device::get_history(const Glib::RefPtr<Surface>& surface,
   return Glib::ArrayHandler<TimeCoord, TimeCoordPtrTraits>::array_to_vector(coords, events_count, 
Glib::OWNERSHIP_DEEP);
 }
 
-void Device::get_position(int& x, int& y) const
-{
-  gdk_device_get_position(const_cast<GdkDevice*>(gobj()), &x, &y);
-}
-
 void Device::get_position(double& x, double& y) const
 {
-  gdk_device_get_position_double(const_cast<GdkDevice*>(gobj()), &x, &y);
+  gdk_device_get_position(const_cast<GdkDevice*>(gobj()), &x, &y);
 }
 
 Glib::RefPtr<Surface> Device::get_surface_at_position()
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index 1ceadadb..5b3a8ab0 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -34,7 +34,6 @@ namespace Gdk
 _WRAP_ENUM(EventMask, GdkEventMask)
 _WRAP_ENUM(InputMode, GdkInputMode)
 _WRAP_ENUM(InputSource, GdkInputSource)
-//_WRAP_ENUM(GrabOwnership, GdkGrabOwnership) Used only in deprecated gdk_device_grab()
 _WRAP_ENUM(GrabStatus, GdkGrabStatus)
 
 class DeviceTool;
@@ -108,22 +107,6 @@ public:
 
   _WRAP_METHOD(Type get_device_type() const, gdk_device_get_device_type)
 
-   _IGNORE(gdk_device_grab, gdk_device_ungrab)dnl//deprecated
-
-  _WRAP_METHOD(void warp(int x, int y), gdk_device_warp)
-
-  /** Gets the current location of the device.
-   * 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,
-   * unless there is an ongoing grab on them. See grab().
-   *
-   * @param[out] x This will contain the root window X coordinate of the device.
-   * @param[out] y This will contain the root window X coordinate of the device.
-   */
-  void get_position(int& x, int& y) const;
-  _IGNORE(gdk_device_get_position)
-
-
   /** Gets the current location of the device in double precision.
    * 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,
@@ -135,14 +118,12 @@ public:
    * @newin{3,10}
    */
   void get_position(double& x, double& y) const;
-  _IGNORE(gdk_device_get_position_double)
-
-  _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)
+  _IGNORE(gdk_device_get_position)
 
-  //TODO: Would this be ambiguous? Test it.
-  //_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)
+  _WRAP_METHOD(Glib::RefPtr<Surface> get_surface_at_position(double& win_x, double& win_y),
+    gdk_device_get_surface_at_position, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Surface> get_surface_at_position(double& win_x, double& win_y) const,
+    gdk_device_get_surface_at_position, refreturn, constversion)
 
   /** 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).
diff --git a/gdk/src/surface.hg b/gdk/src/surface.hg
index 7a39169e..f5c0cf6e 100644
--- a/gdk/src/surface.hg
+++ b/gdk/src/surface.hg
@@ -135,7 +135,6 @@ public:
   _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)
 
@@ -175,9 +174,7 @@ public:
   _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)
+  _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, 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)
diff --git a/gtk/src/actionbar.hg b/gtk/src/actionbar.hg
index bb3c432a..05c8eade 100644
--- a/gtk/src/actionbar.hg
+++ b/gtk/src/actionbar.hg
@@ -67,8 +67,6 @@ public:
 
   _WRAP_PROPERTY("revealed", bool, newin "3,92")
 
-  _WRAP_CHILD_PROPERTY("pack-type", PackType, newin "3,92")
-
   // Gtk::ActionBar has no signals nor vfuncs as of 3.90.
 };
 
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index 86fdd6c7..0d4fa10c 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -303,6 +303,8 @@ public:
 
   _WRAP_SIGNAL(void window_added(Window* window), "window-added")
   _WRAP_SIGNAL(void window_removed(Window* window), "window-removed")
+  // no_default_handler because the wrapped C signal has no default handler.
+  _WRAP_SIGNAL(void query_end(), "query-end", no_default_handler)
 
 private:
   /** This is just a way to call Glib::init() before calling a Glib::Object ctor,
diff --git a/gtk/src/fixed.hg b/gtk/src/fixed.hg
index 5a78957f..6086f7a8 100644
--- a/gtk/src/fixed.hg
+++ b/gtk/src/fixed.hg
@@ -45,9 +45,7 @@ public:
 
   _WRAP_METHOD(void put(Widget& widget, int x, int y), gtk_fixed_put)
   _WRAP_METHOD(void move(Widget& widget, int x, int y), gtk_fixed_move)
-
-  _WRAP_CHILD_PROPERTY("x", int)
-  _WRAP_CHILD_PROPERTY("y", int)
+  _WRAP_METHOD(void get_child_position(Widget& widget, int& x, int& y) const, gtk_fixed_get_child_position)
 };
 
 } //namespace Gtk
diff --git a/gtk/src/headerbar.hg b/gtk/src/headerbar.hg
index e517d55d..41314ebc 100644
--- a/gtk/src/headerbar.hg
+++ b/gtk/src/headerbar.hg
@@ -82,8 +82,6 @@ public:
   _WRAP_PROPERTY("decoration-layout-set", bool)
   _WRAP_PROPERTY("has-subtitle", bool)
 
-  _WRAP_CHILD_PROPERTY("pack-type", PackType)
-
   // Gtk::HeaderBar has no signals nor vfuncs as of 3.12.
 };
 
diff --git a/gtk/src/overlay.hg b/gtk/src/overlay.hg
index 19fca975..3ee358ec 100644
--- a/gtk/src/overlay.hg
+++ b/gtk/src/overlay.hg
@@ -65,9 +65,6 @@ public:
 
 #m4 _CONVERSION(`GdkRectangle*',`Gdk::Rectangle&',`Glib::wrap($3)')
   _WRAP_SIGNAL(bool get_child_position(Gtk::Widget* widget, Gdk::Rectangle& allocation), 
"get-child-position")
-
-  _WRAP_CHILD_PROPERTY("measure", bool)
-  _WRAP_CHILD_PROPERTY("clip-overlay", bool)
 };
 
 } // namespace Gtk
diff --git a/gtk/src/paned.hg b/gtk/src/paned.hg
index 15ca653e..3451da15 100644
--- a/gtk/src/paned.hg
+++ b/gtk/src/paned.hg
@@ -103,9 +103,10 @@ public:
   _WRAP_PROPERTY("min-position", int)
   _WRAP_PROPERTY("max-position", int)
   _WRAP_PROPERTY("wide-handle", bool)
-
-  _WRAP_CHILD_PROPERTY("resize", bool)
-  _WRAP_CHILD_PROPERTY("shrink", bool)
+  _WRAP_PROPERTY("resize-child1", bool)
+  _WRAP_PROPERTY("resize-child2", bool)
+  _WRAP_PROPERTY("shrink-child1", bool)
+  _WRAP_PROPERTY("shrink-child2", bool)
 };
 
 } // namespace Gtk
diff --git a/gtk/src/popovermenu.hg b/gtk/src/popovermenu.hg
index 39c378b4..92234095 100644
--- a/gtk/src/popovermenu.hg
+++ b/gtk/src/popovermenu.hg
@@ -55,12 +55,11 @@ class PopoverMenu : public Popover
 public:
   _CTOR_DEFAULT
 
+  _WRAP_METHOD(void add_submenu(Widget& submenu, const Glib::ustring& name), gtk_popover_menu_add_submenu)
   _WRAP_METHOD(void open_submenu(const Glib::ustring& name), gtk_popover_menu_open_submenu)
 
   _WRAP_PROPERTY("visible-submenu", Glib::ustring)
 
-  _WRAP_CHILD_PROPERTY("submenu", Glib::ustring)
-
   // PopoverMenu has no signals nor vfuncs.
 };
 
diff --git a/gtk/src/searchentry.hg b/gtk/src/searchentry.hg
index f7041820..cf4c1490 100644
--- a/gtk/src/searchentry.hg
+++ b/gtk/src/searchentry.hg
@@ -69,6 +69,7 @@ public:
   _WRAP_METHOD(const Widget* get_key_capture_widget() const, gtk_search_entry_get_key_capture_widget, 
constversion)
   void unset_key_capture_widget();
 
+  _IGNORE_SIGNAL("activate")dnl// Action signal
   _WRAP_SIGNAL(void search_changed(), "search-changed")
   // Although next-match, previous-match and stop-search are keybinding signals,
   // applications shall connect to them.
@@ -76,7 +77,8 @@ public:
   _WRAP_SIGNAL(void previous_match(), "previous-match")
   _WRAP_SIGNAL(void stop_search(), "stop-search")
 
-  // Gtk::SearchEntry has no properties nor vfuncs as of 3.16.
+  _WRAP_PROPERTY("placeholder-text", Glib::ustring)
+  _WRAP_PROPERTY("activates-default", bool)
 };
 
 } /* namespace Gtk */
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
index d8b61495..d1d6384c 100644
--- a/gtk/src/stylecontext.hg
+++ b/gtk/src/stylecontext.hg
@@ -166,7 +166,6 @@ public:
    */
   Gdk::RGBA get_color() const;
   _IGNORE(gtk_style_context_get_color)
-  _IGNORE(gtk_style_context_get_background_color, gtk_style_context_get_border_color)dnl//deprecated
 
   /** Returns the font description for a given state.
    *
diff --git a/gtk/src/toolbar.hg b/gtk/src/toolbar.hg
index cbb511eb..53cf9526 100644
--- a/gtk/src/toolbar.hg
+++ b/gtk/src/toolbar.hg
@@ -86,9 +86,6 @@ public:
 
   _WRAP_PROPERTY("toolbar_style", ToolbarStyle)
   _WRAP_PROPERTY("show_arrow", bool)
-
-  _WRAP_CHILD_PROPERTY("expand", bool)
-  _WRAP_CHILD_PROPERTY("homogeneous", bool)
 };
 
 } // namespace Gtk
diff --git a/gtk/src/toolitem.hg b/gtk/src/toolitem.hg
index 0464013b..2cba1596 100644
--- a/gtk/src/toolitem.hg
+++ b/gtk/src/toolitem.hg
@@ -102,6 +102,8 @@ public:
   _WRAP_PROPERTY("visible_horizontal", bool)
   _WRAP_PROPERTY("visible_vertical", bool)
   _WRAP_PROPERTY("is_important", bool)
+  _WRAP_PROPERTY("expand-item", bool)
+  _WRAP_PROPERTY("homogeneous", bool)
 };
 
 } // namespace Gtk
diff --git a/gtk/src/window.hg b/gtk/src/window.hg
index 4216f28a..8887e5dc 100644
--- a/gtk/src/window.hg
+++ b/gtk/src/window.hg
@@ -77,9 +77,7 @@ public:
   _WRAP_PROPERTY("type_hint", Gdk::Surface::TypeHint)
   _WRAP_PROPERTY("skip_taskbar_hint", bool)
   _WRAP_PROPERTY("skip_pager_hint", bool)
-  _WRAP_PROPERTY("role", Glib::ustring)
   _WRAP_PROPERTY("decorated", bool)
-  _WRAP_PROPERTY("gravity", Gdk::Gravity)
   _WRAP_PROPERTY("transient_for", Window*)
 
   _WRAP_PROPERTY("urgency_hint", bool)
@@ -117,12 +115,8 @@ dnl
 
   _WRAP_METHOD(Glib::ustring get_title() const, gtk_window_get_title)
 
-  _WRAP_METHOD(void set_role(const Glib::ustring& role), gtk_window_set_role)
-
   _WRAP_METHOD(void set_startup_id(const Glib::ustring& startup_id), gtk_window_set_startup_id)
 
-  _WRAP_METHOD(Glib::ustring get_role() const, gtk_window_get_role)
-
 
   _WRAP_METHOD(void add_accel_group(const Glib::RefPtr<AccelGroup>& accel_group),
                gtk_window_add_accel_group)
@@ -207,10 +201,6 @@ dnl
 
   _WRAP_METHOD(bool get_resizable() const, gtk_window_get_resizable)
 
-  _WRAP_METHOD(void set_gravity(Gdk::Gravity gravity), gtk_window_set_gravity)
-
-  _WRAP_METHOD(Gdk::Gravity get_gravity() const, gtk_window_get_gravity)
-
   _WRAP_METHOD(void set_display(const Glib::RefPtr<Gdk::Display>& display), gtk_window_set_display)
 
   _WRAP_METHOD(bool is_active() const, gtk_window_is_active)
@@ -270,11 +260,11 @@ dnl
   _WRAP_METHOD(void close(), gtk_window_close)
 
   _WRAP_METHOD(void begin_resize_drag(Gdk::SurfaceEdge edge,
-                   int button, int root_x, int root_y, guint32 timestamp),
+                   int button, int x, int y, guint32 timestamp),
                gtk_window_begin_resize_drag)
 
   _WRAP_METHOD(void begin_move_drag(
-                   int button, int root_x, int root_y, guint32 timestamp),
+                   int button, int x, int y, guint32 timestamp),
                gtk_window_begin_move_drag)
 
   _WRAP_METHOD(void set_default_size(int width, int height),
@@ -288,12 +278,6 @@ dnl
   _WRAP_METHOD(void get_size(int& width, int& height) const,
                gtk_window_get_size)
 
-
-  _WRAP_METHOD(void move(int x, int y), gtk_window_move)
-
-  _WRAP_METHOD(void get_position(int& root_x, int& root_y) const,
-               gtk_window_get_position)
-
   _WRAP_METHOD(Glib::RefPtr<WindowGroup> get_group(), gtk_window_get_group, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const WindowGroup> get_group() const, gtk_window_get_group, refreturn, 
constversion)
 
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 8965757c..b629d688 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -46,7 +46,6 @@ _CONV_INCLASS_ENUM(Gdk,FrameClock,Phase)
 _CONV_ENUM(Gdk,FullscreenMode)
 _CONV_ENUM(Gdk,Function)
 _CONV_ENUM(Gdk,Gravity)
-_CONV_ENUM(Gdk,GrabOwnership)
 _CONV_ENUM(Gdk,InputCondition)
 _CONV_ENUM(Gdk,InputMode)
 _CONV_ENUM(Gdk,InputSource)


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