[gnome-builder: 103/139] messages: port messages panel to libide-editor



commit ae7eff9fdd99126c4b5c654942a0840149d055ff
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 9 17:30:09 2019 -0800

    messages: port messages panel to libide-editor

 src/plugins/messages/gbp-messages-editor-addin.c      | 14 +++++++-------
 src/plugins/messages/gbp-messages-panel.c             |  7 ++++---
 src/plugins/messages/meson.build                      | 19 ++++++++-----------
 .../{gbp-messages-plugin.c => messages-plugin.c}      | 10 ++++++----
 src/plugins/messages/messages.gresource.xml           |  4 +---
 src/plugins/messages/messages.plugin                  | 10 +++++-----
 6 files changed, 31 insertions(+), 33 deletions(-)
---
diff --git a/src/plugins/messages/gbp-messages-editor-addin.c 
b/src/plugins/messages/gbp-messages-editor-addin.c
index a2440797b..1e634a385 100644
--- a/src/plugins/messages/gbp-messages-editor-addin.c
+++ b/src/plugins/messages/gbp-messages-editor-addin.c
@@ -20,7 +20,7 @@
 
 #define G_LOG_DOMAIN "gbp-messages-editor-addin"
 
-#include <ide.h>
+#include <libide-editor.h>
 
 #include "gbp-messages-editor-addin.h"
 #include "gbp-messages-panel.h"
@@ -32,16 +32,16 @@ struct _GbpMessagesEditorAddin
 };
 
 static void
