[gtkmm] Update for the latest gtk+4 (remove some types of X11 events)



commit 682713acce9209bd1c647b26d396ddb7606105a6
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sun Dec 17 16:52:49 2017 +0100

    Update for the latest gtk+4 (remove some types of X11 events)
    
    Remove enum Gdk:PropertyState.
    Remove Gdk::EventProperty, EventSelection and EventWindowState.
    GdkAtom is now a typedef of const char*. gdk_atom_string() and
    gdk_atom_name() have been removed. Use g_intern_string().
    Some event signals in Gtk::Widget have been removed, others have been
    deprecated.
    GdkEvent is now a GObject. Gdk::Event and its subclasses have not yet
    been modified accordingly.

 demos/gtk-demo/demowindow.cc             |    2 +-
 demos/gtk-demo/example_change_display.cc |    4 +-
 demos/gtk-demo/example_drawingarea.cc    |    4 +
 demos/gtk-demo/example_headerbar.cc      |    2 +-
 demos/gtk-demo/example_iconbrowser.cc    |    2 +-
 demos/gtk-demo/example_stacksidebar.cc   |    2 +-
 gdk/src/display.ccg                      |   33 ----------
 gdk/src/display.hg                       |   39 +-----------
 gdk/src/dragcontext.hg                   |    7 +--
 gdk/src/enums.hg                         |   12 ----
 gdk/src/event.hg                         |   10 +---
 gdk/src/events.ccg                       |   61 ------------------
 gdk/src/events.hg                        |   98 +-----------------------------
 gdk/src/types.ccg                        |   13 ++--
 gdk/src/window.ccg                       |    2 +-
 gdk/src/window.hg                        |   11 +---
 gtk/src/adjustment.hg                    |    5 --
 gtk/src/headerbar.hg                     |    6 +-
 gtk/src/selectiondata.ccg                |   12 ++--
 gtk/src/selectiondata.hg                 |    3 -
 gtk/src/widget.ccg                       |   60 +------------------
 gtk/src/widget.hg                        |   47 +++++---------
 22 files changed, 56 insertions(+), 379 deletions(-)
