[gnome-builder] langserv: use abstract types for plugin base classes



commit f7d4319539d760399abea9c2d63f1c5931cc37c0
Author: Christian Hergert <chergert redhat com>
Date:   Mon Oct 24 15:21:38 2016 -0700

    langserv: use abstract types for plugin base classes
    
    We want people to subclass these in plugins, not instantiate them
    directly. So just enforce that at type definition time.

 libide/langserv/ide-langserv-completion-provider.c |    8 ++++----
 libide/langserv/ide-langserv-diagnostic-provider.c |    6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/libide/langserv/ide-langserv-completion-provider.c 
b/libide/langserv/ide-langserv-completion-provider.c
index e683b84..2d3415e 100644
--- a/libide/langserv/ide-langserv-completion-provider.c
+++ b/libide/langserv/ide-langserv-completion-provider.c
@@ -38,10 +38,10 @@ typedef struct
 
 static void source_completion_provider_iface_init (GtkSourceCompletionProviderIface *iface);
 
-G_DEFINE_TYPE_EXTENDED (IdeLangservCompletionProvider, ide_langserv_completion_provider, IDE_TYPE_OBJECT, 0,
-                        G_ADD_PRIVATE (IdeLangservCompletionProvider)
-                        G_IMPLEMENT_INTERFACE (GTK_SOURCE_TYPE_COMPLETION_PROVIDER, 
source_completion_provider_iface_init)
-                        G_IMPLEMENT_INTERFACE (IDE_TYPE_COMPLETION_PROVIDER, NULL))
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (IdeLangservCompletionProvider, ide_langserv_completion_provider, 
IDE_TYPE_OBJECT,
+                                  G_ADD_PRIVATE (IdeLangservCompletionProvider)
+                                  G_IMPLEMENT_INTERFACE (GTK_SOURCE_TYPE_COMPLETION_PROVIDER, 
source_completion_provider_iface_init)
+                                  G_IMPLEMENT_INTERFACE (IDE_TYPE_COMPLETION_PROVIDER, NULL))
 
 static void
 completion_state_free (CompletionState *state)
diff --git a/libide/langserv/ide-langserv-diagnostic-provider.c 
b/libide/langserv/ide-langserv-diagnostic-provider.c
index 2f1a777..04285d6 100644
--- a/libide/langserv/ide-langserv-diagnostic-provider.c
+++ b/libide/langserv/ide-langserv-diagnostic-provider.c
@@ -37,9 +37,9 @@ typedef struct
 
 static void diagnostic_provider_iface_init (IdeDiagnosticProviderInterface *iface);
 
-G_DEFINE_TYPE_EXTENDED (IdeLangservDiagnosticProvider, ide_langserv_diagnostic_provider, IDE_TYPE_OBJECT, 0,
-                        G_ADD_PRIVATE (IdeLangservDiagnosticProvider)
-                        G_IMPLEMENT_INTERFACE (IDE_TYPE_DIAGNOSTIC_PROVIDER, diagnostic_provider_iface_init))
+G_DEFINE_ABSTRACT_TYPE_WITH_CODE (IdeLangservDiagnosticProvider, ide_langserv_diagnostic_provider, 
IDE_TYPE_OBJECT,
+                                  G_ADD_PRIVATE (IdeLangservDiagnosticProvider)
+                                  G_IMPLEMENT_INTERFACE (IDE_TYPE_DIAGNOSTIC_PROVIDER, 
diagnostic_provider_iface_init))
 
 static void
 ide_langserv_diagnostic_provider_get_diagnostics_cb (GObject      *object,


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