2
* This is a plug-in for the GIMP.
4
* Generates clickable image maps.
6
* Copyright (C) 1998-1999 Maurits Rijk lpeek.mrijk@consunet.nl
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28
#include "imap_commands.h"
30
#include "libgimp/stdplugins-intl.h"
32
static CmdExecuteValue_t move_to_front_command_execute(Command_t *parent);
34
static CommandClass_t move_to_front_command_class = {
35
NULL, /* move_to_front_command_destruct, */
36
move_to_front_command_execute,
37
NULL, /* move_to_front_command_undo */
38
NULL /* move_to_front_command_redo */
44
} MoveToFrontCommand_t;
47
move_to_front_command_new(ObjectList_t *list)
49
MoveToFrontCommand_t *command = g_new(MoveToFrontCommand_t, 1);
51
return command_init(&command->parent, _("Move To Front"),
52
&move_to_front_command_class);
56
remove_one_object(Object_t *obj, gpointer data)
58
MoveToFrontCommand_t *command = (MoveToFrontCommand_t*) data;
59
command_add_subcommand(&command->parent,
60
delete_command_new(command->list, obj));
64
add_one_object(Object_t *obj, gpointer data)
66
MoveToFrontCommand_t *command = (MoveToFrontCommand_t*) data;
67
command_add_subcommand(&command->parent,
68
create_command_new(command->list, obj));
71
static CmdExecuteValue_t
72
move_to_front_command_execute(Command_t *parent)
74
MoveToFrontCommand_t *command = (MoveToFrontCommand_t*) parent;
77
id1 = object_list_add_remove_cb(command->list, remove_one_object, command);
78
id2 = object_list_add_add_cb(command->list, add_one_object, command);
80
object_list_move_to_front(command->list);
81
object_list_remove_remove_cb(command->list, id1);
82
object_list_remove_add_cb(command->list, id2);