anjuta r4376 - in trunk: . plugins/project-wizard plugins/project-wizard/templates plugins/project-wizard/templates/gnome-applet plugins/project-wizard/templates/gnome-applet/po plugins/project-wizard/templates/gnome-applet/src plugins/project-wizard/templates/m4 plugins/project-wizard/templates/terminal



Author: sgranjoux
Date: Wed Nov  5 21:34:32 2008
New Revision: 4376
URL: http://svn.gnome.org/viewvc/anjuta?rev=4376&view=rev

Log:
	* (added) plugins/project-wizard/templates/m4/as-ac-expand.m4,
	(added) plugins/project-wizard/templates/m4/Makefile.am,
	(added) plugins/project-wizard/templates/gnome-applet.wiz,
	(added) plugins/project-wizard/templates/gnome-applet/configure.ac.tpl,
	(added) plugins/project-wizard/templates/gnome-applet/HACKING,
	(added) plugins/project-wizard/templates/gnome-applet/Makefile.am.tpl,
	(added) plugins/project-wizard/templates/gnome-applet/Makefile.am,
	(added) plugins/project-wizard/templates/gnome-applet/autogen.sh,
	(added) plugins/project-wizard/templates/gnome-applet/src/main.c,
	(added) plugins/project-wizard/templates/gnome-applet/src/Makefile.am.tpl,
	(added) plugins/project-wizard/templates/gnome-applet/src/GNOME_Applet.server.in.in,
	(added) plugins/project-wizard/templates/gnome-applet/src/Makefile.am,
	(added) plugins/project-wizard/templates/gnome-applet/po/Makefile.am,
	(added) plugins/project-wizard/templates/gnome-applet/po/POTFILES.in,
	plugins/project-wizard/templates/translatable-strings.h,
	plugins/project-wizard/templates/Makefile.am,
	configure.in:
	Fix #544583 Add support for gnome applet projects

	* plugins/project-wizard/templates/terminal/Makefile.am.tpl:
	intltool helper scripts are missing in packages created by project
	wizard

	* plugins/project-wizard/property.c:
	Fix #556147 Provide valid default directory for project


Added:
   trunk/plugins/project-wizard/templates/gnome-applet/
   trunk/plugins/project-wizard/templates/gnome-applet.wiz
   trunk/plugins/project-wizard/templates/gnome-applet/HACKING
   trunk/plugins/project-wizard/templates/gnome-applet/Makefile.am
   trunk/plugins/project-wizard/templates/gnome-applet/Makefile.am.tpl
   trunk/plugins/project-wizard/templates/gnome-applet/autogen.sh   (contents, props changed)
   trunk/plugins/project-wizard/templates/gnome-applet/configure.ac.tpl
   trunk/plugins/project-wizard/templates/gnome-applet/po/
   trunk/plugins/project-wizard/templates/gnome-applet/po/Makefile.am
   trunk/plugins/project-wizard/templates/gnome-applet/po/POTFILES.in
   trunk/plugins/project-wizard/templates/gnome-applet/src/
   trunk/plugins/project-wizard/templates/gnome-applet/src/GNOME_Applet.server.in.in
   trunk/plugins/project-wizard/templates/gnome-applet/src/Makefile.am
   trunk/plugins/project-wizard/templates/gnome-applet/src/Makefile.am.tpl
   trunk/plugins/project-wizard/templates/gnome-applet/src/main.c   (contents, props changed)
   trunk/plugins/project-wizard/templates/m4/
   trunk/plugins/project-wizard/templates/m4/Makefile.am
   trunk/plugins/project-wizard/templates/m4/as-ac-expand.m4
Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/plugins/project-wizard/property.c
   trunk/plugins/project-wizard/templates/Makefile.am
   trunk/plugins/project-wizard/templates/terminal/Makefile.am.tpl
   trunk/plugins/project-wizard/templates/translatable-strings.h

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Wed Nov  5 21:34:32 2008
@@ -1050,6 +1050,10 @@
 plugins/project-wizard/templates/sdl/src/Makefile
 plugins/project-wizard/templates/sdl/po/Makefile
 plugins/project-wizard/templates/licenses/Makefile
