2000-05-31 21:24:14 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2003-07-03 08:47:26 +08:00
|
|
|
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* gimpmessage_pdb.c
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
2000-06-02 05:18:04 +08:00
|
|
|
* Lesser General Public License for more details.
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2000-06-02 05:18:04 +08:00
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl */
|
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-05-31 21:24:14 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_message:
|
|
|
|
* @message: Message to display in the dialog.
|
|
|
|
*
|
|
|
|
* Displays a dialog box with a message.
|
|
|
|
*
|
|
|
|
* Displays a dialog box with a message. Useful for status or error
|
2003-06-06 21:12:44 +08:00
|
|
|
* reporting. The message must be in UTF-8 encoding.
|
2000-08-25 07:06:53 +08:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2003-07-02 09:20:08 +08:00
|
|
|
gimp_message (const gchar *message)
|
2000-05-31 21:24:14 +08:00
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-05-31 21:24:14 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-05-31 21:24:14 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_message",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_STRING, message,
|
|
|
|
GIMP_PDB_END);
|
2000-05-31 21:24:14 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-05-31 21:24:14 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-05-31 21:24:14 +08:00
|
|
|
}
|
2000-06-02 05:18:04 +08:00
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_message_get_handler:
|
|
|
|
*
|
|
|
|
* Returns the current state of where warning messages are displayed.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Returns: The current handler type.
|
|
|
|
*/
|
2000-06-02 05:18:04 +08:00
|
|
|
GimpMessageHandlerType
|
|
|
|
gimp_message_get_handler (void)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 05:18:04 +08:00
|
|
|
gint nreturn_vals;
|
|
|
|
GimpMessageHandlerType handler = 0;
|
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_message_get_handler",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_END);
|
2000-06-02 05:18:04 +08:00
|
|
|
|
2000-08-03 09:35:28 +08:00
|
|
|
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
|
2000-06-02 05:18:04 +08:00
|
|
|
handler = return_vals[1].data.d_int32;
|
|
|
|
|
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
|
|
|
|
|
|
|
return handler;
|
|
|
|
}
|
|
|
|
|
2000-08-25 07:06:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_message_set_handler:
|
|
|
|
* @handler: The new handler type.
|
|
|
|
*
|
|
|
|
* Controls where warning messages are displayed.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean
|
2000-06-02 05:18:04 +08:00
|
|
|
gimp_message_set_handler (GimpMessageHandlerType handler)
|
|
|
|
{
|
2000-08-03 09:35:28 +08:00
|
|
|
GimpParam *return_vals;
|
2000-06-02 05:18:04 +08:00
|
|
|
gint nreturn_vals;
|
2000-08-23 09:44:59 +08:00
|
|
|
gboolean success = TRUE;
|
2000-06-02 05:18:04 +08:00
|
|
|
|
|
|
|
return_vals = gimp_run_procedure ("gimp_message_set_handler",
|
|
|
|
&nreturn_vals,
|
2000-08-03 09:35:28 +08:00
|
|
|
GIMP_PDB_INT32, handler,
|
|
|
|
GIMP_PDB_END);
|
2000-06-02 05:18:04 +08:00
|
|
|
|
2000-08-23 09:44:59 +08:00
|
|
|
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
|
|
|
|
|
2000-06-02 05:18:04 +08:00
|
|
|
gimp_destroy_params (return_vals, nreturn_vals);
|
2000-08-23 09:44:59 +08:00
|
|
|
|
|
|
|
return success;
|
2000-06-02 05:18:04 +08:00
|
|
|
}
|