1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
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 *---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*/
38 *---------------------------------------------------------------------------*/
41 npw_action_new_file (const gchar
*file
)
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
);
55 npw_action_new_command (const gchar
*command
)
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
);
69 npw_action_free (NPWAction
* action
)
71 g_free (action
->command
);
72 g_slice_free (NPWAction
, action
);
76 npw_action_get_type (const NPWAction
* action
)
82 npw_action_get_command (const NPWAction
* action
)
84 return action
->command
;
88 npw_action_get_file (const NPWAction
* action
)
90 return action
->command
;