[gnome-builder] symbols: add resolver to get symbols in a file
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] symbols: add resolver to get symbols in a file
- Date: Sun, 29 Mar 2015 08:02:34 +0000 (UTC)
commit 91241a2c849e60f70c699f4a9d63ffa618facb37
Author: Christian Hergert <christian hergert me>
Date: Sat Mar 28 17:44:43 2015 -0700
symbols: add resolver to get symbols in a file
libide/ide-symbol-resolver.c | 36 ++++++++++++++++++++++++++++++++++++
libide/ide-symbol-resolver.h | 16 ++++++++++++++++
2 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-symbol-resolver.c b/libide/ide-symbol-resolver.c
index 8adb48f..70ca59a 100644
--- a/libide/ide-symbol-resolver.c
+++ b/libide/ide-symbol-resolver.c
@@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ide-file.h"
#include "ide-symbol-resolver.h"
G_DEFINE_ABSTRACT_TYPE (IdeSymbolResolver, ide_symbol_resolver, IDE_TYPE_OBJECT)
@@ -78,3 +79,38 @@ ide_symbol_resolver_lookup_symbol_finish (IdeSymbolResolver *self,
return IDE_SYMBOL_RESOLVER_GET_CLASS (self)->lookup_symbol_finish (self, result, error);
}
+
+void
+ide_symbol_resolver_get_symbols_async (IdeSymbolResolver *self,
+ IdeFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ g_return_if_fail (IDE_IS_SYMBOL_RESOLVER (self));
+ g_return_if_fail (IDE_IS_FILE (file));
+ g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
+
+ IDE_SYMBOL_RESOLVER_GET_CLASS (self)->
+ get_symbols_async (self, file, cancellable, callback, user_data);
+}
+
+/**
+ * ide_symbol_resolver_get_symbols_finish:
+ * @self: An #IdeSymbolResolver.
+ * @result: A #GAsyncResult.
+ * @error: (out): A location for a #GError or %NULL.
+ *
+ *
+ * Returns: (transfer container) (element-type IdeSymbol*): A #GPtrArray if successful.
+ */
+GPtrArray *
+ide_symbol_resolver_get_symbols_finish (IdeSymbolResolver *self,
+ GAsyncResult *result,
+ GError **error)
+{
+ g_return_val_if_fail (IDE_IS_SYMBOL_RESOLVER (self), NULL);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
+
+ return IDE_SYMBOL_RESOLVER_GET_CLASS (self)->get_symbols_finish (self, result, error);
+}
diff --git a/libide/ide-symbol-resolver.h b/libide/ide-symbol-resolver.h
index 9c53254..9641e3d 100644
--- a/libide/ide-symbol-resolver.h
+++ b/libide/ide-symbol-resolver.h
@@ -39,6 +39,14 @@ struct _IdeSymbolResolverClass
IdeSymbol *(*lookup_symbol_finish) (IdeSymbolResolver *self,
GAsyncResult *result,
GError **error);
+ void (*get_symbols_async) (IdeSymbolResolver *self,
+ IdeFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GPtrArray *(*get_symbols_finish) (IdeSymbolResolver *self,
+ GAsyncResult *result,
+ GError **error);
};
void ide_symbol_resolver_lookup_symbol_async (IdeSymbolResolver *self,
@@ -49,6 +57,14 @@ void ide_symbol_resolver_lookup_symbol_async (IdeSymbolResolver *self,
IdeSymbol *ide_symbol_resolver_lookup_symbol_finish (IdeSymbolResolver *self,
GAsyncResult *result,
GError **error);
+void ide_symbol_resolver_get_symbols_async (IdeSymbolResolver *self,
+ IdeFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GPtrArray *ide_symbol_resolver_get_symbols_finish (IdeSymbolResolver *self,
+ GAsyncResult *result,
+ GError **error);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]