+plugins/project-wizard/templates/gnome-applet/Makefile
+plugins/project-wizard/templates/gnome-applet/src/Makefile
+plugins/project-wizard/templates/gnome-applet/po/Makefile
+plugins/project-wizard/templates/m4/Makefile
 plugins/language-support-cpp-java/Makefile
 plugins/run-program/Makefile
 plugins/scratchbox/Makefile

Modified: trunk/plugins/project-wizard/property.c
==============================================================================
--- trunk/plugins/project-wizard/property.c	(original)
+++ trunk/plugins/project-wizard/property.c	Wed Nov  5 21:34:32 2008
@@ -35,6 +35,7 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <ctype.h>
 
 #include <libanjuta/anjuta-debug.h>
 
@@ -278,9 +279,48 @@
 		gtk_button_set_label (button, _("No"));
 }
 
+static void
+cb_browse_button_clicked (GtkButton *button, NPWProperty* prop)
+{
+	GtkWidget *dialog;
+	
+	switch (prop->type)
+	{
+	case NPW_DIRECTORY_PROPERTY:
+		dialog = gtk_file_chooser_dialog_new (_("Select directory"),
+												 GTK_WINDOW (gtk_widget_get_ancestor (prop->widget, GTK_TYPE_WINDOW)),
+												 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
+												 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+				      							 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+				      							 NULL);
+		break;
+	case NPW_FILE_PROPERTY:
+		dialog = gtk_file_chooser_dialog_new (_("Select file"),
+												 GTK_WINDOW (gtk_widget_get_ancestor (prop->widget, GTK_TYPE_WINDOW)),
+												 GTK_FILE_CHOOSER_ACTION_SAVE,
+												 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+				      							 GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+				      							 NULL);
+		break;
+	default:
+		g_return_if_reached ();
+	}
+
+	if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+  	{
+    	char *filename;
+
+    	filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+		gtk_entry_set_text (GTK_ENTRY (prop->widget), filename);
+    	g_free (filename);
+  	}
+	gtk_widget_destroy (dialog);
+}
+
 GtkWidget*
 npw_property_create_widget (NPWProperty* this)
 {
+	GtkWidget* widget = NULL;
 	GtkWidget* entry;
 	const gchar* value;
 
@@ -309,23 +349,42 @@
 		if (value) gtk_entry_set_text (GTK_ENTRY (entry), value);
 		break;
 	case NPW_DIRECTORY_PROPERTY:
-		entry = gtk_file_chooser_button_new (_("Choose directory"),
-											 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
-		if (value)
+	case NPW_FILE_PROPERTY:
+		if ((this->options & NPW_EXIST_SET_OPTION) && !(this->options & NPW_EXIST_OPTION))
 		{
-			gchar* uri = gnome_vfs_make_uri_from_input (value);
-			gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (entry), uri);
-			g_free (uri);
+			GtkWidget *button;
+			
+			// Use an entry box and a browse button as GtkFileChooserButton
+			// allow to select only existing file
+			widget = gtk_hbox_new (FALSE, 3);
+			
+			entry = gtk_entry_new ();
+			if (value) gtk_entry_set_text (GTK_ENTRY (entry), value);
+			gtk_container_add (GTK_CONTAINER (widget), entry);
+			
+			button = gtk_button_new_from_stock (GTK_STOCK_OPEN);
+			g_signal_connect (button, "clicked", G_CALLBACK (cb_browse_button_clicked), this);
+			gtk_container_add (GTK_CONTAINER (widget), button);
+			gtk_box_set_child_packing (GTK_BOX (widget), button, FALSE, TRUE, 0, GTK_PACK_END);
 		}
-		break;
-	case NPW_FILE_PROPERTY:
-		entry = gtk_file_chooser_button_new (_("Choose file"),
-											 GTK_FILE_CHOOSER_ACTION_OPEN);
-		if (value) 
-		{
-			gchar* uri = gnome_vfs_make_uri_from_input (value);
-			gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (entry), uri);
-			g_free (uri);
+		else
+		{
+			if (this->type == NPW_DIRECTORY_PROPERTY)
+			{
+				entry = gtk_file_chooser_button_new (_("Choose directory"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
+			}
+			else
+			{
+				entry = gtk_file_chooser_button_new (_("Choose file"),
+												 GTK_FILE_CHOOSER_ACTION_OPEN);
+			}
+				
+			if (value)
+			{
+				gchar* uri = gnome_vfs_make_uri_from_input (value);
+				gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (entry), uri);
+				g_free (uri);
+			}
 		}
 		break;
 	case NPW_ICON_PROPERTY:
@@ -358,8 +417,9 @@
 		return NULL;
 	}
 	this->widget = entry;
+	
 
-	return entry;
+	return widget == NULL ? entry : widget;
 }
 
 void
