[gnome-builder/wip/gtk4-port: 333/736] plugins/editorui: stub out workbench addin
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 333/736] plugins/editorui: stub out workbench addin
- Date: Tue, 26 Apr 2022 01:46:23 +0000 (UTC)
commit 8e1fe3605f3fe4399a9a2ccf72aae8aee4d38811
Author: Christian Hergert <chergert redhat com>
Date: Fri Apr 1 21:14:59 2022 -0700
plugins/editorui: stub out workbench addin
src/plugins/editorui/editorui-plugin.c | 11 +++-
.../editorui/gbp-editorui-workbench-addin.c | 77 ++++++++++++++++++++++
.../editorui/gbp-editorui-workbench-addin.h | 31 +++++++++
src/plugins/editorui/meson.build | 1 +
4 files changed, 118 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/editorui/editorui-plugin.c b/src/plugins/editorui/editorui-plugin.c
index 0a82e747f..015d0a924 100644
--- a/src/plugins/editorui/editorui-plugin.c
+++ b/src/plugins/editorui/editorui-plugin.c
@@ -22,12 +22,19 @@
#include "config.h"
-#include "gbp-editorui-resources.h"
-
#include <libpeas/peas.h>
+#include <libide-gui.h>
+
+#include "gbp-editorui-workbench-addin.h"
+#include "gbp-editorui-resources.h"
+
_IDE_EXTERN void
_gbp_editorui_register_types (PeasObjectModule *module)
{
g_resources_register (gbp_editorui_get_resource ());
+
+ peas_object_module_register_extension_type (module,
+ IDE_TYPE_WORKBENCH_ADDIN,
+ GBP_TYPE_EDITORUI_WORKBENCH_ADDIN);
}
diff --git a/src/plugins/editorui/gbp-editorui-workbench-addin.c
b/src/plugins/editorui/gbp-editorui-workbench-addin.c
new file mode 100644
index 000000000..533c76c64
--- /dev/null
+++ b/src/plugins/editorui/gbp-editorui-workbench-addin.c
@@ -0,0 +1,77 @@
+/* gbp-editorui-workbench-addin.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 "gbp-editorui-workbench-addin"
+
+#include "config.h"
+
+#include <libide-gui.h>
+
+#include "gbp-editorui-workbench-addin.h"
+
+struct _GbpEditoruiWorkbenchAddin
+{
+ GObject parent_instance;
+ IdeWorkbench *workbench;
+};
+
+static void
+gbp_editorui_workbench_addin_load (IdeWorkbenchAddin *addin,
+ IdeWorkbench *workbench)
+{
+ GbpEditoruiWorkbenchAddin *self = (GbpEditoruiWorkbenchAddin *)addin;
+
+ g_assert (GBP_IS_EDITORUI_WORKBENCH_ADDIN (self));
+ g_assert (IDE_IS_WORKBENCH (workbench));
+
+ self->workbench = workbench;
+}
+
+static void
+gbp_editorui_workbench_addin_unload (IdeWorkbenchAddin *addin,
+ IdeWorkbench *workbench)
+{
+ GbpEditoruiWorkbenchAddin *self = (GbpEditoruiWorkbenchAddin *)addin;
+
+ g_assert (GBP_IS_EDITORUI_WORKBENCH_ADDIN (self));
+ g_assert (IDE_IS_WORKBENCH (workbench));
+
+ self->workbench = NULL;
+}
+
+static void
+workbench_addin_iface_init (IdeWorkbenchAddinInterface *iface)
+{
+ iface->load = gbp_editorui_workbench_addin_load;
+ iface->unload = gbp_editorui_workbench_addin_unload;
+}
+
+G_DEFINE_TYPE_WITH_CODE (GbpEditoruiWorkbenchAddin, gbp_editorui_workbench_addin, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_WORKBENCH_ADDIN, workbench_addin_iface_init))
+
+static void
+gbp_editorui_workbench_addin_class_init (GbpEditoruiWorkbenchAddinClass *klass)
+{
+}
+
+static void
+gbp_editorui_workbench_addin_init (GbpEditoruiWorkbenchAddin *self)
+{
+}
diff --git a/src/plugins/editorui/gbp-editorui-workbench-addin.h
b/src/plugins/editorui/gbp-editorui-workbench-addin.h
new file mode 100644
index 000000000..ec1ec7809
--- /dev/null
+++ b/src/plugins/editorui/gbp-editorui-workbench-addin.h
@@ -0,0 +1,31 @@
+/* gbp-editorui-workbench-addin.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-object.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_EDITORUI_WORKBENCH_ADDIN (gbp_editorui_workbench_addin_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpEditoruiWorkbenchAddin, gbp_editorui_workbench_addin, GBP,
EDITORUI_WORKBENCH_ADDIN, GObject)
+
+G_END_DECLS
diff --git a/src/plugins/editorui/meson.build b/src/plugins/editorui/meson.build
index 436dac956..15ac96dea 100644
--- a/src/plugins/editorui/meson.build
+++ b/src/plugins/editorui/meson.build
@@ -1,5 +1,6 @@
plugins_sources += files([
'editorui-plugin.c',
+ 'gbp-editorui-workbench-addin.c',
])
plugin_editorui_resources = gnome.compile_resources(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]