geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

templates.h
Go to the documentation of this file.
1/*
2 * templates.h - this file is part of Geany, a fast and lightweight IDE
3 *
4 * Copyright 2005 The Geany contributors
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21/**
22 * @file templates.h
23 * Templates (prefs).
24 **/
25
26
27#ifndef GEANY_TEMPLATES_H
28#define GEANY_TEMPLATES_H 1
29
30#include "document.h"
31#include "filetypes.h"
32
33#include <glib.h>
34
35G_BEGIN_DECLS
36
37/** Template preferences. */
38typedef struct GeanyTemplatePrefs
39{
40 gchar *developer; /**< Name */
41 gchar *company; /**< Company */
42 gchar *mail; /**< Email */
43 gchar *initials; /**< Initials */
44 gchar *version; /**< Initial version */
48}
50
51
52gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname);
53
54
55#ifdef GEANY_PRIVATE
56
57struct filetype;
58
59#define GEANY_TEMPLATES_INDENT 3
60#define GEANY_TEMPLATES_FORMAT_YEAR C_("DefaultYear", "%Y")
61#define GEANY_TEMPLATES_FORMAT_DATE C_("DefaultDate", "%Y-%m-%d")
62#define GEANY_TEMPLATES_FORMAT_DATETIME C_("DefaultDateTime", "%d.%m.%Y %H:%M:%S %Z")
63
64enum
65{
66 GEANY_TEMPLATE_GPL = 0,
67 GEANY_TEMPLATE_BSD,
68 GEANY_TEMPLATE_FILEHEADER,
69 GEANY_TEMPLATE_CHANGELOG,
70 GEANY_TEMPLATE_FUNCTION,
71 GEANY_MAX_TEMPLATES
72};
73
74
76
77
78void templates_init(void);
79
81
82gchar *templates_get_template_function(GeanyDocument *doc, const gchar *func_name);
83
84gchar *templates_get_template_licence(GeanyDocument *doc, gint licence_type);
85
86void templates_replace_common(GString *tmpl, const gchar *fname,
87 GeanyFiletype *ft, const gchar *func_name);
88
89void templates_replace_valist(GString *text,
90 const gchar *first_wildcard, ...) G_GNUC_NULL_TERMINATED;
91
93
94#endif /* GEANY_PRIVATE */
95
96G_END_DECLS
97
98#endif /* GEANY_TEMPLATES_H */
Document related actions: new, save, open, etc.
gchar * text
Definition: editor.c:83
Filetype detection, file extensions and filetype menu items.
Structure for representing an open tab with all its properties.
Definition: document.h:81
Represents a filetype.
Definition: filetypes.h:144
Template preferences.
Definition: templates.h:39
gchar * initials
Initials.
Definition: templates.h:43
gchar * mail
Email.
Definition: templates.h:42
gchar * year_format
Definition: templates.h:45
gchar * company
Company.
Definition: templates.h:41
gchar * version
Initial version.
Definition: templates.h:44
gchar * datetime_format
Definition: templates.h:47
gchar * date_format
Definition: templates.h:46
gchar * developer
Name.
Definition: templates.h:40
void templates_replace_common(GString *tmpl, const gchar *fname, GeanyFiletype *ft, const gchar *func_name)
Definition: templates.c:139
gchar * templates_get_template_changelog(GeanyDocument *doc)
Definition: templates.c:488
void templates_init(void)
Definition: templates.c:308
GeanyTemplatePrefs template_prefs
Definition: templates.c:50
void templates_free_templates(void)
Definition: templates.c:517
gchar * templates_get_template_function(GeanyDocument *doc, const gchar *func_name)
Definition: templates.c:470
gchar * templates_get_template_licence(GeanyDocument *doc, gint licence_type)
Definition: templates.c:419
void templates_replace_valist(GString *text, const gchar *first_wildcard,...)
Definition: templates.c:547
gchar * templates_get_template_fileheader(gint filetype_idx, const gchar *fname)
Definition: templates.c:457
struct GeanyTemplatePrefs GeanyTemplatePrefs
Template preferences.