undo_cmds.c 2.97 KB
Newer Older
Elliot Lee's avatar
Elliot Lee committed
1
/* The GIMP -- an image manipulation program
Manish Singh's avatar
Manish Singh committed
2
 * Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis
Elliot Lee's avatar
Elliot Lee committed
3 4 5 6 7 8 9 10 11 12 13 14 15
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Elliot Lee's avatar
Elliot Lee committed
17 18
 */

Manish Singh's avatar
Manish Singh committed
19 20 21 22 23
/* NOTE: This file is autogenerated by pdbgen.pl. */

#include "procedural_db.h"

#include "undo.h"
24

Manish Singh's avatar
Manish Singh committed
25 26
static ProcRecord undo_push_group_start_proc;
static ProcRecord undo_push_group_end_proc;
Elliot Lee's avatar
Elliot Lee committed
27

Manish Singh's avatar
Manish Singh committed
28 29 30 31 32 33
void
register_undo_procs (void)
{
  procedural_db_register (&undo_push_group_start_proc);
  procedural_db_register (&undo_push_group_end_proc);
}
Elliot Lee's avatar
Elliot Lee committed
34 35 36 37

static Argument *
undo_push_group_start_invoker (Argument *args)
{
Manish Singh's avatar
Manish Singh committed
38 39
  gboolean success = TRUE;
  GimpImage *gimage;
Elliot Lee's avatar
Elliot Lee committed
40

Manish Singh's avatar
Manish Singh committed
41 42 43
  gimage = pdb_id_to_image (args[0].value.pdb_int);
  if (gimage == NULL)
    success = FALSE;
Elliot Lee's avatar
Elliot Lee committed
44 45 46 47 48 49 50

  if (success)
    undo_push_group_start (gimage, MISC_UNDO);

  return procedural_db_return_args (&undo_push_group_start_proc, success);
}

Manish Singh's avatar
Manish Singh committed
51
static ProcArg undo_push_group_start_inargs[] =
Elliot Lee's avatar
Elliot Lee committed
52
{
Manish Singh's avatar
Manish Singh committed
53 54
  {
    PDB_IMAGE,
Elliot Lee's avatar
Elliot Lee committed
55
    "image",
56
    "The ID of the image in which to pop an undo group"
Elliot Lee's avatar
Elliot Lee committed
57 58 59
  }
};

Manish Singh's avatar
Manish Singh committed
60
static ProcRecord undo_push_group_start_proc =
Elliot Lee's avatar
Elliot Lee committed
61 62
{
  "gimp_undo_push_group_start",
Manish Singh's avatar
Manish Singh committed
63 64
  "Starts a group undo.",
  "This function is used to start a group undo--necessary for logically combining two or more undo operations into a single operation. This call must be used in conjunction with a 'gimp-undo-push-group-end' call.",
65 66
  "Spencer Kimball & Peter Mattis",
  "Spencer Kimball & Peter Mattis",
Elliot Lee's avatar
Elliot Lee committed
67 68 69
  "1997",
  PDB_INTERNAL,
  1,
Manish Singh's avatar
Manish Singh committed
70
  undo_push_group_start_inargs,
Elliot Lee's avatar
Elliot Lee committed
71 72
  0,
  NULL,
Manish Singh's avatar
Manish Singh committed
73
  { { undo_push_group_start_invoker } }
Elliot Lee's avatar
Elliot Lee committed
74 75 76
};

static Argument *
Manish Singh's avatar
Manish Singh committed
77
undo_push_group_end_invoker (Argument *args)
Elliot Lee's avatar
Elliot Lee committed
78
{
Manish Singh's avatar
Manish Singh committed
79 80
  gboolean success = TRUE;
  GimpImage *gimage;
Elliot Lee's avatar
Elliot Lee committed
81

Manish Singh's avatar
Manish Singh committed
82 83 84
  gimage = pdb_id_to_image (args[0].value.pdb_int);
  if (gimage == NULL)
    success = FALSE;
Elliot Lee's avatar
Elliot Lee committed
85 86 87 88 89 90 91

  if (success)
    undo_push_group_end (gimage);

  return procedural_db_return_args (&undo_push_group_end_proc, success);
}

Manish Singh's avatar
Manish Singh committed
92
static ProcArg undo_push_group_end_inargs[] =
Elliot Lee's avatar
Elliot Lee committed
93
{
Manish Singh's avatar
Manish Singh committed
94 95
  {
    PDB_IMAGE,
Elliot Lee's avatar
Elliot Lee committed
96
    "image",
97
    "The ID of the image in which to pop an undo group"
Elliot Lee's avatar
Elliot Lee committed
98 99 100
  }
};

Manish Singh's avatar
Manish Singh committed
101
static ProcRecord undo_push_group_end_proc =
Elliot Lee's avatar
Elliot Lee committed
102 103
{
  "gimp_undo_push_group_end",
Manish Singh's avatar
Manish Singh committed
104 105
  "Finish a group undo.",
  "This function must be called once for each gimp-undo-push-group call that is made.",
106 107
  "Spencer Kimball & Peter Mattis",
  "Spencer Kimball & Peter Mattis",
Elliot Lee's avatar
Elliot Lee committed
108 109 110
  "1997",
  PDB_INTERNAL,
  1,
Manish Singh's avatar
Manish Singh committed
111
  undo_push_group_end_inargs,
Elliot Lee's avatar
Elliot Lee committed
112 113
  0,
  NULL,
Manish Singh's avatar
Manish Singh committed
114
  { { undo_push_group_end_invoker } }
Elliot Lee's avatar
Elliot Lee committed
115
};