message_cmds.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /* The GIMP -- an image manipulation program
  2. * Copyright (C) 1995-2000 Spencer Kimball and Peter Mattis
  3. *
  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.
  8. *
  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.
  13. *
  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.
  17. */
  18. /* NOTE: This file is autogenerated by pdbgen.pl. */
  19. #include "config.h"
  20. #include "procedural_db.h"
  21. #include "appenv.h"
  22. static ProcRecord message_proc;
  23. static ProcRecord message_get_handler_proc;
  24. static ProcRecord message_set_handler_proc;
  25. void
  26. register_message_procs (void)
  27. {
  28. procedural_db_register (&message_proc);
  29. procedural_db_register (&message_get_handler_proc);
  30. procedural_db_register (&message_set_handler_proc);
  31. }
  32. static Argument *
  33. message_invoker (Argument *args)
  34. {
  35. gboolean success = TRUE;
  36. gchar *message;
  37. message = (gchar *) args[0].value.pdb_pointer;
  38. if (message == NULL)
  39. success = FALSE;
  40. if (success)
  41. g_message (message, NULL, NULL);
  42. return procedural_db_return_args (&message_proc, success);
  43. }
  44. static ProcArg message_inargs[] =
  45. {
  46. {
  47. PDB_STRING,
  48. "message",
  49. "Message to display in the dialog"
  50. }
  51. };
  52. static ProcRecord message_proc =
  53. {
  54. "gimp_message",
  55. "Displays a dialog box with a message.",
  56. "Displays a dialog box with a message. Useful for status or error reporting.",
  57. "Manish Singh",
  58. "Manish Singh",
  59. "1998",
  60. PDB_INTERNAL,
  61. 1,
  62. message_inargs,
  63. 0,
  64. NULL,
  65. { { message_invoker } }
  66. };
  67. static Argument *
  68. message_get_handler_invoker (Argument *args)
  69. {
  70. Argument *return_args;
  71. return_args = procedural_db_return_args (&message_get_handler_proc, TRUE);
  72. return_args[1].value.pdb_int = message_handler;
  73. return return_args;
  74. }
  75. static ProcArg message_get_handler_outargs[] =
  76. {
  77. {
  78. PDB_INT32,
  79. "handler",
  80. "The current handler type: { MESSAGE_BOX (0), CONSOLE (1), ERROR_CONSOLE (2) }"
  81. }
  82. };
  83. static ProcRecord message_get_handler_proc =
  84. {
  85. "gimp_message_get_handler",
  86. "Returns the current state of where warning messages are displayed.",
  87. "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.",
  88. "Manish Singh",
  89. "Manish Singh",
  90. "1998",
  91. PDB_INTERNAL,
  92. 0,
  93. NULL,
  94. 1,
  95. message_get_handler_outargs,
  96. { { message_get_handler_invoker } }
  97. };
  98. static Argument *
  99. message_set_handler_invoker (Argument *args)
  100. {
  101. gboolean success = TRUE;
  102. gint32 handler;
  103. handler = args[0].value.pdb_int;
  104. if (handler < MESSAGE_BOX || handler > ERROR_CONSOLE)
  105. success = FALSE;
  106. if (success)
  107. message_handler = handler;
  108. return procedural_db_return_args (&message_set_handler_proc, success);
  109. }
  110. static ProcArg message_set_handler_inargs[] =
  111. {
  112. {
  113. PDB_INT32,
  114. "handler",
  115. "The new handler type: { MESSAGE_BOX (0), CONSOLE (1), ERROR_CONSOLE (2) }"
  116. }
  117. };
  118. static ProcRecord message_set_handler_proc =
  119. {
  120. "gimp_message_set_handler",
  121. "Controls where warning messages are displayed.",
  122. "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.",
  123. "Manish Singh",
  124. "Manish Singh",
  125. "1998",
  126. PDB_INTERNAL,
  127. 1,
  128. message_set_handler_inargs,
  129. 0,
  130. NULL,
  131. { { message_set_handler_invoker } }
  132. };