[gtkmm] Gtk: Update for the latest gtk4 (Add NotebookPage, etc.)
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gtk: Update for the latest gtk4 (Add NotebookPage, etc.)
- Date: Fri, 22 Feb 2019 14:32:51 +0000 (UTC)
commit 1390f3184609ebceddcffcff816b5b550d2f16d6
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Fri Feb 22 15:30:30 2019 +0100
Gtk: Update for the latest gtk4 (Add NotebookPage, etc.)
.gitignore | 2 ++
demos/gtk-demo/demowindow.cc | 7 +++---
gtk/src/assistant.hg | 5 ++++
gtk/src/combobox.hg | 1 +
gtk/src/editable.hg | 55 +++++++++++++++++++++++++++----------------
gtk/src/entry.hg | 30 ------------------------
gtk/src/filelist.am | 1 +
gtk/src/notebook.hg | 23 +++++++++---------
gtk/src/notebookpage.ccg | 18 ++++++++++++++
gtk/src/notebookpage.hg | 56 ++++++++++++++++++++++++++++++++++++++++++++
gtk/src/overlay.hg | 10 +++-----
gtk/src/searchbar.hg | 4 ++--
gtk/src/settings.hg | 1 -
gtk/src/snapshot.hg | 15 ++++++++----
gtk/src/spinbutton.hg | 3 ---
gtk/src/treeview.hg | 8 +++----
gtk/src/widget.ccg | 1 +
gtk/src/widget.hg | 9 ++++++-
tools/m4/convert_gtk.m4 | 9 +++++--
19 files changed, 169 insertions(+), 89 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index a1ba1ad9..a435769d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -355,6 +355,8 @@ gtk/gtkmm/nativedialog.cc
gtk/gtkmm/nativedialog.h
gtk/gtkmm/notebook.cc
gtk/gtkmm/notebook.h
+gtk/gtkmm/notebookpage.cc
+gtk/gtkmm/notebookpage.h
gtk/gtkmm/orientable.cc
gtk/gtkmm/orientable.h
gtk/gtkmm/overlay.cc
diff --git a/demos/gtk-demo/demowindow.cc b/demos/gtk-demo/demowindow.cc
index 44734a41..abf28221 100644
--- a/demos/gtk-demo/demowindow.cc
+++ b/demos/gtk-demo/demowindow.cc
@@ -28,6 +28,7 @@
#include <glibmm/convert.h>
#include <giomm/resource.h>
#include <gtkmm/cellrenderertext.h>
+#include <gtkmm/image.h>
#include <gtkmm/treeviewcolumn.h>
#include <gtkmm/video.h>
@@ -100,8 +101,8 @@ DemoWindow::DemoWindow()
m_Notebook.set_scrollable();
m_Notebook.append_page(m_TextWidget_Info, "_Info", true); //true = use mnemonic.
m_Notebook.append_page(m_TextWidget_Source, "_Source", true); //true = use mnemonic.
- m_Notebook.child_property_tab_expand(m_TextWidget_Info) = true;
- m_Notebook.child_property_tab_expand(m_TextWidget_Source) = true;
+ m_Notebook.get_page(m_TextWidget_Info)->property_tab_expand() = true;
+ m_Notebook.get_page(m_TextWidget_Source)->property_tab_expand() = true;
m_Notebook.set_expand(true);
m_HBox.add(m_Notebook);
m_HBox.set_vexpand(true);
@@ -457,7 +458,7 @@ void DemoWindow::add_data_tabs(const std::string& filename)
}
}
m_Notebook.append_page(*Gtk::manage(widget), resources[i]);
- m_Notebook.child_property_tab_expand(*widget) = true;
+ m_Notebook.get_page(*widget)->property_tab_expand() = true;
}
}
diff --git a/gtk/src/assistant.hg b/gtk/src/assistant.hg
index 8db0d8fa..50a531d3 100644
--- a/gtk/src/assistant.hg
+++ b/gtk/src/assistant.hg
@@ -16,6 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <giomm/listmodel.h>
#include <gtkmm/window.h>
#include <gtkmm/assistantpage.h>
#include <gdkmm/pixbuf.h>
@@ -88,6 +89,9 @@ public:
_WRAP_METHOD(Glib::RefPtr<AssistantPage> get_page(Widget& child), gtk_assistant_get_page, refreturn)
_WRAP_METHOD(Glib::RefPtr<const AssistantPage> get_page(const Widget& child) const,
gtk_assistant_get_page, refreturn, constversion)
+ _WRAP_METHOD(Glib::RefPtr<Gio::ListModel> get_pages(), gtk_assistant_get_pages)
+ _WRAP_METHOD(Glib::RefPtr<const Gio::ListModel> get_pages() const, gtk_assistant_get_pages, constversion)
+
_WRAP_SIGNAL(void prepare(Gtk::Widget* page), "prepare")
_WRAP_SIGNAL(void apply(), "apply")
_WRAP_SIGNAL(void close(), "close")
@@ -97,6 +101,7 @@ public:
_IGNORE_SIGNAL("escape")
_WRAP_PROPERTY("use-header-bar", bool)
+ _WRAP_PROPERTY("pages", Glib::RefPtr<Gio::ListModel>)
};
} // namespace Gtk
diff --git a/gtk/src/combobox.hg b/gtk/src/combobox.hg
index c0b79598..1728c967 100644
--- a/gtk/src/combobox.hg
+++ b/gtk/src/combobox.hg
@@ -19,6 +19,7 @@
#include <gtkmm/bin.h>
#include <gtkmm/celllayout.h>
#include <gtkmm/celleditable.h>
+#include <gtkmm/entry.h>
#include <gtkmm/treemodel.h>
#include <gtkmm/treeview.h>
#include <gtkmm/enums.h> //For SensitivityType.
diff --git a/gtk/src/editable.hg b/gtk/src/editable.hg
index e0031665..2e15f3c6 100644
--- a/gtk/src/editable.hg
+++ b/gtk/src/editable.hg
@@ -37,16 +37,15 @@ namespace Gtk
* a large number of action signals used for key bindings, and several
* signals that an application can connect to to modify the behavior of a
* widget.
- *
*/
class Editable : public Glib::Interface
{
_CLASS_INTERFACE(Editable,GtkEditable,GTK_EDITABLE,GtkEditableInterface)
public:
- _WRAP_METHOD(void cut_clipboard(), gtk_editable_cut_clipboard)
- _WRAP_METHOD(void copy_clipboard(), gtk_editable_copy_clipboard)
- _WRAP_METHOD(void paste_clipboard(), gtk_editable_paste_clipboard)
+ _WRAP_METHOD(Glib::ustring get_text() const, gtk_editable_get_text)
+ _WRAP_METHOD(void set_text(const Glib::ustring& text), gtk_editable_set_text)
+
_WRAP_METHOD(void delete_selection(), gtk_editable_delete_selection)
_WRAP_METHOD(void set_editable(bool is_editable = true), gtk_editable_set_editable)
_WRAP_METHOD(bool get_editable() const, gtk_editable_get_editable)
@@ -62,15 +61,28 @@ public:
_WRAP_METHOD(void set_position(int position), gtk_editable_set_position)
_WRAP_METHOD(int get_position() const, gtk_editable_get_position)
+ _WRAP_METHOD(float get_alignment() const, gtk_editable_get_alignment)
+ _WRAP_METHOD(void set_alignment(float xalign), gtk_editable_set_alignment)
+
+ _WRAP_METHOD(int get_width_chars() const, gtk_editable_get_width_chars)
+ _WRAP_METHOD(void set_width_chars(int n_chars), gtk_editable_set_width_chars)
+
+ _WRAP_METHOD(int get_max_width_chars() const, gtk_editable_get_max_width_chars)
+ _WRAP_METHOD(void set_max_width_chars(int n_chars), gtk_editable_set_max_width_chars)
+
+ // Don't wrap API for implementations. Should it be wrapped?
+ _IGNORE(gtk_editable_install_properties, gtk_editable_init_delegate, gtk_editable_finish_delegate,
+ gtk_editable_delegate_set_property, gtk_editable_delegate_get_property)
+
_IGNORE_SIGNAL(insert_text)
#m4begin
dnl // WRAP_SIGNAL "insert_text"
dnl // C++ prototype: void insert_text(const Glib::ustring& text, int* position)
-dnl // C prototype: void insert_text(const gchar* text, gint length, gint* position)
+dnl // C prototype: void insert_text(const gchar* text, int length, int* position)
_SIGNAL_PROXY(
- insert_text, void, `const gchar* text, gint length, gint* position',
+ insert_text, void, `const gchar* text, int length, int* position',
insert_text, void, `const Glib::ustring&, int*',dnl // C++ prototype
`Glib::ustring(text, text + length), position',`dnl // C -> C++ conversion
/**
@@ -80,7 +92,7 @@ dnl // C prototype: void insert_text(const gchar* text, gint length, gint* posit
*/')
_SIGNAL_H(insert_text, void, `const Glib::ustring& text, int* position')
- _SIGNAL_PH(insert_text, void, `GtkEditable* self, const gchar* text, gint length, gint* position')
+ _SIGNAL_PH(insert_text, void, `GtkEditable* self, const gchar* text, int length, int* position')
_SIGNAL_CC(
insert_text, insert_text, void, void,
@@ -89,7 +101,7 @@ dnl // C prototype: void insert_text(const gchar* text, gint length, gint* posit
_SIGNAL_PCC(
insert_text, insert_text, void, void,
- `GtkEditable* self, const gchar* text, gint length, gint* position',dnl // C arguments
+ `GtkEditable* self, const gchar* text, int length, int* position',dnl // C arguments
`self, text, length, position',dnl // C argument names
`Glib::ustring(text, text + length), position',dnl // C -> C++ conversion
self)
@@ -98,22 +110,30 @@ dnl // C prototype: void insert_text(const gchar* text, gint length, gint* posit
_WRAP_SIGNAL(void delete_text(int start_pos, int end_pos), "delete_text")
_WRAP_SIGNAL(void changed(), "changed")
+ _WRAP_PROPERTY("text", Glib::ustring)
+ _WRAP_PROPERTY("cursor-position", int)
+ _WRAP_PROPERTY("selection-bound", int)
+ _WRAP_PROPERTY("editable", bool)
+ _WRAP_PROPERTY("width-chars", int)
+ _WRAP_PROPERTY("max-width-chars", int)
+ _WRAP_PROPERTY("xalign", float)
+
protected:
#m4begin
dnl // WRAP_VFUNC "do_insert_text"
dnl // C++ prototype: void insert_text_vfunc(const Glib::ustring& text, int& position)
-dnl // C prototype: void do_insert_text(const gchar* text, gint length, gint* position)
+dnl // C prototype: void do_insert_text(const char* text, int length, int* position)
_VFUNC_H(insert_text_vfunc, void, `const Glib::ustring& text, int& position')
- _VFUNC_PH(do_insert_text, void, `GtkEditable* self, const gchar* text, gint length, gint* position')
+ _VFUNC_PH(do_insert_text, void, `GtkEditable* self, const char* text, int length, int* position')
_VFUNC_CC(
insert_text_vfunc, do_insert_text, void, void,
`const Glib::ustring& text, int& position',dnl // C++ arguments
`text.data(), text.bytes(), &position')dnl // C++ -> C conversion
_VFUNC_PCC(
insert_text_vfunc, do_insert_text, void, void,
- `GtkEditable* self, const gchar* text, gint length, gint* position',dnl // C arguments
+ `GtkEditable* self, const char* text, int length, int* position',dnl // C arguments
`self, text, length, position',dnl // C argument names
`Glib::ustring(text, text + length), *position',dnl // C -> C++ conversion
self)
@@ -121,18 +141,13 @@ dnl // C prototype: void do_insert_text(const gchar* text, gint length, gint* po
_WRAP_VFUNC(void delete_text(int start_pos, int end_pos), do_delete_text)
-#m4begin
-dnl // This special conversion is not in convert_gtk.m4, because allocating a new
-dnl // string is rarely needed -- probably not a good idea to make this generic.
- _CONVERSION(`Glib::ustring', `gchar*', `g_strdup(($3).c_str())')
- _CONVERSION(`gchar*', `Glib::ustring', `Glib::convert_return_gchar_ptr_to_ustring($3)')
-#m4end
- _WRAP_VFUNC(Glib::ustring get_chars(int start_pos, int end_pos) const, get_chars)
+#m4 _CONVERSION(`Glib::ustring', `const char*', `($3).c_str()')
+ _WRAP_VFUNC(Glib::ustring get_text() const, get_text, keep_return)
_WRAP_VFUNC(void select_region(int start_pos, int end_pos), set_selection_bounds)
_WRAP_VFUNC(bool get_selection_bounds(int& start_pos, int& end_pos) const, get_selection_bounds)
- _WRAP_VFUNC(void set_position(int position), set_position)
- _WRAP_VFUNC(int get_position() const, get_position)
+ // Don't wrap API for implementations. Should it be wrapped?
+ // _WRAP_VFUNC(Editable* get_delegate(), get_delegate)
};
} // namespace Gtk
diff --git a/gtk/src/entry.hg b/gtk/src/entry.hg
index 2b0895a3..526184dd 100644
--- a/gtk/src/entry.hg
+++ b/gtk/src/entry.hg
@@ -84,12 +84,6 @@ public:
_WRAP_METHOD(int get_max_width_chars() const, gtk_entry_get_max_width_chars)
_WRAP_METHOD(void set_text(const Glib::ustring &text), gtk_entry_set_text)
_WRAP_METHOD(Glib::ustring get_text() const, gtk_entry_get_text)
- _WRAP_METHOD(Glib::RefPtr<Pango::Layout> get_layout(), gtk_entry_get_layout, refreturn)
- _WRAP_METHOD(Glib::RefPtr<const Pango::Layout> get_layout() const, gtk_entry_get_layout, refreturn,
constversion)
- _WRAP_METHOD(void get_layout_offsets(int& x, int& y), gtk_entry_get_layout_offsets)
-
- _WRAP_METHOD(int layout_index_to_text_index(int layout_index) const, gtk_entry_layout_index_to_text_index)
- _WRAP_METHOD(int text_index_to_layout_index(int text_index) const, gtk_entry_text_index_to_layout_index)
_WRAP_METHOD(void set_alignment(float xalign), gtk_entry_set_alignment)
_WRAP_METHOD(void set_alignment(Align xalign), gtk_entry_set_alignment)
@@ -172,7 +166,6 @@ public:
_IGNORE(gtk_entry_get_icon_area)
_WRAP_METHOD(int get_current_icon_drag_source(), gtk_entry_get_current_icon_drag_source)
- _WRAP_METHOD(bool im_context_filter_keypress(const Glib::RefPtr<Gdk::EventKey>& gdk_event),
gtk_entry_im_context_filter_keypress)
_WRAP_METHOD(void reset_im_context(), gtk_entry_reset_im_context)
_WRAP_METHOD(void set_input_purpose(InputPurpose purpose), gtk_entry_set_input_purpose)
@@ -191,11 +184,6 @@ public:
_WRAP_METHOD(void grab_focus_without_selecting(), gtk_entry_grab_focus_without_selecting)
- _WRAP_SIGNAL(void populate_popup(Widget* widget), "populate_popup")
-
-#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
- _WRAP_SIGNAL(void insert_at_cursor(const Glib::ustring& str), "insert_at_cursor")
-
//Note that the GTK+ C documentation for the activate signal says (as of 2012-06) that it should be used
by applications even though it is a keybinding signal.
_WRAP_SIGNAL(void activate(), "activate")
@@ -204,35 +192,17 @@ public:
_WRAP_SIGNAL(void icon_release(IconPosition icon_position), "icon-release", no_default_handler)
_WRAP_SIGNAL(void icon_press(IconPosition icon_position), "icon-press", no_default_handler)
- _IGNORE_SIGNAL("move_cursor")
- _IGNORE_SIGNAL("delete_from_cursor")
- _IGNORE_SIGNAL("cut_clipboard")
- _IGNORE_SIGNAL("copy_clipboard")
- _IGNORE_SIGNAL("paste_clipboard")
- _IGNORE_SIGNAL("toggle_overwrite")
- _IGNORE_SIGNAL("backspace")
- _IGNORE_SIGNAL("preedit-changed")
- _IGNORE_SIGNAL("insert-emoji")
-
_WRAP_PROPERTY("buffer", Glib::RefPtr<EntryBuffer>)
- _WRAP_PROPERTY("cursor-position", int)
- _WRAP_PROPERTY("selection-bound", int)
- _WRAP_PROPERTY("editable", bool)
_WRAP_PROPERTY("max-length", int)
_WRAP_PROPERTY("visibility", bool)
_WRAP_PROPERTY("has-frame", bool)
_WRAP_PROPERTY("invisible-char", gunichar)
_WRAP_PROPERTY("invisible-char-set", bool)
_WRAP_PROPERTY("activates-default", bool)
- _WRAP_PROPERTY("width-chars", int)
- _WRAP_PROPERTY("max-width-chars", int)
_WRAP_PROPERTY("scroll-offset", int)
- _WRAP_PROPERTY("text", Glib::ustring)
- _WRAP_PROPERTY("xalign", float)
_WRAP_PROPERTY("truncate-multiline", bool)
_WRAP_PROPERTY("overwrite-mode", bool)
_WRAP_PROPERTY("text-length", guint)
- _WRAP_PROPERTY("caps-lock-warning", bool)
_WRAP_PROPERTY("progress-fraction", double)
_WRAP_PROPERTY("progress-pulse-step", double)
_WRAP_PROPERTY("primary-icon-paintable", Glib::RefPtr<Gdk::Paintable>)
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index ecc030ee..f31977e9 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -125,6 +125,7 @@ gtkmm_files_any_hg = \
modelbutton.hg \
nativedialog.hg \
notebook.hg \
+ notebookpage.hg \
orientable.hg \
overlay.hg \
pagesetup.hg \
diff --git a/gtk/src/notebook.hg b/gtk/src/notebook.hg
index d69d3833..d3f2285c 100644
--- a/gtk/src/notebook.hg
+++ b/gtk/src/notebook.hg
@@ -18,8 +18,10 @@
_CONFIGINCLUDE(gtkmmconfig.h)
+#include <giomm/listmodel.h>
#include <gtkmm/container.h>
#include <gtkmm/label.h>
+#include <gtkmm/notebookpage.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/container_p.h)
@@ -132,10 +134,16 @@ public:
_WRAP_METHOD(Widget* get_action_widget(PackType pack_type = PackType::START),
gtk_notebook_get_action_widget)
_WRAP_METHOD(void set_action_widget(Widget* widget, PackType pack_type = PackType::START),
gtk_notebook_set_action_widget)
+ _WRAP_METHOD(Glib::RefPtr<NotebookPage> get_page(Widget& child), gtk_notebook_get_page, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const NotebookPage> get_page(const Widget& child) const, gtk_notebook_get_page,
refreturn, constversion)
+
+ _WRAP_METHOD(Glib::RefPtr<Gio::ListModel> get_pages(), gtk_notebook_get_pages)
+ _WRAP_METHOD(Glib::RefPtr<const Gio::ListModel> get_pages() const, gtk_notebook_get_pages, constversion)
+
_WRAP_SIGNAL(void switch_page(Widget* page, guint page_number), "switch_page")
- _WRAP_SIGNAL(void page_reordered(Widget* page, guint page_num), "page_reordered", no_default_handler)
- _WRAP_SIGNAL(void page_removed(Widget* page, guint page_num), "page_removed", no_default_handler)
- _WRAP_SIGNAL(void page_added(Widget* page, guint page_num), "page_added", no_default_handler)
+ _WRAP_SIGNAL(void page_reordered(Widget* page, guint page_num), "page_reordered")
+ _WRAP_SIGNAL(void page_removed(Widget* page, guint page_num), "page_removed")
+ _WRAP_SIGNAL(void page_added(Widget* page, guint page_num), "page_added")
//Key-binding signals:
_IGNORE_SIGNAL("move_focus_out")
@@ -154,14 +162,7 @@ public:
_WRAP_PROPERTY("page", int)
_WRAP_PROPERTY("group-name", Glib::ustring)
_WRAP_PROPERTY("enable-popup", bool)
-
- _WRAP_CHILD_PROPERTY("tab-label", Glib::ustring)
- _WRAP_CHILD_PROPERTY("menu-label", Glib::ustring)
- _WRAP_CHILD_PROPERTY("position", int)
- _WRAP_CHILD_PROPERTY("tab-expand", bool)
- _WRAP_CHILD_PROPERTY("tab-fill", bool)
- _WRAP_CHILD_PROPERTY("reorderable", bool)
- _WRAP_CHILD_PROPERTY("detachable", bool)
+ _WRAP_PROPERTY("pages", Glib::RefPtr<Gio::ListModel>)
};
} // namespace Gtk
diff --git a/gtk/src/notebookpage.ccg b/gtk/src/notebookpage.ccg
new file mode 100644
index 00000000..2b01d5aa
--- /dev/null
+++ b/gtk/src/notebookpage.ccg
@@ -0,0 +1,18 @@
+/* Copyright (C) 2019 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 <gtkmm/widget.h>
+#include <gtk/gtk.h>
diff --git a/gtk/src/notebookpage.hg b/gtk/src/notebookpage.hg
new file mode 100644
index 00000000..533c894c
--- /dev/null
+++ b/gtk/src/notebookpage.hg
@@ -0,0 +1,56 @@
+/* Copyright (C) 2019 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>
+#include <glibmm/refptr.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gtk
+{
+class Widget;
+
+/** Holds properties of a Gtk::Notebook page.
+ *
+ * Use Gtk::Notebook::get_page() to get a pointer to a %NotebookPage object.
+ *
+ * @see Notebook
+ * @newin{3,96}
+ */
+class NotebookPage : public Glib::Object
+{
+ _CLASS_GOBJECT(NotebookPage, GtkNotebookPage, GTK_NOTEBOOK_PAGE, Glib::Object, GObject)
+
+public:
+ _WRAP_METHOD(Widget* get_child(), gtk_notebook_page_get_child)
+ _WRAP_METHOD(const Widget* get_child() const, gtk_notebook_page_get_child, constversion)
+
+ _WRAP_PROPERTY("child", Widget*)
+ _WRAP_PROPERTY("tab", Widget*)
+ _WRAP_PROPERTY("menu", Widget*)
+ _WRAP_PROPERTY("tab-label", Glib::ustring)
+ _WRAP_PROPERTY("menu-label", Glib::ustring)
+ _WRAP_PROPERTY("position", int)
+ _WRAP_PROPERTY("tab-expand", bool)
+ _WRAP_PROPERTY("tab-fill", bool)
+ _WRAP_PROPERTY("reorderable", bool)
+ _WRAP_PROPERTY("detachable", bool)
+
+ // There are no signals or vfuncs.
+};
+
+} // namespace Gtk
diff --git a/gtk/src/overlay.hg b/gtk/src/overlay.hg
index 3f5f8554..19fca975 100644
--- a/gtk/src/overlay.hg
+++ b/gtk/src/overlay.hg
@@ -58,20 +58,16 @@ public:
_WRAP_METHOD(void add_overlay(Gtk::Widget& widget), gtk_overlay_add_overlay)
- _WRAP_METHOD(void reorder_overlay(Widget& child, int position), gtk_overlay_reorder_overlay)
- _WRAP_METHOD(bool get_overlay_pass_through(Widget& widget) const, gtk_overlay_get_overlay_pass_through)
- _WRAP_METHOD(void set_overlay_pass_through(Widget& widget, bool pass_through = true),
gtk_overlay_set_overlay_pass_through)
_WRAP_METHOD(bool get_measure_overlay(Widget& widget) const, gtk_overlay_get_measure_overlay)
_WRAP_METHOD(void set_measure_overlay(Widget& widget, bool measure = true),
gtk_overlay_set_measure_overlay)
+ _WRAP_METHOD(bool get_clip_overlay(const Widget& widget) const, gtk_overlay_get_clip_overlay)
+ _WRAP_METHOD(void set_clip_overlay(const Widget& widget, bool clip_overlay = true),
gtk_overlay_set_clip_overlay)
#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("pass-through", bool)
_WRAP_CHILD_PROPERTY("measure", bool)
- _WRAP_CHILD_PROPERTY("blur", double)
- _WRAP_CHILD_PROPERTY("index", int)
-
+ _WRAP_CHILD_PROPERTY("clip-overlay", bool)
};
} // namespace Gtk
diff --git a/gtk/src/searchbar.hg b/gtk/src/searchbar.hg
index 9e9ca928..66ef824c 100644
--- a/gtk/src/searchbar.hg
+++ b/gtk/src/searchbar.hg
@@ -17,7 +17,7 @@
*/
#include <gtkmm/bin.h>
-#include <gtkmm/entry.h>
+#include <gtkmm/editable.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/bin_p.h)
@@ -57,7 +57,7 @@ public:
_CTOR_DEFAULT
- _WRAP_METHOD(void connect_entry(Gtk::Entry& entry), gtk_search_bar_connect_entry)
+ _WRAP_METHOD(void connect_entry(Editable& entry), gtk_search_bar_connect_entry)
_WRAP_METHOD(bool get_search_mode() const, gtk_search_bar_get_search_mode)
_WRAP_METHOD(void set_search_mode(bool search_mode=true), gtk_search_bar_set_search_mode)
diff --git a/gtk/src/settings.hg b/gtk/src/settings.hg
index 554dc15e..864c5c48 100644
--- a/gtk/src/settings.hg
+++ b/gtk/src/settings.hg
@@ -51,7 +51,6 @@ public:
_WRAP_PROPERTY("gtk-cursor-blink-timeout", int) //since 3.4
_WRAP_PROPERTY("gtk-split-cursor", bool)
_WRAP_PROPERTY("gtk-theme-name", Glib::ustring)
- _WRAP_PROPERTY("gtk-key-theme-name", Glib::ustring)
_WRAP_PROPERTY("gtk-dnd-drag-threshold", int)
_WRAP_PROPERTY("gtk-font-name", Glib::ustring)
//#ifdef GDK_WINDOWING_X11
diff --git a/gtk/src/snapshot.hg b/gtk/src/snapshot.hg
index 30a0abb6..ed204472 100644
--- a/gtk/src/snapshot.hg
+++ b/gtk/src/snapshot.hg
@@ -35,7 +35,7 @@ namespace Gtk
/** Auxiliary object for snapshots.
*
* %Snapshot is an auxiliary object that assists in creating GskRenderNodes
- * in the Gtk::WidgetCustomSnapshot::snapshot_vfunc(). It functions in a similar way to
+ * in Gtk::Widget::snapshot_vfunc(). It functions in a similar way to
* a cairo context, and maintains a stack of render nodes and their associated
* transformations.
*
@@ -50,7 +50,7 @@ namespace Gtk
class Snapshot : public Gdk::Snapshot
{
_CLASS_GOBJECT(Snapshot, GtkSnapshot, GTK_SNAPSHOT, Gdk::Snapshot, GdkSnapshot)
- // GtkSnapshot is typedefed as GdkSnapshot.
+ // GtkSnapshot is typedefed as GdkSnapshot in gtktypes.h.
// GtkSnapshot's wrap function can't be called wrap(). It would be ambiguous
// when there is a wrap(GdkSnapshot*, bool)
_NO_WRAP_FUNCTION
@@ -74,6 +74,7 @@ public:
//TODO: These gtk_snapshot_push_*() functions have no documentation.
//TODO: Wrap gtk_snapshot_push_transform()?
//TODO: Wrap gtk_snapshot_push_opacity()?
+ //TODO: Wrap gtk_snapshot_push_blur()?
//TODO: Wrap gtk_snapshot_push_color_matrix()?
//TODO: Wrap gtk_snapshot_push_repeat()?
//TODO: Wrap gtk_snapshot_push_clip()?
@@ -85,11 +86,15 @@ public:
_WRAP_METHOD(void pop(), gtk_snapshot_pop)
- _WRAP_METHOD(void offset(int x, int y), gtk_snapshot_offset)
- _WRAP_METHOD(void get_offset(int& x, int& y) const, gtk_snapshot_get_offset)
-
//TODO: Wrap gtk_snapshot_append_node()?
+ _WRAP_METHOD(void save(), gtk_snapshot_save)
+ _WRAP_METHOD(void restore(), gtk_snapshot_restore)
+
+ _WRAP_METHOD(void rotate(float angle), gtk_snapshot_rotate)
+ _WRAP_METHOD(void scale(float factor_x, float factor_y), gtk_snapshot_scale)
+ _WRAP_METHOD(void scale(float factor_x, float factor_y, float factor_z), gtk_snapshot_scale_3d)
+
_WRAP_METHOD(Cairo::RefPtr<Cairo::Context> append_cairo(const graphene_rect_t* bounds),
gtk_snapshot_append_cairo)
#m4 _CONVERSION(`const Gdk::Rectangle&',`const graphene_rect_t*', `gdk_rect_to_graphene_rect($3).get()')
_WRAP_METHOD(Cairo::RefPtr<Cairo::Context> append_cairo(const Gdk::Rectangle& bounds),
gtk_snapshot_append_cairo)
diff --git a/gtk/src/spinbutton.hg b/gtk/src/spinbutton.hg
index 97959c7e..bfc4b00c 100644
--- a/gtk/src/spinbutton.hg
+++ b/gtk/src/spinbutton.hg
@@ -129,9 +129,6 @@ public:
_WRAP_PROPERTY("wrap", bool)
_WRAP_PROPERTY("update-policy", UpdatePolicy)
_WRAP_PROPERTY("value", double)
- _WRAP_PROPERTY("width-chars", int)
- _WRAP_PROPERTY("max-width-chars", int)
- _WRAP_PROPERTY("text", Glib::ustring)
};
} // namespace Gtk
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index 0ca6e913..3d720b02 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -27,7 +27,7 @@ _CONFIGINCLUDE(gtkmmconfig.h)
#include <gtkmm/treemodelcolumn.h>
#include <gtkmm/cellrenderer.h>
#include <gtkmm/scrollable.h>
-#include <gtkmm/entry.h>
+#include <gtkmm/editable.h>
#include <gtkmm/tooltip.h>
_DEFS(gtkmm,gtk)
@@ -650,9 +650,9 @@ public:
void set_search_equal_func(const SlotSearchEqual& slot);
_IGNORE(gtk_tree_view_set_search_equal_func)
- _WRAP_METHOD(Entry* get_search_entry(), gtk_tree_view_get_search_entry)
- _WRAP_METHOD(const Entry* get_search_entry() const, gtk_tree_view_get_search_entry, constversion)
- _WRAP_METHOD(void set_search_entry(Entry& entry), gtk_tree_view_set_search_entry)
+ _WRAP_METHOD(Editable* get_search_entry(), gtk_tree_view_get_search_entry)
+ _WRAP_METHOD(const Editable* get_search_entry() const, gtk_tree_view_get_search_entry, constversion)
+ _WRAP_METHOD(void set_search_entry(Editable& entry), gtk_tree_view_set_search_entry)
///void on_search_position(Gtk::Widget* search_dialog)
typedef sigc::slot<void(Gtk::Widget* /* search_dialog */)> SlotSearchPosition;
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index 362a59e2..ca4453c5 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -23,6 +23,7 @@
#include <gdkmm/paintable.h>
#include <gtkmm/adjustment.h>
#include <gtkmm/window.h>
+#include <gtkmm/root.h>
#include <gtkmm/accelgroup.h>
#include <gtkmm/settings.h>
#include <gtkmm/container.h>
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index d73cc556..3567d436 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -68,6 +68,7 @@ _WRAP_ENUM(DragResult, GtkDragResult)
class AccelGroup;
class Adjustment;
class Window;
+class Root;
class Container;
class EventController;
class Settings;
@@ -174,6 +175,8 @@ public:
_WRAP_METHOD(void grab_focus(), gtk_widget_grab_focus)
_WRAP_METHOD(void set_focus_on_click(bool focus_on_click = true), gtk_widget_set_focus_on_click)
_WRAP_METHOD(bool get_focus_on_click() const, gtk_widget_get_focus_on_click)
+ _WRAP_METHOD(void set_can_pick(bool can_pick = true), gtk_widget_set_can_pick)
+ _WRAP_METHOD(bool get_can_pick() const, gtk_widget_get_can_pick)
_WRAP_METHOD(void set_can_default(bool can_default = true), gtk_widget_set_can_default)
_WRAP_METHOD(bool get_can_default() const, gtk_widget_get_can_default)
_WRAP_METHOD(bool has_default() const, gtk_widget_has_default)
@@ -233,7 +236,6 @@ public:
_WRAP_METHOD(int get_allocated_width() const, gtk_widget_get_allocated_width)
_WRAP_METHOD(int get_allocated_height() const, gtk_widget_get_allocated_height)
_WRAP_METHOD(int get_allocated_baseline() const, gtk_widget_get_allocated_baseline)
- _WRAP_METHOD(void get_allocated_size(Allocation& allocation, int& baseline) const,
gtk_widget_get_allocated_size)
/** Retrieves the widget's location.
* Note, when implementing a Container: a widget's allocation will be its "adjusted" allocation,
@@ -258,6 +260,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(Root* get_root(), gtk_widget_get_root)
+ _WRAP_METHOD(const Root* get_root() const, gtk_widget_get_root, constversion)
+
_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)
@@ -723,6 +728,7 @@ dnl
_WRAP_PROPERTY("name", Glib::ustring)
_WRAP_PROPERTY("parent", Container*)
+ _WRAP_PROPERTY("root", Root*)
_WRAP_PROPERTY("width_request", int)
_WRAP_PROPERTY("height_request", int)
_WRAP_PROPERTY("visible", bool)
@@ -730,6 +736,7 @@ dnl
_WRAP_PROPERTY("can_focus", bool)
_WRAP_PROPERTY("has_focus", bool)
_WRAP_PROPERTY("is_focus", bool)
+ _WRAP_PROPERTY("can_pick", bool)
_WRAP_PROPERTY("focus_on_click", bool)
_WRAP_PROPERTY("can_default", bool)
_WRAP_PROPERTY("has_default", bool)
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index c5c2d2ee..e56ffc2f 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -186,7 +186,7 @@ _CONVERSION(`const Glib::RefPtr<AccelGroup>&',`GtkAccelGroup*',__CONVERT_REFPTR_
_CONVERSION(`Gtk::Object&',`GObject*', `($3).Glib::Object::gobj()')
_CONVERSION(`GtkAssistantPage*',`Glib::RefPtr<AssistantPage>',`Glib::wrap($3)')
-_CONVERSION(`GtkAssistantPage*',`Glib::RefPtr<const AssistantPage>',`Glib::wrap($3)')
+_CONVERSION(`GtkNotebookPage*',`Glib::RefPtr<NotebookPage>',`Glib::wrap($3)')
_CONVERSION(`GtkCellArea*',`Glib::RefPtr<CellArea>',`Glib::wrap($3)')
_CONVERSION(`GtkCellArea*',`Glib::RefPtr<const CellArea>',`Glib::wrap($3)')
@@ -377,9 +377,15 @@ _CONVERSION(`const TreeModelColumnBase&',`int',`($3).index`'()')
_CONVERSION(`GtkTreePath*',`TreePath', `Gtk::TreePath($3, false)')
_CONVERSION(`GtkTreePath*',`Path', `Gtk::TreePath($3, false)')
_CONVERSION(`GtkTreePath*',`TreeModel::Path', `Gtk::TreePath($3, false)')
+
_CONVERSION(`GtkCellEditable*',`CellEditable*',`dynamic_cast<$2>(Glib::wrap_auto((GObject*)($3), false))')
_CONVERSION(`CellEditable*',`GtkCellEditable*',`Glib::unwrap($3)')
+_CONVERSION(`GtkEditable*',`Editable*',`dynamic_cast<$2>(Glib::wrap_auto((GObject*)($3), false))')
+_CONVERSION(`Editable&',`GtkEditable*',__FR2P)
+
+_CONVERSION(`GtkRoot*',`Root*',`dynamic_cast<$2>(Glib::wrap_auto((GObject*)($3), false))')
+
_CONVERSION(`SelectionData',`GtkSelectionData*', `($3).gobj()')
_CONVERSION(`const SelectionData&',`const GtkSelectionData*', __FR2P)
_CONVERSION(`const SelectionData&',`GtkSelectionData*', __FCR2P)
@@ -423,7 +429,6 @@ _CONVERSION(`GtkEntry*',`Entry*',__RP2P)
_CONVERSION(`GtkEntry*',`const Entry*',__RP2P)
_CONVERSION(`Entry&',`GtkEntry*',__FR2P)
-
_CONVERSION(`Gtk::Border&',`GtkBorder*',__FR2P)
_CONVERSION(`GtkBorder*',`Gtk::Border&',`Glib::wrap($3)')
_CONVERSION(`const Border&',`const GtkBorder*',__FR2P)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]