@@ -430,8 +490,16 @@
 		break;
 	case NPW_DIRECTORY_PROPERTY:
 	case NPW_FILE_PROPERTY:
-		alloc_value = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (this->widget));
-		value = alloc_value;
+		if ((this->options & NPW_EXIST_SET_OPTION) && !(this->options & NPW_EXIST_OPTION))
+		{
+			/* a GtkEntry is used in this case*/
+			value = gtk_entry_get_text (GTK_ENTRY (this->widget));
+		}
+		else
+		{
+			alloc_value = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (this->widget));
+			value = alloc_value;
+		}
 		break;
 	case NPW_ICON_PROPERTY:
 		alloc_value = gnome_icon_entry_get_filename (GNOME_ICON_ENTRY (this->widget));

Modified: trunk/plugins/project-wizard/templates/Makefile.am
==============================================================================
--- trunk/plugins/project-wizard/templates/Makefile.am	(original)
+++ trunk/plugins/project-wizard/templates/Makefile.am	Wed Nov  5 21:34:32 2008
@@ -1,7 +1,7 @@
 
 SUBDIRS = minimal terminal cpp gtk anjuta-plugin anjuta-plugin-vala gnome \
 	gtkmm wxwin xlib xlib-dock gcj java \
-	python mkfile sdl licenses
+	python mkfile sdl licenses gnome-applet m4
 
 wizard_filesdir = $(anjuta_data_dir)/project
 wizard_files_DATA = \
@@ -35,7 +35,8 @@
 	mkfile.wiz \
 	mkfile-logo.png \
 	sdl.wiz \
-	appwiz_sdl.png
+	appwiz_sdl.png \
+	gnome-applet.wiz
 
 
 BUILT_SOURCES = translatable-strings.h extract-translatable-strings.pl

