[gnome-builder/wip/chergert/perspective] libide: add embedded plugin info for editor



commit 037dea31fa628c90918a82328c6c89000f8a57e8
Author: Christian Hergert <christian hergert me>
Date:   Mon Nov 16 16:41:40 2015 -0800

    libide: add embedded plugin info for editor

 libide/Makefile.am                    |    1 +
 libide/editor/editor.plugin           |    9 +++++++++
 libide/editor/ide-editor-plugin.c     |   30 ++++++++++++++++++++++++++++++
 libide/ide-application.c              |    4 ++++
 libide/resources/libide.gresource.xml |    4 ++++
 5 files changed, 48 insertions(+), 0 deletions(-)
---
diff --git a/libide/Makefile.am b/libide/Makefile.am
index 1895f1d..1d5d3a7 100644
--- a/libide/Makefile.am
+++ b/libide/Makefile.am
@@ -238,6 +238,7 @@ libide_1_0_la_SOURCES = \
        editor/ide-editor-frame-private.h \
        editor/ide-editor-map-bin.c \
        editor/ide-editor-map-bin.h \
+       editor/ide-editor-plugin.c \
        editor/ide-editor-print-operation.c \
        editor/ide-editor-print-operation.h \
        editor/ide-editor-tweak-widget.c \
diff --git a/libide/editor/editor.plugin b/libide/editor/editor.plugin
new file mode 100644
index 0000000..42a25da
--- /dev/null
+++ b/libide/editor/editor.plugin
@@ -0,0 +1,9 @@
+[Plugin]
+Module=editor
+Name=Editor
+Description=Builder's source code editor
+Authors=Christian Hergert <christian hergert me>
+Copyright=Copyright © 2014-2015 Christian Hergert
+Builtin=true
+Hidden=true
+Embedded=ide_editor_register_types
diff --git a/libide/editor/ide-editor-plugin.c b/libide/editor/ide-editor-plugin.c
new file mode 100644
index 0000000..ec58c6a
--- /dev/null
+++ b/libide/editor/ide-editor-plugin.c
@@ -0,0 +1,30 @@
+/* ide-editor-plugin.c
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * 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/>.
+ */
+
+#include <libpeas/peas.h>
+
+#include "ide-editor-workbench-addin.h"
+#include "ide-workbench-addin.h"
+
+void
+ide_editor_register_types (PeasObjectModule *module)
+{
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_WORKBENCH_ADDIN,
+                                              IDE_TYPE_EDITOR_WORKBENCH_ADDIN);
+}
diff --git a/libide/ide-application.c b/libide/ide-application.c
index 518838a..be80dd9 100644
--- a/libide/ide-application.c
+++ b/libide/ide-application.c
@@ -110,6 +110,10 @@ ide_application_load_plugins (IdeApplication *self)
                                        PACKAGE_DATADIR"/gnome-builder/plugins");
     }
 
+  peas_engine_prepend_search_path (engine,
+                                   "resource:///org/gnome/builder/plugins/editor",
+                                   "resource:///org/gnome/builder/plugins/editor");
+
   list = peas_engine_get_plugin_list (engine);
 
   for (; list; list = list->next)
diff --git a/libide/resources/libide.gresource.xml b/libide/resources/libide.gresource.xml
index 7b1bb65..8ac76b6 100644
--- a/libide/resources/libide.gresource.xml
+++ b/libide/resources/libide.gresource.xml
@@ -61,4 +61,8 @@
     <file alias="ide-workbench-header-bar.ui">../../data/ui/ide-workbench-header-bar.ui</file>
     <file alias="ide-workbench.ui">../../data/ui/ide-workbench.ui</file>
   </gresource>
+
+  <gresource prefix="/org/gnome/builder/plugins/editor">
+    <file alias="editor.plugin">../editor/editor.plugin</file>
+  </gresource>
 </gresources>


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