~ubuntu-branches/ubuntu/hoary/gimp/hoary

« back to all changes in this revision

Viewing changes to libgimp/gimpmessage_pdb.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-04-04 14:51:23 UTC
  • Revision ID: james.westby@ubuntu.com-20050404145123-9py049eeelfymur8
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* LIBGIMP - The GIMP Library
 
2
 * Copyright (C) 1995-2003 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 "config.h"
 
25
 
 
26
#include "gimp.h"
 
27
 
 
28
/**
 
29
 * gimp_message:
 
30
 * @message: Message to display in the dialog.
 
31
 *
 
32
 * Displays a dialog box with a message.
 
33
 *
 
34
 * Displays a dialog box with a message. Useful for status or error
 
35
 * reporting. The message must be in UTF-8 encoding.
 
36
 *
 
37
 * Returns: TRUE on success.
 
38
 */
 
39
gboolean
 
40
gimp_message (const gchar *message)
 
41
{
 
42
  GimpParam *return_vals;
 
43
  gint nreturn_vals;
 
44
  gboolean success = TRUE;
 
45
 
 
46
  return_vals = gimp_run_procedure ("gimp_message",
 
47
                                    &nreturn_vals,
 
48
                                    GIMP_PDB_STRING, message,
 
49
                                    GIMP_PDB_END);
 
50
 
 
51
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
52
 
 
53
  gimp_destroy_params (return_vals, nreturn_vals);
 
54
 
 
55
  return success;
 
56
}
 
57
 
 
58
/**
 
59
 * gimp_message_get_handler:
 
60
 *
 
61
 * Returns the current state of where warning messages are displayed.
 
62
 *
 
63
 * This procedure returns the way g_message warnings are displayed.
 
64
 * They can be shown in a dialog box or printed on the console where
 
65
 * gimp was started.
 
66
 *
 
67
 * Returns: The current handler type.
 
68
 */
 
69
GimpMessageHandlerType
 
70
gimp_message_get_handler (void)
 
71
{
 
72
  GimpParam *return_vals;
 
73
  gint nreturn_vals;
 
74
  GimpMessageHandlerType handler = 0;
 
75
 
 
76
  return_vals = gimp_run_procedure ("gimp_message_get_handler",
 
77
                                    &nreturn_vals,
 
78
                                    GIMP_PDB_END);
 
79
 
 
80
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
 
81
    handler = return_vals[1].data.d_int32;
 
82
 
 
83
  gimp_destroy_params (return_vals, nreturn_vals);
 
84
 
 
85
  return handler;
 
86
}
 
87
 
 
88
/**
 
89
 * gimp_message_set_handler:
 
90
 * @handler: The new handler type.
 
91
 *
 
92
 * Controls where warning messages are displayed.
 
93
 *
 
94
 * This procedure controls how g_message warnings are displayed. They
 
95
 * can be shown in a dialog box or printed on the console where gimp
 
96
 * was started.
 
97
 *
 
98
 * Returns: TRUE on success.
 
99
 */
 
100
gboolean
 
101
gimp_message_set_handler (GimpMessageHandlerType handler)
 
102
{
 
103
  GimpParam *return_vals;
 
104
  gint nreturn_vals;
 
105
  gboolean success = TRUE;
 
106
 
 
107
  return_vals = gimp_run_procedure ("gimp_message_set_handler",
 
108
                                    &nreturn_vals,
 
109
                                    GIMP_PDB_INT32, handler,
 
110
                                    GIMP_PDB_END);
 
111
 
 
112
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
 
113
 
 
114
  gimp_destroy_params (return_vals, nreturn_vals);
 
115
 
 
116
  return success;
 
117
}