[gnome-builder] symbols: Adding IdeCodeIndexEntries interface



commit 80118f9ea4f78e913ec4dacc23837005cd5f296d
Author: Anoop Chandu <anoopchandu96 gmail com>
Date:   Tue Aug 29 21:17:49 2017 +0530

    symbols: Adding IdeCodeIndexEntries interface
    
    Through this interface we can get each item in index entries.
    This is the type of object returned by IdeCodeIndexer when it
    indexes a file.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786700

 libide/symbols/ide-code-index-entries.c |   53 +++++++++++++++++++++++++++++++
 libide/symbols/ide-code-index-entries.h |   43 +++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 0 deletions(-)
---
diff --git a/libide/symbols/ide-code-index-entries.c b/libide/symbols/ide-code-index-entries.c
new file mode 100644
index 0000000..351478a
--- /dev/null
+++ b/libide/symbols/ide-code-index-entries.c
@@ -0,0 +1,53 @@
+/* ide-code-index-entries.c
+ *
+ * Copyright (C) 2017 Anoop Chandu <anoopchandu96 gmail com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#define G_LOG_DOMAIN "ide-code-index-entries"
+
+#include "ide-code-index-entries.h"
+
+G_DEFINE_INTERFACE (IdeCodeIndexEntries, ide_code_index_entries, G_TYPE_OBJECT)
+
+IdeCodeIndexEntry *
+ide_code_index_entries_real_get_next_entry (IdeCodeIndexEntries *self)
+{
+  return NULL;
+}
+
+static void
+ide_code_index_entries_default_init (IdeCodeIndexEntriesInterface *iface)
+{
+  iface->get_next_entry = ide_code_index_entries_real_get_next_entry;
+}
+
+/**
+ * ide_code_index_entries_get_next_entry:
+ * @self: An #IdeCodeIndexEntries instance.
+ *
+ * This will fetch next entry in index.
+ *
+ * Returns: (transfer full) : An #IdeCodeIndexEntry.
+ *
+ * Since: 3.26
+ */
+IdeCodeIndexEntry *
+ide_code_index_entries_get_next_entry (IdeCodeIndexEntries *self)
+{
+  g_return_val_if_fail (IDE_IS_CODE_INDEX_ENTRIES (self), NULL);
+
+  return IDE_CODE_INDEX_ENTRIES_GET_IFACE (self)->get_next_entry (self);
+}
diff --git a/libide/symbols/ide-code-index-entries.h b/libide/symbols/ide-code-index-entries.h
new file mode 100644
index 0000000..fe1e046
--- /dev/null
+++ b/libide/symbols/ide-code-index-entries.h
@@ -0,0 +1,43 @@
+/* ide-code-index-entries.h
+ *
+ * Copyright (C) 2017 Anoop Chandu <anoopchandu96 gmail com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef IDE_CODE_INDEX_ENTRIES_H
+#define IDE_CODE_INDEX_ENTRIES_H
+
+#include "ide-object.h"
+#include "ide-symbol.h"
+#include "ide-code-index-entry.h"
+
+G_BEGIN_DECLS
+
+#define IDE_TYPE_CODE_INDEX_ENTRIES (ide_code_index_entries_get_type ())
+
+G_DECLARE_INTERFACE (IdeCodeIndexEntries, ide_code_index_entries, IDE, CODE_INDEX_ENTRIES, GObject)
+
+struct _IdeCodeIndexEntriesInterface
+{
+  GTypeInterface parent_iface;
+
+  IdeCodeIndexEntry   *(*get_next_entry)   (IdeCodeIndexEntries *self);
+};
+
+IdeCodeIndexEntry  *ide_code_index_entries_get_next_entry (IdeCodeIndexEntries *self);
+
+G_END_DECLS
+
+#endif /* IDE_CODE_INDEX_ENTRIES_H */


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