Added: trunk/plugins/project-wizard/templates/gnome-applet.wiz
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet.wiz	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,96 @@
+<project-wizard>
+	<_name>GNOME Applet</_name>
+	<_description>A GNOME applet project</_description>
+	<icon>gnome-logo.png</icon>
+	<category>C</category>
+	<required-program>automake</required-program>
+	<required-program>autoconf</required-program>
+	<required-program>make</required-program>
+	<required-package>libgnome-2.0 >= 2.14</required-package>
+	<required-package>libpanelapplet-2.0 >= 2.14</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="gnome-applet" 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" 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="icon" name="Icon" _label="Icon File:" _description="Icon file for the plugin" summary="yes" mandatory="yes"/>
+	<property type="string" name="Title" _label="Applet Title:" _description="Display title of the applet" default="GNOME Applet" summary="yes" mandatory="yes"/>
+	<property type="string" name="Description" _label="Description:" _description="Display description of the applet" default="A sample demonstration GNOME applet created by Anjuta" summary="yes" mandatory="yes"/>
+	<property type="hidden" name="PackageModule1" default="libgnome-2.0 >= 2.14 libpanelapplet-2.0 >= 2.14"/>
+	<property type="boolean" name="HaveLangCPP" _label="Add C++ support:" _description="Adds C++ support to the project so that C++ source files can be built" default="0"/>
+	<property type="boolean" name="HaveI18n" _label="Add internationalization:" _description="Adds support for internationalization so that your project can have translations in different languages" 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="string" 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"/>
+	<property type="string" name="PackageModule3" _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'"/>
+	<property type="string" name="PackageModule4" _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'"/>
+	<property type="string" name="PackageModule5" _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'"/>
+</page>
+[+ENDIF+]
+
+<content>
+	<directory source="terminal" destination="[+Destination+]">
+		<file source="AUTHORS"/>
+		<file source="ChangeLog"/>
+		<file source="NEWS"/>
+		<file source="README"/>
+		<file destination="[+NameHLower+].anjuta" source="project.anjuta"/>
+		<file source="cvsignore" destination=".cvsignore"/>
+		<directory source="src">
+			<file source="cvsignore" destination=".cvsignore"/>
+		</directory>
+		[+IF (=(get "HaveI18n") "1") +]
+		<directory source="po">
+			<file source="ChangeLog"/>
+			<file source="POTFILES.in"/>
+			<file source="LINGUAS" />
+			<file source="cvsignore" destination=".cvsignore"/>
+		</directory>
+		[+ENDIF+]
+	</directory>
+	<directory source="." destination="[+Destination+]">
+		<directory source="m4">
+			<file source="as-ac-expand.m4"/>
+		</directory>
+	</directory>
+	<directory source="gnome-applet" destination="[+Destination+]">
+		<file source="configure.ac.tpl" destination="configure.ac"/>
+		<file source="Makefile.am.tpl" destination="Makefile.am"/>
+		<file source="autogen.sh" executable="yes"/>
+		<file source="HACKING"/>
+		<directory source="src">
+			<file source="main.c"/>
+			<file source="GNOME_Applet.server.in.in" destination="[+Name+].server.in.in"/>
+			<file source="Makefile.am.tpl" destination="Makefile.am"/>
+		</directory>
+	</directory>
+	<directory source="licenses" destination="[+Destination+]">
+		<file source="[+License+]" destination="COPYING"/>	
+	</directory>
+</content>
+
+<action>
+	<run command="sh -c &quot;cd [+(raw-shell-str (get "Destination"))+] &amp;&amp; ./autogen.sh&quot;"/>
+	<open file="[+Destination+]/[+NameHLower+].anjuta"/>
+</action>

Added: trunk/plugins/project-wizard/templates/gnome-applet/HACKING
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/HACKING	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,33 @@
+Some tips for hacking/debugging the applets:
+
+1) The Panel Applet Writer's Reference Manual, including the PanelApplet
+   library documentation, can be found at 
+   http://developer.gnome.org/doc/API/2.0/panel-applet/libpanel-applet.html,
+   or in gnome-panel/doc/reference/panel-applet (source). It is not
+   completely up to date, but it covers the basics of writing an applet.
+
+2) Look at the other applet implementations. One of the simpler applets is
+   the fish applet, which lives in gnome-panel/applets/fish.
+
+3) Read the article about debugging GNOME Applets at 
+   http://www.davyd.id.au/articles/debugging-gnome-applets.shtml.
+   This article also contains a list of common considerations when developing
+   applets. Please, please read this article, it covers everything you're
+   likely to need to know. If you find anything is missing, then contact
+   the maintainers.
+
+4) Be weary of static, global variables if you plan to allow the user
+   to be able to add multiple instances of the applet. Each instance will
+   share the static varible. This is described in the debugging article, under
+   "Other considerations".
+
+5) You'd probably want to run the applets from CVS, without nescessarily doing
+   the same with all of GNOME. To do this, install the applets from CVS to a
+   different prefix than the rest of GNOME, and change your bonobo servers 
+   directory to $prefix/lib/bonobo/servers. You'll find the config file by
+   running "bonobo-activation-sysconf --config-file-path". Add the directory to
+   as an <item> at the top of <searchpath>. Log out, run bonobo-slay and make
+   sure no bonobo processes are running. When you log in again, your applets
+   should be running from the new prefix.
+   Running single applets from CVS is described further in Davyd's debugging
+   article.

