[gtkmm/use-dllexport: 41/60] Gdk, Gtk: Update for the latest gtk4 (add Gtk::WindowHandle, etc.)
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/use-dllexport: 41/60] Gdk, Gtk: Update for the latest gtk4 (add Gtk::WindowHandle, etc.)
- Date: Mon, 8 Jun 2020 02:45:27 +0000 (UTC)
commit 6c765478678f525d40cb97e459dafba20a7fb534
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Tue Jun 2 18:44:54 2020 +0200
Gdk, Gtk: Update for the latest gtk4 (add Gtk::WindowHandle, etc.)
There are many new classes in gtk. Most of them are not yet wrapped
in gtkmm.
.gitignore | 10 ++++
docs/reference/Doxyfile.in | 2 -
gdk/src/display.hg | 6 ---
gtk/gtkmm.h | 2 +
gtk/src/eventcontrollermotion.hg | 6 +--
gtk/src/filelist.am | 4 +-
gtk/src/widget.hg | 1 +
gtk/src/windowcontrols.ccg | 31 ++++++++++++
gtk/src/windowcontrols.hg | 107 +++++++++++++++++++++++++++++++++++++++
gtk/src/windowhandle.ccg | 27 ++++++++++
gtk/src/windowhandle.hg | 55 ++++++++++++++++++++
11 files changed, 238 insertions(+), 13 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 1c6194b2..86f17a08 100644
--- a/.gitignore
+++ b/.gitignore
@@ -561,8 +561,12 @@ gtk/gtkmm/widgetpaintable.cc
gtk/gtkmm/widgetpaintable.h
gtk/gtkmm/window.cc
gtk/gtkmm/window.h
+gtk/gtkmm/windowcontrols.cc
+gtk/gtkmm/windowcontrols.h
gtk/gtkmm/windowgroup.cc
gtk/gtkmm/windowgroup.h
+gtk/gtkmm/windowhandle.cc
+gtk/gtkmm/windowhandle.h
gtk/gtkmm/wrap_init.cc
gtk/gtkmmconfig.h
gtk/stamp-h3
@@ -581,3 +585,9 @@ tools/extra_defs_gen/generate_defs_gtk
# win32_installer
win32_installer/gtkmm-installer.nsi
win32_installer/lgpl.txt
+
+# untracked/
+untracked/build_scripts/
+untracked/docs/
+untracked/gdk/
+untracked/gtk/
diff --git a/docs/reference/Doxyfile.in b/docs/reference/Doxyfile.in
index 98ec2fea..6990139c 100644
--- a/docs/reference/Doxyfile.in
+++ b/docs/reference/Doxyfile.in
@@ -316,12 +316,10 @@ GENERATE_TAGFILE = "reference/@GTKMM_MODULE_NAME@.tag"
ALLEXTERNALS = NO
EXTERNAL_GROUPS = NO
EXTERNAL_PAGES = YES
-PERL_PATH = @PERL@
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
-MSCGEN_PATH =
DIA_PATH =
HIDE_UNDOC_RELATIONS = NO
HAVE_DOT = YES
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index 9b5b6d24..6f8ef913 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -69,13 +69,7 @@ public:
_WRAP_METHOD(bool is_composited() const, gdk_display_is_composited)
_WRAP_METHOD(bool is_rgba() const, gdk_display_is_rgba)
- // get_event() removes the next event, if there is one - therefore there is no const version:
- _WRAP_METHOD(Glib::RefPtr<Event> get_event(), gdk_display_get_event)
-
- _WRAP_METHOD(Glib::RefPtr<Event> peek_event(), gdk_display_peek_event)
- _WRAP_METHOD(Glib::RefPtr<const Event> peek_event() const, gdk_display_peek_event, constversion)
_WRAP_METHOD(void put_event(const Glib::RefPtr<const Event>& event), gdk_display_put_event)
- _WRAP_METHOD(bool has_pending() const, gdk_display_has_pending)
_WRAP_METHOD(static Glib::RefPtr<Display> get_default(), gdk_display_get_default, refreturn)
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index b0f9df8a..c4077a65 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -280,6 +280,8 @@ extern const int gtkmm_micro_version;
#include <gtkmm/volumebutton.h>
#include <gtkmm/widget.h>
#include <gtkmm/widgetpaintable.h>
+#include <gtkmm/windowcontrols.h>
#include <gtkmm/window.h>
+#include <gtkmm/windowhandle.h>
#endif /* #ifndef GTKMM_H */
diff --git a/gtk/src/eventcontrollermotion.hg b/gtk/src/eventcontrollermotion.hg
index 23f2def2..b8b17fbe 100644
--- a/gtk/src/eventcontrollermotion.hg
+++ b/gtk/src/eventcontrollermotion.hg
@@ -15,7 +15,6 @@
*/
#include <gtkmm/eventcontroller.h>
-#include <gdkmm/enums.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/eventcontroller_p.h)
@@ -47,9 +46,8 @@ public:
_WRAP_METHOD(bool is_pointer() const, gtk_event_controller_motion_is_pointer)
// no_default_handler because GtkEventControllerMotionClass is private.
- _WRAP_SIGNAL(void enter(double x, double y, Gdk::CrossingMode mode),
- "enter", no_default_handler)
- _WRAP_SIGNAL(void leave(Gdk::CrossingMode mode), "leave", no_default_handler)
+ _WRAP_SIGNAL(void enter(double x, double y), "enter", no_default_handler)
+ _WRAP_SIGNAL(void leave(), "leave", no_default_handler)
_WRAP_SIGNAL(void motion(double x, double y), "motion", no_default_handler)
_WRAP_PROPERTY("is-pointer", bool)
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index a201cbe8..e3b7875d 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -217,7 +217,9 @@ gtkmm_files_any_hg = \
widget.hg \
widgetpaintable.hg \
window.hg \
- windowgroup.hg
+ windowcontrols.hg \
+ windowgroup.hg \
+ windowhandle.hg
gtkmm_files_posix_hg = \
pagesetupunixdialog.hg \
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 75334de6..ee473871 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -219,6 +219,7 @@ public:
_WRAP_METHOD(int get_width() const, gtk_widget_get_width)
_WRAP_METHOD(int get_height() const, gtk_widget_get_height)
+ _WRAP_METHOD(int get_size(Orientation orientation) const, gtk_widget_get_size)
_WRAP_METHOD(Widget* get_parent(), gtk_widget_get_parent)
_WRAP_METHOD(const Widget* get_parent() const, gtk_widget_get_parent, constversion)
diff --git a/gtk/src/windowcontrols.ccg b/gtk/src/windowcontrols.ccg
new file mode 100644
index 00000000..d87f957b
--- /dev/null
+++ b/gtk/src/windowcontrols.ccg
@@ -0,0 +1,31 @@
+/* Copyright (C) 2020 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 <gtk/gtk.h>
+
+namespace Gtk
+{
+
+// gtk_window_controls_set_decoration_layout(gobj(), nullptr) is not the same as
+// gtk_window_controls_set_decoration_layout(gobj(), "").
+// nullptr means: Use Gtk::Settings::property_gtk_decoration_layout().
+// An empty string means: No decorations.
+void WindowControls::unset_decoration_layout()
+{
+ gtk_window_controls_set_decoration_layout(gobj(), nullptr);
+}
+
+} // namespace Gtk
diff --git a/gtk/src/windowcontrols.hg b/gtk/src/windowcontrols.hg
new file mode 100644
index 00000000..826f8a43
--- /dev/null
+++ b/gtk/src/windowcontrols.hg
@@ -0,0 +1,107 @@
+/* Copyright (C) 2020 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 <gtkmm/enums.h>
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/widget_p.h)
+
+namespace Gtk
+{
+
+/** A widget displaying window buttons.
+ *
+ * %Gtk::WindowControls shows window frame controls, such as minimize, maximize
+ * and close buttons, and the window icon.
+ *
+ * %Gtk::WindowControls only displays start or end side of the controls (see
+ * property_side()), so it's intended to be always used in pair with
+ * another %Gtk::WindowControls using the opposite side, for example:
+ *
+ * @code
+ * <object class="GtkBox">
+ * <child>
+ * <object class="GtkWindowControls">
+ * <property name="side">start</property>
+ * </object>
+ * </child>
+ *
+ * ...
+ *
+ * <child>
+ * <object class="GtkWindowControls">
+ * <property name="side">end</property>
+ * </object>
+ * </child>
+ * </object>
+ * @endcode
+ *
+ * @see Gtk::HeaderBar
+ *
+ * @ingroup Widgets
+ * @newin{3,98}
+ */
+class WindowControls : public Widget
+{
+ _CLASS_GTKOBJECT(WindowControls, GtkWindowControls, GTK_WINDOW_CONTROLS, Gtk::Widget, GtkWidget)
+ _STRUCT_NOT_HIDDEN
+
+public:
+ /** Create a new %WindowControls widget.
+ */
+ _WRAP_CTOR(WindowControls(PackType side), gtk_window_controls_new)
+
+ _WRAP_METHOD(void set_side(PackType side), gtk_window_controls_set_side)
+ _WRAP_METHOD(PackType get_side() const, gtk_window_controls_get_side)
+
+ /** Sets the decoration layout for the title buttons, overriding
+ * the Gtk::Settings::property_gtk_decoration_layout() setting.
+ *
+ * The format of the string is button names, separated by commas.
+ * A colon separates the buttons that should appear on the left
+ * from those on the right. Recognized button names are minimize,
+ * maximize, close and icon (the window icon).
+ *
+ * For example, “icon:minimize,maximize,close” specifies an icon
+ * on the left, and minimize, maximize and close buttons on the right.
+ *
+ * If the property_side() value is @a Gtk::PackType::START, this %WindowControls
+ * will display the part before the colon, otherwise after that.
+ *
+ * To unset the layout, call unset_decoration_layout().
+ *
+ * @param layout A decoration layout.
+ */
+ _WRAP_METHOD(void set_decoration_layout(const Glib::ustring& layout),
gtk_window_controls_set_decoration_layout)
+
+ /** Unset the decoration layout.
+ * See set_decoration_layout().
+ */
+ void unset_decoration_layout();
+
+ _WRAP_METHOD(Glib::ustring get_decoration_layout() const, gtk_window_controls_get_decoration_layout)
+
+ _WRAP_METHOD(bool get_empty() const, gtk_window_controls_get_empty)
+
+ _WRAP_PROPERTY("side", PackType)
+ _WRAP_PROPERTY("decoration-layout", Glib::ustring)
+ _WRAP_PROPERTY("empty", bool)
+
+ // Gtk::WindowControls has no signals nor vfuncs.
+};
+
+} // namespace Gtk
diff --git a/gtk/src/windowhandle.ccg b/gtk/src/windowhandle.ccg
new file mode 100644
index 00000000..049fc669
--- /dev/null
+++ b/gtk/src/windowhandle.ccg
@@ -0,0 +1,27 @@
+/* Copyright (C) 2020 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 <gtk/gtk.h>
+
+namespace Gtk
+{
+
+void WindowHandle::unset_child()
+{
+ gtk_window_handle_set_child(gobj(), nullptr);
+}
+
+} // namespace Gtk
diff --git a/gtk/src/windowhandle.hg b/gtk/src/windowhandle.hg
new file mode 100644
index 00000000..71d81607
--- /dev/null
+++ b/gtk/src/windowhandle.hg
@@ -0,0 +1,55 @@
+/* Copyright (C) 2020 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>
+_DEFS(gtkmm,gtk)
+_PINCLUDE(gtkmm/private/widget_p.h)
+
+namespace Gtk
+{
+
+/** A titlebar area widget.
+ *
+ * %Gtk::WindowHandle is a titlebar area widget. When added into a window, it can
+ * be dragged to move the window, and handles right click, double click and
+ * middle click as expected of a titlebar.
+ *
+ * @see Gtk::Window, Gtk::HeaderBar
+ *
+ * @ingroup Containers
+ * @newin{3,98}
+ */
+class WindowHandle : public Widget
+{
+ _CLASS_GTKOBJECT(WindowHandle, GtkWindowHandle, GTK_WINDOW_HANDLE, Gtk::Widget, GtkWidget)
+ _STRUCT_NOT_HIDDEN
+
+public:
+ /** Create a new %WindowHandle widget.
+ */
+ _CTOR_DEFAULT
+
+ _WRAP_METHOD(void set_child(Widget& child), gtk_window_handle_set_child)
+ void unset_child();
+ _WRAP_METHOD(Widget* get_child(), gtk_window_handle_get_child)
+ _WRAP_METHOD(const Widget* get_child() const, gtk_window_handle_get_child, constversion)
+
+ _WRAP_PROPERTY("child", Widget*)
+
+ // Gtk::WindowHandle has no signals nor vfuncs.
+};
+
+} // namespace Gtk
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]