---
diff --git a/demos/gtk-demo/demowindow.cc b/demos/gtk-demo/demowindow.cc
index 8febc54..c0129e4 100644
--- a/demos/gtk-demo/demowindow.cc
+++ b/demos/gtk-demo/demowindow.cc
@@ -107,7 +107,7 @@ DemoWindow::DemoWindow()
 
 void DemoWindow::configure_header_bar()
 {
-  m_HeaderBar.set_show_close_button();
+  m_HeaderBar.set_show_title_buttons();
   m_HeaderBar.pack_start(m_RunButton);
 
   m_RunButton.get_style_context()->add_class("suggested-action");
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index b154a82..3733c7f 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -26,8 +26,10 @@
  *  - Using Gtk::Dialog
  */
 
-#include <gtkmm.h>
+//TODO: Remove this undef when we know what to use instead of signal_button_release_event().
+#undef GTKMM_DISABLE_DEPRECATED
 
+#include <gtkmm.h>
 
 class Popup : public Gtk::Window
 {
diff --git a/demos/gtk-demo/example_drawingarea.cc b/demos/gtk-demo/example_drawingarea.cc
index 5e697ba..118771c 100644
--- a/demos/gtk-demo/example_drawingarea.cc
+++ b/demos/gtk-demo/example_drawingarea.cc
@@ -13,6 +13,10 @@
  * to clear the area.
  */
 
+//TODO: Remove this undef when we know what to use instead of
+// signal_motion_notify_event() and signal_button_release_event().
+#undef GTKMM_DISABLE_DEPRECATED
+
 #include <gtkmm.h>
 
 class Example_DrawingArea : public Gtk::Window
diff --git a/demos/gtk-demo/example_headerbar.cc b/demos/gtk-demo/example_headerbar.cc
index e201513..3a27850 100644
--- a/demos/gtk-demo/example_headerbar.cc
+++ b/demos/gtk-demo/example_headerbar.cc
@@ -49,7 +49,7 @@ Example_HeaderBar::Example_HeaderBar()
   set_default_size(600, 400);
 
   // Configuration
-  m_header_bar.set_show_close_button();
+  m_header_bar.set_show_title_buttons();
   m_header_bar.set_title("Welcome to Facebook - Log in, sign up or learn more");
   m_header_bar.set_has_subtitle(false);
 
diff --git a/demos/gtk-demo/example_iconbrowser.cc b/demos/gtk-demo/example_iconbrowser.cc
index f76d53b..c25c0e2 100644
--- a/demos/gtk-demo/example_iconbrowser.cc
+++ b/demos/gtk-demo/example_iconbrowser.cc
@@ -193,7 +193,7 @@ Example_IconBrowser::Example_IconBrowser()
   // The header bar.
   set_titlebar(m_header);
   m_header.set_title("Icon Browser");
-  m_header.set_show_close_button(true);
+  m_header.set_show_title_buttons(true);
   m_header.pack_end(m_search_button);
   m_search_button.set_image_from_icon_name("edit-find-symbolic");
   m_header.pack_end(m_header_radio_button_box);
diff --git a/demos/gtk-demo/example_stacksidebar.cc b/demos/gtk-demo/example_stacksidebar.cc
index 4dd9077..6a05c1c 100644
--- a/demos/gtk-demo/example_stacksidebar.cc
+++ b/demos/gtk-demo/example_stacksidebar.cc
@@ -43,7 +43,7 @@ Example_StackSidebar::Example_StackSidebar()
   m_Separator(Gtk::Orientation::VERTICAL),
   m_Stack()
 {
-  m_HeaderBar.set_show_close_button(true);
+  m_HeaderBar.set_show_title_buttons(true);
   set_titlebar(m_HeaderBar);
   set_title("Stack Sidebar demo");
   set_default_size(500, 350);
diff --git a/gdk/src/display.ccg b/gdk/src/display.ccg
index 4d91882..4af2dfc 100644
--- a/gdk/src/display.ccg
+++ b/gdk/src/display.ccg
@@ -27,37 +27,4 @@
 
 namespace Gdk
 {
-
-bool Display::set_selection_owner(const Glib::RefPtr<Window>& owner, Glib::ustring& selection, guint32 
time_, bool send_event)
-{
-  return gdk_selection_owner_set_for_display(gobj(), owner->gobj(), Gdk::AtomUstring::to_c_type(selection), 
time_, (gboolean)send_event);
-}
-
-Glib::RefPtr<Window> Display::get_selection_owner(const Glib::ustring& selection)
-{
-  return Glib::wrap(gdk_selection_owner_get_for_display(gobj(), Gdk::AtomUstring::to_c_type(selection)) , 
true);
-}
-
-void Display::selection_send_notify(const Glib::RefPtr<Window>& requestor, Glib::ustring& selection, 
Glib::ustring& target, Glib::ustring& property, guint32 time_)
-{
-  gdk_selection_send_notify_for_display(gobj(), Glib::unwrap(requestor), 
Gdk::AtomUstring::to_c_type(selection), Gdk::AtomUstring::to_c_type(target), 
Gdk::AtomUstring::to_c_type(property), time_);
-}
-
-void Display::store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_)
-{
-  gdk_display_store_clipboard(gobj(), clipboard_window->gobj(), time_, nullptr /* see the C docs */, 0);
-}
-
-void Display::store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_, const 
std::vector<Glib::ustring>& targets)
-{
-  if (!targets.size ())
-  {
-    gdk_display_store_clipboard(gobj(),
-                                Glib::unwrap (clipboard_window),
-                                time_,
-                                Glib::ArrayHandler<Glib::ustring, 
AtomUstringTraits>::vector_to_array(targets).data (),
-                                targets.size ());
-  }
-}
-
 } //namespace Gdk
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index 5731d53..b91ec83 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -73,24 +73,8 @@ public:
 
   _WRAP_METHOD(static Glib::RefPtr<Display> get_default(), gdk_display_get_default, refreturn)
 
-  _WRAP_METHOD(GdkKeymap* get_keymap(), gdk_keymap_get_for_display)
-  _WRAP_METHOD(const GdkKeymap* get_keymap() const, gdk_keymap_get_for_display, constversion)
-
-  bool set_selection_owner(const Glib::RefPtr<Window>& owner, Glib::ustring& selection, guint32 time_, bool 
send_event);
-  Glib::RefPtr<Window> get_selection_owner(const Glib::ustring& selection);
-
-  /** Send a response to SelectionRequest event.
-   *
-   * @newin{2,2}
-   *
-   * @param requestor Window to which to deliver response.
-   * @param selection Selection that was requested.
-   * @param target Target that was selected.
-   * @param property Property in which the selection owner stored the data,
-   * or "None" to indicate that the request was rejected.
-   * @param time_ Timestamp.
-   */
-  void selection_send_notify(const Glib::RefPtr<Window>& requestor, Glib::ustring& selection, Glib::ustring& 
target, Glib::ustring& property, guint32 time_);
+  _WRAP_METHOD(GdkKeymap* get_keymap(), gdk_display_get_keymap)
+  _WRAP_METHOD(const GdkKeymap* get_keymap() const, gdk_display_get_keymap, constversion)
 
   _WRAP_METHOD(void flush(), gdk_display_flush)
   _WRAP_METHOD(bool supports_cursor_alpha() const, gdk_display_supports_cursor_alpha)
@@ -101,30 +85,11 @@ public:
   _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(bool supports_selection_notification() const, gdk_display_supports_selection_notification)
-  _WRAP_METHOD(bool request_selection_notification(const Glib::ustring& selection), 
gdk_display_request_selection_notification)
-
   _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)
   _WRAP_METHOD(Glib::RefPtr<Clipboard> get_primary_clipboard(), gdk_display_get_primary_clipboard, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Clipboard> get_primary_clipboard() const, 
gdk_display_get_primary_clipboard, refreturn, constversion)
 
-  _WRAP_METHOD(bool supports_clipboard_persistence() const, gdk_display_supports_clipboard_persistence)
-
-  /** Issues a request to the clipboard manager to store the clipboard data,
-   * saving all available targets.
-   * On X11, this is a special program that works according to the freedesktop clipboard specification,
-   * available at http://www.freedesktop.org/Standards/clipboard-manager-spec.
-   * @newin{2,6}
-   *
-   * @param clipboard_window A Gdk::Window belonging to the clipboard owner.
-   * @param time_ A timestamp.
-   */
-  void store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_);
-
-  void store_clipboard(const Glib::RefPtr<Gdk::Window>& clipboard_window, guint32 time_, const 
std::vector<Glib::ustring>& targets);
-  _IGNORE(gdk_display_store_clipboard)
-
   _WRAP_METHOD(bool supports_shapes() const, gdk_display_supports_shapes)
   _WRAP_METHOD(bool supports_input_shapes() const, gdk_display_supports_input_shapes)
   _WRAP_METHOD(void notify_startup_complete(const Glib::ustring& startup_id), 
gdk_display_notify_startup_complete)
diff --git a/gdk/src/dragcontext.hg b/gdk/src/dragcontext.hg
index f71ac67..68eaf32 100644
--- a/gdk/src/dragcontext.hg
+++ b/gdk/src/dragcontext.hg
@@ -53,15 +53,13 @@ public:
 
   _WRAP_METHOD(void drop_reply(bool accepted, guint32 time), gdk_drop_reply)
   _WRAP_METHOD(void drop_finish(bool success, guint32 time), gdk_drop_finish)
-  _WRAP_METHOD(Glib::ustring get_selection() const, gdk_drag_get_selection)
 
