[gtkmm] Remove Gtk::Main
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Remove Gtk::Main
- Date: Mon, 6 Jul 2020 15:13:30 +0000 (UTC)
commit 3b34207011bdda73f9a89a99ac255f4a6170901f
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Mon Jul 6 17:09:00 2020 +0200
Remove Gtk::Main
Remove the deprecated parts of Gtk::Main.
Replace Gtk::Main::init_gtkmm_internals() by Gtk::init_gtkmm_internals()
in the new files gtk/gtkmm/init.[h|cc].
.gitignore | 2 -
demos/gtk-demo/main.cc | 2 +-
gtk/gtkmm.h | 1 -
gtk/gtkmm/filelist.am | 2 +
gtk/gtkmm/init.cc | 51 ++++++++++++++++
gtk/gtkmm/init.h | 38 ++++++++++++
gtk/gtkmm/meson.build | 2 +-
gtk/src/filelist.am | 1 -
gtk/src/main.ccg | 122 --------------------------------------
gtk/src/main.hg | 110 ----------------------------------
tests/bitset_iterator/main.cc | 3 +-
tests/child_widget/main.cc | 2 +-
tests/delete_cpp_child/main.cc | 2 +-
tests/object_move/main.cc | 3 +-
tests/tree_model_iterator/main.cc | 3 +-
15 files changed, 101 insertions(+), 243 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index a4dbb8d7..c5ff44c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -373,8 +373,6 @@ gtk/gtkmm/liststore.cc
gtk/gtkmm/liststore.h
gtk/gtkmm/lockbutton.cc
gtk/gtkmm/lockbutton.h
-gtk/gtkmm/main.cc
-gtk/gtkmm/main.h
gtk/gtkmm/mediacontrols.cc
gtk/gtkmm/mediacontrols.h
gtk/gtkmm/mediafile.cc
diff --git a/demos/gtk-demo/main.cc b/demos/gtk-demo/main.cc
index eba21fa9..c302ae73 100644
--- a/demos/gtk-demo/main.cc
+++ b/demos/gtk-demo/main.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <gtkmm/main.h>
+#include <gtkmm/application.h>
#include "demowindow.h"
int main (int argc, char *argv[])
diff --git a/gtk/gtkmm.h b/gtk/gtkmm.h
index 40a26c55..e2bacf56 100644
--- a/gtk/gtkmm.h
+++ b/gtk/gtkmm.h
@@ -193,7 +193,6 @@ extern const int gtkmm_micro_version;
#include <gtkmm/liststore.h>
#include <gtkmm/listviewtext.h>
#include <gtkmm/linkbutton.h>
-#include <gtkmm/main.h>
#include <gtkmm/mediacontrols.h>
#include <gtkmm/mediafile.h>
#include <gtkmm/menubutton.h>
diff --git a/gtk/gtkmm/filelist.am b/gtk/gtkmm/filelist.am
index 45f27b59..82711ed9 100644
--- a/gtk/gtkmm/filelist.am
+++ b/gtk/gtkmm/filelist.am
@@ -8,6 +8,7 @@ gtkmm_files_extra_any_cc = \
accelkey.cc \
bitsetconstiter.cc \
cellrenderer_generation.cc \
+ init.cc \
listviewtext.cc \
object.cc \
radiobuttongroup.cc \
@@ -21,6 +22,7 @@ gtkmm_files_extra_any_h = \
accelkey.h \
bitsetconstiter.h \
cellrenderer_generation.h \
+ init.h \
listviewtext.h \
object.h \
radiobuttongroup.h \
diff --git a/gtk/gtkmm/init.cc b/gtk/gtkmm/init.cc
new file mode 100644
index 00000000..ddd30bbc
--- /dev/null
+++ b/gtk/gtkmm/init.cc
@@ -0,0 +1,51 @@
+/* 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/init.h>
+#include <glibmm/init.h>
+#include <giomm/init.h>
+#include <pangomm/wrap_init.h>
+#ifdef GTKMM_ATKMM_ENABLED
+#include <atkmm/wrap_init.h>
+#endif //GTKMM_ATKMM_ENABLED
+#include <gdkmm/wrap_init.h>
+#include <gtkmm/wrap_init.h>
+
+namespace Gtk
+{
+
+void init_gtkmm_internals()
+{
+ static bool init_done = false;
+
+ if (!init_done)
+ {
+ Glib::init();
+ Gio::init();
+
+ // Populate the map of GTypes to C++ wrap_new() functions.
+ Pango::wrap_init();
+#ifdef GTKMM_ATKMM_ENABLED
+ Atk::wrap_init();
+#endif //GTKMM_ATKMM_ENABLED
+ Gdk::wrap_init();
+ Gtk::wrap_init();
+
+ init_done = true;
+ }
+}
+
+} // namespace Gtk
diff --git a/gtk/gtkmm/init.h b/gtk/gtkmm/init.h
new file mode 100644
index 00000000..5ff4a2c9
--- /dev/null
+++ b/gtk/gtkmm/init.h
@@ -0,0 +1,38 @@
+#ifndef _GTKMM_INIT_H
+#define _GTKMM_INIT_H
+
+/* 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 <gtkmmconfig.h>
+
+namespace Gtk
+{
+
+/** Initialize the table of wrap_new functions.
+ *
+ * This would usually only be used by the init() methods of libraries that
+ * depend on gtkmm. Gtkmm applications initialize gtkmm by a call to
+ * Gtk::Application::create().
+ *
+ * @newin{3,98}
+ */
+GTKMM_API
+void init_gtkmm_internals();
+
+} // namespace Gtk
+
+#endif /* _GTKMM_INIT_H */
diff --git a/gtk/gtkmm/meson.build b/gtk/gtkmm/meson.build
index 0fe6011b..1b8a5a5b 100644
--- a/gtk/gtkmm/meson.build
+++ b/gtk/gtkmm/meson.build
@@ -144,7 +144,6 @@ gtkmm_any_hg_ccg_basenames = [
'listboxrow',
'liststore',
'lockbutton',
- 'main',
'mediacontrols',
'mediafile',
'mediastream',
@@ -259,6 +258,7 @@ gtkmm_extra_any_h_cc_basenames = [
'accelkey',
'bitsetconstiter',
'cellrenderer_generation',
+ 'init',
'listviewtext',
'object',
'radiobuttongroup',
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 5963a1df..c0114a6b 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -129,7 +129,6 @@ gtkmm_files_any_hg = \
listboxrow.hg \
liststore.hg \
lockbutton.hg \
- main.hg \
mediacontrols.hg \
mediafile.hg \
mediastream.hg \
diff --git a/tests/bitset_iterator/main.cc b/tests/bitset_iterator/main.cc
index 12149980..61656629 100644
--- a/tests/bitset_iterator/main.cc
+++ b/tests/bitset_iterator/main.cc
@@ -1,4 +1,5 @@
#include <gtkmm.h>
+#include <gtkmm/init.h>
#include <iostream>
#include <set>
@@ -95,7 +96,7 @@ void test_copy()
int main(int /* argc */, char** /* argv */)
{
gtk_init();
- Gtk::Main::init_gtkmm_internals();
+ Gtk::init_gtkmm_internals();
test_traversal1();
test_traversal2();
diff --git a/tests/child_widget/main.cc b/tests/child_widget/main.cc
index c4cc8044..ebb538d3 100644
--- a/tests/child_widget/main.cc
+++ b/tests/child_widget/main.cc
@@ -14,7 +14,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <gtkmm/main.h>
+#include <gtkmm/application.h>
#include "testwindow.h"
int main(int argc, char *argv[])
diff --git a/tests/delete_cpp_child/main.cc b/tests/delete_cpp_child/main.cc
index bd4e76ab..6b709a72 100644
--- a/tests/delete_cpp_child/main.cc
+++ b/tests/delete_cpp_child/main.cc
@@ -1,8 +1,8 @@
+#include <gtkmm/application.h>
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/label.h>
#include <gtkmm/window.h>
-#include <gtkmm/main.h>
class AppWindow
: public Gtk::Window
diff --git a/tests/object_move/main.cc b/tests/object_move/main.cc
index ff44db7d..f62105dc 100644
--- a/tests/object_move/main.cc
+++ b/tests/object_move/main.cc
@@ -1,4 +1,5 @@
#include <gtkmm.h>
+#include <gtkmm/init.h>
#include <gtk/gtk.h>
#include <iostream>
#include <stdlib.h>
@@ -66,7 +67,7 @@ void test_object_move_assignment_operator()
int main(int /* argc */, char** /* argv */)
{
gtk_init();
- Gtk::Main::init_gtkmm_internals();
+ Gtk::init_gtkmm_internals();
test_object_move_constructor();
test_object_move_assignment_operator();
diff --git a/tests/tree_model_iterator/main.cc b/tests/tree_model_iterator/main.cc
index 9e5514db..61685c25 100644
--- a/tests/tree_model_iterator/main.cc
+++ b/tests/tree_model_iterator/main.cc
@@ -1,4 +1,5 @@
#include <gtkmm.h>
+#include <gtkmm/init.h>
#include <iostream>
#include <cassert>
#include <cstdlib>
@@ -34,7 +35,7 @@ test_assignment_to_const() {
int main(int /* argc */, char** /* argv */)
{
gtk_init();
- Gtk::Main::init_gtkmm_internals();
+ Gtk::init_gtkmm_internals();
test_const_conversion();
test_assignment_from_const();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]