[gtkmm] Gtk: Remove Layout, remove child properties
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gtk: Remove Layout, remove child properties
- Date: Sun, 7 Apr 2019 08:24:02 +0000 (UTC)
commit 4fb2ba9bb86965318a982fe01db1570d283e9d0c
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Sun Apr 7 10:17:38 2019 +0200
Gtk: Remove Layout, remove child properties
and make other changes to update for the latest gtk4.
All child properties have been removed from gtk4.
.gitignore | 2 -
demos/gtk-demo/example_iconbrowser.cc | 17 +---
gdk/src/clipboard.hg | 4 +-
gdk/src/drop.hg | 4 +-
gtk/gtkmm.h | 1 -
gtk/gtkmm/childpropertyproxy.cc | 26 -----
gtk/gtkmm/childpropertyproxy.h | 181 ----------------------------------
gtk/gtkmm/childpropertyproxy_base.cc | 90 -----------------
gtk/gtkmm/childpropertyproxy_base.h | 71 -------------
gtk/gtkmm/filelist.am | 4 -
gtk/src/container.hg | 37 -------
gtk/src/filelist.am | 1 -
gtk/src/grid.hg | 7 +-
gtk/src/layout.ccg | 24 -----
gtk/src/layout.hg | 63 ------------
gtk/src/searchbar.hg | 19 ++--
gtk/src/searchentry.hg | 11 +--
gtk/src/widget.hg | 9 --
18 files changed, 22 insertions(+), 549 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 851206e5..b190d52e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -319,8 +319,6 @@ gtk/gtkmm/infobar.cc
gtk/gtkmm/infobar.h
gtk/gtkmm/label.cc
gtk/gtkmm/label.h
-gtk/gtkmm/layout.cc
-gtk/gtkmm/layout.h
gtk/gtkmm/layoutchild.cc
gtk/gtkmm/layoutchild.h
gtk/gtkmm/layoutmanager.cc
diff --git a/demos/gtk-demo/example_iconbrowser.cc b/demos/gtk-demo/example_iconbrowser.cc
index 35841b74..6f05bb6a 100644
--- a/demos/gtk-demo/example_iconbrowser.cc
+++ b/demos/gtk-demo/example_iconbrowser.cc
@@ -119,7 +119,6 @@ public:
protected:
// Signal handlers:
- bool on_window_key_pressed(guint keyval, guint keycode, Gdk::ModifierType state);
void on_symbolic_radio_toggled();
void on_context_list_selected_rows_changed();
void on_icon_view_item_activated(const Gtk::TreeModel::Path& path);
@@ -247,11 +246,10 @@ Example_IconBrowser::Example_IconBrowser()
m_filter_model->set_visible_func(
sigc::mem_fun(*this, &Example_IconBrowser::is_icon_visible));
+ // Hook the search bar to key presses.
+ m_search_bar.set_key_capture_widget(*this);
+
// Connect signal handlers.
- auto controller = Gtk::EventControllerKey::create();
- add_controller(controller);
- controller->signal_key_pressed().connect(
- sigc::mem_fun(*this, &Example_IconBrowser::on_window_key_pressed), false);
m_symbolic_radio.signal_toggled().connect(
sigc::mem_fun(*this, &Example_IconBrowser::on_symbolic_radio_toggled));
m_context_list.signal_selected_rows_changed().connect(
@@ -273,15 +271,6 @@ Example_IconBrowser::~Example_IconBrowser()
{
}
-bool Example_IconBrowser::on_window_key_pressed(guint, guint, Gdk::ModifierType)
-{
- Glib::RefPtr<Gdk::Event> current_event = Glib::wrap(gtk_get_current_event());
- if (current_event->get_event_type() == Gdk::Event::Type::KEY_PRESS)
- return m_search_bar.handle_event(std::static_pointer_cast<Gdk::EventKey>(current_event));
- else
- return false;
-}
-
void Example_IconBrowser::on_symbolic_radio_toggled()
{
const bool symbolic = m_symbolic_radio.get_active();
diff --git a/gdk/src/clipboard.hg b/gdk/src/clipboard.hg
index b3e30711..ff414920 100644
--- a/gdk/src/clipboard.hg
+++ b/gdk/src/clipboard.hg
@@ -76,8 +76,8 @@ public:
const Gio::SlotAsyncReady& slot{callback}, const Glib::RefPtr<Gio::Cancellable>& cancellable{.?}),
gdk_clipboard_read_async, slot_name slot, slot_callback Gio::SignalProxy_async_callback)
#m4 _INITIALIZATION(`Glib::ustring&',`const char*',`$3 = Glib::convert_const_gchar_ptr_to_ustring($4)')
- _WRAP_METHOD(Glib::RefPtr<Gio::InputStream> read_finish(Glib::ustring& out_mime_type{>>},
- const Glib::RefPtr<Gio::AsyncResult>& result), gdk_clipboard_read_finish, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<Gio::InputStream> read_finish(const Glib::RefPtr<Gio::AsyncResult>& result,
+ Glib::ustring& out_mime_type{>>}), gdk_clipboard_read_finish, errthrow)
_WRAP_METHOD(void read_texture_async(const Gio::SlotAsyncReady& slot{callback}, const
Glib::RefPtr<Gio::Cancellable>& cancellable{.?}),
gdk_clipboard_read_texture_async, slot_name slot, slot_callback Gio::SignalProxy_async_callback)
diff --git a/gdk/src/drop.hg b/gdk/src/drop.hg
index f64c89ea..a01b73da 100644
--- a/gdk/src/drop.hg
+++ b/gdk/src/drop.hg
@@ -81,8 +81,8 @@ public:
const Gio::SlotAsyncReady& slot{callback}, const Glib::RefPtr<Gio::Cancellable>& cancellable{.?}),
gdk_drop_read_async, slot_name slot, slot_callback Gio::SignalProxy_async_callback)
#m4 _INITIALIZATION(`Glib::ustring&',`const char*',`$3 = Glib::convert_const_gchar_ptr_to_ustring($4)')
- _WRAP_METHOD(Glib::RefPtr<Gio::InputStream> read_finish(Glib::ustring& out_mime_type{>>},
- const Glib::RefPtr<Gio::AsyncResult>& result), gdk_drop_read_finish, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<Gio::InputStream> read_finish(const Glib::RefPtr<Gio::AsyncResult>& result,
+ Glib::ustring& out_mime_type{>>}), gdk_drop_read_finish, errthrow)
_WRAP_METHOD(void read_text_async(const Gio::SlotAsyncReady& slot{callback}, const
Glib::RefPtr<Gio::Cancellable>& cancellable{.?}),
gdk_drop_read_text_async, slot_name slot, slot_callback Gio::SignalProxy_async_callback)
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 2343d923..7b6c9cb0 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -179,7 +179,6 @@ extern const int gtkmm_micro_version;
#include <gtkmm/infobar.h>
#include <gtkmm/calendar.h>
#include <gtkmm/label.h>
-#include <gtkmm/layout.h>
#include <gtkmm/layoutchild.h>
#include <gtkmm/layoutmanager.h>
#include <gtkmm/levelbar.h>
diff --git a/gtk/gtkmm/filelist.am b/gtk/gtkmm/filelist.am
index 0906e4f6..670c6e33 100644
--- a/gtk/gtkmm/filelist.am
+++ b/gtk/gtkmm/filelist.am
@@ -7,8 +7,6 @@ gtkmm_files_extra_any_cc = \
accelkey.cc \
accelmap.cc \
cellrenderer_generation.cc \
- childpropertyproxy.cc \
- childpropertyproxy_base.cc \
dnd_ns.cc \
listviewtext.cc \
object.cc \
@@ -24,8 +22,6 @@ gtkmm_files_extra_any_h = \
accelmap.h \
border.h \
cellrenderer_generation.h \
- childpropertyproxy.h \
- childpropertyproxy_base.h \
dnd_ns.h \
listviewtext.h \
object.h \
diff --git a/gtk/src/container.hg b/gtk/src/container.hg
index 96e698e0..daf2a315 100644
--- a/gtk/src/container.hg
+++ b/gtk/src/container.hg
@@ -18,7 +18,6 @@
#include <vector>
#include <gtkmm/widget.h>
-#include <gtkmm/childpropertyproxy.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/widget_p.h)
@@ -50,7 +49,6 @@ class Label;
class Container : public Widget
{
_CLASS_GTKOBJECT(Container,GtkContainer,GTK_CONTAINER,Gtk::Widget,GtkWidget)
- _IGNORE(gtk_container_child_set_valist)
public:
/* Application-level methods */
@@ -133,11 +131,6 @@ public:
#m4 _CONVERSION(`GtkWidgetPath*',`WidgetPath',`Glib::wrap($3, false)')
_WRAP_METHOD(WidgetPath get_path_for_child(const Widget& child) const, gtk_container_get_path_for_child)
- // Ignore functions such as gtk_container_class_install_child_property(), which I think are for themes,
like the GtkWidget style properties.
- _IGNORE(gtk_container_class_install_child_property, gtk_container_class_find_child_property,
gtk_container_class_list_child_properties,
- gtk_container_add_with_properties, gtk_container_child_set, gtk_container_child_get,
gtk_container_child_get_valist, gtk_container_child_get_property)
-
-
_WRAP_SIGNAL(void add(Widget* widget), "add")
//We use the optional custom_c_callback parameter with _WRAP_SIGNAL() here,
@@ -173,37 +166,7 @@ protected:
*/
_WRAP_VFUNC(void set_focus_child(Widget* child), set_focus_child)
- /** Sets a child property for this container and its child.
- *
- * Child properties are object properties that are not specific to either the
- * container or the contained widget, but rather to their relation. Typical
- * examples of child properties are the position or pack-type of a widget
- * which is contained in a Gtk::Box.
- *
- * @param child The child widget.
- * @param property_id The ID of the child property to set.
- * @param value The new value for the child property.
- * @param pspec The GParamSpec of the child property to set.
- */
- _WRAP_VFUNC(void set_child_property(Widget* child, guint property_id,
- const Glib::ValueBase& value, GParamSpec* pspec), set_child_property)
-
#m4 _CONVERSION(`const Widget*', `GtkWidget*', `const_cast<$2>(Glib::unwrap($3))')
- /** Returns a child property for this container and its child.
- *
- * Child properties are object properties that are not specific to either the
- * container or the contained widget, but rather to their relation. Typical
- * examples of child properties are the position or pack-type of a widget
- * which is contained in a Gtk::Box.
- *
- * @param child The child widget.
- * @param property_id The ID of the child property to get.
- * @param value A Glib::Value to fill with the child property's value.
- * @param pspec The GParamSpec of the child property to get.
- */
- _WRAP_VFUNC(void get_child_property(const Widget* child, guint property_id,
- Glib::ValueBase& value, GParamSpec* pspec) const, get_child_property)
-
#m4 _CONVERSION(`WidgetPath', `GtkWidgetPath*', __FR2P)
/** Returns a widget path representing all the widget hierarchy
* from the toplevel down to and including @a child.
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index df457c34..cd5edc10 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -106,7 +106,6 @@ gtkmm_files_any_hg = \
image.hg \
infobar.hg \
label.hg \
- layout.hg \
layoutchild.hg \
layoutmanager.hg \
levelbar.hg \
diff --git a/gtk/src/grid.hg b/gtk/src/grid.hg
index e5e7bda8..b17f045f 100644
--- a/gtk/src/grid.hg
+++ b/gtk/src/grid.hg
@@ -98,17 +98,14 @@ public:
_WRAP_METHOD(BaselinePosition get_row_baseline_position(int row) const, gtk_grid_get_row_baseline_position)
_WRAP_METHOD(void set_baseline_row(int row), gtk_grid_set_baseline_row)
_WRAP_METHOD(int get_baseline_row() const, gtk_grid_get_baseline_row)
+ _WRAP_METHOD(void query_child(const Widget& child,
+ int& left, int& top, int& width, int& height) const, gtk_grid_query_child)
_WRAP_PROPERTY("row-spacing", guint)
_WRAP_PROPERTY("column-spacing", guint)
_WRAP_PROPERTY("row-homogeneous", bool)
_WRAP_PROPERTY("column-homogeneous", bool)
_WRAP_PROPERTY("baseline-row", int)
-
- _WRAP_CHILD_PROPERTY("left-attach", int)
- _WRAP_CHILD_PROPERTY("top-attach", int)
- _WRAP_CHILD_PROPERTY("width", int)
- _WRAP_CHILD_PROPERTY("height", int)
};
} // namespace Gtk
diff --git a/gtk/src/searchbar.hg b/gtk/src/searchbar.hg
index 66ef824c..c13ffa85 100644
--- a/gtk/src/searchbar.hg
+++ b/gtk/src/searchbar.hg
@@ -26,19 +26,20 @@ namespace Gtk
/** A toolbar to integrate a search entry with.
*
- * Gtk::SearchBar is a container made to have a search entry (possibly
+ * %Gtk::SearchBar is a container made to have a search entry (possibly
* with additional connex widgets, such as drop-down menus, or buttons)
* built-in. The search bar would appear when a search is started through
* typing on the keyboard, or the application's search mode is toggled on.
*
- * For keyboard presses to start a search, events will need to be
- * forwarded from the top-level window that contains the search bar.
- * See Gtk::SearchBar::handle_event() for example code. Common shortcuts
- * such as Ctrl+F should be handled as an application action, or through
- * the menu items.
+ * For keyboard presses to start a search, the search bar must be told
+ * of a widget to capture key events from through
+ * set_key_capture_widget(). This widget will typically
+ * be the top-level window, or a parent container of the search bar. Common
+ * shortcuts such as Ctrl+F should be handled as an application action, or
+ * through the menu items.
*
* You will also need to tell the search bar about which entry you
- * are using as your search entry using Gtk::SearchBar::connect_entry().
+ * are using as your search entry using connect_entry().
*
* @ingroup Widgets
* @newin{3,10}
@@ -65,10 +66,6 @@ public:
_WRAP_METHOD(bool get_show_close_button() const, gtk_search_bar_get_show_close_button)
_WRAP_METHOD(void set_show_close_button(bool visible=true), gtk_search_bar_set_show_close_button)
- // We use Gdk::EventKey& rather than Gdk::Event&. See GTK+ bug
https://bugzilla.gnome.org/show_bug.cgi?id=709544
-#m4 _CONVERSION(`const Glib::RefPtr<Gdk::EventKey>&',`GdkEvent*',`reinterpret_cast<$2>(Glib::unwrap($3))')
- _WRAP_METHOD(bool handle_event(const Glib::RefPtr<Gdk::EventKey>& gdk_event), gtk_search_bar_handle_event)
-
_WRAP_METHOD(void set_key_capture_widget(Widget& widget), gtk_search_bar_set_key_capture_widget)
_WRAP_METHOD(Widget* get_key_capture_widget(), gtk_search_bar_get_key_capture_widget)
_WRAP_METHOD(const Widget* get_key_capture_widget() const, gtk_search_bar_get_key_capture_widget,
constversion)
diff --git a/gtk/src/searchentry.hg b/gtk/src/searchentry.hg
index cf4c1490..26a9b67b 100644
--- a/gtk/src/searchentry.hg
+++ b/gtk/src/searchentry.hg
@@ -45,9 +45,10 @@ namespace Gtk
* and signal_stop_search() signals can be uesd to implement
* moving between search results and ending the search.
*
- * Often, Gtk::SearchEntry will be fed events by means of being
+ * Often, %Gtk::SearchEntry will be fed events by means of being
* placed inside a Gtk::SearchBar. If that is not the case,
- * you can use handle_event() to pass events.
+ * you can use set_key_capture_widget() to let it
+ * capture key input from another widget.
*
* @ingroup Widgets
* @newin{3,6}
@@ -60,10 +61,6 @@ public:
_CTOR_DEFAULT
- // We use Gdk::EventKey& rather than Gdk::Event&. See GTK+ bug
https://bugzilla.gnome.org/show_bug.cgi?id=709544
-#m4 _CONVERSION(`const Glib::RefPtr<Gdk::EventKey>&',`GdkEvent*',`reinterpret_cast<$2>(Glib::unwrap($3))')
- _WRAP_METHOD(bool handle_event(const Glib::RefPtr<Gdk::EventKey>& gdk_event),
gtk_search_entry_handle_event)
-
_WRAP_METHOD(void set_key_capture_widget(Widget& widget), gtk_search_entry_set_key_capture_widget)
_WRAP_METHOD(Widget* get_key_capture_widget(), gtk_search_entry_get_key_capture_widget)
_WRAP_METHOD(const Widget* get_key_capture_widget() const, gtk_search_entry_get_key_capture_widget,
constversion)
@@ -76,6 +73,8 @@ public:
_WRAP_SIGNAL(void next_match(), "next-match")
_WRAP_SIGNAL(void previous_match(), "previous-match")
_WRAP_SIGNAL(void stop_search(), "stop-search")
+ // no_default_handler because the wrapped C signal has no default handler.
+ _WRAP_SIGNAL(void search_started(), "search-started", no_default_handler)
_WRAP_PROPERTY("placeholder-text", Glib::ustring)
_WRAP_PROPERTY("activates-default", bool)
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 969e2225..b8ca4036 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -170,10 +170,6 @@ public:
*/
void reparent(Container& new_parent);
- _WRAP_METHOD(void freeze_child_notify(), gtk_widget_freeze_child_notify)
- _WRAP_METHOD(void child_notify(const Glib::ustring& child_property), gtk_widget_child_notify)
- _WRAP_METHOD(void thaw_child_notify(), gtk_widget_thaw_child_notify)
-
_WRAP_METHOD(void set_can_focus(bool can_focus = true), gtk_widget_set_can_focus)
_WRAP_METHOD(bool get_can_focus() const, gtk_widget_get_can_focus)
_WRAP_METHOD(bool has_focus() const, gtk_widget_has_focus)
@@ -678,8 +674,6 @@ public:
_WRAP_SIGNAL(void grab_notify(bool was_grabbed), "grab_notify")
- _WRAP_SIGNAL(void child_notify(GParamSpec* pspec), "child_notify", detail_name child_property_name)
-
_WRAP_SIGNAL(bool mnemonic_activate(bool group_cycling), "mnemonic_activate")
#m4begin
@@ -767,9 +761,6 @@ dnl
protected:
- //comment in GTK+ header: "seldomly overidden"
- _WRAP_VFUNC(void dispatch_child_properties_changed(guint, GParamSpec**),
"dispatch_child_properties_changed")
-
_WRAP_VFUNC(void root(), root)
_WRAP_VFUNC(void unroot(), unroot)
_WRAP_VFUNC(SizeRequestMode get_request_mode() const, get_request_mode)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]