project-wizard: bgo #732672 - Suggestion to use a Glade prompted handler name rather...
[anjuta.git] / plugins / project-wizard / action.c
blob211a2494a052d3507c4a833d86383980a6760d74
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 action.c
4 Copyright (C) 2004 Sebastien Granjoux
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (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
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 * Actions data read in .wiz file
23 *---------------------------------------------------------------------------*/
25 #include <config.h>
27 #include "action.h"
29 /*---------------------------------------------------------------------------*/
31 struct _NPWAction {
32 NPWActionType type;
33 gchar* command;
36 /* Action object
38 *---------------------------------------------------------------------------*/
40 NPWAction*
41 npw_action_new_file (const gchar *file)
43 NPWAction* action;
45 g_return_val_if_fail (file != NULL, NULL);
47 action = g_slice_new (NPWAction);
48 action->type = NPW_OPEN_ACTION;
49 action->command = g_strdup (file);
51 return action;
54 NPWAction*
55 npw_action_new_command (const gchar *command)
57 NPWAction* action;
59 g_return_val_if_fail (command != NULL, NULL);
61 action = g_slice_new (NPWAction);
62 action->type = NPW_RUN_ACTION;
63 action->command = g_strdup (command);
65 return action;
68 void
69 npw_action_free (NPWAction* action)
71 g_free (action->command);
72 g_slice_free (NPWAction, action);
75 NPWActionType
76 npw_action_get_type (const NPWAction* action)
78 return action->type;
81 const gchar*
82 npw_action_get_command (const NPWAction* action)
84 return action->command;
87 const gchar*
88 npw_action_get_file (const NPWAction* action)
90 return action->command;