Added: trunk/plugins/project-wizard/templates/gnome-applet/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/Makefile.am	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,11 @@
+
+SUBDIRS = src po
+
+wizard_filesdir = $(anjuta_data_dir)/project/gnome-applet
+wizard_files_DATA = \
+	configure.ac.tpl \
+	autogen.sh \
+	Makefile.am.tpl \
+	HACKING
+
+EXTRA_DIST = $(wizard_files_DATA)

Added: trunk/plugins/project-wizard/templates/gnome-applet/Makefile.am.tpl
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/Makefile.am.tpl	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,42 @@
+[+ autogen5 template +]
+## Process this file with automake to produce Makefile.in
+## Created by Anjuta
+
+SUBDIRS = src [+IF (=(get "HaveI18n") "1") +]po[+ENDIF+]
+
+ACLOCAL_AMFLAGS = -I m4
+
+[+NameCLower+]docdir = ${prefix}/doc/[+NameHLower+]
+[+NameCLower+]doc_DATA = \
+	README\
+	COPYING\
+	AUTHORS\
+	ChangeLog\
+	INSTALL\
+	NEWS
+
+[+IF (=(get "HaveI18n") "1") +]
+INTLTOOL_FILES = intltool-extract.in \
+	intltool-merge.in \
+	intltool-update.in
+
+EXTRA_DIST = $([+NameCLower+]doc_DATA) \
+	$(INTLTOOL_FILES)
+
+DISTCLEANFILES = intltool-extract \
+	intltool-merge \
+	intltool-update \
+	po/.intltool-merge-cache
+[+ELSE+]
+EXTRA_DIST = $([+NameCLower+]doc_DATA)
+[+ENDIF+]
+
+
+# Copy all the spec files. Of cource, only one is actually used.
+dist-hook:
+	for specfile in *.spec; do \
+		if test -f $$specfile; then \
+			cp -p $$specfile $(distdir); \
+		fi \
+	done
+

Added: trunk/plugins/project-wizard/templates/gnome-applet/autogen.sh
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/autogen.sh	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,23 @@
+[+ autogen5 template +]
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="[+Name+]"
+
+(test -f $srcdir/configure.ac \
+  && test -d $srcdir/src) || {
+	echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+	echo " top-level $PKG_NAME directory"
+	exit 1
+}
+
+which gnome-autogen.sh || {
+	echo "You need to install gnome-common from GNOME SVN and make"
+	echo "sure the gnome-autogen.sh script is in your \$PATH."
+	exit 1
+}
+
+REQUIRED_AUTOMAKE_VERSION=1.9 USE_GNOME2_MACROS=1 . gnome-autogen.sh