-  //For some reason this is not in our *_docs.xml file.
+  // This description is in gtk_docs.xml, not in gdk_docs.xml file.
   /** Informs the drag source that the drop is finished, and that the data of the drag will no longer be 
required.
    * @param success A flag indicating whether the drop was successful.
-   * @param del A flag indicating whether the source should delete the original data. (This should be true 
for a move.)
    * @param time The timestamp from the "drag_data_drop" signal.
    */
-  _WRAP_METHOD(void drag_finish(bool success, bool del, guint32 time), gtk_drag_finish)
+  _WRAP_METHOD(void drag_finish(bool success, guint32 time), gtk_drag_finish)
   //Gtk::Widget* get_source_widget() - see Gtk::Widget::drag_get_source_widget()
 
   // void set_icon(Gtk::Widget* widget, int hot_x, int hot_y) - see Gtk::Widget::set_as_icon().
@@ -76,7 +74,6 @@ public:
   _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(void set_device(const Glib::RefPtr<Device>& device), gdk_drag_context_set_device)
   _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/enums.hg b/gdk/src/enums.hg
index 38e5271..c9dd337 100644
--- a/gdk/src/enums.hg
+++ b/gdk/src/enums.hg
@@ -19,17 +19,6 @@
 
 _DEFS(gdkmm,gdk)
 
-/* Shadow DELETE macro (from winnt.h).
- * It interferes with Gdk::PropertyState::DELETE.
- */
-#if defined(DELETE) && !defined(GTKMM_MACRO_SHADOW_DELETE)
-enum { GTKMM_MACRO_DEFINITION_DELETE = DELETE };
-#undef DELETE
-enum { DELETE = GTKMM_MACRO_DEFINITION_DELETE };
-#define DELETE DELETE
-#define GTKMM_MACRO_SHADOW_DELETE 1
-#endif
-
 namespace Gdk
 {
 _WRAP_ENUM(AxisFlags, GdkAxisFlags)
@@ -37,7 +26,6 @@ _WRAP_ENUM(AxisUse, GdkAxisUse)
 _WRAP_ENUM(CrossingMode, GdkCrossingMode)
 //_WRAP_ENUM(FilterReturn, GdkFilterReturn)
 _WRAP_ENUM(NotifyType, GdkNotifyType)
-_WRAP_ENUM(PropertyState, GdkPropertyState)
 _WRAP_ENUM(ScrollDirection, GdkScrollDirection)
 // GdkEventVisibility is deprecated and not wrapped in gtkmm.
 //_WRAP_ENUM(VisibilityState, GdkVisibilityState)
diff --git a/gdk/src/event.hg b/gdk/src/event.hg
index 8d76ae5..37408d0 100644
--- a/gdk/src/event.hg
+++ b/gdk/src/event.hg
@@ -85,11 +85,6 @@ public:
   _WRAP_METHOD(Glib::RefPtr<Seat> get_seat(), gdk_event_get_seat, refreturn, newin "3,90")
   _WRAP_METHOD(Glib::RefPtr<const Seat> get_seat() const, gdk_event_get_seat, refreturn, constversion, newin 
"3,90")
 
-  _WRAP_METHOD(static Event get(), gdk_event_get)
-  _WRAP_METHOD(static Event peek(), gdk_event_peek)
-  _WRAP_METHOD(void put() const, gdk_event_put)
-  _WRAP_METHOD(static bool events_pending(), gdk_events_pending)
-
   //TODO: If GdkDeviceTool is wrapped in gtkmm, wrap gdk_event_get_device_tool().
   _IGNORE(gdk_event_set_device_tool) dnl// "Should be rarely used"
 
@@ -102,9 +97,8 @@ public:
     gdk_event_get_scroll_direction, gdk_event_is_scroll_stop_event, gdk_event_get_axis,
     gdk_event_get_event_sequence, gdk_event_get_touch_emulating_pointer,
     gdk_event_get_pointer_emulated, gdk_event_get_crossing_mode,
-    gdk_event_get_crossing_detail, gdk_event_get_focus_in, gdk_event_get_property,
-    gdk_event_get_selection, gdk_event_get_selection_property,
-    gdk_event_get_drag_context, gdk_event_get_window_state,
+    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_touchpad_gesture_n_fingers, gdk_event_get_touchpad_deltas,
     gdk_event_get_touchpad_angle_delta, gdk_event_get_touchpad_scale,
diff --git a/gdk/src/events.ccg b/gdk/src/events.ccg
index 1660ab2..67e0f27 100644
--- a/gdk/src/events.ccg
+++ b/gdk/src/events.ccg
@@ -319,55 +319,6 @@ void EventConfigure::get_coords(double& x_win, double& y_win) const
   gdk_event_get_coords(Event::gobj(), &x_win, &y_win);
 }
 
-// *** EventProperty ***
-
-guint32 EventProperty::get_time() const
-{
-  return gdk_event_get_time(Event::gobj());
-}
-
-GdkAtom EventProperty::get_property_atom() const
-{
-  GdkAtom property = nullptr;
-  GdkPropertyState state = GDK_PROPERTY_DELETE;
-  gdk_event_get_property(Event::gobj(), &property, &state);
-  return property;
-}
-
-PropertyState EventProperty::get_property_state() const
-{
-  GdkAtom property = nullptr;
-  GdkPropertyState state = GDK_PROPERTY_DELETE;
-  gdk_event_get_property(Event::gobj(), &property, &state);
-  return static_cast<PropertyState>(state);
-}
-
-// *** EventSelection ***
-
-guint32 EventSelection::get_time() const
-{
-  return gdk_event_get_time(Event::gobj());
-}
-
-GdkAtom EventSelection::get_selection() const
-{
-  GdkAtom selection = nullptr;
-  gdk_event_get_selection(Event::gobj(), &selection);
-  return selection;
-}
-
-Glib::RefPtr<Gdk::Window> EventSelection::get_selection_property(GdkAtom& property, GdkAtom& target)
-{
-  GdkWindow* requestor = nullptr;
-  gdk_event_get_selection_property(Event::gobj(), &property, &target, &requestor);
-  return Glib::wrap(requestor, true);
-}
-
-Glib::RefPtr<const Gdk::Window> EventSelection::get_selection_property(GdkAtom& property, GdkAtom& target) 
const
-{
-  return const_cast<EventSelection*>(this)->get_selection_property(property, target);
-}
-
 // *** EventDND ***
 
 guint32 EventDND::get_time() const
