[anjuta] project-wizard: Added vala project type



commit 9da0f72d7a5a667dc5fad1371f4bcedb9e25c5f0
Author: Johannes Schmid <jhs gnome org>
Date:   Sat Dec 4 14:39:29 2010 +0100

    project-wizard: Added vala project type

 configure.ac                                       |    2 +
 plugins/project-wizard/templates/vala-gtk.wiz.in   |   78 ++++++++++++++++++++
 .../project-wizard/templates/vala-gtk/Makefile.am  |    9 ++
 .../templates/vala-gtk/configure.ac.tpl            |   29 +++++++
 .../templates/vala-gtk/src/Makefile.am             |    5 +
 .../templates/vala-gtk/src/Makefile.am.tpl         |   37 +++++++++
 .../templates/vala-gtk/src/main.vala               |   40 ++++++++++
 .../templates/vala-gtk/src/project.ui              |   15 ++++
 src/action-callbacks.c                             |    2 +-
 9 files changed, 216 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 64f9dec..ab897ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -897,6 +897,8 @@ plugins/project-wizard/templates/pygtk/Makefile
 plugins/project-wizard/templates/pygtk/src/Makefile
 plugins/project-wizard/templates/pygtk/po/Makefile
 plugins/project-wizard/templates/pygtk/data/Makefile
+plugins/project-wizard/templates/vala-gtk/Makefile
+plugins/project-wizard/templates/vala-gtk/src/Makefile
 plugins/project-wizard/templates/wxwin/Makefile
 plugins/project-wizard/templates/wxwin/src/Makefile
 plugins/project-wizard/templates/wxwin/po/Makefile