Added: trunk/plugins/project-wizard/templates/gnome-applet/configure.ac.tpl
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/configure.ac.tpl	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,48 @@
+[+ autogen5 template +]
+dnl Process this file with autoconf to produce a configure script.
+dnl Created by Anjuta application wizard.
+
+AC_INIT([+NameHLower+], [+Version+])
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+AC_CONFIG_HEADERS([config.h])
+AM_MAINTAINER_MODE
+
+AC_ISC_POSIX
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+
+[+IF (=(get "HaveLangCPP") "1")+]
+AC_PROG_CPP
+AC_PROG_CXX
+[+ENDIF+]
+
+[+IF (=(get "HaveI18n") "1")+]
+dnl ***************************************************************************
+dnl Internatinalization
+dnl ***************************************************************************
+GETTEXT_PACKAGE=[+NameHLower+]
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
+AC_DEFINE_DIR(GNOMELOCALEDIR, "${datadir}/locale", [locale directory])
+AM_GLIB_GNU_GETTEXT
+IT_PROG_INTLTOOL([0.35.0])
+[+ENDIF+]
+
+PKG_CHECK_MODULES(GNOME_APPLETS, libpanelapplet-2.0) 
+[+IF (=(get "HavePackage") "1")+]
+PKG_CHECK_MODULES([+NameCUpper+], [[+PackageModule1+] [+PackageModule2+] [+PackageModule3+] [+PackageModule4+] [+PackageModule5+]])
+[+ENDIF+]
+
+AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
+AC_SUBST(LIBEXECDIR)
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+src/[+Name+].server.in
+[+IF (=(get "HaveI18n") "1")+]po/Makefile.in[+ENDIF+]
+])

Added: trunk/plugins/project-wizard/templates/gnome-applet/po/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/po/Makefile.am	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,3 @@
+wizard_filesdir = $(anjuta_data_dir)/project/gnome/po
+wizard_files_DATA = POTFILES.in
+EXTRA_DIST = $(wizard_files_DATA)

Added: trunk/plugins/project-wizard/templates/gnome-applet/po/POTFILES.in
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/po/POTFILES.in	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,5 @@
+[+ autogen5 template +]
+# List of source files containing translatable strings.
+
+src/main.c
+

Added: trunk/plugins/project-wizard/templates/gnome-applet/src/GNOME_Applet.server.in.in
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/src/GNOME_Applet.server.in.in	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,22 @@
+[+ autogen5 template +]
+<oaf_info>
+	<oaf_server iid="OAFIID:[+Name+]Applet_Factory" type="exe" location="@LIBEXECDIR@/[+NameHLower+]">
+		<oaf_attribute name="repo_ids" type="stringv">
+			<item value="IDL:Bonobo/GenericFactory:1.0"/>
+			<item value="IDL:Bonobo/Unknown:1.0"/>
+		</oaf_attribute>
+		<oaf_attribute name="name" type="string" value="[+Title+] applet Factory"/>
+		<oaf_attribute name="description" type="string" value="[+Description+]"/>
+	</oaf_server>
+
+	<oaf_server iid="OAFIID:[+Name+]Applet" type="factory" location="OAFIID:[+Name+]Applet_Factory">
+		<oaf_attribute name="repo_ids" type="stringv">
+			<item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
+			<item value="IDL:Bonobo/Control:1.0"/>
+			<item value="IDL:Bonobo/Unknown:1.0"/>
+		</oaf_attribute>
+		<oaf_attribute name="name" type="string" value="[+Title+]"/>
+		<oaf_attribute name="description" type="string" value="GNOME applet created by Anjuta"/>
+		<oaf_attribute name="panel:icon" type="string" value="[+Icon+]"/>
+	</oaf_server>
+</oaf_info>

Added: trunk/plugins/project-wizard/templates/gnome-applet/src/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/src/Makefile.am	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,7 @@
+wizard_filesdir = $(anjuta_data_dir)/project/gnome-applet/src
+
+wizard_files_DATA = main.c \
+		    Makefile.am.tpl \
+		    GNOME_Applet.server.in.in 
+
+EXTRA_DIST = $(wizard_files_DATA)

