From 47328ffd2e244a12614a563659627a7f95378105 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 29 Jul 2000 21:32:55 +0000 Subject: [PATCH] libgimp/gimp.c libgimp/gimp.h libgimp/gimpmenu.c libgimp/gimpprotocol.c 2000-07-30 Tor Lillqvist * libgimp/gimp.c * libgimp/gimp.h * libgimp/gimpmenu.c * libgimp/gimpprotocol.c * libgimp/gimpprotocol.h * libgimp/gimp.def * app/plug_in.c * plug-ins/helpbrowser/helpbrowser.c * plug-ins/script-fu/script-fu.c: As the GLib main loop and IO channel implementation on Win32 now provides the same interface as that on Unix, much of the Win32-only crap could be removed. Especially, no need for "wakeup" out-of-band messages to wake up pipe readers. No need for plug-ins to tell GIMP their thread id. * libgimp/gimp.c (gimp_extension_process): On Win32, use the new g_io_channel_win32_wait_for_condition() function. * plug-ins/makefile.cygwin: Add the homogenizer plug-in to the unofficial part. --- ChangeLog | 23 +++++++++++++++ app/actions/plug-in-commands.c | 42 +------------------------- app/gui/plug-in-commands.c | 42 +------------------------- app/gui/plug-in-menus.c | 42 +------------------------- app/menus/plug-in-menus.c | 42 +------------------------- app/plug-in/gimpplugin-message.c | 42 +------------------------- app/plug-in/gimpplugin-progress.c | 42 +------------------------- app/plug-in/gimpplugin.c | 42 +------------------------- app/plug-in/gimppluginmanager-call.c | 42 +------------------------- app/plug-in/gimppluginmanager-run.c | 42 +------------------------- app/plug-in/gimppluginmanager.c | 42 +------------------------- app/plug-in/gimppluginshm.c | 42 +------------------------- app/plug-in/plug-in-def.c | 42 +------------------------- app/plug-in/plug-in-message.c | 42 +------------------------- app/plug-in/plug-in-params.c | 42 +------------------------- app/plug-in/plug-in-progress.c | 42 +------------------------- app/plug-in/plug-in-run.c | 42 +------------------------- app/plug-in/plug-in-shm.c | 42 +------------------------- app/plug-in/plug-in.c | 42 +------------------------- app/plug-in/plug-ins.c | 42 +------------------------- app/plug_in.c | 42 +------------------------- libgimp/gimp.c | 43 ++------------------------- libgimp/gimp.def | 1 - libgimp/gimp.h | 1 - libgimp/gimpmenu.c | 3 -- libgimp/gimpprotocol.c | 44 ---------------------------- libgimp/gimpprotocol.h | 4 +-- libgimpbase/gimpprotocol.c | 44 ---------------------------- libgimpbase/gimpprotocol.h | 4 +-- plug-ins/helpbrowser/helpbrowser.c | 3 -- plug-ins/makefile.cygwin | 11 ++++++- plug-ins/script-fu/script-fu.c | 3 -- 32 files changed, 58 insertions(+), 966 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12333b39e9..8159668911 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2000-07-30 Tor Lillqvist + + * libgimp/gimp.c + * libgimp/gimp.h + * libgimp/gimpmenu.c + * libgimp/gimpprotocol.c + * libgimp/gimpprotocol.h + * libgimp/gimp.def + * app/plug_in.c + * plug-ins/helpbrowser/helpbrowser.c + * plug-ins/script-fu/script-fu.c: As the GLib main loop and IO + channel implementation on Win32 now provides the same interface as + that on Unix, much of the Win32-only crap could be + removed. Especially, no need for "wakeup" out-of-band messages to + wake up pipe readers. No need for plug-ins to tell GIMP their + thread id. + + * libgimp/gimp.c (gimp_extension_process): On Win32, use the new + g_io_channel_win32_wait_for_condition() function. + + * plug-ins/makefile.cygwin: Add the homogenizer plug-in to the + unofficial part. + 2000-07-29 Sven Neumann * app/main.c: no need to mark this string for translation diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index d7c6be43f2..644f100097 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/gui/plug-in-commands.c b/app/gui/plug-in-commands.c index d7c6be43f2..644f100097 100644 --- a/app/gui/plug-in-commands.c +++ b/app/gui/plug-in-commands.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/gui/plug-in-menus.c b/app/gui/plug-in-menus.c index d7c6be43f2..644f100097 100644 --- a/app/gui/plug-in-menus.c +++ b/app/gui/plug-in-menus.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c index d7c6be43f2..644f100097 100644 --- a/app/menus/plug-in-menus.c +++ b/app/menus/plug-in-menus.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/gimpplugin-progress.c +++ b/app/plug-in/gimpplugin-progress.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/plug-in-def.c b/app/plug-in/plug-in-def.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/plug-in-def.c +++ b/app/plug-in/plug-in-def.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/plug-in-progress.c b/app/plug-in/plug-in-progress.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/plug-in-progress.c +++ b/app/plug-in/plug-in-progress.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index d7c6be43f2..644f100097 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/app/plug_in.c b/app/plug_in.c index d7c6be43f2..644f100097 100644 --- a/app/plug_in.c +++ b/app/plug_in.c @@ -946,8 +946,6 @@ xspawnv (gint mode, } return pid; } -#undef _spawnv -#define _spawnv xspawnv #endif /* G_OS_WIN32 */ @@ -976,35 +974,17 @@ plug_in_open (PlugIn *plug_in) setmode (my_write[1], _O_BINARY); #endif -#ifndef G_OS_WIN32 plug_in->my_read = g_io_channel_unix_new (my_read[0]); plug_in->my_write = g_io_channel_unix_new (my_write[1]); plug_in->his_read = g_io_channel_unix_new (my_write[0]); plug_in->his_write = g_io_channel_unix_new (my_read[1]); -#else - plug_in->my_read = g_io_channel_win32_new_pipe (my_read[0]); - plug_in->his_read = g_io_channel_win32_new_pipe (my_write[0]); - plug_in->his_read_fd = my_write[0]; - plug_in->my_write = g_io_channel_win32_new_pipe (my_write[1]); - plug_in->his_write = g_io_channel_win32_new_pipe (my_read[1]); -#endif /* Remember the file descriptors for the pipes. */ -#ifndef G_OS_WIN32 plug_in->args[2] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_read)); plug_in->args[3] = g_strdup_printf ("%d", g_io_channel_unix_get_fd (plug_in->his_write)); -#else - plug_in->args[2] = - g_strdup_printf ("%d", g_io_channel_win32_get_fd (plug_in->his_read)); - plug_in->args[3] = - g_strdup_printf ("%d:%u:%d", - g_io_channel_win32_get_fd (plug_in->his_write), - GetCurrentThreadId (), - g_io_channel_win32_get_fd (plug_in->my_read)); -#endif /* Set the rest of the command line arguments. */ @@ -1028,7 +1008,7 @@ plug_in_open (PlugIn *plug_in) fcntl (my_write[1], F_SETFD, 1); #endif #if defined(G_OS_WIN32) || defined (G_WITH_CYGWIN) || defined(__EMX__) - plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); + plug_in->pid = xspawnv (_P_NOWAIT, plug_in->args[0], plug_in->args); if (plug_in->pid == -1) #else plug_in->pid = fork (); @@ -1065,19 +1045,6 @@ plug_in_open (PlugIn *plug_in) g_io_channel_unref (plug_in->his_write); plug_in->his_write = NULL; -#ifdef G_OS_WIN32 - /* The plug-in tells us its thread id */ - if (!plug_in->query) - { - if (!wire_read_int32 (plug_in->my_read, &plug_in->his_thread_id, 1)) - { - g_message ("Unable to read Plug-In's thread id"); - plug_in_destroy (plug_in); - return FALSE; - } - } -#endif - if (!plug_in->synchronous) { plug_in->input_id = @@ -1554,13 +1521,6 @@ plug_in_handle_message (WireMessage *msg) case GP_EXTENSION_ACK: gtk_main_quit (); break; - case GP_REQUEST_WAKEUPS: -#ifdef G_OS_WIN32 - g_io_channel_win32_pipe_request_wakeups (current_plug_in->my_write, - current_plug_in->his_thread_id, - current_plug_in->his_read_fd); -#endif - break; } } diff --git a/libgimp/gimp.c b/libgimp/gimp.c index 6a72af9092..53015095fc 100644 --- a/libgimp/gimp.c +++ b/libgimp/gimp.c @@ -169,14 +169,14 @@ gimp_main (int argc, char *argv[]) { #ifdef G_OS_WIN32 - char *peer, *peer_fd; - guint32 thread; int i, j, k; #endif setlocale (LC_NUMERIC, "C"); #ifdef G_OS_WIN32 + g_assert (PLUG_IN_INFO_PTR != NULL); + /* Check for exe file name with spaces in the path having been split up * by buggy NT C runtime, or something. I don't know why this happens * on NT (including w2k), but not on w95/98. @@ -241,22 +241,12 @@ gimp_main (int argc, gimp_signal_private (SIGCHLD, gimp_plugin_sigchld_handler, SA_RESTART); #endif -#ifndef G_OS_WIN32 _readchannel = g_io_channel_unix_new (atoi (argv[2])); _writechannel = g_io_channel_unix_new (atoi (argv[3])); #ifdef __EMX__ setmode (g_io_channel_unix_get_fd (_readchannel), O_BINARY); setmode (g_io_channel_unix_get_fd (_writechannel), O_BINARY); #endif -#else - g_assert (PLUG_IN_INFO_PTR != NULL); - _readchannel = g_io_channel_win32_new_pipe (atoi (argv[2])); - peer = strchr (argv[3], ':') + 1; - peer_fd = strchr (peer, ':') + 1; - _writechannel = g_io_channel_win32_new_pipe_with_wakeups (atoi (argv[3]), - atoi (peer), - atoi (peer_fd)); -#endif gp_init (); wire_set_writer (gimp_write); @@ -274,13 +264,6 @@ gimp_main (int argc, GIMP_STACK_TRACE_NEVER, GIMP_STACK_TRACE_ALWAYS); -#ifdef G_OS_WIN32 - /* Tell the GIMP our thread id */ - thread = GetCurrentThreadId (); - wire_write_int32 (_writechannel, &thread, 1); - wire_flush (_writechannel); -#endif - g_set_message_handler ((GPrintFunc) gimp_message_func); temp_proc_ht = g_hash_table_new (&g_str_hash, &g_str_equal); @@ -823,20 +806,7 @@ gimp_extension_process (guint timeout) gimp_quit (); } #else - /* ??? */ - MSG msg; - UINT timer; - static UINT message = 0; - - if (message == 0) - message = RegisterWindowMessage ("g-pipe-readable"); - if (timeout > 0) - timer = SetTimer (NULL, 0, timeout, NULL); - WaitMessage (); - if (timeout > 0) - KillTimer (NULL, timer); - - if (PeekMessage (&msg, (HWND) -1, message, message, PM_NOREMOVE)) + if (g_io_channel_win32_wait_for_condition (_readchannel, G_IO_IN, timeout) == 1) gimp_single_message (); #endif } @@ -855,13 +825,6 @@ gimp_run_temp (void) gimp_single_message (); } -void -gimp_request_wakeups (void) -{ - if (!gp_request_wakeups_write (_writechannel)) - gimp_quit (); -} - gchar * gimp_get_progname (void) { diff --git a/libgimp/gimp.def b/libgimp/gimp.def index 6ea5fe50b9..5b81fe07f3 100644 --- a/libgimp/gimp.def +++ b/libgimp/gimp.def @@ -286,7 +286,6 @@ EXPORTS gimp_register_load_handler gimp_register_magic_load_handler gimp_register_save_handler - gimp_request_wakeups gimp_rgb_to_hls gimp_rgb_to_hsv gimp_rgb_to_hsv4 diff --git a/libgimp/gimp.h b/libgimp/gimp.h index d023f7c405..7650f12379 100644 --- a/libgimp/gimp.h +++ b/libgimp/gimp.h @@ -319,7 +319,6 @@ gboolean gimp_install_cmap (void); gboolean gimp_use_xshm (void); guchar * gimp_color_cube (void); gint gimp_min_colors (void); -void gimp_request_wakeups (void); gchar * gimp_get_progname (void); diff --git a/libgimp/gimpmenu.c b/libgimp/gimpmenu.c index 05dca40ce1..07b59a4b4b 100644 --- a/libgimp/gimpmenu.c +++ b/libgimp/gimpmenu.c @@ -937,9 +937,6 @@ gimp_setup_callbacks (void) /* Tie into the gdk input function only once */ g_io_add_watch (_readchannel, G_IO_IN | G_IO_PRI, input_callback, NULL); - /* This needed on Win32 */ - gimp_request_wakeups (); - first_time = FALSE; } } diff --git a/libgimp/gimpprotocol.c b/libgimp/gimpprotocol.c index b75d3f5106..d11e0821e5 100644 --- a/libgimp/gimpprotocol.c +++ b/libgimp/gimpprotocol.c @@ -98,12 +98,6 @@ static void _gp_extension_ack_write (GIOChannel *channel, WireMessage *msg); static void _gp_extension_ack_destroy (WireMessage *msg); -static void _gp_request_wakeups_read (GIOChannel *channel, - WireMessage *msg); -static void _gp_request_wakeups_write (GIOChannel *channel, - WireMessage *msg); -static void _gp_request_wakeups_destroy (WireMessage *msg); - static void _gp_params_read (GIOChannel *channel, GPParam **params, guint *nparams); @@ -167,10 +161,6 @@ gp_init (void) _gp_extension_ack_read, _gp_extension_ack_write, _gp_extension_ack_destroy); - wire_register (GP_REQUEST_WAKEUPS, - _gp_request_wakeups_read, - _gp_request_wakeups_write, - _gp_request_wakeups_destroy); } gboolean @@ -362,21 +352,6 @@ gp_extension_ack_write (GIOChannel *channel) return TRUE; } -gboolean -gp_request_wakeups_write (GIOChannel *channel) -{ - WireMessage msg; - - msg.type = GP_REQUEST_WAKEUPS; - msg.data = NULL; - - if (!wire_write_msg (channel, &msg)) - return FALSE; - if (!wire_flush (channel)) - return FALSE; - return TRUE; -} - /* quit */ static void @@ -1005,25 +980,6 @@ _gp_extension_ack_destroy (WireMessage *msg) { } -/* request_wakeups */ - -static void -_gp_request_wakeups_read (GIOChannel *channel, - WireMessage *msg) -{ -} - -static void -_gp_request_wakeups_write (GIOChannel *channel, - WireMessage *msg) -{ -} - -static void -_gp_request_wakeups_destroy (WireMessage *msg) -{ -} - /* params */ static void diff --git a/libgimp/gimpprotocol.h b/libgimp/gimpprotocol.h index 4595d53919..19a63e3ba3 100644 --- a/libgimp/gimpprotocol.h +++ b/libgimp/gimpprotocol.h @@ -45,8 +45,7 @@ enum GP_TEMP_PROC_RETURN, GP_PROC_INSTALL, GP_PROC_UNINSTALL, - GP_EXTENSION_ACK, - GP_REQUEST_WAKEUPS + GP_EXTENSION_ACK }; @@ -209,7 +208,6 @@ gboolean gp_proc_install_write (GIOChannel *channel, gboolean gp_proc_uninstall_write (GIOChannel *channel, GPProcUninstall *proc_uninstall); gboolean gp_extension_ack_write (GIOChannel *channel); -gboolean gp_request_wakeups_write (GIOChannel *channel); #ifdef __cplusplus diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c index b75d3f5106..d11e0821e5 100644 --- a/libgimpbase/gimpprotocol.c +++ b/libgimpbase/gimpprotocol.c @@ -98,12 +98,6 @@ static void _gp_extension_ack_write (GIOChannel *channel, WireMessage *msg); static void _gp_extension_ack_destroy (WireMessage *msg); -static void _gp_request_wakeups_read (GIOChannel *channel, - WireMessage *msg); -static void _gp_request_wakeups_write (GIOChannel *channel, - WireMessage *msg); -static void _gp_request_wakeups_destroy (WireMessage *msg); - static void _gp_params_read (GIOChannel *channel, GPParam **params, guint *nparams); @@ -167,10 +161,6 @@ gp_init (void) _gp_extension_ack_read, _gp_extension_ack_write, _gp_extension_ack_destroy); - wire_register (GP_REQUEST_WAKEUPS, - _gp_request_wakeups_read, - _gp_request_wakeups_write, - _gp_request_wakeups_destroy); } gboolean @@ -362,21 +352,6 @@ gp_extension_ack_write (GIOChannel *channel) return TRUE; } -gboolean -gp_request_wakeups_write (GIOChannel *channel) -{ - WireMessage msg; - - msg.type = GP_REQUEST_WAKEUPS; - msg.data = NULL; - - if (!wire_write_msg (channel, &msg)) - return FALSE; - if (!wire_flush (channel)) - return FALSE; - return TRUE; -} - /* quit */ static void @@ -1005,25 +980,6 @@ _gp_extension_ack_destroy (WireMessage *msg) { } -/* request_wakeups */ - -static void -_gp_request_wakeups_read (GIOChannel *channel, - WireMessage *msg) -{ -} - -static void -_gp_request_wakeups_write (GIOChannel *channel, - WireMessage *msg) -{ -} - -static void -_gp_request_wakeups_destroy (WireMessage *msg) -{ -} - /* params */ static void diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h index 4595d53919..19a63e3ba3 100644 --- a/libgimpbase/gimpprotocol.h +++ b/libgimpbase/gimpprotocol.h @@ -45,8 +45,7 @@ enum GP_TEMP_PROC_RETURN, GP_PROC_INSTALL, GP_PROC_UNINSTALL, - GP_EXTENSION_ACK, - GP_REQUEST_WAKEUPS + GP_EXTENSION_ACK }; @@ -209,7 +208,6 @@ gboolean gp_proc_install_write (GIOChannel *channel, gboolean gp_proc_uninstall_write (GIOChannel *channel, GPProcUninstall *proc_uninstall); gboolean gp_extension_ack_write (GIOChannel *channel); -gboolean gp_request_wakeups_write (GIOChannel *channel); #ifdef __cplusplus diff --git a/plug-ins/helpbrowser/helpbrowser.c b/plug-ins/helpbrowser/helpbrowser.c index cc4aebc344..5643db26d3 100644 --- a/plug-ins/helpbrowser/helpbrowser.c +++ b/plug-ins/helpbrowser/helpbrowser.c @@ -1077,9 +1077,6 @@ install_temp_proc (void) /* Tie into the gdk input function */ g_io_add_watch (_readchannel, G_IO_IN | G_IO_PRI, input_callback, NULL); - /* This needed on Win32 */ - gimp_request_wakeups (); - temp_proc_installed = TRUE; } diff --git a/plug-ins/makefile.cygwin b/plug-ins/makefile.cygwin index a851c83ff7..70fc9858c0 100644 --- a/plug-ins/makefile.cygwin +++ b/plug-ins/makefile.cygwin @@ -45,7 +45,7 @@ SEPARATE = AlienMap AlienMap2 FractalExplorer Lighting MapObject bmp dbbrowser f # ../unofficial-plug-ins directory, go there, and do "make -f # makefile.cygwin unofficial". -UNOFFICIAL = Anamorphose DigitalSignature RGB_Displace ccanalyze fixer gdyntext gimp_ace guash kaleidoscope logconv sel_gauss magiceye mathmap psd_save resynthesizer user_filter +UNOFFICIAL = Anamorphose DigitalSignature RGB_Displace ccanalyze fixer gdyntext gimp_ace guash homogenizer kaleidoscope logconv sel_gauss magiceye mathmap psd_save resynthesizer user_filter # The main target @@ -301,6 +301,15 @@ OBJECTS = \ queue.o endif +ifdef EXTRA_homogenizer +CXX = c++ -mno-cygwin -mpentium -fnative-struct +OBJECTS = \ + homogenize.o +EXTRALIBS = -lstdc++ +.cc.o: + $(CXX) $(CFLAGS) -c $< -o $@ +endif + ifdef EXTRA_ifscompose OBJECTS = \ ifscompose.o \ diff --git a/plug-ins/script-fu/script-fu.c b/plug-ins/script-fu/script-fu.c index 9d388fbb61..e6f0f96519 100644 --- a/plug-ins/script-fu/script-fu.c +++ b/plug-ins/script-fu/script-fu.c @@ -234,9 +234,6 @@ run (gchar *name, /* Acknowledge that the extension is properly initialized */ gimp_extension_ack (); - /* We need wakeups (on Win32) when getting callbacks from the GIMP */ - gimp_request_wakeups (); - while (1) gimp_extension_process (0);