gimpmessage_pdb.c 3.02 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
3 4 5 6 7 8 9 10 11 12 13
 *
 * 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
14
 * Lesser General Public License for more details.
15 16 17 18 19 20 21
 *
 * 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.
 */

22 23
/* NOTE: This file is autogenerated by pdbgen.pl */

Sven Neumann's avatar
Sven Neumann committed
24 25
#include "config.h"

26 27
#include "gimp.h"

28 29 30 31 32 33 34
/**
 * 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
35
 * reporting. The message must be in UTF-8 encoding.
36 37 38
 *
 * Returns: TRUE on success.
 */
39
gboolean
40
gimp_message (const gchar *message)
41
{
42
  GimpParam *return_vals;
43
  gint nreturn_vals;
44
  gboolean success = TRUE;
45 46 47

  return_vals = gimp_run_procedure ("gimp_message",
				    &nreturn_vals,
48 49
				    GIMP_PDB_STRING, message,
				    GIMP_PDB_END);
50

51 52
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

53
  gimp_destroy_params (return_vals, nreturn_vals);
54 55

  return success;
56
}
57

58 59 60 61 62 63 64 65 66 67 68
/**
 * 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.
 */
69 70 71
GimpMessageHandlerType
gimp_message_get_handler (void)
{
72
  GimpParam *return_vals;
73 74 75 76 77
  gint nreturn_vals;
  GimpMessageHandlerType handler = 0;

  return_vals = gimp_run_procedure ("gimp_message_get_handler",
				    &nreturn_vals,
78
				    GIMP_PDB_END);
79

80
  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
81 82 83 84 85 86 87
    handler = return_vals[1].data.d_int32;

  gimp_destroy_params (return_vals, nreturn_vals);

  return handler;
}

88 89 90 91 92 93 94 95 96 97 98 99
/**
 * 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.
 */
100
gboolean
101 102
gimp_message_set_handler (GimpMessageHandlerType handler)
{
103
  GimpParam *return_vals;
104
  gint nreturn_vals;
105
  gboolean success = TRUE;
106 107 108

  return_vals = gimp_run_procedure ("gimp_message_set_handler",
				    &nreturn_vals,
109 110
				    GIMP_PDB_INT32, handler,
				    GIMP_PDB_END);
111

112 113
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

114
  gimp_destroy_params (return_vals, nreturn_vals);
115 116

  return success;
117
}