[gnome-builder/wip/symbol-tree] symbol-tree: stub out symbol tree and builder
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/symbol-tree] symbol-tree: stub out symbol tree and builder
- Date: Sat, 25 Apr 2015 18:42:30 +0000 (UTC)
commit 40de7b63d041a97b1c69ba39101b2827dbf508ff
Author: Christian Hergert <christian hergert me>
Date: Sat Apr 25 11:40:55 2015 -0700
symbol-tree: stub out symbol tree and builder
src/symbol-tree/gb-symbol-tree-builder.c | 55 ++++++++++++++++
src/symbol-tree/gb-symbol-tree-builder.h | 35 +++++++++++
src/symbol-tree/gb-symbol-tree.c | 99 ++++++++++++++++++++++++++++++
src/symbol-tree/gb-symbol-tree.h | 34 ++++++++++
4 files changed, 223 insertions(+), 0 deletions(-)
---
diff --git a/src/symbol-tree/gb-symbol-tree-builder.c b/src/symbol-tree/gb-symbol-tree-builder.c
new file mode 100644
index 0000000..677a09a
--- /dev/null
+++ b/src/symbol-tree/gb-symbol-tree-builder.c
@@ -0,0 +1,55 @@
+/* gb-symbol-tree-builder.c
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * 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/>.
+ */
+
+#include "gb-symbol-tree-builder.h"
+
+struct _GbSymbolTreeBuilder
+{
+ GbTreeBuilder parent_instance;
+};
+
+G_DEFINE_TYPE (GbSymbolTreeBuilder, gb_symbol_tree_builder, GB_TYPE_TREE_BUILDER)
+
+GbTreeBuilder *
+gb_symbol_tree_builder_new (void)
+{
+ return g_object_new (GB_TYPE_SYMBOL_TREE_BUILDER, NULL);
+}
+
+static void
+gb_symbol_tree_builder_build_node (GbTreeBuilder *builder,
+ GbTreeNode *node)
+{
+ g_assert (GB_IS_TREE_BUILDER (builder));
+ g_assert (GB_IS_TREE_BUILDER_NODE (node));
+
+ g_print ("Build node\n");
+}
+
+static void
+gb_symbol_tree_builder_class_init (GbSymbolTreeBuilderClass *klass)
+{
+ GbTreeBuilderClass *builder_class = GB_TREE_BUILDER_CLASS (klass);
+
+ builder_class->build_node = gb_symbol_tree_builder_build_node;
+}
+
+static void
+gb_symbol_tree_builder_init (GbSymbolTreeBuilder *self)
+{
+}
diff --git a/src/symbol-tree/gb-symbol-tree-builder.h b/src/symbol-tree/gb-symbol-tree-builder.h
new file mode 100644
index 0000000..83d81fd
--- /dev/null
+++ b/src/symbol-tree/gb-symbol-tree-builder.h
@@ -0,0 +1,35 @@
+/* gb-symbol-tree-builder.h
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * 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 GB_SYMBOL_TREE_BUILDER_H
+#define GB_SYMBOL_TREE_BUILDER_H
+
+#include "gb-tree-builder.h"
+
+G_BEGIN_DECLS
+
+#define GB_TYPE_SYMBOL_TREE_BUILDER (gb_symbol_tree_builder_get_type())
+
+G_DECLARE_FINAL_TYPE (GbSymbolTreeBuilder, gb_symbol_tree_builder,
+ GB, SYMBOL_TREE_BUILDER, GbTreeBuilder)
+
+GbTreeBuilder *gb_symbol_tree_builder_new (void);
+
+G_END_DECLS
+
+#endif /* GB_SYMBOL_TREE_BUILDER_H */
diff --git a/src/symbol-tree/gb-symbol-tree.c b/src/symbol-tree/gb-symbol-tree.c
new file mode 100644
index 0000000..03ea120
--- /dev/null
+++ b/src/symbol-tree/gb-symbol-tree.c
@@ -0,0 +1,99 @@
+/* gb-symbol-tree.c
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * 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/>.
+ */
+
+#include <glib/gi18n.h>
+
+#include "gb-symbol-tree.h"
+#include "gb-symbol-tree-builder.h"
+
+struct _GbSymbolTree
+{
+ GbTree parent_instance;
+};
+
+G_DEFINE_TYPE (GbSymbolTree, gb_symbol_tree, GB_TYPE_TREE)
+
+enum {
+ PROP_0,
+ LAST_PROP
+};
+
+static GParamSpec *gParamSpecs [LAST_PROP];
+
+GtkWidget *
+gb_symbol_tree_new (void)
+{
+ return g_object_new (GB_TYPE_SYMBOL_TREE, NULL);
+}
+
+static void
+gb_symbol_tree_finalize (GObject *object)
+{
+ GbSymbolTree *self = (GbSymbolTree *)object;
+
+ G_OBJECT_CLASS (gb_symbol_tree_parent_class)->finalize (object);
+}
+
+static void
+gb_symbol_tree_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GbSymbolTree *self = GB_SYMBOL_TREE (object);
+
+ switch (prop_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gb_symbol_tree_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GbSymbolTree *self = GB_SYMBOL_TREE (object);
+
+ switch (prop_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+gb_symbol_tree_class_init (GbSymbolTreeClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = gb_symbol_tree_finalize;
+ object_class->get_property = gb_symbol_tree_get_property;
+ object_class->set_property = gb_symbol_tree_set_property;
+}
+
+static void
+gb_symbol_tree_init (GbSymbolTree *self)
+{
+ GbTreeBuilder *builder;
+
+ builder = gb_symbol_tree_builder_new ();
+ gb_tree_add_builder (GB_TREE (self), builder);
+}
diff --git a/src/symbol-tree/gb-symbol-tree.h b/src/symbol-tree/gb-symbol-tree.h
new file mode 100644
index 0000000..59d78e7
--- /dev/null
+++ b/src/symbol-tree/gb-symbol-tree.h
@@ -0,0 +1,34 @@
+/* gb-symbol-tree.h
+ *
+ * Copyright (C) 2015 Christian Hergert <christian hergert me>
+ *
+ * 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 GB_SYMBOL_TREE_H
+#define GB_SYMBOL_TREE_H
+
+#include "gb-tree.h"
+
+G_BEGIN_DECLS
+
+#define GB_TYPE_SYMBOL_TREE (gb_symbol_tree_get_type())
+
+G_DECLARE_FINAL_TYPE (GbSymbolTree, gb_symbol_tree, GB, SYMBOL_TREE, GbTree)
+
+GtkWidget *gb_symbol_tree_new (void);
+
+G_END_DECLS
+
+#endif /* GB_SYMBOL_TREE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]