search: Use G_REGEX_MULTILINE for find in files.
[anjuta.git] / plugins / am-project / amp-root.c
blob93e49fc3fa9987db430fef6f196bbad9a6f5b172
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4; coding: utf-8 -*- */
2 /* am-root.c
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.
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
27 #include "amp-root.h"
29 #include "amp-node.h"
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>
40 #include <memory.h>
41 #include <string.h>
42 #include <ctype.h>
44 /* Types
45 *---------------------------------------------------------------------------*/
51 /* Root object
52 *---------------------------------------------------------------------------*/
54 gboolean
55 amp_root_node_set_file (AmpRootNode *root, GFile *new_file)
57 return amp_group_node_set_file (&root->base, new_file);
60 AnjutaProjectNode*
61 amp_root_node_new (GFile *file)
63 return (AnjutaProjectNode *)amp_group_node_new (file, FALSE);
66 AnjutaProjectNode*
67 amp_root_node_new_valid (GFile *file, GError **error)
69 return (AnjutaProjectNode *)amp_group_node_new_valid (file, FALSE, error);
72 void
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);
84 static void
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;
95 static void
96 amp_root_node_finalize (GObject *object)
98 G_OBJECT_CLASS (amp_root_node_parent_class)->finalize (object);
101 static void
102 amp_root_node_class_init (AmpRootNodeClass *klass)
104 GObjectClass* object_class = G_OBJECT_CLASS (klass);
106 object_class->finalize = amp_root_node_finalize;
109 static void
110 amp_root_node_class_finalize (AmpRootNodeClass *klass)
114 void
115 amp_root_node_register (GTypeModule *module)
117 amp_root_node_register_type (module);