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

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpmessage_pdb.c
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Lesser General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Lesser General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Lesser General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. /* NOTE: This file is autogenerated by pdbgen.pl */
  23.  
  24. #include "gimp.h"
  25.  
  26. /**
  27.  * gimp_message:
  28.  * @message: Message to display in the dialog.
  29.  *
  30.  * Displays a dialog box with a message.
  31.  *
  32.  * Displays a dialog box with a message. Useful for status or error
  33.  * reporting.
  34.  *
  35.  * Returns: TRUE on success.
  36.  */
  37. gboolean
  38. gimp_message (gchar *message)
  39. {
  40.   GimpParam *return_vals;
  41.   gint nreturn_vals;
  42.   gboolean success = TRUE;
  43.  
  44.   return_vals = gimp_run_procedure ("gimp_message",
  45.                     &nreturn_vals,
  46.                     GIMP_PDB_STRING, message,
  47.                     GIMP_PDB_END);
  48.  
  49.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  50.  
  51.   gimp_destroy_params (return_vals, nreturn_vals);
  52.  
  53.   return success;
  54. }
  55.  
  56. /**
  57.  * gimp_message_get_handler:
  58.  *
  59.  * Returns the current state of where warning messages are displayed.
  60.  *
  61.  * This procedure returns the way g_message warnings are displayed.
  62.  * They can be shown in a dialog box or printed on the console where
  63.  * gimp was started.
  64.  *
  65.  * Returns: The current handler type.
  66.  */
  67. GimpMessageHandlerType
  68. gimp_message_get_handler (void)
  69. {
  70.   GimpParam *return_vals;
  71.   gint nreturn_vals;
  72.   GimpMessageHandlerType handler = 0;
  73.  
  74.   return_vals = gimp_run_procedure ("gimp_message_get_handler",
  75.                     &nreturn_vals,
  76.                     GIMP_PDB_END);
  77.  
  78.   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  79.     handler = return_vals[1].data.d_int32;
  80.  
  81.   gimp_destroy_params (return_vals, nreturn_vals);
  82.  
  83.   return handler;
  84. }
  85.  
  86. /**
  87.  * gimp_message_set_handler:
  88.  * @handler: The new handler type.
  89.  *
  90.  * Controls where warning messages are displayed.
  91.  *
  92.  * This procedure controls how g_message warnings are displayed. They
  93.  * can be shown in a dialog box or printed on the console where gimp
  94.  * was started.
  95.  *
  96.  * Returns: TRUE on success.
  97.  */
  98. gboolean
  99. gimp_message_set_handler (GimpMessageHandlerType handler)
  100. {
  101.   GimpParam *return_vals;
  102.   gint nreturn_vals;
  103.   gboolean success = TRUE;
  104.  
  105.   return_vals = gimp_run_procedure ("gimp_message_set_handler",
  106.                     &nreturn_vals,
  107.                     GIMP_PDB_INT32, handler,
  108.                     GIMP_PDB_END);
  109.  
  110.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  111.  
  112.   gimp_destroy_params (return_vals, nreturn_vals);
  113.  
  114.   return success;
  115. }
  116.