[gnome-builder] libide: stub out IdeValaLanguage



commit 558867592d82913d6cd26f8955a8387deb49e7a5
Author: Christian Hergert <christian hergert me>
Date:   Wed Apr 22 18:37:07 2015 -0700

    libide: stub out IdeValaLanguage
    
    If anyone wants to start on this, have at it. This should get you the
    hooks you need to get loaded.

 .editorconfig                   |    5 +++
 libide/Makefile.am              |    3 ++
 libide/ide.c                    |    5 +++
 libide/vala/ide-vala-language.c |   62 +++++++++++++++++++++++++++++++++++++++
 libide/vala/ide-vala-language.h |   32 ++++++++++++++++++++
 5 files changed, 107 insertions(+), 0 deletions(-)
---
diff --git a/.editorconfig b/.editorconfig
index 17aa167..7380b8e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -29,6 +29,11 @@ indent_size = 2
 tab_size = 2
 indent_style = space
 
+[*.vala]
+indent_size = 4
+tab_size = 4
+indent_style = tab
+
 [*.{xml.in,xml}]
 indent_size = 2
 tab_size = 2
diff --git a/libide/Makefile.am b/libide/Makefile.am
index 27faa1c..0eb113b 100644
--- a/libide/Makefile.am
+++ b/libide/Makefile.am
@@ -201,6 +201,8 @@ libide_1_0_la_public_sources = \
        libide/python/ide-python-language.h \
        libide/theatrics/ide-animation.c \
        libide/theatrics/ide-animation.h \
+       libide/vala/ide-vala-language.c \
+       libide/vala/ide-vala-language.h \
        libide/xml/ide-xml-indenter.c \
        libide/xml/ide-xml-indenter.h \
        libide/xml/ide-xml-language.c \
@@ -322,6 +324,7 @@ libide_1_0_la_includes = \
        -I$(top_srcdir)/libide/theatrics \
        -I$(top_srcdir)/libide/trie \
        -I$(top_srcdir)/libide/util \
+       -I$(top_srcdir)/libide/vala \
        -I$(top_srcdir)/libide/xml \
        $(CLANG_CFLAGS) \
        $(NULL)
diff --git a/libide/ide.c b/libide/ide.c
index 90ddd56..5f51c16 100644
--- a/libide/ide.c
+++ b/libide/ide.c
@@ -42,6 +42,7 @@
 #include "ide-pygobject-script.h"
 #include "ide-python-language.h"
 #include "ide-search-provider.h"
+#include "ide-vala-language.h"
 #include "ide-xml-language.h"
 
 #include "modeline-parser.h"
@@ -129,6 +130,10 @@ ide_init_ctor (void)
                                   IDE_TYPE_XML_LANGUAGE,
                                   IDE_LANGUAGE_EXTENSION_POINT".xml",
                                   0);
+  g_io_extension_point_implement (IDE_LANGUAGE_EXTENSION_POINT,
+                                  IDE_TYPE_VALA_LANGUAGE,
+                                  IDE_LANGUAGE_EXTENSION_POINT".vala",
+                                  0);
 
   g_io_extension_point_implement (IDE_PROJECT_MINER_EXTENSION_POINT,
                                   IDE_TYPE_AUTOTOOLS_PROJECT_MINER,
diff --git a/libide/vala/ide-vala-language.c b/libide/vala/ide-vala-language.c
new file mode 100644
index 0000000..4c88eab
--- /dev/null
+++ b/libide/vala/ide-vala-language.c
@@ -0,0 +1,62 @@
+/* ide-vala-language.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 "ide-vala-language.h"
+
+struct _IdeValaLanguage
+{
+  IdeLanguage parent_instance;
+};
+
+static void initable_iface_init (GInitableIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (IdeValaLanguage,
+                         ide_vala_language,
+                         IDE_TYPE_LANGUAGE,
+                         G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
+                                                initable_iface_init))
+
+static gboolean
+ide_vala_language_initable_init (GInitable     *initable,
+                                 GCancellable  *cancellable,
+                                 GError       **error)
+{
+  const gchar *id;
+
+  g_return_val_if_fail (IDE_IS_VALA_LANGUAGE (initable), FALSE);
+
+  id = ide_language_get_id (IDE_LANGUAGE (initable));
+
+  return (g_strcmp0 (id, "vala") == 0);
+}
+
+static void
+initable_iface_init (GInitableIface *iface)
+{
+  iface->init = ide_vala_language_initable_init;
+}
+
+static void
+ide_vala_language_class_init (IdeValaLanguageClass *klass)
+{
+}
+
+static void
+ide_vala_language_init (IdeValaLanguage *self)
+{
+}
diff --git a/libide/vala/ide-vala-language.h b/libide/vala/ide-vala-language.h
new file mode 100644
index 0000000..2c1997d
--- /dev/null
+++ b/libide/vala/ide-vala-language.h
@@ -0,0 +1,32 @@
+/* ide-vala-language.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 IDE_VALA_LANGUAGE_H
+#define IDE_VALA_LANGUAGE_H
+
+#include "ide-language.h"
+
+G_BEGIN_DECLS
+
+#define IDE_TYPE_VALA_LANGUAGE (ide_vala_language_get_type())
+
+G_DECLARE_FINAL_TYPE (IdeValaLanguage, ide_vala_language, IDE, VALA_LANGUAGE, IdeLanguage)
+
+G_END_DECLS
+
+#endif /* IDE_VALA_LANGUAGE_H */


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