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., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, 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 return (AnjutaProjectNode
*)amp_group_node_new (file
, FALSE
);
67 amp_root_node_new_valid (GFile
*file
, GError
**error
)
69 return (AnjutaProjectNode
*)amp_group_node_new_valid (file
, FALSE
, error
);
73 amp_root_node_free (AmpRootNode
*node
)
75 g_object_unref (G_OBJECT (node
));
79 /* GObjet implementation
80 *---------------------------------------------------------------------------*/
82 G_DEFINE_DYNAMIC_TYPE (AmpRootNode
, amp_root_node
, AMP_TYPE_GROUP_NODE
);
85 amp_root_node_init (AmpRootNode
*node
)
87 node
->base
.base
.type
= ANJUTA_PROJECT_GROUP
| ANJUTA_PROJECT_ROOT_GROUP
;
88 node
->base
.base
.properties_info
= amp_get_project_property_list();
89 node
->base
.base
.state
= ANJUTA_PROJECT_CAN_ADD_GROUP
|
90 ANJUTA_PROJECT_CAN_ADD_TARGET
|
91 ANJUTA_PROJECT_CAN_ADD_PACKAGE
,
92 ANJUTA_PROJECT_CAN_SAVE
;
96 amp_root_node_finalize (GObject
*object
)
98 G_OBJECT_CLASS (amp_root_node_parent_class
)->finalize (object
);
102 amp_root_node_class_init (AmpRootNodeClass
*klass
)
104 GObjectClass
* object_class
= G_OBJECT_CLASS (klass
);
106 object_class
->finalize
= amp_root_node_finalize
;
110 amp_root_node_class_finalize (AmpRootNodeClass
*klass
)
115 amp_root_node_register (GTypeModule
*module
)
117 amp_root_node_register_type (module
);