[gnome-builder/gnome-builder-3-18] libide: make a few classes bind better into vala vapi
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-18] libide: make a few classes bind better into vala vapi
- Date: Tue, 13 Oct 2015 07:24:16 +0000 (UTC)
commit 34d0f4fefd5aeab0f8c1394d82188c1314352af8
Author: Christian Hergert <christian hergert me>
Date: Sat Sep 26 01:20:02 2015 -0700
libide: make a few classes bind better into vala vapi
libide/ide-internal.h | 6 ------
libide/ide-symbol-node.c | 7 +++++++
libide/ide-symbol-resolver.c | 12 +++++++++++-
libide/ide-symbol-resolver.h | 2 ++
libide/ide-symbol-tree.c | 3 +++
libide/ide-symbol.c | 12 ++++++------
libide/ide-symbol.h | 6 ++++++
plugins/clang/ide-clang-translation-unit.c | 6 +++---
plugins/ctags/ide-ctags-symbol-resolver.c | 5 ++---
9 files changed, 40 insertions(+), 19 deletions(-)
---
diff --git a/libide/ide-internal.h b/libide/ide-internal.h
index 9023e18..277e7a0 100644
--- a/libide/ide-internal.h
+++ b/libide/ide-internal.h
@@ -96,12 +96,6 @@ void _ide_source_view_set_count (IdeSourceView
guint count);
void _ide_source_view_set_modifier (IdeSourceView *self,
gunichar modifier);
-IdeSymbol *_ide_symbol_new (const gchar *name,
- IdeSymbolKind kind,
- IdeSymbolFlags flags,
- IdeSourceLocation *declaration_location,
- IdeSourceLocation *definition_location,
- IdeSourceLocation *canonical_location);
void _ide_thread_pool_init (void);
IdeUnsavedFile *_ide_unsaved_file_new (GFile *file,
GBytes *content,
diff --git a/libide/ide-symbol-node.c b/libide/ide-symbol-node.c
index b988fc5..74fbdaf 100644
--- a/libide/ide-symbol-node.c
+++ b/libide/ide-symbol-node.c
@@ -177,6 +177,13 @@ ide_symbol_node_get_kind (IdeSymbolNode *self)
return priv->kind;
}
+/**
+ * ide_symbol_node_get_location:
+ *
+ * Gets the location for the symbol node.
+ *
+ * Returns: (transfer full) (nullable): An #IdeSourceLocation or %NULL.
+ */
IdeSourceLocation *
ide_symbol_node_get_location (IdeSymbolNode *self)
{
diff --git a/libide/ide-symbol-resolver.c b/libide/ide-symbol-resolver.c
index 0e78342..cbe3063 100644
--- a/libide/ide-symbol-resolver.c
+++ b/libide/ide-symbol-resolver.c
@@ -83,6 +83,16 @@ ide_symbol_resolver_lookup_symbol_finish (IdeSymbolResolver *self,
return IDE_SYMBOL_RESOLVER_GET_IFACE (self)->lookup_symbol_finish (self, result, error);
}
+/**
+ * ide_symbol_resolver_get_symbol_tree_async:
+ * @self: An #IdeSymbolResolver
+ * @file: A #GFile
+ * @cancellable: (allow-none): a #GCancellable or %NULL.
+ * @callback: (allow-none): a callback to execute upon completion
+ * @user_data: user data for @callback
+ *
+ * Asynchronously fetch an up to date symbol tree for @file.
+ */
void
ide_symbol_resolver_get_symbol_tree_async (IdeSymbolResolver *self,
GFile *file,
@@ -101,7 +111,7 @@ ide_symbol_resolver_get_symbol_tree_async (IdeSymbolResolver *self,
*
* Completes an asynchronous request to get the symbol tree for the requested file.
*
- * Returns: (transfer full): An #IdeSymbolTree; otherwise %NULL and @error is set.
+ * Returns: (nullable) (transfer full): An #IdeSymbolTree; otherwise %NULL and @error is set.
*/
IdeSymbolTree *
ide_symbol_resolver_get_symbol_tree_finish (IdeSymbolResolver *self,
diff --git a/libide/ide-symbol-resolver.h b/libide/ide-symbol-resolver.h
index 0d4f20c..83052f9 100644
--- a/libide/ide-symbol-resolver.h
+++ b/libide/ide-symbol-resolver.h
@@ -32,6 +32,8 @@ struct _IdeSymbolResolverInterface
{
GTypeInterface parent_interface;
+ void (*set_context) (IdeSymbolResolver *self,
+ IdeContext *context);
void (*lookup_symbol_async) (IdeSymbolResolver *self,
IdeSourceLocation *location,
GCancellable *cancellable,
diff --git a/libide/ide-symbol-tree.c b/libide/ide-symbol-tree.c
index 2836de2..c009d4d 100644
--- a/libide/ide-symbol-tree.c
+++ b/libide/ide-symbol-tree.c
@@ -45,6 +45,9 @@ ide_symbol_tree_get_n_children (IdeSymbolTree *self,
/**
* ide_symbol_tree_get_nth_child:
+ * @self: An #IdeSymbolTree.
+ * @node: (nullable): an #IdeSymboNode
+ * @nth: the nth child to retrieve.
*
* Gets the @nth child node of @node.
*
diff --git a/libide/ide-symbol.c b/libide/ide-symbol.c
index c11c3f1..e4ec9c6 100644
--- a/libide/ide-symbol.c
+++ b/libide/ide-symbol.c
@@ -41,12 +41,12 @@ G_DEFINE_BOXED_TYPE (IdeSymbol, ide_symbol, ide_symbol_ref, ide_symbol_unref)
EGG_DEFINE_COUNTER (instances, "IdeSymbol", "Instances", "Number of symbol instances")
IdeSymbol *
-_ide_symbol_new (const gchar *name,
- IdeSymbolKind kind,
- IdeSymbolFlags flags,
- IdeSourceLocation *declaration_location,
- IdeSourceLocation *definition_location,
- IdeSourceLocation *canonical_location)
+ide_symbol_new (const gchar *name,
+ IdeSymbolKind kind,
+ IdeSymbolFlags flags,
+ IdeSourceLocation *declaration_location,
+ IdeSourceLocation *definition_location,
+ IdeSourceLocation *canonical_location)
{
IdeSymbol *ret;
diff --git a/libide/ide-symbol.h b/libide/ide-symbol.h
index de27b16..a649715 100644
--- a/libide/ide-symbol.h
+++ b/libide/ide-symbol.h
@@ -57,6 +57,12 @@ const gchar *ide_symbol_get_name (IdeSymbol *self);
IdeSourceLocation *ide_symbol_get_canonical_location (IdeSymbol *self);
IdeSourceLocation *ide_symbol_get_declaration_location (IdeSymbol *self);
IdeSourceLocation *ide_symbol_get_definition_location (IdeSymbol *self);
+IdeSymbol *ide_symbol_new (const gchar *name,
+ IdeSymbolKind kind,
+ IdeSymbolFlags flags,
+ IdeSourceLocation *declaration_location,
+ IdeSourceLocation *definition_location,
+ IdeSourceLocation *canonical_location);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (IdeSymbol, ide_symbol_unref)
diff --git a/plugins/clang/ide-clang-translation-unit.c b/plugins/clang/ide-clang-translation-unit.c
index 02d1ce7..549c351 100644
--- a/plugins/clang/ide-clang-translation-unit.c
+++ b/plugins/clang/ide-clang-translation-unit.c
@@ -952,8 +952,8 @@ ide_clang_translation_unit_lookup_symbol (IdeClangTranslationUnit *self,
symkind = get_symbol_kind (cursor, &symflags);
cxstr = clang_getCursorDisplayName (cursor);
- ret = _ide_symbol_new (clang_getCString (cxstr), symkind, symflags,
- declaration, definition, canonical);
+ ret = ide_symbol_new (clang_getCString (cxstr), symkind, symflags,
+ declaration, definition, canonical);
/*
* TODO: We should also get information about the defintion of the symbol.
@@ -985,7 +985,7 @@ create_symbol (CXCursor cursor,
symkind = get_symbol_kind (cursor, &symflags);
- symbol = _ide_symbol_new (name, symkind, symflags, NULL, NULL, srcloc);
+ symbol = ide_symbol_new (name, symkind, symflags, NULL, NULL, srcloc);
return symbol;
}
diff --git a/plugins/ctags/ide-ctags-symbol-resolver.c b/plugins/ctags/ide-ctags-symbol-resolver.c
index 3c337f2..fc0d3e5 100644
--- a/plugins/ctags/ide-ctags-symbol-resolver.c
+++ b/plugins/ctags/ide-ctags-symbol-resolver.c
@@ -24,6 +24,7 @@
#include "ide-ctags-util.h"
#include "ide-internal.h"
#include "ide-line-reader.h"
+#include "ide-symbol.h"
struct _IdeCtagsSymbolResolver
{
@@ -123,9 +124,7 @@ create_symbol (IdeCtagsSymbolResolver *self,
NULL);
loc = ide_source_location_new (file, line, line_offset, offset);
- return _ide_symbol_new (entry->name,
- transform_kind (entry->kind),
- 0, loc, loc, loc);
+ return ide_symbol_new (entry->name, transform_kind (entry->kind), 0, loc, loc, loc);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]