-gbp_messages_editor_addin_load (IdeEditorAddin       *addin,
-                                IdeEditorPerspective *editor)
+gbp_messages_editor_addin_load (IdeEditorAddin   *addin,
+                                IdeEditorSurface *editor)
 {
   GbpMessagesEditorAddin *self = (GbpMessagesEditorAddin *)addin;
   GtkWidget *utilities;
 
   g_assert (GBP_IS_MESSAGES_EDITOR_ADDIN (self));
-  g_assert (IDE_IS_EDITOR_PERSPECTIVE (editor));
+  g_assert (IDE_IS_EDITOR_SURFACE (editor));
 
-  utilities = ide_editor_perspective_get_utilities (editor);
+  utilities = ide_editor_surface_get_utilities (editor);
 
   /* hidden by default */
   self->panel = g_object_new (GBP_TYPE_MESSAGES_PANEL, NULL);
@@ -54,12 +54,12 @@ gbp_messages_editor_addin_load (IdeEditorAddin       *addin,
 
 static void
 gbp_messages_editor_addin_unload (IdeEditorAddin       *addin,
-                                  IdeEditorPerspective *editor)
+                                  IdeEditorSurface *editor)
 {
   GbpMessagesEditorAddin *self = (GbpMessagesEditorAddin *)addin;
 
   g_assert (GBP_IS_MESSAGES_EDITOR_ADDIN (self));
-  g_assert (IDE_IS_EDITOR_PERSPECTIVE (editor));
+  g_assert (IDE_IS_EDITOR_SURFACE (editor));
 
   if (self->panel != NULL)
     gtk_widget_destroy (GTK_WIDGET (self->panel));
diff --git a/src/plugins/messages/gbp-messages-panel.c b/src/plugins/messages/gbp-messages-panel.c
index fd73a16a6..a9db8fbf9 100644
--- a/src/plugins/messages/gbp-messages-panel.c
+++ b/src/plugins/messages/gbp-messages-panel.c
@@ -20,7 +20,8 @@
 
 #define G_LOG_DOMAIN "gbp-messages-panel"
 
-#include <ide.h>
+#include <libide-editor.h>
+#include <libide-terminal.h>
 
 #include "gbp-messages-panel.h"
 
@@ -39,6 +40,7 @@ G_DEFINE_TYPE (GbpMessagesPanel, gbp_messages_panel, DZL_TYPE_DOCK_WIDGET)
 static void
 gbp_messages_panel_log_cb (GbpMessagesPanel *self,
                            GLogLevelFlags    log_level,
+                           const gchar      *domain,
                            const gchar      *message,
                            IdeContext       *context)
 {
@@ -94,8 +96,7 @@ gbp_messages_panel_class_init (GbpMessagesPanelClass *klass)
 
   widget_class->destroy = gbp_messages_panel_destroy;
 
-  gtk_widget_class_set_template_from_resource (widget_class,
-                                               
"/org/gnome/builder/plugins/messages-plugin/gbp-messages-panel.ui");
+  gtk_widget_class_set_template_from_resource (widget_class, "/plugins/messages/gbp-messages-panel.ui");
   gtk_widget_class_bind_template_child (widget_class, GbpMessagesPanel, scrollbar);
   gtk_widget_class_bind_template_child (widget_class, GbpMessagesPanel, terminal);
 }
diff --git a/src/plugins/messages/meson.build b/src/plugins/messages/meson.build
index 96afadbcf..af8a212fa 100644
--- a/src/plugins/messages/meson.build
+++ b/src/plugins/messages/meson.build
@@ -1,16 +1,13 @@
-messages_resources = gnome.compile_resources(
+plugins_sources += files([
+  'gbp-messages-editor-addin.c',
+  'gbp-messages-panel.c',
+  'messages-plugin.c',
+])
+
+plugin_messages_resources = gnome.compile_resources(
   'messages-resources',
   'messages.gresource.xml',
   c_name: 'gbp_messages',
 )
 
-messages_sources = [
-  'gbp-messages-editor-addin.c',
-  'gbp-messages-editor-addin.h',
-  'gbp-messages-panel.c',
-  'gbp-messages-panel.h',
-  'gbp-messages-plugin.c',
-]
-
-gnome_builder_plugins_sources += files(messages_sources)
-gnome_builder_plugins_sources += messages_resources[0]
+plugins_sources += plugin_messages_resources[0]
diff --git a/src/plugins/messages/gbp-messages-plugin.c b/src/plugins/messages/messages-plugin.c
similarity index 87%
rename from src/plugins/messages/gbp-messages-plugin.c
rename to src/plugins/messages/messages-plugin.c
index 3fa07b09d..2a93f433b 100644
--- a/src/plugins/messages/gbp-messages-plugin.c
+++ b/src/plugins/messages/messages-plugin.c
@@ -1,4 +1,4 @@
-/* gbp-messages-plugin.c
+/* messages-plugin.c
  *
  * Copyright 2018-2019 Christian Hergert <chergert redhat com>
  *
@@ -18,13 +18,15 @@
  * SPDX-License-Identifier: GPL-3.0-or-later
  */
 
+#include "config.h"
+
 #include <libpeas/peas.h>
-#include <ide.h>
+#include <libide-editor.h>
 
 #include "gbp-messages-editor-addin.h"
 
-void
-gbp_messages_register_types (PeasObjectModule *module)
+_IDE_EXTERN void
+_gbp_messages_register_types (PeasObjectModule *module)
 {
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_EDITOR_ADDIN,
diff --git a/src/plugins/messages/messages.gresource.xml b/src/plugins/messages/messages.gresource.xml
index d32baf5e4..e2e923da1 100644
--- a/src/plugins/messages/messages.gresource.xml
+++ b/src/plugins/messages/messages.gresource.xml
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <gresources>
-  <gresource prefix="/org/gnome/builder/plugins">
+  <gresource prefix="/plugins/messages">
     <file>messages.plugin</file>
-  </gresource>
-  <gresource prefix="/org/gnome/builder/plugins/messages-plugin">
     <file preprocess="xml-stripblanks">gbp-messages-panel.ui</file>
   </gresource>
 </gresources>
diff --git a/src/plugins/messages/messages.plugin b/src/plugins/messages/messages.plugin
index 438ff362a..139ad0c53 100644
--- a/src/plugins/messages/messages.plugin
+++ b/src/plugins/messages/messages.plugin
@@ -1,10 +1,10 @@
 [Plugin]
-Module=messages-plugin
-Name=Internal Logging
-Description=Show internal warning logs
 Authors=Christian Hergert <christian hergert me>
+Builtin=true
 Copyright=Copyright © 2018 Christian Hergert
 Depends=editor;
+Description=Show internal warning logs
+Embedded=_gbp_messages_register_types
 Hidden=true
-Builtin=true
-Embedded=gbp_messages_register_types
+Module=messages
+Name=Internal Logging


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