1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4; coding: utf-8 -*- */
2 /* amp-target.h
3  *
4  * Copyright (C) 2010  Sébastien Granjoux
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (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 GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _AMP_TARGET_H_
23 #define _AMP_TARGET_H_
24 
25 #include "am-project-private.h"
26 #include "am-scanner.h"
27 
28 #include <glib-object.h>
29 
30 #include <libanjuta/anjuta-project.h>
31 #include <libanjuta/anjuta-token.h>
32 #include <libanjuta/anjuta-token-file.h>
33 
34 G_BEGIN_DECLS
35 
36 /* Type macros
37  *---------------------------------------------------------------------------*/
38 
39 #define AMP_TYPE_TARGET_NODE							(amp_target_node_get_type ())
40 #define AMP_TARGET_NODE(obj)							(G_TYPE_CHECK_INSTANCE_CAST ((obj), AMP_TYPE_TARGET_NODE, AmpTargetNode))
41 
42 GType amp_target_node_get_type (void) G_GNUC_CONST;
43 
44 typedef enum {
45 	AM_TARGET_TOKEN_TARGET,
46 	AM_TARGET_TOKEN_SOURCES,
47 	AM_TARGET_TOKEN_LAST
48 } AmpTargetNodeTokenCategory;
49 
50 typedef enum _AmpTargetNodeFlag
51 {
52 	AM_TARGET_CHECK = 1 << 0,
53 	AM_TARGET_NOINST = 1 << 1,
54 	AM_TARGET_DIST = 1 << 2,
55 	AM_TARGET_NODIST = 1 << 3,
56 	AM_TARGET_NOBASE = 1 << 4,
57 	AM_TARGET_NOTRANS = 1 << 5,
58 	AM_TARGET_MAN = 1 << 6,
59 	AM_TARGET_MAN_SECTION = 31 << 7
60 } AmpTargetNodeFlag;
61 
62 void amp_target_node_register (GTypeModule *module);
63 
64 void amp_target_node_add_token (AmpTargetNode *target, AmTokenType type, AnjutaToken *token);
65 void amp_target_node_remove_token (AmpTargetNode *target, AnjutaToken *token);
66 GList * amp_target_node_get_token (AmpTargetNode *target, AmTokenType type);
67 GList * amp_target_node_get_all_token (AmpTargetNode *target);
68 void amp_target_node_set_type (AmpTargetNode *target, AmTokenType type);
69 AnjutaTokenType amp_target_node_get_first_token_type (AmpTargetNode *target);
70 AnjutaTokenType amp_target_node_get_next_token_type (AmpTargetNode *target, AnjutaTokenType type);
71 AmpTargetNode* amp_target_node_new (const gchar *name, AnjutaProjectNodeType type, const gchar *install, gint flags);
72 AmpTargetNode* amp_target_node_new_valid (const gchar *name, AnjutaProjectNodeType type, const gchar *install, gint flags, AnjutaProjectNode *parent, GError **error);
73 void amp_target_node_free (AmpTargetNode *node);
74 void amp_target_node_update_node (AmpTargetNode *node, AmpTargetNode *new_node);
75 const gchar *amp_target_node_get_install_directory (AmpTargetNode *node);
76 void amp_target_changed (AmpTargetNode *node);
77 
78 G_END_DECLS
79 
80 #endif /* _AM_TARGET_H_ */
81