[gnome-builder] plugins/projectui: add plugin for project tweaks



commit f1bd7a5ffd3c47f4bd9533c9511407416349a35c
Author: Christian Hergert <chergert redhat com>
Date:   Wed Aug 17 22:21:21 2022 -0700

    plugins/projectui: add plugin for project tweaks
    
    Just contains scaffolding, still needs tweaks to be added.

 src/plugins/meson.build                            |  1 +
 src/plugins/projectui/gbp-projectui-tweaks-addin.c | 46 ++++++++++++++++++++++
 src/plugins/projectui/gbp-projectui-tweaks-addin.h | 31 +++++++++++++++
 src/plugins/projectui/meson.build                  | 12 ++++++
 src/plugins/projectui/projectui-plugin.c           | 38 ++++++++++++++++++
 src/plugins/projectui/projectui.gresource.xml      |  7 ++++
 src/plugins/projectui/projectui.plugin             |  8 ++++
 src/plugins/projectui/tweaks.ui                    | 25 ++++++++++++
 8 files changed, 168 insertions(+)
---
diff --git a/src/plugins/meson.build b/src/plugins/meson.build
index 37f93e7a6..f22545489 100644
--- a/src/plugins/meson.build
+++ b/src/plugins/meson.build
@@ -102,6 +102,7 @@ subdir('platformui')
 subdir('phpize')
 subdir('podman')
 subdir('project-tree')
+subdir('projectui')
 subdir('pygi')
 subdir('qemu')
 subdir('quick-highlight')
diff --git a/src/plugins/projectui/gbp-projectui-tweaks-addin.c 
b/src/plugins/projectui/gbp-projectui-tweaks-addin.c
new file mode 100644
index 000000000..ff736ff9d
--- /dev/null
+++ b/src/plugins/projectui/gbp-projectui-tweaks-addin.c
@@ -0,0 +1,46 @@
+/* gbp-projectui-tweaks-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-projectui-tweaks-addin"
+
+#include "config.h"
+
+#include <glib/gi18n.h>
+
+#include "gbp-projectui-tweaks-addin.h"
+
+struct _GbpProjectuiTweaksAddin
+{
+  IdeTweaksAddin parent_instance;
+};
+
+G_DEFINE_FINAL_TYPE (GbpProjectuiTweaksAddin, gbp_projectui_tweaks_addin, IDE_TYPE_TWEAKS_ADDIN)
+
+static void
+gbp_projectui_tweaks_addin_class_init (GbpProjectuiTweaksAddinClass *klass)
+{
+}
+
+static void
+gbp_projectui_tweaks_addin_init (GbpProjectuiTweaksAddin *self)
+{
+  ide_tweaks_addin_set_resource_paths (IDE_TWEAKS_ADDIN (self),
+                                       IDE_STRV_INIT ("/plugins/projectui/tweaks.ui"));
+}
diff --git a/src/plugins/projectui/gbp-projectui-tweaks-addin.h 
b/src/plugins/projectui/gbp-projectui-tweaks-addin.h
new file mode 100644
index 000000000..8402c3a1c
--- /dev/null
+++ b/src/plugins/projectui/gbp-projectui-tweaks-addin.h
@@ -0,0 +1,31 @@
+/* gbp-projectui-tweaks-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 <libide-tweaks.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_PROJECTUI_TWEAKS_ADDIN (gbp_projectui_tweaks_addin_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpProjectuiTweaksAddin, gbp_projectui_tweaks_addin, GBP, PROJECTUI_TWEAKS_ADDIN, 
IdeTweaksAddin)
+
+G_END_DECLS
diff --git a/src/plugins/projectui/meson.build b/src/plugins/projectui/meson.build
new file mode 100644
index 000000000..d320c8fe2
--- /dev/null
+++ b/src/plugins/projectui/meson.build
@@ -0,0 +1,12 @@
+plugins_sources += files([
+  'projectui-plugin.c',
+  'gbp-projectui-tweaks-addin.c',
+])
+
+plugin_projectui_resources = gnome.compile_resources(
+  'projectui-resources',
+  'projectui.gresource.xml',
+  c_name: 'gbp_projectui',
+)
+
+plugins_sources += plugin_projectui_resources
diff --git a/src/plugins/projectui/projectui-plugin.c b/src/plugins/projectui/projectui-plugin.c
new file mode 100644
index 000000000..335db0d82
--- /dev/null
+++ b/src/plugins/projectui/projectui-plugin.c
@@ -0,0 +1,38 @@
+/* projectui-plugin.c
+ *
+ * Copyright 2018-2019 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 "projectui-plugin"
+
+#include "config.h"
+
+#include <libpeas/peas.h>
+
+#include <libide-gui.h>
+#include <libide-tweaks.h>
+
+#include "gbp-projectui-tweaks-addin.h"
+
+_IDE_EXTERN void
+_gbp_projectui_register_types (PeasObjectModule *module)
+{
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_TWEAKS_ADDIN,
+                                              GBP_TYPE_PROJECTUI_TWEAKS_ADDIN);
+}
diff --git a/src/plugins/projectui/projectui.gresource.xml b/src/plugins/projectui/projectui.gresource.xml
new file mode 100644
index 000000000..0b5566e32
--- /dev/null
+++ b/src/plugins/projectui/projectui.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/plugins/projectui">
+    <file>projectui.plugin</file>
+    <file preprocess="xml-stripblanks">tweaks.ui</file>
+  </gresource>
+</gresources>
diff --git a/src/plugins/projectui/projectui.plugin b/src/plugins/projectui/projectui.plugin
new file mode 100644
index 000000000..d6202c9f2
--- /dev/null
+++ b/src/plugins/projectui/projectui.plugin
@@ -0,0 +1,8 @@
+[Plugin]
+Authors=Christian Hergert <christian hergert me>
+Builtin=true
+Copyright=Copyright © 2022 Christian Hergert
+Embedded=_gbp_projectui_register_types
+Hidden=true
+Module=projectui
+Name=Project Integration
diff --git a/src/plugins/projectui/tweaks.ui b/src/plugins/projectui/tweaks.ui
new file mode 100644
index 000000000..54f40a4f3
--- /dev/null
+++ b/src/plugins/projectui/tweaks.ui
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <template class="IdeTweaks">
+    <child>
+      <object class="IdeTweaksSettings" id="settings_org_gnome_builder">
+        <property name="schema-id">org.gnome.builder</property>
+        <property name="application-only">true</property>
+      </object>
+    </child>
+    <child internal-child="projects_section">
+      <object class="IdeTweaksSection">
+        <child>
+          <object class="IdeTweaksPage" id="projects_page">
+            <property name="icon-name">folder-symbolic</property>
+            <property name="title" translatable="yes">Projects</property>
+            <child>
+              <object class="IdeTweaksGroup">
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>


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