2006-12-09 13:33:38 -08:00
/* GIMP - The GNU Image Manipulation Program
2003-07-02 17:47:26 -07:00
* Copyright ( C ) 1995 - 2003 Spencer Kimball and Peter Mattis
1999-05-03 12:22:58 -07:00
*
2009-01-17 14:28:01 -08:00
* This program is free software : you can redistribute it and / or modify
1999-05-03 12:22:58 -07:00
* it under the terms of the GNU General Public License as published by
2009-01-17 14:28:01 -08:00
* the Free Software Foundation ; either version 3 of the License , or
1999-05-03 12:22:58 -07:00
* ( at your option ) any later version .
*
* This program 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 General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2018-07-11 14:47:19 -07:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
1999-05-03 12:22:58 -07:00
*/
2007-01-09 02:52:47 -08:00
/* NOTE: This file is auto-generated by pdbgen.pl. */
1999-05-03 12:22:58 -07:00
2000-12-29 07:22:01 -08:00
# include "config.h"
2003-06-13 07:37:00 -07:00
# include <string.h>
2000-12-29 07:22:01 -08:00
2008-10-09 13:24:04 -07:00
# include <gegl.h>
2000-12-29 07:22:01 -08:00
2012-05-02 18:36:22 -07:00
# include <gdk-pixbuf/gdk-pixbuf.h>
2012-05-03 15:50:23 -07:00
# include "libgimpbase/gimpbase.h"
2001-08-17 07:27:31 -07:00
# include "pdb-types.h"
1999-05-03 12:22:58 -07:00
2001-12-01 13:02:34 -08:00
# include "core/gimp.h"
2008-02-07 09:08:54 -08:00
# include "core/gimpparamspecs.h"
2006-05-03 11:05:06 -07:00
# include "plug-in/gimpplugin.h"
2006-04-28 15:26:51 -07:00
# include "plug-in/gimppluginmanager.h"
1999-05-03 12:22:58 -07:00
2008-02-07 09:08:54 -08:00
# include "gimppdb.h"
# include "gimpprocedure.h"
2008-04-04 04:15:55 -07:00
# include "internal-procs.h"
2006-10-31 11:02:56 -08:00
2008-02-07 09:08:54 -08:00
# include "gimp-intl.h"
1999-05-03 12:22:58 -07:00
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
message_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-05-03 12:22:58 -07:00
{
gboolean success = TRUE ;
2006-04-02 09:03:32 -07:00
const gchar * message ;
1999-05-03 12:22:58 -07:00
2012-05-03 15:50:23 -07:00
message = g_value_get_string ( gimp_value_array_index ( args , 0 ) ) ;
1999-05-03 12:22:58 -07:00
if ( success )
2003-06-06 06:12:44 -07:00
{
2007-03-12 06:04:32 -07:00
const gchar * domain = NULL ;
2006-07-18 23:50:34 -07:00
2006-04-28 15:26:51 -07:00
if ( gimp - > plug_in_manager - > current_plug_in )
2006-07-18 23:50:34 -07:00
domain = gimp_plug_in_get_undo_desc ( gimp - > plug_in_manager - > current_plug_in ) ;
2006-10-09 01:17:22 -07:00
gimp_show_message ( gimp , G_OBJECT ( progress ) , GIMP_MESSAGE_WARNING ,
2018-02-11 16:59:08 -08:00
domain , message ) ;
2003-06-06 06:12:44 -07:00
}
1999-05-03 12:22:58 -07:00
2008-08-16 06:57:57 -07:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-05-03 12:22:58 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
message_get_handler_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-05-03 12:22:58 -07:00
{
2012-05-03 15:50:23 -07:00
GimpValueArray * return_vals ;
2006-03-15 07:00:01 -08:00
gint32 handler = 0 ;
handler = gimp - > message_handler ;
1999-05-03 12:22:58 -07:00
2008-08-16 06:57:57 -07:00
return_vals = gimp_procedure_get_return_values ( procedure , TRUE , NULL ) ;
2012-05-03 15:50:23 -07:00
g_value_set_enum ( gimp_value_array_index ( return_vals , 1 ) , handler ) ;
1999-05-03 12:22:58 -07:00
2006-03-27 13:09:32 -08:00
return return_vals ;
1999-05-03 12:22:58 -07:00
}
2012-05-03 15:50:23 -07:00
static GimpValueArray *
2012-05-28 10:55:28 -07:00
message_set_handler_invoker ( GimpProcedure * procedure ,
2012-05-03 15:50:23 -07:00
Gimp * gimp ,
GimpContext * context ,
GimpProgress * progress ,
const GimpValueArray * args ,
GError * * error )
1999-05-03 12:22:58 -07:00
{
gboolean success = TRUE ;
gint32 handler ;
2012-05-03 15:50:23 -07:00
handler = g_value_get_enum ( gimp_value_array_index ( args , 0 ) ) ;
1999-05-03 12:22:58 -07:00
if ( success )
2006-03-15 07:00:01 -08:00
{
gimp - > message_handler = handler ;
}
1999-05-03 12:22:58 -07:00
2008-08-16 06:57:57 -07:00
return gimp_procedure_get_return_values ( procedure , success ,
error ? * error : NULL ) ;
1999-05-03 12:22:58 -07:00
}
2006-04-04 14:11:45 -07:00
void
2006-04-26 02:13:47 -07:00
register_message_procs ( GimpPDB * pdb )
1999-05-03 12:22:58 -07:00
{
2006-04-04 14:11:45 -07:00
GimpProcedure * procedure ;
/*
* gimp - message
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( message_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-message " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-message " ,
" Displays a dialog box with a message. " ,
" Displays a dialog box with a message. Useful for status or error reporting. The message must be in UTF-8 encoding. " ,
" Manish Singh " ,
" Manish Singh " ,
" 1998 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
gimp_param_spec_string ( " message " ,
" message " ,
" Message to display in the dialog " ,
2007-04-25 07:23:05 -07:00
FALSE , FALSE , FALSE ,
2006-04-04 14:11:45 -07:00
NULL ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2006-04-04 14:11:45 -07:00
/*
* gimp - message - get - handler
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( message_get_handler_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-message-get-handler " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" 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. " ,
" Manish Singh " ,
" Manish Singh " ,
" 1998 " ,
NULL ) ;
gimp_procedure_add_return_value ( procedure ,
g_param_spec_enum ( " handler " ,
" handler " ,
2006-05-18 10:25:15 -07:00
" The current handler type " ,
2006-04-04 14:11:45 -07:00
GIMP_TYPE_MESSAGE_HANDLER_TYPE ,
GIMP_MESSAGE_BOX ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2006-04-04 14:11:45 -07:00
/*
* gimp - message - set - handler
*/
2006-04-06 03:01:30 -07:00
procedure = gimp_procedure_new ( message_set_handler_invoker ) ;
2008-04-04 03:58:56 -07:00
gimp_object_set_static_name ( GIMP_OBJECT ( procedure ) ,
" gimp-message-set-handler " ) ;
2006-04-04 14:11:45 -07:00
gimp_procedure_set_static_strings ( procedure ,
" gimp-message-set-handler " ,
" 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. " ,
" Manish Singh " ,
" Manish Singh " ,
" 1998 " ,
NULL ) ;
gimp_procedure_add_argument ( procedure ,
g_param_spec_enum ( " handler " ,
" handler " ,
2006-05-18 10:25:15 -07:00
" The new handler type " ,
2006-04-04 14:11:45 -07:00
GIMP_TYPE_MESSAGE_HANDLER_TYPE ,
GIMP_MESSAGE_BOX ,
GIMP_PARAM_READWRITE ) ) ;
2006-04-26 02:13:47 -07:00
gimp_pdb_register_procedure ( pdb , procedure ) ;
2006-04-07 01:16:26 -07:00
g_object_unref ( procedure ) ;
2006-04-04 14:11:45 -07:00
}