diff --git a/plugins/project-wizard/templates/vala-gtk.wiz.in b/plugins/project-wizard/templates/vala-gtk.wiz.in
new file mode 100644
index 0000000..f85f6b7
--- /dev/null
+++ b/plugins/project-wizard/templates/vala-gtk.wiz.in
@@ -0,0 +1,78 @@
+<project-template>
+	<project-wizard>
+		<_name>GTK+ (simple)</_name>
+		<_description>Simple GTK+ project</_description>
+		<icon>gtk-logo.png</icon>
+		<category>Vala</category>
+		<required-program>automake</required-program>
+		<required-program>autoconf</required-program>
+		<required-program>make</required-program>
+		<required-package>gtk+-3.0 >= 2.90.3</required-package>
+	</project-wizard>
+	
+	<page name="basic" _label="Basic information" _description="General Project Information">
+		<property type="string" name="Name" _label="Project Name:" _description="project name" default="gtk-foobar" summary="yes" restriction="filename" mandatory="yes"/>
+		<property type="string" name="Author" _label="Author:" _description="" default="[+UserName+]" mandatory="yes"/>
+		<property type="string" name="Email" _label="Email address:" _description="" default="[+EmailAddress+]" mandatory="no"/>
+		<property type="string" name="Version" _label="Version:" default="0.1" mandatory="yes"/>
+	</page>
+	
+	<page name="options" _label="Project options" _description="Options for project build system">
+		<property type="directory" name="Destination" _label="Destination:" _description="" default='[+AnjutaProjectDirectory+]/[+(string-downcase (get "Name"))+]' mandatory="yes" exist="no" restriction="directory" summary="yes"/>
+		<property type="list" name="License" _label="License" _description="Select code license" default="GPL" editable="no">
+			<item name="GPL" _label="General Public License (GPL)"/>
+			<item name="LGPL" _label="Lesser General Public License (LGPL)"/>
+			<item name="BSD" _label="Berkeley Software Distribution License (BSD)"/>
+			<item name="None" _label="No license"/>
+		</property>
+		<property type="hidden" name="NameUpper" default='[+(string-upcase (get "Name"))+]'/>
+		<property type="hidden" name="NameLower" default='[+(string-downcase (get "Name"))+]'/>
+		<property type="hidden" name="NameCUpper" default='[+(string->c-name! (string-substitute (string-upcase (get "Name")) " " "_"))+]'/>
+		<property type="hidden" name="NameCLower" default='[+(string->c-name! (string-substitute (string-downcase (get "Name")) " " "_"))+]'/>
+		<property type="hidden" name="NameHLower" default='[+(string-substitute (string->c-name! (string-downcase (get "Name"))) " " "-")+]'/>
+		<property type="hidden" name="HavePackage" default="1"/>
+		<property type="hidden" name="PackageModule1" default="gtk+-2.0 >= 2.16"/>
+		<property type="boolean" name="HaveSharedlib" _label="Add shared library support:" _description="Adds support for building shared libraries in your project" default="1"/>
+		<property type="boolean" name="HavePackageExtra" _label="Configure external packages:" _description="Use pkg-config to add library support from other packages" default="0"/>
+	</page>
+	
+	[+IF (=(get "HavePackageExtra") "1")+]
+	<page name="packages" _label="Configure external packages" _description="Configure external packages">
+		<property type="package" name="PackageModule2" _label="Require Package:" _description="Give a package name that your project require. You may also mention what is the required version of the package. For example, 'libgnomeui-2.0' or 'libgnomeui-2.0 &gt;= 2.2.0'" mandatory="yes"/>
+	</page>
+	[+ENDIF+]
+	
+	<content>
+		<directory source="terminal" destination="[+Destination+]">
+			<file source="AUTHORS"/>
+			<file source="ChangeLog"/>
+			<file source="Makefile.am.tpl" destination="Makefile.am"/>
+			<file source="NEWS"/>
+			<file source="README"/>
+			<file source="autogen.sh" executable="yes"/>
+			<file destination="[+NameHLower+].anjuta" source="project.anjuta"/>
+		</directory>
+		<directory source="vala-gtk" destination="[+Destination+]">
+			<file source="configure.ac.tpl" destination="configure.ac"/>
+			<directory source="src">
+				<file source="main.vala" destination="[+NameHLower+].vala"/>
+				<file source="project.ui" destination="[+NameHLower+].ui"/>
+				<file source="Makefile.am.tpl" destination="Makefile.am"/>
+			</directory>
+		</directory>
+		<directory source="licenses" destination="[+Destination+]">
+			<file source="[+License+]" destination="COPYING"/>	
+		</directory>
+		<directory source="minimal" destination="[+Destination+]">
+			<directory source="." destination=".anjuta">
+				<directory source="." destination="session">
+					<file source="anjuta.session"/>
+				</directory>
+			</directory>
+		</directory>
+	</content>
+
+	<action>
+		<open file="[+Destination+]/[+NameHLower+].anjuta"/>
+	</action>
+</project-template>
diff --git a/plugins/project-wizard/templates/vala-gtk/Makefile.am b/plugins/project-wizard/templates/vala-gtk/Makefile.am
new file mode 100644
index 0000000..398ea76
--- /dev/null
+++ b/plugins/project-wizard/templates/vala-gtk/Makefile.am
@@ -0,0 +1,9 @@
+SUBDIRS = src
+
+wizard_filesdir = $(anjuta_data_dir)/project/vala-gtk
+wizard_files_DATA = \
+	configure.ac.tpl
+
+EXTRA_DIST = $(wizard_files_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/plugins/project-wizard/templates/vala-gtk/configure.ac.tpl b/plugins/project-wizard/templates/vala-gtk/configure.ac.tpl
new file mode 100644
index 0000000..20a6960
--- /dev/null
+++ b/plugins/project-wizard/templates/vala-gtk/configure.ac.tpl
@@ -0,0 +1,29 @@
+[+ autogen5 template +]
+dnl Process this file with autoconf to produce a configure script.
+dnl Created by Anjuta application wizard.
+
+AC_INIT([+NameHLower+], [+Version+])
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+
+AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+AC_CONFIG_HEADERS([config.h])
+AM_MAINTAINER_MODE
+
+AC_PROG_CC
+
+[+IF (=(get "HaveSharedlib") "1")+]
+AM_PROG_LIBTOOL
+[+ENDIF+]
+
+dnl Check for vala
+AM_PROG_VALAC([0.10.0])
+
+[+IF (=(get "HavePackage") "1")+]
+PKG_CHECK_MODULES([+NameCUpper+], [[+PackageModule1+] [+PackageModule2+]])
+[+ENDIF+]
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+[+IF (=(get "HaveI18n") "1")+]po/Makefile.in[+ENDIF+]
+])
diff --git a/plugins/project-wizard/templates/vala-gtk/src/Makefile.am b/plugins/project-wizard/templates/vala-gtk/src/Makefile.am
new file mode 100644
index 0000000..8c5ca9c
--- /dev/null
+++ b/plugins/project-wizard/templates/vala-gtk/src/Makefile.am
@@ -0,0 +1,5 @@
+wizard_filesdir = $(anjuta_data_dir)/project/vala-gtk/src
+wizard_files_DATA = main.vala Makefile.am.tpl project.ui
+EXTRA_DIST = $(wizard_files_DATA)
+
+-include $(top_srcdir)/git.mk
diff --git a/plugins/project-wizard/templates/vala-gtk/src/Makefile.am.tpl b/plugins/project-wizard/templates/vala-gtk/src/Makefile.am.tpl
new file mode 100644
index 0000000..f3b5601
--- /dev/null
+++ b/plugins/project-wizard/templates/vala-gtk/src/Makefile.am.tpl
@@ -0,0 +1,37 @@
+[+ autogen5 template +]
+## Process this file with automake to produce Makefile.in
+
+## Created by Anjuta
+
+uidir = $(datadir)/[+NameHLower+]/ui
+ui_DATA = [+NameHLower+].ui
+
+AM_CPPFLAGS = \
+	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+	-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
+	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+	$([+NameCUpper+]_CFLAGS)
+
+AM_CFLAGS =\
+	 -Wall\
+	 -g
+
+VALAFLAGS = [+IF (not (= (get "PackageModule2") ""))+] --pkg [+(string-substitute (get "PackageModule2") " " " --pkg ")+] [+ENDIF+] \
+	--pkg gtk+-3.0
+
+bin_PROGRAMS = [+NameHLower+]
+
+[+NameCLower+]_SOURCES = \
+	[+NameHLower+].vala
+
+[+NameCLower+]_LDFLAGS = \
+	-Wl,--export-dynamic
+
+[+NameCLower+]_LDADD = $([+NameCUpper+]_LIBS)
+
+EXTRA_DIST = $(ui_DATA)
+
+# Remove ui directory on uninstall
+uninstall-local:
+	-rm -r $(uidir)
+	-rm -r $(datadir)/[+NameHLower+]
diff --git a/plugins/project-wizard/templates/vala-gtk/src/main.vala b/plugins/project-wizard/templates/vala-gtk/src/main.vala
new file mode 100644
index 0000000..9b2902d
--- /dev/null
+++ b/plugins/project-wizard/templates/vala-gtk/src/main.vala
@@ -0,0 +1,40 @@
+[+ autogen5 template +]
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * main.c
+ * Copyright (C) [+Author+] [+(shell "date +%Y")+] <[+Email+]>
+ * 
+[+CASE (get "License") +]
+[+ == "BSD"  +][+(bsd  (get "Name") (get "Author") " * ")+]
+[+ == "LGPL" +][+(lgpl (get "Name") (get "Author") " * ")+]
+[+ == "GPL"  +][+(gpl  (get "Name")                " * ")+]
+[+ESAC+] */
+
+using GLib;
+using Gtk;
+
+public void on_destroy (Window window) 
+{
+    Gtk.main_quit();
+}
+
+
+int main (string[] args) 
+{
+	Gtk.init (ref args);
+
+    try {
+        var builder = new Builder ();
+        builder.add_from_file ("[+NameHLower+].ui");
+        builder.connect_signals (null);
+
+		var window = builder.get_object ("window") as Window;
+        window.show_all ();
+        Gtk.main ();
+    } catch (Error e) {
+        stderr.printf ("Could not load UI: %s\n", e.message);
+        return 1;
+    } 
+
+    return 0;
+}
diff --git a/plugins/project-wizard/templates/vala-gtk/src/project.ui b/plugins/project-wizard/templates/vala-gtk/src/project.ui
new file mode 100644
index 0000000..f9338c6
--- /dev/null
+++ b/plugins/project-wizard/templates/vala-gtk/src/project.ui
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkWindow" id="window">
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">window</property>
+    <property name="default_width">500</property>
+    <property name="default_height">400</property>
+    <signal name="destroy" handler="on_destroy"/>
+    <child>
+      <placeholder/>
+    </child>
+  </object>
+</interface>
diff --git a/src/action-callbacks.c b/src/action-callbacks.c
index db8dd84..c8b8bb6 100644
--- a/src/action-callbacks.c
+++ b/src/action-callbacks.c
@@ -147,7 +147,7 @@ on_help_advanced_tutorial_activate (GtkAction *action, gpointer data)
 void
 on_help_faqs_activate (GtkAction *action, gpointer data)
 {
-	help_activate (data, "anjuta-faqs", "anjuta-faqs.xml");
+	help_activate (data, "anjuta-faqs", "index.page");
 }
 
 void



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