home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / undo_cmds.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-02-23  |  3.1 KB  |  116 lines

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995-2000 Spencer Kimball and Peter Mattis
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  */
  18.  
  19. /* NOTE: This file is autogenerated by pdbgen.pl. */
  20.  
  21. #include "procedural_db.h"
  22.  
  23. #include "undo.h"
  24.  
  25. static ProcRecord undo_push_group_start_proc;
  26. static ProcRecord undo_push_group_end_proc;
  27.  
  28. void
  29. register_undo_procs (void)
  30. {
  31.   procedural_db_register (&undo_push_group_start_proc);
  32.   procedural_db_register (&undo_push_group_end_proc);
  33. }
  34.  
  35. static Argument *
  36. undo_push_group_start_invoker (Argument *args)
  37. {
  38.   gboolean success = TRUE;
  39.   GimpImage *gimage;
  40.  
  41.   gimage = pdb_id_to_image (args[0].value.pdb_int);
  42.   if (gimage == NULL)
  43.     success = FALSE;
  44.  
  45.   if (success)
  46.     undo_push_group_start (gimage, MISC_UNDO);
  47.  
  48.   return procedural_db_return_args (&undo_push_group_start_proc, success);
  49. }
  50.  
  51. static ProcArg undo_push_group_start_inargs[] =
  52. {
  53.   {
  54.     PDB_IMAGE,
  55.     "image",
  56.     "The ID of the image in which to pop an undo group"
  57.   }
  58. };
  59.  
  60. static ProcRecord undo_push_group_start_proc =
  61. {
  62.   "gimp_undo_push_group_start",
  63.   "Starts a group undo.",
  64.   "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.   "Spencer Kimball & Peter Mattis",
  66.   "Spencer Kimball & Peter Mattis",
  67.   "1997",
  68.   PDB_INTERNAL,
  69.   1,
  70.   undo_push_group_start_inargs,
  71.   0,
  72.   NULL,
  73.   { { undo_push_group_start_invoker } }
  74. };
  75.  
  76. static Argument *
  77. undo_push_group_end_invoker (Argument *args)
  78. {
  79.   gboolean success = TRUE;
  80.   GimpImage *gimage;
  81.  
  82.   gimage = pdb_id_to_image (args[0].value.pdb_int);
  83.   if (gimage == NULL)
  84.     success = FALSE;
  85.  
  86.   if (success)
  87.     undo_push_group_end (gimage);
  88.  
  89.   return procedural_db_return_args (&undo_push_group_end_proc, success);
  90. }
  91.  
  92. static ProcArg undo_push_group_end_inargs[] =
  93. {
  94.   {
  95.     PDB_IMAGE,
  96.     "image",
  97.     "The ID of the image in which to pop an undo group"
  98.   }
  99. };
  100.  
  101. static ProcRecord undo_push_group_end_proc =
  102. {
  103.   "gimp_undo_push_group_end",
  104.   "Finish a group undo.",
  105.   "This function must be called once for each gimp-undo-push-group call that is made.",
  106.   "Spencer Kimball & Peter Mattis",
  107.   "Spencer Kimball & Peter Mattis",
  108.   "1997",
  109.   PDB_INTERNAL,
  110.   1,
  111.   undo_push_group_end_inargs,
  112.   0,
  113.   NULL,
  114.   { { undo_push_group_end_invoker } }
  115. };
  116.