On 2016-08-27 04:09 PM, Matthew Brush wrote:
[...] I propose we use Vala as a way to generate GObject boilerplate [...]

See attached for the minimal diff to start supporting Vala.

Cheers,
Matthew Brush
diff --git a/.gitignore b/.gitignore
index f013c72..9a0d638 100644
--- a/.gitignore
+++ b/.gitignore
@@ -87,6 +87,10 @@ Makefile.in
 /src/geany
 /src/geany_private.res
 /src/signallist.i
+/src/geanyvala-1.0.vapi
+/src/geanyvala.h
+/src/placeholder.c
+/src/*_vala.stamp
 
 #-----------------------------------------------------------------------
 # /doc/
diff --git a/configure.ac b/configure.ac
index 28b6202..f26fc9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,8 @@ GEANY_PROG_CXX
 AC_PROG_INSTALL
 AC_PROG_LN_S
 
+AM_PROG_VALAC
+
 # autoscan start
 
 # Checks for header files.
diff --git a/src/Makefile.am b/src/Makefile.am
index 9454c44..156bb70 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,6 +22,10 @@ AM_CPPFLAGS = \
 	@GTK_CFLAGS@ @GTHREAD_CFLAGS@ \
 	$(MAC_INTEGRATION_CFLAGS)
 
+AM_VALAFLAGS = \
+	--vapi=geanyvala-1.0.vapi \
+	--header=geanyvala.h --use-header
+
 bin_PROGRAMS = geany
 lib_LTLIBRARIES = libgeany.la
 
@@ -43,6 +47,7 @@ geany_include_HEADERS = \
 	encodings.h \
 	filetypes.h \
 	geany.h \
+	geanyvala.h \
 	gtkcompat.h \
 	highlighting.h \
 	keybindings.h \
@@ -88,6 +93,7 @@ libgeany_la_SOURCES = \
 	msgwindow.c msgwindow.h \
 	navqueue.c navqueue.h \
 	notebook.c notebook.h \
+	placeholder.vala \
 	plugins.c plugins.h \
 	pluginutils.c pluginutils.h \
 	prefs.c prefs.h \
@@ -117,6 +123,7 @@ endif
 
 libgeany_la_CFLAGS  = $(AM_CPPFLAGS) @LIBGEANY_CFLAGS@
 libgeany_la_LDFLAGS = @LIBGEANY_LDFLAGS@
+libgeany_la_VALAFLAGS = $(AM_VALAFLAGS)
 
 libgeany_la_LIBADD = \
 	$(top_builddir)/scintilla/libscintilla.la \
@@ -126,6 +133,8 @@ libgeany_la_LIBADD = \
 	$(MAC_INTEGRATION_LIBS) \
 	$(INTLLIBS)
 
+geanyvala.h: placeholder.vala
+
 # tell automake we have a C++ file so it uses the C++ linker we need for Scintilla
 nodist_EXTRA_libgeany_la_SOURCES = dummy1.cxx
 
diff --git a/src/placeholder.vala b/src/placeholder.vala
new file mode 100644
index 0000000..e8b7a72
--- /dev/null
+++ b/src/placeholder.vala
@@ -0,0 +1,7 @@
+namespace Geany
+{
+	public int reserved_placeholder()
+	{
+		return 42;
+	}
+}
diff --git a/src/plugindata.h b/src/plugindata.h
index c8bd687..d09e6c5 100644
--- a/src/plugindata.h
+++ b/src/plugindata.h
@@ -37,6 +37,7 @@
 #include "document.h" /* GeanyDocument */
 #include "editor.h"	/* GeanyEditor, GeanyIndentType */
 #include "filetypes.h" /* GeanyFiletype */
+#include "geanyvala.h"
 
 #include "gtkcompat.h"
 
_______________________________________________
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel

Reply via email to