1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
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.
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.
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.
19
/* NOTE: This file is auto-generated by pdbgen.pl. */
25
#include <glib-object.h>
27
#include "pdb-types.h"
29
#include "gimpprocedure.h"
30
#include "core/gimpparamspecs.h"
32
#include "core/gimp.h"
33
#include "gimp-intl.h"
34
#include "plug-in/gimpplugin.h"
35
#include "plug-in/gimppluginmanager.h"
37
#include "internal_procs.h"
41
message_invoker (GimpProcedure *procedure,
44
GimpProgress *progress,
45
const GValueArray *args)
47
gboolean success = TRUE;
50
message = g_value_get_string (&args->values[0]);
54
const gchar *domain = NULL;
56
if (gimp->plug_in_manager->current_plug_in)
57
domain = gimp_plug_in_get_undo_desc (gimp->plug_in_manager->current_plug_in);
58
gimp_show_message (gimp, G_OBJECT (progress), GIMP_MESSAGE_WARNING,
62
return gimp_procedure_get_return_values (procedure, success);
66
message_get_handler_invoker (GimpProcedure *procedure,
69
GimpProgress *progress,
70
const GValueArray *args)
72
GValueArray *return_vals;
75
handler = gimp->message_handler;
77
return_vals = gimp_procedure_get_return_values (procedure, TRUE);
78
g_value_set_enum (&return_vals->values[1], handler);
84
message_set_handler_invoker (GimpProcedure *procedure,
87
GimpProgress *progress,
88
const GValueArray *args)
90
gboolean success = TRUE;
93
handler = g_value_get_enum (&args->values[0]);
97
gimp->message_handler = handler;
100
return gimp_procedure_get_return_values (procedure, success);
104
register_message_procs (GimpPDB *pdb)
106
GimpProcedure *procedure;
111
procedure = gimp_procedure_new (message_invoker);
112
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-message");
113
gimp_procedure_set_static_strings (procedure,
115
"Displays a dialog box with a message.",
116
"Displays a dialog box with a message. Useful for status or error reporting. The message must be in UTF-8 encoding.",
121
gimp_procedure_add_argument (procedure,
122
gimp_param_spec_string ("message",
124
"Message to display in the dialog",
127
GIMP_PARAM_READWRITE));
128
gimp_pdb_register_procedure (pdb, procedure);
129
g_object_unref (procedure);
132
* gimp-message-get-handler
134
procedure = gimp_procedure_new (message_get_handler_invoker);
135
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-message-get-handler");
136
gimp_procedure_set_static_strings (procedure,
137
"gimp-message-get-handler",
138
"Returns the current state of where warning messages are displayed.",
139
"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.",
144
gimp_procedure_add_return_value (procedure,
145
g_param_spec_enum ("handler",
147
"The current handler type",
148
GIMP_TYPE_MESSAGE_HANDLER_TYPE,
150
GIMP_PARAM_READWRITE));
151
gimp_pdb_register_procedure (pdb, procedure);
152
g_object_unref (procedure);
155
* gimp-message-set-handler
157
procedure = gimp_procedure_new (message_set_handler_invoker);
158
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-message-set-handler");
159
gimp_procedure_set_static_strings (procedure,
160
"gimp-message-set-handler",
161
"Controls where warning messages are displayed.",
162
"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.",
167
gimp_procedure_add_argument (procedure,
168
g_param_spec_enum ("handler",
170
"The new handler type",
171
GIMP_TYPE_MESSAGE_HANDLER_TYPE,
173
GIMP_PARAM_READWRITE));
174
gimp_pdb_register_procedure (pdb, procedure);
175
g_object_unref (procedure);