Updated Spanish translation
[anjuta.git] / plugins / am-project / amp-object.c
blob805d76fceaf8d740f77d1acadd55aa200fe8988b
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4; coding: utf-8 -*- */
2 /* am-object.c
4 * Copyright (C) 2011 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.
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
27 #include "amp-object.h"
29 #include "amp-node.h"
30 #include "am-scanner.h"
31 #include "am-properties.h"
32 #include "am-writer.h"
35 #include <libanjuta/interfaces/ianjuta-project.h>
37 #include <libanjuta/anjuta-debug.h>
39 #include <glib/gi18n.h>
41 #include <memory.h>
42 #include <string.h>
43 #include <ctype.h>
45 /* Types
46 *---------------------------------------------------------------------------*/
48 struct _AmpObjectNode {
49 AnjutaProjectNode base;
55 /* Object object
56 *---------------------------------------------------------------------------*/
58 AnjutaProjectNode*
59 amp_object_node_new (GFile *file, AnjutaProjectNodeType type)
61 AmpObjectNode *node = NULL;
63 node = g_object_new (AMP_TYPE_OBJECT_NODE, NULL);
64 node->base.file = g_object_ref (file);
65 node->base.type = ANJUTA_PROJECT_OBJECT | type;
67 return ANJUTA_PROJECT_NODE (node);
70 AnjutaProjectNode*
71 amp_object_node_new_valid (GFile *file, AnjutaProjectNodeType type, GError **error)
73 return amp_object_node_new (file, type);
76 void
77 amp_object_node_free (AmpObjectNode *node)
79 g_object_unref (G_OBJECT (node));
82 /* AmpNode implementation
83 *---------------------------------------------------------------------------*/
85 static gboolean
86 amp_object_node_update (AmpNode *node, AmpNode *new_node)
89 return TRUE;
92 static gboolean
93 amp_object_node_write (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
95 return TRUE;
98 static gboolean
99 amp_object_node_erase (AmpNode *node, AmpNode *parent, AmpProject *project, GError **error)
101 return TRUE;
107 /* GObjet implementation
108 *---------------------------------------------------------------------------*/
110 typedef struct _AmpObjectNodeClass AmpObjectNodeClass;
112 struct _AmpObjectNodeClass {
113 AmpNodeClass parent_class;
116 G_DEFINE_DYNAMIC_TYPE (AmpObjectNode, amp_object_node, AMP_TYPE_NODE);
118 static void
119 amp_object_node_init (AmpObjectNode *node)
121 node->base.type = ANJUTA_PROJECT_OBJECT;
122 node->base.properties_info = NULL;
123 node->base.state = 0;
126 static void
127 amp_object_node_finalize (GObject *object)
129 AmpObjectNode *node = AMP_OBJECT_NODE (object);
131 G_OBJECT_CLASS (amp_object_node_parent_class)->finalize (object);
134 static void
135 amp_object_node_class_init (AmpObjectNodeClass *klass)
137 GObjectClass* object_class = G_OBJECT_CLASS (klass);
138 AmpNodeClass* node_class;
140 object_class->finalize = amp_object_node_finalize;
142 node_class = AMP_NODE_CLASS (klass);
143 node_class->update = amp_object_node_update;
144 node_class->write = amp_object_node_write;
145 node_class->erase = amp_object_node_erase;
148 static void
149 amp_object_node_class_finalize (AmpObjectNodeClass *klass)
153 void
154 amp_object_node_register (GTypeModule *module)
156 amp_object_node_register_type (module);