1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4; coding: utf-8 -*- */
4 * Copyright (C) 2010 Sébastien Granjoux
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.
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.
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.
30 #include "am-scanner.h"
31 #include "am-properties.h"
34 #include <libanjuta/interfaces/ianjuta-project.h>
36 #include <libanjuta/anjuta-debug.h>
38 #include <glib/gi18n.h>
45 *---------------------------------------------------------------------------*/
52 *---------------------------------------------------------------------------*/
55 amp_root_node_set_file (AmpRootNode
*root
, GFile
*new_file
)
57 return amp_group_node_set_file (&root
->base
, new_file
);
61 amp_root_node_new (GFile
*file
)
63 gchar
*name
= g_file_get_basename (file
);
64 AnjutaProjectNode
*node
;
66 node
= (AnjutaProjectNode
*)amp_group_node_new (file
, name
, FALSE
);
73 amp_root_node_new_valid (GFile
*file
, GError
**error
)
75 gchar
*name
= g_file_get_basename (file
);
76 AnjutaProjectNode
*node
;
78 node
= (AnjutaProjectNode
*)amp_group_node_new_valid (file
, name
, FALSE
, error
);
85 amp_root_node_free (AmpRootNode
*node
)
87 g_object_unref (G_OBJECT (node
));
91 /* GObjet implementation
92 *---------------------------------------------------------------------------*/
94 G_DEFINE_DYNAMIC_TYPE (AmpRootNode
, amp_root_node
, AMP_TYPE_GROUP_NODE
);
97 amp_root_node_init (AmpRootNode
*node
)
99 node
->base
.base
.type
= ANJUTA_PROJECT_GROUP
| ANJUTA_PROJECT_ROOT_GROUP
;
100 node
->base
.base
.properties_info
= amp_get_project_property_list();
101 node
->base
.base
.state
= ANJUTA_PROJECT_CAN_ADD_GROUP
|
102 ANJUTA_PROJECT_CAN_ADD_TARGET
|
103 ANJUTA_PROJECT_CAN_ADD_PACKAGE
,
104 ANJUTA_PROJECT_CAN_SAVE
;
108 amp_root_node_finalize (GObject
*object
)
110 G_OBJECT_CLASS (amp_root_node_parent_class
)->finalize (object
);
114 amp_root_node_class_init (AmpRootNodeClass
*klass
)
116 GObjectClass
* object_class
= G_OBJECT_CLASS (klass
);
118 object_class
->finalize
= amp_root_node_finalize
;
122 amp_root_node_class_finalize (AmpRootNodeClass
*klass
)
127 amp_root_node_register (GTypeModule
*module
)
129 amp_root_node_register_type (module
);