home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / message_cmds.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-31  |  3.9 KB  |  154 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 "appenv.h"
  24.  
  25. static ProcRecord message_proc;
  26. static ProcRecord message_get_handler_proc;
  27. static ProcRecord message_set_handler_proc;
  28.  
  29. void
  30. register_message_procs (void)
  31. {
  32.   procedural_db_register (&message_proc);
  33.   procedural_db_register (&message_get_handler_proc);
  34.   procedural_db_register (&message_set_handler_proc);
  35. }
  36.  
  37. static Argument *
  38. message_invoker (Argument *args)
  39. {
  40.   gboolean success = TRUE;
  41.   gchar *message;
  42.  
  43.   message = (gchar *) args[0].value.pdb_pointer;
  44.   if (message == NULL)
  45.     success = FALSE;
  46.  
  47.   if (success)
  48.     g_message (message, NULL, NULL);
  49.  
  50.   return procedural_db_return_args (&message_proc, success);
  51. }
  52.  
  53. static ProcArg message_inargs[] =
  54. {
  55.   {
  56.     PDB_STRING,
  57.     "message",
  58.     "Message to display in the dialog"
  59.   }
  60. };
  61.  
  62. static ProcRecord message_proc =
  63. {
  64.   "gimp_message",
  65.   "Displays a dialog box with a message.",
  66.   "Displays a dialog box with a message. Useful for status or error reporting.",
  67.   "Manish Singh",
  68.   "Manish Singh",
  69.   "1998",
  70.   PDB_INTERNAL,
  71.   1,
  72.   message_inargs,
  73.   0,
  74.   NULL,
  75.   { { message_invoker } }
  76. };
  77.  
  78. static Argument *
  79. message_get_handler_invoker (Argument *args)
  80. {
  81.   Argument *return_args;
  82.  
  83.   return_args = procedural_db_return_args (&message_get_handler_proc, TRUE);
  84.   return_args[1].value.pdb_int = message_handler;
  85.  
  86.   return return_args;
  87. }
  88.  
  89. static ProcArg message_get_handler_outargs[] =
  90. {
  91.   {
  92.     PDB_INT32,
  93.     "handler",
  94.     "The current handler type: { MESSAGE_BOX (0), CONSOLE (1), ERROR_CONSOLE (2) }"
  95.   }
  96. };
  97.  
  98. static ProcRecord message_get_handler_proc =
  99. {
  100.   "gimp_message_get_handler",
  101.   "Returns the current state of where warning messages are displayed.",
  102.   "This procedure returns the way g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.",
  103.   "Manish Singh",
  104.   "Manish Singh",
  105.   "1998",
  106.   PDB_INTERNAL,
  107.   0,
  108.   NULL,
  109.   1,
  110.   message_get_handler_outargs,
  111.   { { message_get_handler_invoker } }
  112. };
  113.  
  114. static Argument *
  115. message_set_handler_invoker (Argument *args)
  116. {
  117.   gboolean success = TRUE;
  118.   gint32 handler;
  119.  
  120.   handler = args[0].value.pdb_int;
  121.   if (handler < MESSAGE_BOX || handler > ERROR_CONSOLE)
  122.     success = FALSE;
  123.  
  124.   if (success)
  125.     message_handler = handler;
  126.  
  127.   return procedural_db_return_args (&message_set_handler_proc, success);
  128. }
  129.  
  130. static ProcArg message_set_handler_inargs[] =
  131. {
  132.   {
  133.     PDB_INT32,
  134.     "handler",
  135.     "The new handler type: { MESSAGE_BOX (0), CONSOLE (1), ERROR_CONSOLE (2) }"
  136.   }
  137. };
  138.  
  139. static ProcRecord message_set_handler_proc =
  140. {
  141.   "gimp_message_set_handler",
  142.   "Controls where warning messages are displayed.",
  143.   "This procedure controls how g_message warnings are displayed. They can be shown in a dialog box or printed on the console where gimp was started.",
  144.   "Manish Singh",
  145.   "Manish Singh",
  146.   "1998",
  147.   PDB_INTERNAL,
  148.   1,
  149.   message_set_handler_inargs,
  150.   0,
  151.   NULL,
  152.   { { message_set_handler_invoker } }
  153. };
  154.