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
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
2000-05-31 21:24:14 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
2000-05-31 21:24:14 +08:00
|
|
|
*
|
|
|
|
* 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
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2000-05-31 21:24:14 +08:00
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl */
|
2000-06-02 05:18:04 +08:00
|
|
|
|
2002-05-14 07:30:23 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-05-31 21:24:14 +08:00
|
|
|
#include "gimp.h"
|
|
|
|
|
2010-07-07 17:43:10 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION: gimpmessage
|
|
|
|
* @title: gimpmessage
|
|
|
|
* @short_description: Display a dialog box with a message.
|
|
|
|
*
|
|
|
|
* Display a dialog box with a message.
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-message",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
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;
|
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-message-get-handler",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
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
|
|
|
|
2005-08-03 06:52:23 +08:00
|
|
|
return_vals = gimp_run_procedure ("gimp-message-set-handler",
|
2006-04-12 18:27:31 +08:00
|
|
|
&nreturn_vals,
|
|
|
|
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
|
|
|
}
|