@@ -409,18 +360,6 @@ Glib::RefPtr<const Gdk::Device> EventProximity::get_device() const
   return Glib::wrap(gdk_event_get_device(Event::gobj()), true);
 }
 
-// *** EventWindowState ***
-
-void EventWindowState::get_window_state(Gdk::Window::State& changed,
-  Gdk::Window::State& new_state) const
-{
-  GdkWindowState c_changed = static_cast<GdkWindowState>(0);
-  GdkWindowState c_new_state = static_cast<GdkWindowState>(0);
-  gdk_event_get_window_state(Event::gobj(), &c_changed, &c_new_state);
-  changed = static_cast<Gdk::Window::State>(c_changed);
-  new_state = static_cast<Gdk::Window::State>(c_new_state);
-}
-
 // *** EventGrabBroken ***
 
 Glib::RefPtr<Gdk::Window> EventGrabBroken::get_grab_window()
diff --git a/gdk/src/events.hg b/gdk/src/events.hg
index bbd6c8a..0335d12 100644
--- a/gdk/src/events.hg
+++ b/gdk/src/events.hg
@@ -104,9 +104,7 @@ public:
 
   // Belong to the base class:
   _IGNORE(gdk_event_get_event_type, gdk_event_get_window, gdk_event_is_sent,
-    gdk_event_get_seat, gdk_event_get, gdk_event_peek,
-    gdk_event_put, gdk_events_pending, gdk_event_get_device_tool,
-    gdk_event_set_device_tool)
+    gdk_event_get_seat, gdk_event_get_device_tool, gdk_event_set_device_tool)
 };
 
 /** Represents a mouse button press or release event.
@@ -479,80 +477,6 @@ public:
   //Gdk::Rectangle get_rect() const; //TODO: Remove? There is no corresponding gtk+ function.
 };
 
-/** Rarely used event. Generated when a property of a window changes.
- *
- * get_event_type() will return Gdk::Event::Type::PROPERTY_NOTIFY.
- *
- * @newin{3,90}
- */
-class EventProperty : public Event
-{
-  _CLASS_GDKEVENT(EventProperty, GdkEventProperty, Event, GdkEvent)
-
-public:
-
-  /**
-   * Returns the timestamp of the event in milliseconds.
-   */
-  guint32 get_time() const;
-
-  /**
-   * Returns the atom indicating the property that was changed
-   */
-  GdkAtom get_property_atom() const;
-  _IGNORE(gdk_event_get_property)
-
-  /**
-   * Identifies whether the property was changed (Gdk::PropertyState::NEW_VALUE) or
-   * deleted (Gdk::PropertyState::DELETE).
-   */
-  PropertyState get_property_state() const;
-};
-
-/** Rarely used event. Generated when a selection is requested or ownership of a
- * selection is taken over by another client application.
- *
- * get_event_type() will return one of Gdk::Event::Type::SELECTION_CLEAR,
- * Gdk::Event::Type::SELECTION_NOTIFY or Gdk::Event::Type::SELECTION_REQUEST.
- *
- * @newin{3,90}
- */
-class EventSelection : public Event
-{
-  _CLASS_GDKEVENT(EventSelection, GdkEventSelection, Event, GdkEvent)
-
-public:
-
-  /**
-   * Returns the timestamp of the event in milliseconds.
-   */
-  guint32 get_time() const;
-
-  /**
-   * Returns the atom identifying the selection.
-   */
-  GdkAtom get_selection() const;
-  _IGNORE(gdk_event_get_selection)
-
-  /**
-   * @param[out] property The atom identifying the property in which to place
-   *             the result of the conversion.
-   * @param[out] target The atom identifying the target to which the selection
-   *             should be converted.
-   * @returns The window on which to place @a property, or Glib::RefPtr<Gdk::Window>(nullptr) if none.
-   */
-  Glib::RefPtr<Gdk::Window> get_selection_property(GdkAtom& property, GdkAtom& target);
-  /**
-   * @param[out] property The atom identifying the property in which to place
-   *             the result of the conversion.
-   * @param[out] target The atom identifying the target to which the selection
-   *             should be converted.
-   * @returns The window on which to place @a property, or Glib::RefPtr<const Gdk::Window>(nullptr) if none.
-   */
-  Glib::RefPtr<const Gdk::Window> get_selection_property(GdkAtom& property, GdkAtom& target) const;
-  _IGNORE(gdk_event_get_selection_property)
-};
-
 /** Generated during Drag-and-Drop (DND) operations.
  *
  * get_event_type() will return one of Gdk::Event::Type::DRAG_ENTER,
@@ -626,26 +550,6 @@ public:
   Glib::RefPtr<const Gdk::Device> get_device() const;
 };
 
-/** Generated when the state of the toplevel window changes.
- *
- * get_event_type() will return Gdk::Event::Type::WINDOW_STATE.
- *
- * @newin{3,90}
- */
-class EventWindowState : public Event
-{
-  _CLASS_GDKEVENT(EventWindowState, GdkEventWindowState, Event, GdkEvent)
-
-public:
-
-  /**
-   * @param[out] changed Bit mask identifying which bits of the state have been changed.
-   * @param[out] new_state The new window state.
-   */
-  void get_window_state(Gdk::Window::State& changed, Gdk::Window::State& new_state) const;
-  _IGNORE(gdk_event_get_window_state)
-};
-
 /** 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
  * unmapped), or if the same application grabs the pointer or keyboard again.
diff --git a/gdk/src/types.ccg b/gdk/src/types.ccg
index 79be79e..f831f33 100644
--- a/gdk/src/types.ccg
+++ b/gdk/src/types.ccg
@@ -62,14 +62,15 @@ bool Point::equal(const Gdk::Point& rhs) const
 // static
 GdkAtom AtomStringTraits::to_c_type(const std::string& atom_name)
 {
-  return gdk_atom_intern(atom_name.c_str(), 0);
+  return g_intern_string(atom_name.c_str());
 }
 
 // static
 std::string AtomStringTraits::to_cpp_type(GdkAtom atom)
 {
-  if(const auto atom_name = gdk_atom_name(atom))
-    return std::string(Glib::make_unique_ptr_gfree(atom_name).get());
+  // GdkAtom is an interned string (typedef const char* GdkAtom).
+  if (atom)
+    return std::string(atom);
   else
     return std::string();
 }
@@ -77,14 +78,14 @@ std::string AtomStringTraits::to_cpp_type(GdkAtom atom)
 // static
 GdkAtom AtomUstringTraits::to_c_type(const Glib::ustring& atom_name)
 {
-  return gdk_atom_intern(atom_name.c_str(), 0);
+  return g_intern_string(atom_name.c_str());
 }
 
 // static
 Glib::ustring AtomUstringTraits::to_cpp_type(GdkAtom atom)
 {
-  if(const auto atom_name = gdk_atom_name(atom))
-    return Glib::ustring(Glib::make_unique_ptr_gfree(atom_name).get());
+  if (atom)
+    return Glib::ustring(atom);
   else
     return Glib::ustring();
 }
diff --git a/gdk/src/window.ccg b/gdk/src/window.ccg
index a4a593c..a640953 100644
--- a/gdk/src/window.ccg
+++ b/gdk/src/window.ccg
@@ -17,7 +17,7 @@
 
 #include <gdk/gdk.h>
 #include <gdkmm/cairoutils.h>
-#include <gdkmm/contentformats.h>
+#include <gdkmm/contentprovider.h>
 #include <gdkmm/cursor.h>
 #include <gdkmm/device.h>
 #include <gdkmm/types.h>
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 696d4a3..59ed319 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -44,7 +44,7 @@ _WRAP_ENUM(FullscreenMode, GdkFullscreenMode,
   s#^CURRENT_MONITOR$#ON_CURRENT_MONITOR#,
   s#^ALL_MONITORS$#ON_ALL_MONITORS#)
 
-class ContentFormats;
+class ContentProvider;
 class Cursor;
 class GLContext;
 class DrawContext;
@@ -242,11 +242,8 @@ public:
 
   _WRAP_METHOD(void begin_move_drag(const Glib::RefPtr<Device>& device, int button, int root_x, int root_y, 
guint32 timestamp), gdk_window_begin_move_drag_for_device)
 
-  _WRAP_METHOD(Glib::RefPtr<DragContext> drag_begin(const Glib::RefPtr<ContentFormats>& formats), 
gdk_drag_begin)
-  _WRAP_METHOD(Glib::RefPtr<DragContext> drag_begin_for_device(const Glib::RefPtr<Device>& device,
-    const Glib::RefPtr<ContentFormats>& formats), gdk_drag_begin_for_device)
   _WRAP_METHOD(Glib::RefPtr<DragContext> drag_begin_from_point(const Glib::RefPtr<Device>& device,
-    const Glib::RefPtr<ContentFormats>& formats, int x_root, int y_root), gdk_drag_begin_from_point)
+    const Glib::RefPtr<ContentProvider>& content, DragAction actions, int dx, int dy), gdk_drag_begin)
 
   _WRAP_METHOD(void invalidate_rect(const Rectangle& rect, bool invalidate_children), 
gdk_window_invalidate_rect)
 
@@ -307,9 +304,6 @@ public:
 
   _WRAP_METHOD(void set_opaque_region(const ::Cairo::RefPtr<const ::Cairo::Region>& region), 
gdk_window_set_opaque_region)
 
-  _WRAP_METHOD(void set_event_compression(bool event_compression = true), gdk_window_set_event_compression)
-  _WRAP_METHOD(bool get_event_compression() const, gdk_window_get_event_compression)
-
   _WRAP_METHOD(void set_shadow_width(int left, int right, int top, int bottom), gdk_window_set_shadow_width)
 
   _WRAP_METHOD(bool show_window_menu(const Event& event), gdk_window_show_window_menu)
@@ -337,6 +331,7 @@ public:
 
   _WRAP_PROPERTY("cursor", Glib::RefPtr<Cursor>)
   _WRAP_PROPERTY("display", Glib::RefPtr<Display>)
+  _WRAP_PROPERTY("state", State)
 };
 
 } // namespace Gdk
diff --git a/gtk/src/adjustment.hg b/gtk/src/adjustment.hg
index dc393e8..c21139d 100644
--- a/gtk/src/adjustment.hg
+++ b/gtk/src/adjustment.hg
@@ -33,11 +33,6 @@ namespace Gtk
  *
  * The Gtk::Adjustment object does not update the value itself. Instead it
  * is left up to the owner of the Gtk::Adjustment to control the value.
- *
- * The owner of the Gtk::Adjustment typically calls the value_changed() and
- * changed() functions after changing the value and its bounds. This results
- * in the emission of the "value_changed" or "changed" signal respectively.
- *
  */
 class Adjustment : public Glib::Object
 {
diff --git a/gtk/src/headerbar.hg b/gtk/src/headerbar.hg
index 5afba89..77ffdbd 100644
--- a/gtk/src/headerbar.hg
+++ b/gtk/src/headerbar.hg
@@ -61,8 +61,8 @@ public:
   _WRAP_METHOD(void pack_start(Gtk::Widget& child), gtk_header_bar_pack_start)
   _WRAP_METHOD(void pack_end(Gtk::Widget& child), gtk_header_bar_pack_end)
 
-  _WRAP_METHOD(void set_show_close_button(bool setting = true), gtk_header_bar_set_show_close_button)
-  _WRAP_METHOD(bool get_show_close_button() const, gtk_header_bar_get_show_close_button)
+  _WRAP_METHOD(void set_show_title_buttons(bool setting = true), gtk_header_bar_set_show_title_buttons)
+  _WRAP_METHOD(bool get_show_title_buttons() const, gtk_header_bar_get_show_title_buttons)
 
   _WRAP_METHOD(void set_decoration_layout(const Glib::ustring& layout), gtk_header_bar_set_decoration_layout)
 
@@ -75,7 +75,7 @@ public:
 
 
   _WRAP_PROPERTY("custom-title", Gtk::Widget*)
-  _WRAP_PROPERTY("show-close-button", bool)
+  _WRAP_PROPERTY("show-title-buttons", bool)
   _WRAP_PROPERTY("spacing", int)
   _WRAP_PROPERTY("subtitle", Glib::ustring)
   _WRAP_PROPERTY("title", Glib::ustring)
diff --git a/gtk/src/selectiondata.ccg b/gtk/src/selectiondata.ccg
index 4acefc8..fdb7a21 100644
--- a/gtk/src/selectiondata.ccg
+++ b/gtk/src/selectiondata.ccg
@@ -25,7 +25,7 @@ namespace Gtk
 
 void SelectionData::set(const std::string& type, int format, const guint8* data, int length)
 {
-  gtk_selection_data_set(gobj(), gdk_atom_intern(type.c_str(), 0), format, data, length);
+  gtk_selection_data_set(gobj(), g_intern_string(type.c_str()), format, data, length);
 }
 
 void SelectionData::set(int format, const guint8* data, int length)
@@ -36,7 +36,7 @@ void SelectionData::set(int format, const guint8* data, int length)
 
 void SelectionData::set(const std::string& type, const std::string& data)
 {
-  gtk_selection_data_set(gobj(), gdk_atom_intern(type.c_str(), 0),
+  gtk_selection_data_set(gobj(), g_intern_string(type.c_str()),
                          sizeof(char) * 8, // format is 8 bits per unit
                          reinterpret_cast<const guint8*>(data.data()), data.size());
 }
@@ -64,8 +64,8 @@ std::string SelectionData::get_data_as_string() const
 
 std::string SelectionData::get_target() const
 {
-  return Glib::convert_return_gchar_ptr_to_stdstring(
-      gdk_atom_name( gtk_selection_data_get_target(const_cast<GtkSelectionData*>(gobj())) ) );
+  return Glib::convert_const_gchar_ptr_to_stdstring(
+      gtk_selection_data_get_target(const_cast<GtkSelectionData*>(gobj())) );
 }
 
 std::vector<std::string> SelectionData::get_targets() const
@@ -83,8 +83,8 @@ std::vector<std::string> SelectionData::get_targets() const
 
 std::string SelectionData::get_data_type() const
 {
-  return Glib::convert_return_gchar_ptr_to_stdstring(
-    gdk_atom_name( gtk_selection_data_get_data_type(const_cast<GtkSelectionData*>(gobj())) ) );
+  return Glib::convert_const_gchar_ptr_to_stdstring(
+    gtk_selection_data_get_data_type(const_cast<GtkSelectionData*>(gobj())) );
 }
 
 } // namespace Gtk
diff --git a/gtk/src/selectiondata.hg b/gtk/src/selectiondata.hg
index 8844ac1..cd25982 100644
--- a/gtk/src/selectiondata.hg
+++ b/gtk/src/selectiondata.hg
@@ -106,9 +106,6 @@ dnl The constness of gtk_selection_data_set_uris() is not quite right:
    */
   std::string get_data_as_string() const;
 
-#m4 _CONVERSION(`GdkAtom',`std::string',`Gdk::AtomString::to_cpp_type ($3)')
-  _WRAP_METHOD(std::string get_selection() const, gtk_selection_data_get_selection)
-
   /** Retrieves the target of the selection.
    *
    * @newin{2,14}
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index 638d195..0048e61 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -82,29 +82,6 @@ static void Widget_signal_drag_data_get_callback(GtkWidget* self, GdkDragContext
   }
 }
 
-static void Widget_signal_selection_get_callback(GtkWidget* self, GtkSelectionData* p0,guint p1,void* data)
-{
-  using namespace Gtk;
-  typedef sigc::slot<void(SelectionData&, guint)> SlotType;
-
-  // Do not try to call a signal on a disassociated wrapper.
-  if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
-  {
-    try
-    {
-      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
-      {
-        SelectionData_WithoutOwnership temp_instance(p0);
-        (*static_cast<SlotType*>(slot))(temp_instance, p1);
-      }
-    }
-    catch(...)
-    {
-      Glib::exception_handlers_invoke();
-    }
-  }
-}
-
 // The reinterpret_cast works because Event is a standard-layout class
 // whose only data member is a GdkEvent pointer.
 Gdk::Event& wrap_event_any(GdkEventAny*& event)
@@ -161,43 +138,8 @@ void Widget_Class::hide_callback(GtkWidget* self)
     (*base->hide)(self);
 }
 
-//These default handler callbacks are custom implemented, so that we can create a temporary SelectionData 
instance.
+//This default handler callback is custom implemented, so that we can create a temporary SelectionData 
instance.
 //To do this, we used the optional custom_c_callback paramater to _WRAP_SIGNAL() in the .hg file.
-void Widget_Class::selection_get_callback(GtkWidget* self, GtkSelectionData* p0, guint p1)
-{
-  const auto obj = dynamic_cast<CppObjectType*>(
-      Glib::ObjectBase::_get_current_wrapper((GObject*)self));
-
-  // Non-gtkmmproc-generated custom classes implicitly call the default
-  // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
-  // generated classes can use this optimisation, which avoids the unnecessary
-  // parameter conversions if there is no possibility of the virtual function
-  // being overridden:
-  if(obj && obj->is_derived_())
-  {
-    try // Trap C++ exceptions which would normally be lost because this is a C callback.
-    {
-      // Call the virtual member method, which derived classes might override.
-      SelectionData_WithoutOwnership temp_instance(p0);
-      obj->on_selection_get(temp_instance, p1);
-    }
-    catch(...)
-    {
-      Glib::exception_handlers_invoke();
-    }
-  }
-  else
-  {
-    const auto base = static_cast<BaseClassType*>(
-        g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The 
original underlying C class).
-    );
-
-    // Call the original underlying C function:
-    if(base && base->selection_get)
-      (*base->selection_get)(self, p0, p1);
-  }
-}
-
 void Widget_Class::drag_data_get_callback(GtkWidget* self, GdkDragContext* p0, GtkSelectionData* p1, guint 
p2)
 {
   const auto obj = dynamic_cast<CppObjectType*>(
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 3542556..7f3c980 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -444,8 +444,9 @@ public:
   _WRAP_METHOD(void drag_source_add_uri_targets(), gtk_drag_source_add_uri_targets)
   _WRAP_METHOD(void drag_source_add_image_targets(), gtk_drag_source_add_image_targets)
 
-  _WRAP_METHOD(Glib::RefPtr<Gdk::DragContext> drag_begin(const Glib::RefPtr<Gdk::ContentFormats>& targets,
-    Gdk::DragAction actions, int button, const Gdk::Event& gdk_event, int x, int y), 
gtk_drag_begin_with_coordinates, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::DragContext> drag_begin(const Glib::RefPtr<Gdk::Device>& device,
+    const Glib::RefPtr<Gdk::ContentFormats>& targets, Gdk::DragAction actions, int x, int y),
+    gtk_drag_begin_with_coordinates, refreturn)
   _WRAP_METHOD(bool drag_check_threshold(int start_x, int start_y, int current_x, int current_y), 
gtk_drag_check_threshold)
 
   //These should be a method of Gdk::DragContext, but gdkmm can't depend on gtkmm.
@@ -569,26 +570,26 @@ public:
   _WRAP_SIGNAL(void grab_focus(), "grab_focus")
   _WRAP_SIGNAL(bool focus(DirectionType direction), "focus")
 #m4 _CONVERSION(`GdkEvent*',`Gdk::Event&',`Gdk::wrap_event($3)')
-  _WRAP_SIGNAL(bool event(Gdk::Event& gdk_event), "event")
+  _WRAP_SIGNAL(bool event(Gdk::Event& gdk_event), "event", deprecated)
   // The event_after signal can't have a default handler because the wrapped C signal has no default handler.
 #m4 _CONVERSION(`GdkEvent*',`const Gdk::Event&',`Gdk::wrap_event($3)')
-  _WRAP_SIGNAL(void event_after(const Gdk::Event& gdk_event), "event_after", no_default_handler)
+  _WRAP_SIGNAL(void event_after(const Gdk::Event& gdk_event), "event_after", no_default_handler, deprecated)
 
 #m4 _CONVERSION(`GdkEventButton*',`Gdk::EventButton&',`Gdk::wrap_event($3)')
   /// Event triggered by user pressing button.
-  _WRAP_SIGNAL(bool button_press_event(Gdk::EventButton& button_event),"button_press_event")
+  _WRAP_SIGNAL(bool button_press_event(Gdk::EventButton& button_event),"button_press_event", deprecated)
 
   /// Event triggered by user releasing button.
-  _WRAP_SIGNAL(bool button_release_event(Gdk::EventButton& release_event), "button_release_event")
+  _WRAP_SIGNAL(bool button_release_event(Gdk::EventButton& release_event), "button_release_event", 
deprecated)
 
 #m4 _CONVERSION(`GdkEventScroll*',`Gdk::EventScroll&',`Gdk::wrap_event($3)')
 #m4 _CONVERSION(`Gdk::EventScroll&',`GdkEventScroll*',`($3).gobj()')
-  _WRAP_SIGNAL(bool scroll_event(Gdk::EventScroll& scroll_event), "scroll_event")
+  _WRAP_SIGNAL(bool scroll_event(Gdk::EventScroll& scroll_event), "scroll_event", deprecated)
 
 #m4 _CONVERSION(`GdkEventMotion*',`Gdk::EventMotion&',`Gdk::wrap_event($3)')
 #m4 _CONVERSION(`Gdk::EventMotion&',`GdkEventMotion*',`($3).gobj()')
   /// Event triggered by user moving pointer.
-  _WRAP_SIGNAL(bool motion_notify_event(Gdk::EventMotion& motion_event), "motion_notify_event")
+  _WRAP_SIGNAL(bool motion_notify_event(Gdk::EventMotion& motion_event), "motion_notify_event", deprecated)
 
 #m4 _CONVERSION(`GdkEventAny*',`Gdk::Event&',`wrap_event_any($3)')
 #m4 _CONVERSION(`Gdk::Event&',`GdkEventAny*',`reinterpret_cast<GdkEventAny*>(($3).gobj())')
@@ -624,10 +625,10 @@ dnl
 #m4 _CONVERSION(`GdkEventCrossing*',`Gdk::EventCrossing&',`Gdk::wrap_event($3)')
 #m4 _CONVERSION(`Gdk::EventCrossing&',`GdkEventCrossing*',`($3).gobj()')
   /// Event triggered by pointer entering widget area.
-  _WRAP_SIGNAL(bool enter_notify_event(Gdk::EventCrossing& crossing_event), "enter_notify_event")
+  _WRAP_SIGNAL(bool enter_notify_event(Gdk::EventCrossing& crossing_event), "enter_notify_event", deprecated)
 
   /// Event triggered by pointer leaving widget area.
-  _WRAP_SIGNAL(bool leave_notify_event(Gdk::EventCrossing& crossing_event), "leave_notify_event")
+  _WRAP_SIGNAL(bool leave_notify_event(Gdk::EventCrossing& crossing_event), "leave_notify_event", deprecated)
 
 #m4 _CONVERSION(`GdkEventConfigure*',`Gdk::EventConfigure&',`Gdk::wrap_event($3)')
 #m4 _CONVERSION(`Gdk::EventConfigure&',`GdkEventConfigure*',`($3).gobj()')
@@ -639,38 +640,24 @@ dnl
   _WRAP_SIGNAL(bool focus_out_event(Gdk::EventFocus& gdk_event), "focus_out_event")
   _WRAP_SIGNAL(bool map_event(Gdk::Event& any_event), "map_event")
   _WRAP_SIGNAL(bool unmap_event(Gdk::Event& any_event), "unmap_event")
-#m4 _CONVERSION(`GdkEventProperty*',`Gdk::EventProperty&',`Gdk::wrap_event($3)')
-#m4 _CONVERSION(`Gdk::EventProperty&',`GdkEventProperty*',`($3).gobj()')
-  _WRAP_SIGNAL(bool property_notify_event(Gdk::EventProperty& property_event), "property_notify_event")
-#m4 _CONVERSION(`GdkEventSelection*',`Gdk::EventSelection&',`Gdk::wrap_event($3)')
-#m4 _CONVERSION(`Gdk::EventSelection&',`GdkEventSelection*',`($3).gobj()')
-  _WRAP_SIGNAL(bool selection_clear_event(Gdk::EventSelection& selection_event), "selection_clear_event")
-  _WRAP_SIGNAL(bool selection_request_event(Gdk::EventSelection& selection_event), "selection_request_event")
-  _WRAP_SIGNAL(bool selection_notify_event(Gdk::EventSelection& selection_event), "selection_notify_event")
 #m4 _CONVERSION(`GdkEventProximity*',`Gdk::EventProximity&',`Gdk::wrap_event($3)')
 #m4 _CONVERSION(`Gdk::EventProximity&',`GdkEventProximity*',`($3).gobj()')
-  _WRAP_SIGNAL(bool proximity_in_event(Gdk::EventProximity& proximity_event), "proximity_in_event")
-  _WRAP_SIGNAL(bool proximity_out_event(Gdk::EventProximity& proximity_event), "proximity_out_event")
-#m4 _CONVERSION(`GdkEventWindowState*',`Gdk::EventWindowState&',`Gdk::wrap_event($3)')
-#m4 _CONVERSION(`Gdk::EventWindowState&',`GdkEventWindowState*',`($3).gobj()')
-  _WRAP_SIGNAL(bool window_state_event(Gdk::EventWindowState& window_state_event), "window_state_event")
-
-  //We use the optional custom_c_callback parameter with _WRAP_SIGNAL() for some of these,
-  //so that we can write special code to wrap the non-const SelectionData& output parameters:
-  _WRAP_SIGNAL(void selection_get(SelectionData& selection_data, guint time), "selection_get", 
custom_c_callback)
-  _WRAP_SIGNAL(void selection_received(const SelectionData& selection_data, guint time), 
"selection_received")
+  _WRAP_SIGNAL(bool proximity_in_event(Gdk::EventProximity& proximity_event), "proximity_in_event", 
deprecated)
+  _WRAP_SIGNAL(bool proximity_out_event(Gdk::EventProximity& proximity_event), "proximity_out_event", 
deprecated)
 
 #m4 _CONVERSION(`GdkDragContext*',`const Glib::RefPtr<Gdk::DragContext>&',Glib::wrap($3, true))
 
   _WRAP_SIGNAL(void drag_begin(const Glib::RefPtr<Gdk::DragContext>& context), "drag_begin")
   _WRAP_SIGNAL(void drag_end(const Glib::RefPtr<Gdk::DragContext>& context), "drag_end")
+  //We use the optional custom_c_callback parameter with _WRAP_SIGNAL(),
+  //so that we can write special code to wrap the non-const SelectionData& output parameter:
   _WRAP_SIGNAL(void drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, SelectionData& 
selection_data, guint time), "drag_data_get", custom_c_callback)
   _WRAP_SIGNAL(void drag_data_delete(const Glib::RefPtr<Gdk::DragContext>& context), "drag_data_delete")
   _WRAP_SIGNAL(bool drag_failed(const Glib::RefPtr<Gdk::DragContext>& context, DragResult result), 
"drag_failed")
   _WRAP_SIGNAL(void drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time), "drag_leave")
   _WRAP_SIGNAL(bool drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time), 
"drag_motion")
   _WRAP_SIGNAL(bool drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time), 
"drag_drop")
-  _WRAP_SIGNAL(void drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const 
SelectionData& selection_data, guint time), "drag_data_received")
+  _WRAP_SIGNAL(void drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, const SelectionData& 
selection_data, guint time), "drag_data_received")
 
   // The accel_closures_changed signal can't have a default handler because the wrapped C signal has no 
default handler.
   _WRAP_SIGNAL(void accel_closures_changed(), "accel_closures_changed", no_default_handler)
@@ -698,7 +685,7 @@ _CONVERSION(`GdkDisplay*',`const Glib::RefPtr<Gdk::Display>&',`Glib::wrap($3, tr
 
 #m4 _CONVERSION(`GdkEventTouch*',`Gdk::EventTouch&',`Gdk::wrap_event($3)')
 #m4 _CONVERSION(`Gdk::EventTouch&',`GdkEventTouch*',`($3).gobj()')
-  _WRAP_SIGNAL(bool touch_event(Gdk::EventTouch& touch_event), "touch_event")
+  _WRAP_SIGNAL(bool touch_event(Gdk::EventTouch& touch_event), "touch_event", deprecated)
 
   _WRAP_PROPERTY("name", Glib::ustring)
   _WRAP_PROPERTY("parent", Container*)



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