[gnome-builder] ctags: remove use of dynamic types
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] ctags: remove use of dynamic types
- Date: Mon, 18 Jun 2018 20:31:36 +0000 (UTC)
commit 665e62eac7293c35a06b38e0817b05543129e49d
Author: Christian Hergert <chergert redhat com>
Date: Mon Jun 18 13:30:50 2018 -0700
ctags: remove use of dynamic types
src/plugins/ctags/ctags-plugin.c | 13 ------------
src/plugins/ctags/ide-ctags-completion-provider.c | 20 ++++---------------
src/plugins/ctags/ide-ctags-highlighter.c | 24 +++++++----------------
src/plugins/ctags/ide-ctags-index.c | 16 ++-------------
src/plugins/ctags/ide-ctags-service.c | 15 ++------------
src/plugins/ctags/ide-ctags-symbol-resolver.c | 22 +++++----------------
6 files changed, 20 insertions(+), 90 deletions(-)
---
diff --git a/src/plugins/ctags/ctags-plugin.c b/src/plugins/ctags/ctags-plugin.c
index 0bbfdfb6b..d06b9edbc 100644
--- a/src/plugins/ctags/ctags-plugin.c
+++ b/src/plugins/ctags/ctags-plugin.c
@@ -28,22 +28,9 @@
#include "ide-ctags-service.h"
#include "ide-ctags-symbol-resolver.h"
-void _ide_ctags_index_register_type (GTypeModule *module);
-void _ide_ctags_builder_register_type (GTypeModule *module);
-void _ide_ctags_completion_provider_register_type (GTypeModule *module);
-void _ide_ctags_highlighter_register_type (GTypeModule *module);
-void _ide_ctags_service_register_type (GTypeModule *module);
-void _ide_ctags_symbol_resolver_register_type (GTypeModule *module);
-
void
ide_ctags_register_types (PeasObjectModule *module)
{
- _ide_ctags_index_register_type (G_TYPE_MODULE (module));
- _ide_ctags_completion_provider_register_type (G_TYPE_MODULE (module));
- _ide_ctags_highlighter_register_type (G_TYPE_MODULE (module));
- _ide_ctags_service_register_type (G_TYPE_MODULE (module));
- _ide_ctags_symbol_resolver_register_type (G_TYPE_MODULE (module));
-
peas_object_module_register_extension_type (module, IDE_TYPE_COMPLETION_PROVIDER,
IDE_TYPE_CTAGS_COMPLETION_PROVIDER);
peas_object_module_register_extension_type (module, IDE_TYPE_HIGHLIGHTER, IDE_TYPE_CTAGS_HIGHLIGHTER);
peas_object_module_register_extension_type (module, IDE_TYPE_SERVICE, IDE_TYPE_CTAGS_SERVICE);
diff --git a/src/plugins/ctags/ide-ctags-completion-provider.c
b/src/plugins/ctags/ide-ctags-completion-provider.c
index 877fd7ace..285f83b1c 100644
--- a/src/plugins/ctags/ide-ctags-completion-provider.c
+++ b/src/plugins/ctags/ide-ctags-completion-provider.c
@@ -33,11 +33,10 @@ static void provider_iface_init (IdeCompletionProviderInterface *iface);
static GHashTable *reserved;
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (IdeCtagsCompletionProvider,
- ide_ctags_completion_provider,
- IDE_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (IDE_TYPE_COMPLETION_PROVIDER, provider_iface_init))
+G_DEFINE_TYPE_WITH_CODE (IdeCtagsCompletionProvider,
+ ide_ctags_completion_provider,
+ IDE_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_COMPLETION_PROVIDER, provider_iface_init))
static const gchar *
get_icon_name (IdeCtagsCompletionItem *item)
@@ -192,11 +191,6 @@ ide_ctags_completion_provider_class_init (IdeCtagsCompletionProviderClass *klass
g_hash_table_insert (reserved, (gchar *)reserved_keywords[i], NULL);
}
-static void
-ide_ctags_completion_provider_class_finalize (IdeCtagsCompletionProviderClass *klass)
-{
-}
-
static void
changed_enabled_cb (IdeCtagsCompletionProvider *self,
const gchar *key,
@@ -423,9 +417,3 @@ provider_iface_init (IdeCompletionProviderInterface *iface)
iface->refilter = ide_ctags_completion_provider_refilter;
iface->display_proposal = ide_ctags_completion_provider_display_proposal;
}
-
-void
-_ide_ctags_completion_provider_register_type (GTypeModule *module)
-{
- ide_ctags_completion_provider_register_type (module);
-}
diff --git a/src/plugins/ctags/ide-ctags-highlighter.c b/src/plugins/ctags/ide-ctags-highlighter.c
index 583cc42f1..610a51bf4 100644
--- a/src/plugins/ctags/ide-ctags-highlighter.c
+++ b/src/plugins/ctags/ide-ctags-highlighter.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "config.h"
+
#define G_LOG_DOMAIN "ide-ctags-highlighter"
#include <glib/gi18n.h>
@@ -34,12 +36,11 @@ struct _IdeCtagsHighlighter
static void highlighter_iface_init (IdeHighlighterInterface *iface);
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (IdeCtagsHighlighter,
- ide_ctags_highlighter,
- IDE_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (IDE_TYPE_HIGHLIGHTER,
- highlighter_iface_init))
+G_DEFINE_TYPE_WITH_CODE (IdeCtagsHighlighter,
+ ide_ctags_highlighter,
+ IDE_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_HIGHLIGHTER,
+ highlighter_iface_init))
static inline gboolean
accepts_char (gunichar ch)
@@ -280,11 +281,6 @@ ide_ctags_highlighter_class_init (IdeCtagsHighlighterClass *klass)
object_class->finalize = ide_ctags_highlighter_finalize;
}
-static void
-ide_ctags_highlighter_class_finalize (IdeCtagsHighlighterClass *klass)
-{
-}
-
static void
ide_ctags_highlighter_init (IdeCtagsHighlighter *self)
{
@@ -297,9 +293,3 @@ highlighter_iface_init (IdeHighlighterInterface *iface)
iface->update = ide_ctags_highlighter_real_update;
iface->set_engine = ide_ctags_highlighter_real_set_engine;
}
-
-void
-_ide_ctags_highlighter_register_type (GTypeModule *module)
-{
- ide_ctags_highlighter_register_type (module);
-}
diff --git a/src/plugins/ctags/ide-ctags-index.c b/src/plugins/ctags/ide-ctags-index.c
index ce34b3570..b7060abfb 100644
--- a/src/plugins/ctags/ide-ctags-index.c
+++ b/src/plugins/ctags/ide-ctags-index.c
@@ -52,9 +52,8 @@ enum {
static void async_initable_iface_init (GAsyncInitableIface *iface);
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (IdeCtagsIndex, ide_ctags_index, IDE_TYPE_OBJECT, 0,
- G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
- async_initable_iface_init))
+G_DEFINE_TYPE_WITH_CODE (IdeCtagsIndex, ide_ctags_index, IDE_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init))
DZL_DEFINE_COUNTER (instances, "IdeCtagsIndex", "Instances", "Number of IdeCtagsIndex instances.")
DZL_DEFINE_COUNTER (index_entries, "IdeCtagsIndex", "N Entries", "Number of entries in indexes.")
@@ -415,11 +414,6 @@ ide_ctags_index_class_init (IdeCtagsIndexClass *klass)
g_object_class_install_properties (object_class, LAST_PROP, properties);
}
-static void
-ide_ctags_index_class_finalize (IdeCtagsIndexClass *klass)
-{
-}
-
static void
ide_ctags_index_init (IdeCtagsIndex *self)
{
@@ -626,12 +620,6 @@ ide_ctags_index_lookup_prefix (IdeCtagsIndex *self,
ide_ctags_index_entry_compare_prefix);
}
-void
-_ide_ctags_index_register_type (GTypeModule *module)
-{
- ide_ctags_index_register_type (module);
-}
-
guint64
ide_ctags_index_get_mtime (IdeCtagsIndex *self)
{
diff --git a/src/plugins/ctags/ide-ctags-service.c b/src/plugins/ctags/ide-ctags-service.c
index dfd7f1fcf..eda7d2cb8 100644
--- a/src/plugins/ctags/ide-ctags-service.c
+++ b/src/plugins/ctags/ide-ctags-service.c
@@ -59,8 +59,8 @@ typedef struct
static void service_iface_init (IdeServiceInterface *iface);
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (IdeCtagsService, ide_ctags_service, IDE_TYPE_OBJECT, 0,
- G_IMPLEMENT_INTERFACE (IDE_TYPE_SERVICE, service_iface_init))
+G_DEFINE_TYPE_WITH_CODE (IdeCtagsService, ide_ctags_service, IDE_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_SERVICE, service_iface_init))
static void
queued_request_free (gpointer data)
@@ -674,11 +674,6 @@ service_iface_init (IdeServiceInterface *iface)
iface->stop = ide_ctags_service_stop;
}
-static void
-ide_ctags_service_class_finalize (IdeCtagsServiceClass *klass)
-{
-}
-
static void
ide_ctags_service_init (IdeCtagsService *self)
{
@@ -703,12 +698,6 @@ ide_ctags_service_init (IdeCtagsService *self)
dzl_task_cache_set_name (self->indexes, "ctags index cache");
}
-void
-_ide_ctags_service_register_type (GTypeModule *module)
-{
- ide_ctags_service_register_type (module);
-}
-
/**
* ide_ctags_service_get_indexes:
*
diff --git a/src/plugins/ctags/ide-ctags-symbol-resolver.c b/src/plugins/ctags/ide-ctags-symbol-resolver.c
index 8d85524fe..3a415d814 100644
--- a/src/plugins/ctags/ide-ctags-symbol-resolver.c
+++ b/src/plugins/ctags/ide-ctags-symbol-resolver.c
@@ -47,12 +47,11 @@ enum {
static void symbol_resolver_iface_init (IdeSymbolResolverInterface *iface);
-G_DEFINE_DYNAMIC_TYPE_EXTENDED (IdeCtagsSymbolResolver,
- ide_ctags_symbol_resolver,
- IDE_TYPE_OBJECT,
- 0,
- G_IMPLEMENT_INTERFACE (IDE_TYPE_SYMBOL_RESOLVER,
- symbol_resolver_iface_init))
+G_DEFINE_TYPE_WITH_CODE (IdeCtagsSymbolResolver,
+ ide_ctags_symbol_resolver,
+ IDE_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (IDE_TYPE_SYMBOL_RESOLVER,
+ symbol_resolver_iface_init))
static void
lookup_symbol_free (gpointer data)
@@ -718,11 +717,6 @@ ide_ctags_symbol_resolver_class_init (IdeCtagsSymbolResolverClass *klass)
{
}
-static void
-ide_ctags_symbol_resolver_class_finalize (IdeCtagsSymbolResolverClass *klass)
-{
-}
-
static void
ide_ctags_symbol_resolver_init (IdeCtagsSymbolResolver *resolver)
{
@@ -737,12 +731,6 @@ symbol_resolver_iface_init (IdeSymbolResolverInterface *iface)
iface->get_symbol_tree_finish = ide_ctags_symbol_resolver_get_symbol_tree_finish;
}
-void
-_ide_ctags_symbol_resolver_register_type (GTypeModule *module)
-{
- ide_ctags_symbol_resolver_register_type (module);
-}
-
void
ide_ctags_symbol_resolver_get_location_async (IdeCtagsSymbolResolver *self,
IdeCtagsIndex *index,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]