Added: trunk/plugins/project-wizard/templates/gnome-applet/src/Makefile.am.tpl
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/src/Makefile.am.tpl	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,54 @@
+[+ autogen5 template +]
+## Process this file with automake to produce Makefile.in
+
+## Created by Anjuta
+
+AM_CPPFLAGS = \
+	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+	-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
+	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+	$([+NameCUpper+]_CFLAGS)
+
+AM_CFLAGS =\
+	 -Wall\
+	 -g
+
+libexec_PROGRAMS = [+NameHLower+]
+
+[+NameCLower+]_SOURCES = \
+	main.c
+
+[+NameCLower+]_LDFLAGS = \
+	-Wl,--export-dynamic
+
+[+NameCLower+]_LDADD = $([+NameCUpper+]_LIBS)
+
+serverdir       = $(libdir)/bonobo/servers
+server_in_files = [+Name+].server.in
+server_DATA     = $(server_in_files:.server.in=.server)
+
+CLEANFILES = $(server_in_files) $(server_DATA)
+
+EXTRA_DIST = \
+	[+Name+].server.in.in
+
+[+IF (=(get "HaveI18n") "1")+]
+%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po)
+	LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_buildir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@
+[+ELSE+]
+%.server: %.server.in
+	cp $< $@
+[+ENDIF+]
+
+# Display a message at the end of install
+install-data-hook:
+	@echo "***"
+	@echo "*** If you have installed your applet in a non standard directory. You have to"
+	@echo "*** add it in the bonobo server list, so it can find your applet."
+	@echo "***"
+	@echo "*** Run 'bonobo-activation-sysconf --add-directory=$(serverdir)'"
+	@echo "*** Log out from your current GNOME session"
+	@echo "*** Run 'bonobo-slay'"
+	@echo "*** Check that the bonobo server is not running"
+	@echo "*** Log in again, your applet should be available"
+	@echo "***"

Added: trunk/plugins/project-wizard/templates/gnome-applet/src/main.c
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/gnome-applet/src/main.c	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,44 @@
+[+ 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  "main.c" (get "Author") " * ")+]
+[+ == "LGPL" +][+(lgpl "main.c" (get "Author") " * ")+]
+[+ == "GPL"  +][+(gpl  "main.c"                " * ")+]
+[+ESAC+] */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <panel-applet.h>
+
+static gboolean
+applet_factory (PanelApplet *applet, const gchar *iid, gpointer user_data)
+{
+	GtkWidget *label;
+
+	if (strcmp (iid, "OAFIID:[+Name+]Applet") != 0)
+		return FALSE;
+
+	label = gtk_label_new ("Hello World");
+	gtk_container_add (GTK_CONTAINER (applet), label);
+
+	gtk_widget_show_all (GTK_WIDGET (applet));
+
+	return TRUE;
+}
+
+PANEL_APPLET_BONOBO_FACTORY ("OAFIID:[+Name+]Applet_Factory",
+                             PANEL_TYPE_APPLET,
+                             "[+Title+]",
+                             "0",
+                             applet_factory,
+                             NULL);
+

Added: trunk/plugins/project-wizard/templates/m4/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/m4/Makefile.am	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,6 @@
+wizard_filesdir = $(anjuta_data_dir)/project/m4
+
+wizard_files_DATA = \
+	as-ac-expand.m4
+
+EXTRA_DIST = $(wizard_files_DATA)

