Debian Codegraph @

geanygendoc/src/ggd-doc-setting.h

raw
1 /*
2 *
3 * GeanyGenDoc, a Geany plugin to ease generation of source code documentation
4 * Copyright (C) 2010-2011 Colomban Wendling <[email protected]>
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 3 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
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef H_GGD_DOC_SETTING
22 #define H_GGD_DOC_SETTING
23
24 #include <stdio.h>
25 #include <glib.h>
26 #include <ctpl/ctpl.h>
27
28 #include "ggd-tag-utils.h"
29 #include "ggd-macros.h"
30
31 G_BEGIN_DECLS
32 GGD_BEGIN_PLUGIN_API
33
34
35 /**
36 * _GgdPosition:
37 * @GGD_POS_BEFORE: Place the documentation before what it documents
38 * @GGD_POS_AFTER: Place the documentation after what it documents
39 * @GGD_POS_CURSOR: Place the documentation at the cursor's position
40 *
41 * Possible positions for documentation insertion.
42 */
43 typedef enum _GgdPosition
44 {
45 GGD_POS_BEFORE,
46 GGD_POS_AFTER,
47 GGD_POS_CURSOR
48 } GgdPosition;
49
50 /**
51 * _GgdPolicy:
52 * @GGD_POLICY_KEEP: Document the symbol
53 * @GGD_POLICY_FORWARD: Forward the documentation request to the parent symbol
54 * @GGD_POLICY_PASS: Ignore the symbol, do as if it didn't exist
55 *
56 * Possible policies for documenting symbols.
57 */
58 typedef enum _GgdPolicy
59 {
60 GGD_POLICY_KEEP,
61 GGD_POLICY_FORWARD,
62 GGD_POLICY_PASS/*,
63 GGD_POLICY_DUPLICATE*/
64 } GgdPolicy;
65
66 typedef struct _GgdDocSetting GgdDocSetting;
67
68 struct _GgdDocSetting
69 {
70 gint ref_count;
71 gchar *match;
72
73 CtplToken *template;
74 GgdPosition position;
75 GgdPolicy policy;
76 gboolean merge_children;
77 TMTagType matches;
78 gboolean autodoc_children;
79 };
80
81
82 GgdPosition ggd_position_from_string (const gchar *string);
83 GgdPolicy ggd_policy_from_string (const gchar *string);
84 gboolean ggd_merge_policy_from_string (const gchar *string);
85 #define ggd_match_from_string ggd_tag_type_from_name
86
87 GgdDocSetting *ggd_doc_setting_new (const gchar *match);
88 GgdDocSetting *ggd_doc_setting_ref (GgdDocSetting *setting);
89 void ggd_doc_setting_unref (GgdDocSetting *setting);
90 void ggd_doc_setting_dump (const GgdDocSetting *setting,
91 FILE *stream);
92 gboolean ggd_doc_setting_matches (const GgdDocSetting *setting,
93 const gchar *match,
94 gssize match_len);
95
96
97 GGD_END_PLUGIN_API
98 G_END_DECLS
99
100 #endif /* guard */