~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to plug-ins/imagemap/imap_command.h

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *
6
6
 * Copyright (C) 1998-1999 Maurits Rijk  lpeek.mrijk@consunet.nl
7
7
 *
8
 
 * This program is free software; you can redistribute it and/or modify
 
8
 * This program is free software: you can redistribute it and/or modify
9
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
 
10
 * the Free Software Foundation; either version 3 of the License, or
11
11
 * (at your option) any later version.
12
12
 *
13
13
 * This program is distributed in the hope that it will be useful,
16
16
 * GNU General Public License for more details.
17
17
 *
18
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.
 
19
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
20
 *
22
21
 */
23
22
 
34
33
 
35
34
typedef enum {CMD_APPEND, CMD_DESTRUCT, CMD_IGNORE} CmdExecuteValue_t;
36
35
 
37
 
#define COMMAND_PROTO(class) \
38
 
static void class##_destruct(Command_t *command); \
39
 
static CmdExecuteValue_t class##_execute(Command_t *command); \
40
 
static void class##_undo(Command_t *command); \
41
 
static void class##_redo(Command_t *command)
42
 
 
43
36
struct CommandClass_t {
44
37
   void (*destruct)(Command_t*);
45
38
   CmdExecuteValue_t (*execute)(Command_t*);
50
43
struct Command_t {
51
44
   CommandClass_t      *class;
52
45
   CommandList_t       *sub_commands;
53
 
   const gchar         *name;
54
 
   gboolean             locked;
 
46
   const gchar         *name;
 
47
   gboolean             locked;
55
48
};
56
49
 
57
50
 
72
65
   CommandList_t *parent;
73
66
   gint undo_levels;
74
67
   GList *list;
75
 
   GList *undo;                 /* Pointer to current undo command */
76
 
   GList *redo;                 /* Pointer to current redo command */
 
68
   GList *undo;                 /* Pointer to current undo command */
 
69
   GList *redo;                 /* Pointer to current redo command */
77
70
   CommandListCallback_t update_cb;
78
71
};
79
72
 
91
84
 
92
85
Command_t *command_new(void (*func)(void));
93
86
Command_t *command_init(Command_t *command, const gchar *name,
94
 
                        CommandClass_t *class);
 
87
                        CommandClass_t *class);
95
88
void command_execute(Command_t *command);
96
89
void command_undo(Command_t *command);
97
90
void command_redo(Command_t *command);