2005-11-22 12:26:26 +00:00
|
|
|
/*
|
|
|
|
* templates.h - this file is part of Geany, a fast and lightweight IDE
|
|
|
|
*
|
2011-01-19 19:39:09 +00:00
|
|
|
* Copyright 2005-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
|
|
|
* Copyright 2006-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
2005-11-22 12:26:26 +00:00
|
|
|
*
|
|
|
|
* 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 2 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, write to the Free Software
|
2006-05-10 19:54:44 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-11-22 12:26:26 +00:00
|
|
|
*/
|
|
|
|
|
2009-10-26 12:58:52 +00:00
|
|
|
/**
|
|
|
|
* @file templates.h
|
|
|
|
* Templates (prefs).
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#ifndef GEANY_TEMPLATES_H
|
|
|
|
#define GEANY_TEMPLATES_H 1
|
|
|
|
|
2012-03-28 22:50:18 -07:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2011-03-15 16:51:47 +00:00
|
|
|
#define GEANY_TEMPLATES_INDENT 3
|
|
|
|
|
2007-07-04 11:32:33 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
GEANY_TEMPLATE_GPL = 0,
|
|
|
|
GEANY_TEMPLATE_BSD,
|
|
|
|
GEANY_TEMPLATE_FILEHEADER,
|
|
|
|
GEANY_TEMPLATE_CHANGELOG,
|
|
|
|
GEANY_TEMPLATE_FUNCTION,
|
|
|
|
GEANY_MAX_TEMPLATES
|
|
|
|
};
|
2006-11-14 16:03:25 +00:00
|
|
|
|
2008-05-16 12:08:39 +00:00
|
|
|
|
2009-10-26 12:58:52 +00:00
|
|
|
/** Template preferences. */
|
2008-05-16 12:08:39 +00:00
|
|
|
typedef struct GeanyTemplatePrefs
|
|
|
|
{
|
2009-10-26 12:58:52 +00:00
|
|
|
gchar *developer; /**< Name */
|
|
|
|
gchar *company; /**< Company */
|
|
|
|
gchar *mail; /**< Email */
|
|
|
|
gchar *initials; /**< Initials */
|
|
|
|
gchar *version; /**< Initial version */
|
2008-07-13 11:51:00 +00:00
|
|
|
gchar *year_format;
|
|
|
|
gchar *date_format;
|
|
|
|
gchar *datetime_format;
|
2008-05-16 12:08:39 +00:00
|
|
|
}
|
|
|
|
GeanyTemplatePrefs;
|
|
|
|
|
|
|
|
extern GeanyTemplatePrefs template_prefs;
|
|
|
|
|
|
|
|
|
2007-07-04 11:32:33 +00:00
|
|
|
struct filetype;
|
2007-06-14 13:10:51 +00:00
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
void templates_init(void);
|
|
|
|
|
2007-07-04 11:32:33 +00:00
|
|
|
gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname);
|
2006-11-14 16:03:25 +00:00
|
|
|
|
2010-01-24 14:52:46 +00:00
|
|
|
gchar *templates_get_template_changelog(GeanyDocument *doc);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2010-01-24 14:52:46 +00:00
|
|
|
gchar *templates_get_template_function(GeanyDocument *doc, const gchar *func_name);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2010-01-24 14:52:46 +00:00
|
|
|
gchar *templates_get_template_licence(GeanyDocument *doc, gint licence_type);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2012-03-28 22:50:18 -07:00
|
|
|
void templates_replace_common(GString *tmpl, const gchar *fname,
|
2010-04-22 13:01:45 +00:00
|
|
|
GeanyFiletype *ft, const gchar *func_name);
|
|
|
|
|
|
|
|
void templates_replace_valist(GString *text,
|
|
|
|
const gchar *first_wildcard, ...) G_GNUC_NULL_TERMINATED;
|
2010-01-24 14:52:46 +00:00
|
|
|
|
2007-06-14 13:10:51 +00:00
|
|
|
void templates_free_templates(void);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2012-03-28 22:50:18 -07:00
|
|
|
G_END_DECLS
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#endif
|