[gnome-builder/wip/gtk4-port] libide/terminal: ensure access to terminal symbols



commit 193c72cd1d9aff54d938458145c6a3323c037b49
Author: Christian Hergert <chergert redhat com>
Date:   Fri Apr 1 02:02:28 2022 -0700

    libide/terminal: ensure access to terminal symbols
    
    Until we have things depending on them, the linker will drop them. Ensure
    they are there even without plugins compiled.

 src/libide/terminal/ide-terminal-init.c    | 36 ++++++++++++++++++++++++++++++
 src/libide/terminal/ide-terminal-private.h | 29 ++++++++++++++++++++++++
 src/libide/terminal/meson.build            |  2 ++
 src/main.c                                 |  2 ++
 4 files changed, 69 insertions(+)
---
diff --git a/src/libide/terminal/ide-terminal-init.c b/src/libide/terminal/ide-terminal-init.c
new file mode 100644
index 000000000..d80246221
--- /dev/null
+++ b/src/libide/terminal/ide-terminal-init.c
@@ -0,0 +1,36 @@
+/* ide-terminal-init.c
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "ide-terminal-init"
+
+#include "ide-terminal.h"
+#include "ide-terminal-launcher.h"
+#include "ide-terminal-page.h"
+#include "ide-terminal-private.h"
+#include "ide-terminal-search.h"
+
+void
+_ide_terminal_init (void)
+{
+  g_type_ensure (IDE_TYPE_TERMINAL);
+  g_type_ensure (IDE_TYPE_TERMINAL_LAUNCHER);
+  g_type_ensure (IDE_TYPE_TERMINAL_PAGE);
+  g_type_ensure (IDE_TYPE_TERMINAL_SEARCH);
+}
diff --git a/src/libide/terminal/ide-terminal-private.h b/src/libide/terminal/ide-terminal-private.h
new file mode 100644
index 000000000..d9015f5b6
--- /dev/null
+++ b/src/libide/terminal/ide-terminal-private.h
@@ -0,0 +1,29 @@
+/* ide-terminal-private.h
+ *
+ * Copyright 2022 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+void _ide_terminal_init (void);
+
+G_END_DECLS
diff --git a/src/libide/terminal/meson.build b/src/libide/terminal/meson.build
index 48a8f3912..eb69d8da3 100644
--- a/src/libide/terminal/meson.build
+++ b/src/libide/terminal/meson.build
@@ -31,6 +31,7 @@ libide_terminal_private_headers = [
   'ide-terminal-page-private.h',
   'ide-terminal-popover-row.h',
   'ide-terminal-search-private.h',
+  'ide-terminal-private.h',
 ]
 
 libide_terminal_public_sources = [
@@ -43,6 +44,7 @@ libide_terminal_public_sources = [
 ]
 
 libide_terminal_private_sources = [
+  'ide-terminal-init.c',
   'ide-terminal-page-actions.c',
   'ide-terminal-popover-row.c',
 ]
diff --git a/src/main.c b/src/main.c
index 702e40a60..5952bf256 100644
--- a/src/main.c
+++ b/src/main.c
@@ -40,6 +40,7 @@
 #include "ide-build-ident.h"
 #include "ide-gtk-private.h"
 #include "ide-shell-private.h"
+#include "ide-terminal-private.h"
 #include "ide-thread-private.h"
 #include "ide-private.h"
 
@@ -287,6 +288,7 @@ main (gint   argc,
 
   /* Ensure availability of some symbols possibly dropped in link */
   _ide_gtk_init ();
+  _ide_terminal_init ();
 
   app = _ide_application_new (standalone);
   g_application_add_option_group (G_APPLICATION (app), g_irepository_get_option_group ());


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