Added: trunk/plugins/project-wizard/templates/m4/as-ac-expand.m4
==============================================================================
--- (empty file)
+++ trunk/plugins/project-wizard/templates/m4/as-ac-expand.m4	Wed Nov  5 21:34:32 2008
@@ -0,0 +1,49 @@
+dnl as-ac-expand.m4 0.2.0                                   -*- autoconf -*-
+dnl autostars m4 macro for expanding directories using configure's prefix
+
+dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
+
+dnl Copying and distribution of this file, with or without modification,
+dnl are permitted in any medium without royalty provided the copyright
+dnl notice and this notice are preserved.
+
+dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
+
+dnl example:
+dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
+
+AC_DEFUN([AS_AC_EXPAND],
+[
+  EXP_VAR=[$1]
+  FROM_VAR=[$2]
+
+  dnl first expand prefix and exec_prefix if necessary
+  prefix_save=$prefix
+  exec_prefix_save=$exec_prefix
+
+  dnl if no prefix given, then use /usr/local, the default prefix
+  if test "x$prefix" = "xNONE"; then
+    prefix="$ac_default_prefix"
+  fi
+  dnl if no exec_prefix given, then use prefix
+  if test "x$exec_prefix" = "xNONE"; then
+    exec_prefix=$prefix
+  fi
+
+  full_var="$FROM_VAR"
+  dnl loop until it doesn't change anymore
+  while true; do
+    new_full_var="`eval echo $full_var`"
+    if test "x$new_full_var" = "x$full_var"; then break; fi
+    full_var=$new_full_var
+  done
+
+  dnl clean up
+  full_var=$new_full_var
+  AC_SUBST([$1], "$full_var")
+
+  dnl restore prefix and exec_prefix
+  prefix=$prefix_save
+  exec_prefix=$exec_prefix_save
+])

Modified: trunk/plugins/project-wizard/templates/terminal/Makefile.am.tpl
==============================================================================
--- trunk/plugins/project-wizard/templates/terminal/Makefile.am.tpl	(original)
+++ trunk/plugins/project-wizard/templates/terminal/Makefile.am.tpl	Wed Nov  5 21:34:32 2008
@@ -13,7 +13,21 @@
 	INSTALL\
 	NEWS
 
+[+IF (=(get "HaveI18n") "1") +]
+INTLTOOL_FILES = intltool-extract.in \
+	intltool-merge.in \
+	intltool-update.in
+
+EXTRA_DIST = $([+NameCLower+]doc_DATA) \
+	$(INTLTOOL_FILES)
+
+DISTCLEANFILES = intltool-extract \
+	intltool-merge \
+	intltool-update \
+	po/.intltool-merge-cache
+[+ELSE+]
 EXTRA_DIST = $([+NameCLower+]doc_DATA)
+[+ENDIF+]
 
 # Copy all the spec files. Of cource, only one is actually used.
 dist-hook:

Modified: trunk/plugins/project-wizard/templates/translatable-strings.h
==============================================================================
--- trunk/plugins/project-wizard/templates/translatable-strings.h	(original)
+++ trunk/plugins/project-wizard/templates/translatable-strings.h	Wed Nov  5 21:34:32 2008
@@ -1,3 +1,4 @@
+char *s = N_("A GNOME applet project");
 char *s = N_("A generic C++ project");
 char *s = N_("A generic GNOME project");
 char *s = N_("A generic GTK+ project");
@@ -20,6 +21,7 @@
 char *s = N_("Adds support for internationalization so that your project can have translations in different languages");
 char *s = N_("Anjuta Plugin");
 char *s = N_("Anjuta plugin project that uses libanjuta framework");
+char *s = N_("Applet Title:");
 char *s = N_("Author:");
 char *s = N_("Basic information");
 char *s = N_("Berkeley Software Distribution License (BSD)");
@@ -28,14 +30,18 @@
 char *s = N_("Configure external packages:");
 char *s = N_("Create a template glade interface file");
 char *s = N_("Create glade interface file");
+char *s = N_("Description:");
 char *s = N_("Destination:");
+char *s = N_("Display description of the applet");
 char *s = N_("Display description of the plugin");
+char *s = N_("Display title of the applet");
 char *s = N_("Display title of the plugin");
 char *s = N_("Django Project");
 char *s = N_("Django Project information");
 char *s = N_("Email address:");
 char *s = N_("GCJ needs to know which class contains the main() function");
 char *s = N_("GNOME");
+char *s = N_("GNOME Applet");
 char *s = N_("GTK+");
 char *s = N_("GTKmm");
 char *s = N_("General Project Information");



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