diff --git a/ChangeLog b/ChangeLog index f3275f561b..2330236378 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Fri Jun 19 16:37:40 PDT 1998 Manish Singh + + * app/appenv.h + * app/app_procs.c + * app/errors.[ch] + * app/main.c + * app/plug_in.c: implemented PDB interface for changing + the g_message handler + + * plug-ins/gif/gif.c: g_printized "no comment" warning + Fri Jun 19 16:12:51 EDT 1998 Adrian Likins * TODO: more updates diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index 545c3000f7..c5f3e506af 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/app_procs.c b/app/app_procs.c index ca7ba9e0fe..015c3fa270 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -518,8 +518,7 @@ app_init (void) render_setup (transparency_type, transparency_size); tools_options_dialog_new (); tools_select (RECT_SELECT); - if (console_messages == FALSE) - g_set_message_handler (&message_box_func); + message_handler = MESSAGE_BOX; } color_transfer_init (); @@ -556,7 +555,7 @@ app_exit_finish (void) return; is_app_exit_finish_done = TRUE; - g_set_message_handler (&message_console_func); + message_handler = CONSOLE; lc_dialog_free (); gdisplays_delete (); diff --git a/app/appenv.h b/app/appenv.h index 82ef2840a1..9199fe191d 100644 --- a/app/appenv.h +++ b/app/appenv.h @@ -28,6 +28,11 @@ #define MINIMUM(x,y) ((x < y) ? x : y) #define MAXIMUM(x,y) ((x > y) ? x : y) +typedef enum { + MESSAGE_BOX, + CONSOLE +} MessageHandlerType; + extern int no_interface; extern int no_splash; extern int no_splash_image; @@ -36,4 +41,6 @@ extern int be_verbose; extern int use_debug_handler; extern int console_messages; +extern MessageHandlerType message_handler; + #endif /* APPENV_H */ diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c index 4d0f9e95c6..74983bdb50 100644 --- a/app/disp_callbacks.c +++ b/app/disp_callbacks.c @@ -479,7 +479,7 @@ gdisplay_origin_button_press (GtkWidget *widget, /* Stop the signal emission so the button doesn't grab the * pointer away from us */ - gtk_signal_emit_stop_by_name (widget, "button_press_event"); + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "button_press_event"); } return FALSE; diff --git a/app/display/gimpdisplay-callbacks.c b/app/display/gimpdisplay-callbacks.c index 4d0f9e95c6..74983bdb50 100644 --- a/app/display/gimpdisplay-callbacks.c +++ b/app/display/gimpdisplay-callbacks.c @@ -479,7 +479,7 @@ gdisplay_origin_button_press (GtkWidget *widget, /* Stop the signal emission so the button doesn't grab the * pointer away from us */ - gtk_signal_emit_stop_by_name (widget, "button_press_event"); + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "button_press_event"); } return FALSE; diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index 4d0f9e95c6..74983bdb50 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -479,7 +479,7 @@ gdisplay_origin_button_press (GtkWidget *widget, /* Stop the signal emission so the button doesn't grab the * pointer away from us */ - gtk_signal_emit_stop_by_name (widget, "button_press_event"); + gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "button_press_event"); } return FALSE; diff --git a/app/errors.c b/app/errors.c index 587564082e..caeaf711c6 100644 --- a/app/errors.c +++ b/app/errors.c @@ -33,15 +33,12 @@ extern char *prog_name; void -message_console_func (char *str) +message_func (char *str) { - fprintf (stderr, "%s: %s\n", prog_name, str); -} - -void -message_box_func (char *str) -{ - message_box (str, NULL, NULL); + if ((console_messages == FALSE) && (message_handler == MESSAGE_BOX)) + message_box (str, NULL, NULL); + else + fprintf (stderr, "%s: %s\n", prog_name, str); } void diff --git a/app/errors.h b/app/errors.h index 0e1ae8ad5e..93251ff24f 100644 --- a/app/errors.h +++ b/app/errors.h @@ -18,8 +18,7 @@ #ifndef __ERRORS_H__ #define __ERRORS_H__ -void message_console_func (char *); -void message_box_func (char *); +void message_func (char *); void fatal_error (char *, ...); void terminate (char *, ...); diff --git a/app/gui/plug-in-commands.c b/app/gui/plug-in-commands.c index 545c3000f7..c5f3e506af 100644 --- a/app/gui/plug-in-commands.c +++ b/app/gui/plug-in-commands.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/gui/plug-in-menus.c b/app/gui/plug-in-menus.c index 545c3000f7..c5f3e506af 100644 --- a/app/gui/plug-in-menus.c +++ b/app/gui/plug-in-menus.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/main.c b/app/main.c index 7db3219f89..d403c2fc0e 100644 --- a/app/main.c +++ b/app/main.c @@ -48,6 +48,9 @@ int be_verbose; int use_shm; int use_debug_handler; int console_messages; + +MessageHandlerType message_handler; + char *prog_name; /* The path name we are invoked with */ char **batch_cmds; @@ -109,6 +112,9 @@ main (int argc, char **argv) use_shm = TRUE; use_debug_handler = FALSE; console_messages = FALSE; + + message_handler = CONSOLE; + batch_cmds = g_new (char*, argc); batch_cmds[0] = NULL; @@ -207,8 +213,7 @@ main (int argc, char **argv) if (show_version || show_help) exit (0); - /* Print to console at first */ - g_set_message_handler (&message_console_func); + g_set_message_handler (&message_func); /* Handle some signals */ signal (SIGHUP, on_signal); diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c index 545c3000f7..c5f3e506af 100644 --- a/app/menus/plug-in-menus.c +++ b/app/menus/plug-in-menus.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/gimpplugin-progress.c +++ b/app/plug-in/gimpplugin-progress.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/plug-in-def.c b/app/plug-in/plug-in-def.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/plug-in-def.c +++ b/app/plug-in/plug-in-def.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/plug-in-progress.c b/app/plug-in/plug-in-progress.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/plug-in-progress.c +++ b/app/plug-in/plug-in-progress.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/app/plug_in.c b/app/plug_in.c index 545c3000f7..c5f3e506af 100644 --- a/app/plug_in.c +++ b/app/plug_in.c @@ -116,6 +116,9 @@ static Argument* progress_update_invoker (Argument *args); static Argument* message_invoker (Argument *args); +static Argument* message_handler_get_invoker (Argument *args); +static Argument* message_handler_set_invoker (Argument *args); + static GSList *plug_in_defs = NULL; static GSList *gimprc_proc_defs = NULL; @@ -213,6 +216,53 @@ static ProcRecord message_proc = }; +static ProcArg message_handler_get_out_args[] = +{ + { PDB_INT32, + "handler", + "the current handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_get_proc = +{ + "gimp_message_handler_get", + "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", + PDB_INTERNAL, + 0, + NULL, + 1, + message_handler_get_out_args, + { { message_handler_get_invoker } }, +}; + +static ProcArg message_handler_set_args[] = +{ + { PDB_INT32, + "handler", + "the new handler type: { MESSAGE_BOX (0), CONSOLE (1) }" } +}; + +static ProcRecord message_handler_set_proc = +{ + "gimp_message_handler_set", + "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", + PDB_INTERNAL, + 1, + message_handler_set_args, + 0, + NULL, + { { message_handler_set_invoker } }, +}; + + void plug_in_init () { @@ -229,6 +279,8 @@ plug_in_init () /* initialize the message box procedural db calls */ procedural_db_register (&message_proc); + procedural_db_register (&message_handler_get_proc); + procedural_db_register (&message_handler_set_proc); /* initialize the gimp protocol library and set the read and * write handlers. @@ -3063,3 +3115,27 @@ message_invoker (Argument *args) g_message (args[0].value.pdb_pointer, NULL, NULL); return procedural_db_return_args (&message_proc, TRUE); } + +static Argument* +message_handler_get_invoker (Argument *args) +{ + Argument *return_args; + + return_args = procedural_db_return_args (&message_handler_get_proc, TRUE); + return_args[1].value.pdb_int = message_handler; + return return_args; +} + +static Argument* +message_handler_set_invoker (Argument *args) +{ + int success = TRUE; + + if ((args[0].value.pdb_int >= MESSAGE_BOX) && + (args[0].value.pdb_int <= CONSOLE)) + message_handler = args[0].value.pdb_int; + else + success = FALSE; + + return procedural_db_return_args (&message_handler_set_proc, success); +} diff --git a/configure.in b/configure.in index 2a9d7a6286..9345caf132 100644 --- a/configure.in +++ b/configure.in @@ -60,9 +60,7 @@ AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_CPP -dnl Check for our required libraries -AM_PATH_GLIB(1.1.0,, - AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.)) +dnl Check for GTK+ AM_PATH_GTK(1.1.0,, AC_MSG_ERROR(Test for GTK failed. See the file 'INSTALL' for help.)) @@ -93,7 +91,6 @@ gimp_save_LDFLAGS="$LDFLAGS" gimp_save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $GTK_CFLAGS" -LDFLAGS="$LDFLAGS `echo $GLIB_LIBS | sed 's/\(.*\)\(-lglib.*\)/\1/'`" LDFLAGS="$LDFLAGS `echo $GTK_LIBS | sed 's/\(.*\)\(-lgtk.*\)/\1/'`" LIBS="$LIBS $GTK_LIBS" diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am index c619d3332d..6722fa920b 100644 --- a/libgimp/Makefile.am +++ b/libgimp/Makefile.am @@ -49,7 +49,7 @@ CPPFLAGS = \ INCLUDES = \ -I$(top_srcdir) \ - $(GLIB_CFLAGS) \ + $(GTK_CFLAGS) \ -I$(includedir) libgimpui_1_1_la_INCLUDES = \ diff --git a/plug-ins/common/gif.c b/plug-ins/common/gif.c index 46f9af50ea..ca36ca185e 100644 --- a/plug-ins/common/gif.c +++ b/plug-ins/common/gif.c @@ -2689,7 +2689,7 @@ static void GIFEncodeCommentExt (FILE *fp, char *comment) { if (comment==NULL||strlen(comment)<1) { - g_message ("GIF: warning: no comment given - comment block not written.\n"); + g_print ("GIF: warning: no comment given - comment block not written.\n"); return; } diff --git a/plug-ins/gif/gif.c b/plug-ins/gif/gif.c index 46f9af50ea..ca36ca185e 100644 --- a/plug-ins/gif/gif.c +++ b/plug-ins/gif/gif.c @@ -2689,7 +2689,7 @@ static void GIFEncodeCommentExt (FILE *fp, char *comment) { if (comment==NULL||strlen(comment)<1) { - g_message ("GIF: warning: no comment given - comment block not written.\n"); + g_print ("GIF: warning: no comment given - comment block not written.\n"); return; }