mirror of https://github.com/GNOME/gimp.git
use G_OS_WIN32 and G_HAVE_CYGWIN #defines
* app/app_procs.c * app/gdisplay_color.[ch] * app/gdisplay_color_ui.c: make the ui usable * app/gdisplay.c: enable cdisplay support * modules/Makefile.am * modules/cdisplay_gamma.c: moved gamma functionality to separate -Yosh
This commit is contained in:
parent
7f54f56e51
commit
d0519fd33d
48
ChangeLog
48
ChangeLog
|
@ -1,3 +1,51 @@
|
|||
Mon Oct 4 12:16:44 PDT 1999 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* app/app_procs.c
|
||||
* app/appenv.h
|
||||
* app/batch.c
|
||||
* app/datafiles.c
|
||||
* app/errorconsole.c
|
||||
* app/errors.c
|
||||
* app/fileops.[ch]
|
||||
* app/general.c
|
||||
* app/gimprc.c
|
||||
* app/install.c
|
||||
* app/main.c
|
||||
* app/module_db.c
|
||||
* app/plug_in.[ch]
|
||||
* app/temp_buf.c
|
||||
* app/tile_swap.c
|
||||
* libgimp/gimp.[ch]
|
||||
* libgimp/gimpenv.c
|
||||
* libgimp/gimpfileselection.c
|
||||
* libgimp/gimpwire.c
|
||||
* libgimp/parasite.c
|
||||
* plug-ins/FractalExplorer/FractalExplorer.c
|
||||
* plug-ins/common/gbr.c
|
||||
* plug-ins/common/gz.c
|
||||
* plug-ins/common/hrz.c
|
||||
* plug-ins/common/pat.c
|
||||
* plug-ins/common/pnm.c
|
||||
* plug-ins/common/ps.c
|
||||
* plug-ins/faxg3/faxg3.c
|
||||
* plug-ins/gap/gap_lib.h
|
||||
* plug-ins/gfig/gfig.c
|
||||
* plug-ins/gimpressionist/gimpressionist.c
|
||||
* plug-ins/script-fu/interp_slib.c
|
||||
* plug-ins/script-fu/script-fu-console.c
|
||||
* plug-ins/script-fu/script-fu-scripts.c
|
||||
* plug-ins/script-fu/script-fu.c
|
||||
* tools/gcg/gcg.c: use G_OS_WIN32 and G_HAVE_CYGWIN #defines
|
||||
|
||||
* app/app_procs.c
|
||||
* app/gdisplay_color.[ch]
|
||||
* app/gdisplay_color_ui.c: make the ui usable
|
||||
|
||||
* app/gdisplay.c: enable cdisplay support
|
||||
|
||||
* modules/Makefile.am
|
||||
* modules/cdisplay_gamma.c: moved gamma functionality to separate lib
|
||||
|
||||
Mon Oct 4 19:02:08 CEST 1999 Olof S Kylander <olof@gimp.org>
|
||||
|
||||
* Makefile.am fix of a typo
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
|
@ -494,7 +494,7 @@ app_init (void)
|
|||
RESET_BAR();
|
||||
internal_procs_init ();
|
||||
|
||||
gdisplay_color_init ();
|
||||
color_display_init ();
|
||||
|
||||
RESET_BAR();
|
||||
parse_buffers_init ();
|
||||
|
@ -789,7 +789,7 @@ toast_old_temp_files (void)
|
|||
*/
|
||||
|
||||
int pid = atoi (entry->d_name + 9);
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill (pid, 0))
|
||||
#else
|
||||
/* On Windows, you can't remove open files anyhow,
|
||||
|
|
|
@ -47,7 +47,7 @@ extern int we_are_exiting; /* this is used in session_get_window_info() */
|
|||
extern GimpSet* image_context;
|
||||
extern MessageHandlerType message_handler;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
char *quote_spaces (char *string);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ batch_init ()
|
|||
{
|
||||
if (!read_from_stdin)
|
||||
{
|
||||
#ifndef NATIVE_WIN32 /* for now */
|
||||
#ifndef G_OS_WIN32 /* for now */
|
||||
g_print ("reading batch commands from stdin\n");
|
||||
gdk_input_add (STDIN_FILENO, GDK_INPUT_READ, batch_read, NULL);
|
||||
read_from_stdin = TRUE;
|
||||
|
@ -129,7 +129,7 @@ batch_run_cmd (char *cmd)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
|
||||
static void
|
||||
batch_read (gpointer data,
|
||||
|
@ -185,7 +185,7 @@ batch_read (gpointer data,
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* !NATIVE_WIN32 */
|
||||
#endif /* !G_OS_WIN32 */
|
||||
|
||||
static void
|
||||
batch_pserver (int run_mode,
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
|
|
|
@ -340,6 +340,9 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
gdisp->idle_render.active = FALSE;
|
||||
}
|
||||
|
||||
/* detach any color displays */
|
||||
gdisplay_color_detach_all (gdisp);
|
||||
|
||||
/* get rid of signals handled by this display */
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (gdisp->gimage), gdisp);
|
||||
|
||||
|
@ -1256,6 +1259,12 @@ gdisplay_display_area (GDisplay *gdisp,
|
|||
int x2, y2;
|
||||
int dx, dy;
|
||||
int i, j;
|
||||
GList *list;
|
||||
guchar *buf;
|
||||
int bpp;
|
||||
|
||||
buf = gximage_get_data ();
|
||||
bpp = gximage_get_bpp ();
|
||||
|
||||
sx = SCALEX (gdisp, gdisp->gimage->width);
|
||||
sy = SCALEY (gdisp, gdisp->gimage->height);
|
||||
|
@ -1333,6 +1342,15 @@ gdisplay_display_area (GDisplay *gdisp,
|
|||
dx, dy,
|
||||
0, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
list = gdisp->cd_list;
|
||||
while (list)
|
||||
{
|
||||
ColorDisplayNode *node = (ColorDisplayNode *) list->data;
|
||||
node->cd_convert (node->cd_ID, buf, dx, dy, bpp);
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
gximage_put (gdisp->canvas->window,
|
||||
j, i, dx, dy,
|
||||
gdisp->offset_x,
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
|
|
|
@ -453,7 +453,7 @@ valid_module_name (const char *filename)
|
|||
|
||||
len = strlen (basename);
|
||||
|
||||
#if !defined(WIN32) && !defined(__EMX__)
|
||||
#if !defined(G_OS_WIN32) && !defined(G_HAVE_CYGWIN) && !defined(__EMX__)
|
||||
if (len < 3 + 1 + 3)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "libgimp/gimpintl.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
# ifndef __EMX__
|
||||
# define USER_INSTALL "user_install"
|
||||
# else
|
||||
|
@ -339,7 +339,7 @@ help_quit_callback (GtkWidget *widget,
|
|||
gtk_exit (0);
|
||||
}
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
char *
|
||||
quote_spaces (char *string)
|
||||
|
@ -430,7 +430,7 @@ install_run (InstallCallback callback)
|
|||
/* Realize the text widget before inserting text strings */
|
||||
gtk_widget_realize (text);
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, _("User Installation Log\n\n"), -1);
|
||||
#endif
|
||||
|
||||
|
@ -456,7 +456,7 @@ install_run (InstallCallback callback)
|
|||
|
||||
if (executable == TRUE)
|
||||
{
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
char *quoted_data_dir, *quoted_user_dir;
|
||||
|
||||
/* On Windows, it is common for the GIMP data directory
|
||||
|
@ -519,7 +519,7 @@ install_run (InstallCallback callback)
|
|||
}
|
||||
else
|
||||
executable = FALSE;
|
||||
#endif /* !NATIVE_WIN32 */
|
||||
#endif /* !G_OS_WIN32 */
|
||||
}
|
||||
|
||||
if (executable == FALSE)
|
||||
|
@ -538,7 +538,7 @@ install_continue_callback (GtkWidget *widget,
|
|||
{
|
||||
InstallCallback callback;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
FreeConsole ();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -340,6 +340,9 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
gdisp->idle_render.active = FALSE;
|
||||
}
|
||||
|
||||
/* detach any color displays */
|
||||
gdisplay_color_detach_all (gdisp);
|
||||
|
||||
/* get rid of signals handled by this display */
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (gdisp->gimage), gdisp);
|
||||
|
||||
|
@ -1256,6 +1259,12 @@ gdisplay_display_area (GDisplay *gdisp,
|
|||
int x2, y2;
|
||||
int dx, dy;
|
||||
int i, j;
|
||||
GList *list;
|
||||
guchar *buf;
|
||||
int bpp;
|
||||
|
||||
buf = gximage_get_data ();
|
||||
bpp = gximage_get_bpp ();
|
||||
|
||||
sx = SCALEX (gdisp, gdisp->gimage->width);
|
||||
sy = SCALEY (gdisp, gdisp->gimage->height);
|
||||
|
@ -1333,6 +1342,15 @@ gdisplay_display_area (GDisplay *gdisp,
|
|||
dx, dy,
|
||||
0, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
list = gdisp->cd_list;
|
||||
while (list)
|
||||
{
|
||||
ColorDisplayNode *node = (ColorDisplayNode *) list->data;
|
||||
node->cd_convert (node->cd_ID, buf, dx, dy, bpp);
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
gximage_put (gdisp->canvas->window,
|
||||
j, i, dx, dy,
|
||||
gdisp->offset_x,
|
||||
|
|
|
@ -29,11 +29,21 @@ typedef struct _ColorDisplayDialog ColorDisplayDialog;
|
|||
struct _ColorDisplayDialog
|
||||
{
|
||||
GtkWidget *shell;
|
||||
|
||||
GtkWidget *src;
|
||||
GtkWidget *dest;
|
||||
|
||||
gint src_row;
|
||||
gint dest_row;
|
||||
|
||||
gboolean modified;
|
||||
|
||||
GList *old_nodes;
|
||||
|
||||
GDisplay *gdisp;
|
||||
};
|
||||
|
||||
static ColorDisplayDialog cdd = { NULL, NULL, NULL };
|
||||
static ColorDisplayDialog cdd = { NULL, NULL, NULL, 0, 0, FALSE, NULL, NULL };
|
||||
|
||||
typedef void (*ButtonCallback) (GtkWidget *, gpointer);
|
||||
|
||||
|
@ -45,17 +55,38 @@ struct _ButtonInfo
|
|||
ButtonCallback callback;
|
||||
};
|
||||
|
||||
static void color_display_ok_callback (GtkWidget *, gpointer);
|
||||
static void color_display_cancel_callback (GtkWidget *, gpointer);
|
||||
static gint color_display_destroy_callback (GtkWidget *, gpointer);
|
||||
static void color_display_add_callback (GtkWidget *, gpointer);
|
||||
static void color_display_remove_callback (GtkWidget *, gpointer);
|
||||
static void color_display_up_callback (GtkWidget *, gpointer);
|
||||
static void color_display_down_callback (GtkWidget *, gpointer);
|
||||
static void color_display_configure_callback (GtkWidget *, gpointer);
|
||||
static void color_display_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_cancel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_add_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_remove_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_up_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_down_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_configure_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
static void src_list_populate (const char *name,
|
||||
gpointer user_data);
|
||||
static void src_list_populate (const char *name,
|
||||
gpointer data);
|
||||
static void dest_list_populate (GList *node_list);
|
||||
|
||||
static void select_src (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data);
|
||||
static void select_dest (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data);
|
||||
|
||||
#define LIST_WIDTH 180
|
||||
#define LIST_HEIGHT 180
|
||||
|
||||
static void
|
||||
make_dialog (void)
|
||||
|
@ -102,10 +133,15 @@ make_dialog (void)
|
|||
titles[0] = _("Available Filters");
|
||||
titles[1] = NULL;
|
||||
cdd.src = gtk_clist_new_with_titles (1, titles);
|
||||
gtk_widget_set_usize (cdd.src, LIST_WIDTH, LIST_HEIGHT);
|
||||
gtk_clist_column_titles_passive (GTK_CLIST (cdd.src));
|
||||
gtk_clist_set_auto_sort (GTK_CLIST (cdd.src), TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_win), cdd.src);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (cdd.src), "select_row",
|
||||
GTK_SIGNAL_FUNC (select_src),
|
||||
NULL);
|
||||
|
||||
vbbox = gtk_vbutton_box_new ();
|
||||
gtk_vbutton_box_set_layout_default (GTK_BUTTONBOX_START);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), vbbox, FALSE, FALSE, 2);
|
||||
|
@ -120,9 +156,14 @@ make_dialog (void)
|
|||
titles[0] = _("Active Filters");
|
||||
titles[1] = NULL;
|
||||
cdd.dest = gtk_clist_new_with_titles (1, titles);
|
||||
gtk_widget_set_usize (cdd.dest, LIST_WIDTH, LIST_HEIGHT);
|
||||
gtk_clist_column_titles_passive (GTK_CLIST (cdd.dest));
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_win), cdd.dest);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (cdd.src), "select_row",
|
||||
GTK_SIGNAL_FUNC (select_dest),
|
||||
NULL);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
@ -142,46 +183,126 @@ static void
|
|||
color_display_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
|
||||
if (cdd.modified)
|
||||
{
|
||||
list = cdd.old_nodes;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (!g_list_find (cdd.gdisp->cd_list, list->data))
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, list->data);
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
g_list_free (cdd.old_nodes);
|
||||
}
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_cancel_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
}
|
||||
GList *list;
|
||||
|
||||
static gint
|
||||
color_display_destroy_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
g_free (data);
|
||||
return FALSE;
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
|
||||
if (cdd.modified)
|
||||
{
|
||||
list = cdd.gdisp->cd_list;
|
||||
cdd.gdisp->cd_list = cdd.old_nodes;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (!g_list_find (cdd.old_nodes, list->data))
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, list->data);
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_add_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gchar *name = NULL;
|
||||
ColorDisplayNode *node;
|
||||
gint row;
|
||||
|
||||
gtk_clist_get_text (GTK_CLIST (cdd.src), cdd.src_row, 0, &name);
|
||||
|
||||
cdd.modified = TRUE;
|
||||
|
||||
node = gdisplay_color_attach (cdd.gdisp, name);
|
||||
|
||||
row = gtk_clist_append (GTK_CLIST (cdd.dest), &name);
|
||||
gtk_clist_set_row_data (GTK_CLIST (cdd.dest), row, node);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_remove_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_remove (GTK_CLIST (cdd.dest), cdd.dest_row);
|
||||
|
||||
cdd.modified = TRUE;
|
||||
|
||||
if (g_list_find (cdd.old_nodes, node))
|
||||
gdisplay_color_detach (cdd.gdisp, node);
|
||||
else
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, node);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_up_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_row_move (GTK_CLIST (cdd.dest), cdd.dest_row, cdd.dest_row - 1);
|
||||
|
||||
gdisplay_color_reorder_up (cdd.gdisp, node);
|
||||
cdd.modified = TRUE;
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_down_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_row_move (GTK_CLIST (cdd.dest), cdd.dest_row, cdd.dest_row + 1);
|
||||
|
||||
gdisplay_color_reorder_down (cdd.gdisp, node);
|
||||
cdd.modified = TRUE;
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -199,14 +320,60 @@ gdisplay_color_ui (GDisplay *gdisp)
|
|||
gtk_clist_clear (GTK_CLIST (cdd.src));
|
||||
gtk_clist_clear (GTK_CLIST (cdd.dest));
|
||||
|
||||
gimp_color_display_foreach (src_list_populate, cdd.src);
|
||||
color_display_foreach (src_list_populate, cdd.src);
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
cdd.old_nodes = gdisp->cd_list;
|
||||
dest_list_populate (gdisp->cd_list);
|
||||
gdisp->cd_list = g_list_copy (cdd.old_nodes);
|
||||
}
|
||||
|
||||
cdd.gdisp = gdisp;
|
||||
|
||||
gtk_widget_show (cdd.shell);
|
||||
}
|
||||
|
||||
static void
|
||||
src_list_populate (const char *name,
|
||||
gpointer user_data)
|
||||
gpointer data)
|
||||
{
|
||||
gtk_clist_append (GTK_CLIST (user_data), &name);
|
||||
gtk_clist_append (GTK_CLIST (data), (gchar **) &name);
|
||||
}
|
||||
|
||||
static void
|
||||
dest_list_populate (GList *node_list)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
int row;
|
||||
|
||||
while (node_list)
|
||||
{
|
||||
node = (ColorDisplayNode *) node_list->data;
|
||||
|
||||
row = gtk_clist_append (GTK_CLIST (cdd.dest), &node->cd_name);
|
||||
gtk_clist_set_row_data (GTK_CLIST (cdd.dest), row, node);
|
||||
|
||||
node_list = node_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
select_src (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
cdd.src_row = row;
|
||||
}
|
||||
|
||||
static void
|
||||
select_dest (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
cdd.dest_row = row;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "gdisplay_color.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimageP.h"
|
||||
|
@ -39,62 +41,21 @@ struct _ColorDisplayInfo {
|
|||
|
||||
static GHashTable *color_display_table = NULL;
|
||||
|
||||
typedef struct _GammaContext GammaContext;
|
||||
|
||||
struct _GammaContext
|
||||
{
|
||||
double gamma;
|
||||
guchar *lookup;
|
||||
|
||||
GtkWidget *shell;
|
||||
GtkWidget *spinner;
|
||||
};
|
||||
|
||||
static void color_display_foreach (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data);
|
||||
|
||||
static void color_display_foreach_real (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data);
|
||||
static void gdisplay_color_detach_real (GDisplay *gdisp,
|
||||
ColorDisplayNode *node,
|
||||
gboolean unref);
|
||||
static gint node_name_compare (ColorDisplayNode *node,
|
||||
const char *name);
|
||||
|
||||
static gpointer gamma_new (int type);
|
||||
static void gamma_create_lookup_table (GammaContext *context);
|
||||
static void gamma_destroy (gpointer cd_ID);
|
||||
static void gamma_convert (gpointer cd_ID,
|
||||
guchar *buf,
|
||||
int width,
|
||||
int height,
|
||||
int bpp);
|
||||
static void gamma_load (gpointer cd_ID,
|
||||
Parasite *state);
|
||||
static Parasite * gamma_save (gpointer cd_ID);
|
||||
static void gamma_configure_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gamma_configure_cancel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gamma_configure (gpointer cd_ID);
|
||||
|
||||
void
|
||||
gdisplay_color_init (void)
|
||||
color_display_init (void)
|
||||
{
|
||||
GimpColorDisplayMethods methods = {
|
||||
NULL,
|
||||
gamma_new,
|
||||
gamma_convert,
|
||||
gamma_destroy,
|
||||
NULL,
|
||||
gamma_load,
|
||||
gamma_save,
|
||||
gamma_configure
|
||||
};
|
||||
|
||||
gimp_color_display_register ("Gamma", &methods);
|
||||
}
|
||||
|
||||
gboolean
|
||||
G_MODULE_EXPORT gboolean
|
||||
gimp_color_display_register (const char *name,
|
||||
GimpColorDisplayMethods *methods)
|
||||
{
|
||||
|
@ -120,7 +81,7 @@ gimp_color_display_register (const char *name,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
G_MODULE_EXPORT gboolean
|
||||
gimp_color_display_unregister (const char *name)
|
||||
{
|
||||
ColorDisplayInfo *info;
|
||||
|
@ -135,8 +96,9 @@ gimp_color_display_unregister (const char *name)
|
|||
{
|
||||
gdisp = (GDisplay *) refs->data;
|
||||
|
||||
node = g_list_find_custom (gdisp->cd_list, name, node_name_compare);
|
||||
gdisp->cd_list = g_slist_remove_link (gdisp->cd_list, node);
|
||||
node = g_list_find_custom (gdisp->cd_list, (gpointer) name,
|
||||
(GCompareFunc) node_name_compare);
|
||||
gdisp->cd_list = g_list_remove_link (gdisp->cd_list, node);
|
||||
|
||||
gdisplay_color_detach_real (gdisp, node->data, FALSE);
|
||||
|
||||
|
@ -165,29 +127,29 @@ struct _DisplayForeachData
|
|||
};
|
||||
|
||||
void
|
||||
gimp_color_display_foreach (GimpCDFunc func,
|
||||
gpointer user_data)
|
||||
color_display_foreach (GimpCDFunc func,
|
||||
gpointer user_data)
|
||||
{
|
||||
DisplayForeachData data;
|
||||
|
||||
data.func = func;
|
||||
data.user_data = user_data;
|
||||
|
||||
g_hash_table_foreach (color_display_table, color_display_foreach, &data);
|
||||
g_hash_table_foreach (color_display_table, color_display_foreach_real, &data);
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_foreach (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
color_display_foreach_real (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
{
|
||||
DisplayForeachData *data = (DisplayForeachData *) user_data;
|
||||
data->func (key, data->user_data);
|
||||
}
|
||||
|
||||
void
|
||||
ColorDisplayNode *
|
||||
gdisplay_color_attach (GDisplay *gdisp,
|
||||
const char *name)
|
||||
const char *name)
|
||||
{
|
||||
ColorDisplayInfo *info;
|
||||
ColorDisplayNode *node;
|
||||
|
@ -209,23 +171,29 @@ gdisplay_color_attach (GDisplay *gdisp,
|
|||
|
||||
node->cd_convert = info->methods.convert;
|
||||
|
||||
gdisp->cd_list = g_list_append (gdisp->cd_list, name);
|
||||
gdisp->cd_list = g_list_append (gdisp->cd_list, node);
|
||||
|
||||
return node;
|
||||
}
|
||||
else
|
||||
g_warning ("Tried to attach a nonexistant color display");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gdisplay_color_detach (GDisplay *gdisp,
|
||||
const char *name)
|
||||
gdisplay_color_detach (GDisplay *gdisp,
|
||||
ColorDisplayNode *node)
|
||||
{
|
||||
GList *node;
|
||||
gdisp->cd_list = g_list_remove (gdisp->cd_list, node);
|
||||
}
|
||||
|
||||
node = g_list_find_custom (gdisp->cd_list, name, node_name_compare);
|
||||
gdisplay_color_detach_real (gdisp, node->data, TRUE);
|
||||
|
||||
gdisp->cd_list = g_list_remove_link (gdisp->cd_list, node);
|
||||
g_list_free_1 (node);
|
||||
void
|
||||
gdisplay_color_detach_destroy (GDisplay *gdisp,
|
||||
ColorDisplayNode *node)
|
||||
{
|
||||
gdisplay_color_detach_real (gdisp, node, TRUE);
|
||||
gdisp->cd_list = g_list_remove (gdisp->cd_list, node);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -266,179 +234,33 @@ gdisplay_color_detach_real (GDisplay *gdisp,
|
|||
g_free (node);
|
||||
}
|
||||
|
||||
void
|
||||
gdisplay_color_reorder_up (GDisplay *gdisp,
|
||||
ColorDisplayNode *node)
|
||||
{
|
||||
GList *node_list;
|
||||
|
||||
node_list = g_list_find (gdisp->cd_list, node);
|
||||
|
||||
node_list->data = node_list->prev->data;
|
||||
node_list->prev->data = node;
|
||||
}
|
||||
|
||||
void
|
||||
gdisplay_color_reorder_down (GDisplay *gdisp,
|
||||
ColorDisplayNode *node)
|
||||
{
|
||||
GList *node_list;
|
||||
|
||||
node_list = g_list_find (gdisp->cd_list, node);
|
||||
|
||||
node_list->data = node_list->next->data;
|
||||
node_list->next->data = node;
|
||||
}
|
||||
|
||||
static gint
|
||||
node_name_compare (ColorDisplayNode *node,
|
||||
const char *name)
|
||||
{
|
||||
return strcmp (node->cd_name, name);
|
||||
}
|
||||
|
||||
/* The Gamma Color Display */
|
||||
|
||||
static gpointer
|
||||
gamma_new (int type)
|
||||
{
|
||||
int i;
|
||||
GammaContext *context = NULL;
|
||||
|
||||
context = g_new (GammaContext, 1);
|
||||
context->gamma = 1.0;
|
||||
context->lookup = g_new (guchar, 256);
|
||||
context->shell = NULL;
|
||||
context->spinner = NULL;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
context->lookup[i] = i;
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_create_lookup_table (GammaContext *context)
|
||||
{
|
||||
double one_over_gamma;
|
||||
double ind;
|
||||
int i;
|
||||
|
||||
if (context->gamma == 0.0)
|
||||
context->gamma = 1.0;
|
||||
|
||||
one_over_gamma = 1.0 / context->gamma;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
ind = (double) i / 255.0;
|
||||
context->lookup[i] = (guchar) (int) (255 * pow (ind, one_over_gamma));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_destroy (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
|
||||
if (context->shell)
|
||||
gtk_widget_destroy (context->shell);
|
||||
|
||||
g_free (context->lookup);
|
||||
g_free (context);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_convert (gpointer cd_ID,
|
||||
guchar *buf,
|
||||
int width,
|
||||
int height,
|
||||
int bpp)
|
||||
{
|
||||
int i;
|
||||
guchar *lookup = ((GammaContext *) cd_ID)->lookup;
|
||||
|
||||
for (i = 0; i < width * height * bpp; i++)
|
||||
*buf++ = lookup[*buf];
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_load (gpointer cd_ID,
|
||||
Parasite *state)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
memcpy (&context->gamma, parasite_data (state), sizeof (double));
|
||||
#else
|
||||
guint32 buf[2], *data = parasite_data (state);
|
||||
|
||||
buf[0] = g_ntohl (data[1]);
|
||||
buf[1] = g_ntohl (data[0]);
|
||||
|
||||
memcpy (&context->gamma, buf, sizeof (double));
|
||||
#endif
|
||||
|
||||
gamma_create_lookup_table (context);
|
||||
}
|
||||
|
||||
static Parasite *
|
||||
gamma_save (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
guint32 buf[2];
|
||||
|
||||
memcpy (buf, &context->gamma, sizeof (double));
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
{
|
||||
guint32 tmp = g_htonl (buf[0]);
|
||||
buf[0] = g_htonl (buf[1]);
|
||||
buf[1] = tmp;
|
||||
}
|
||||
#endif
|
||||
|
||||
return parasite_new ("Display/Gamma", PARASITE_PERSISTENT,
|
||||
sizeof (double), &buf);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) data;
|
||||
|
||||
context->gamma = gtk_spin_button_get_value_as_float (context->spinner);
|
||||
gamma_create_lookup_table (context);
|
||||
|
||||
gtk_widget_hide (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure_cancel_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_widget_hide (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *entry;
|
||||
GtkObject *adjustment;
|
||||
|
||||
if (!context->shell)
|
||||
{
|
||||
context->shell =
|
||||
gimp_dialog_new (_("Gamma"), "gamma",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/display_filters/gamma.html",
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
|
||||
_("OK"), gamma_configure_ok_callback,
|
||||
cd_ID, NULL, FALSE, FALSE,
|
||||
_("Cancel"), gamma_configure_cancel_callback,
|
||||
cd_ID, NULL, TRUE, TRUE,
|
||||
|
||||
NULL);
|
||||
|
||||
hbox = gtk_hbox_new (TRUE, 2);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (context->shell)->vbox),
|
||||
hbox, FALSE, FALSE, 0);
|
||||
|
||||
label = gtk_label_new (_("Gamma:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
|
||||
|
||||
adjustment = gtk_adjustment_new (1.0, 0.01, 10.0, 0.01, 0.1, 0.0);
|
||||
context->spinner = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment),
|
||||
0.1, 3);
|
||||
gtk_widget_set_usize (context->spinner, 100, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (hbox);
|
||||
}
|
||||
|
||||
gtk_widget_show (context->shell);
|
||||
}
|
||||
|
|
|
@ -24,22 +24,28 @@
|
|||
typedef struct _ColorDisplayNode ColorDisplayNode;
|
||||
|
||||
struct _ColorDisplayNode {
|
||||
char *cd_name;
|
||||
gpointer cd_ID;
|
||||
char *cd_name;
|
||||
GimpColorDisplayConvert cd_convert;
|
||||
};
|
||||
|
||||
void gdisplay_color_init (void);
|
||||
void gdisplay_color_attach (GDisplay *gdisp,
|
||||
const char *name);
|
||||
void gdisplay_color_detach (GDisplay *gdisp,
|
||||
const char *name);
|
||||
void gdisplay_color_detach_all (GDisplay *gdisp);
|
||||
|
||||
typedef void (*GimpCDFunc) (const char *name,
|
||||
gpointer user_data);
|
||||
|
||||
void gimp_color_display_foreach (GimpCDFunc func,
|
||||
gpointer user_data);
|
||||
void color_display_init (void);
|
||||
void color_display_foreach (GimpCDFunc func,
|
||||
gpointer user_data);
|
||||
|
||||
ColorDisplayNode * gdisplay_color_attach (GDisplay *gdisp,
|
||||
const char *name);
|
||||
void gdisplay_color_detach (GDisplay *gdisp,
|
||||
ColorDisplayNode *node);
|
||||
void gdisplay_color_detach_destroy (GDisplay *gdisp,
|
||||
ColorDisplayNode *node);
|
||||
void gdisplay_color_detach_all (GDisplay *gdisp);
|
||||
void gdisplay_color_reorder_up (GDisplay *gdisp,
|
||||
ColorDisplayNode *node);
|
||||
void gdisplay_color_reorder_down (GDisplay *gdisp,
|
||||
ColorDisplayNode *node);
|
||||
|
||||
#endif /* __GDISPLAY_COLOR_H__ */
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#ifndef S_IRUSR
|
||||
#define S_IRUSR _S_IREAD
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
@ -73,7 +73,7 @@ gimp_message_func (gchar *str)
|
|||
void
|
||||
gimp_fatal_error (gchar *fmt, ...)
|
||||
{
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
va_list args;
|
||||
|
||||
va_start (args, fmt);
|
||||
|
@ -99,7 +99,7 @@ gimp_fatal_error (gchar *fmt, ...)
|
|||
void
|
||||
gimp_terminate (gchar *fmt, ...)
|
||||
{
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
va_list args;
|
||||
|
||||
va_start (args, fmt);
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <direct.h> /* For _mkdir() */
|
||||
#define mkdir(path,mode) _mkdir(path)
|
||||
#endif
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -340,6 +340,9 @@ gdisplay_delete (GDisplay *gdisp)
|
|||
gdisp->idle_render.active = FALSE;
|
||||
}
|
||||
|
||||
/* detach any color displays */
|
||||
gdisplay_color_detach_all (gdisp);
|
||||
|
||||
/* get rid of signals handled by this display */
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (gdisp->gimage), gdisp);
|
||||
|
||||
|
@ -1256,6 +1259,12 @@ gdisplay_display_area (GDisplay *gdisp,
|
|||
int x2, y2;
|
||||
int dx, dy;
|
||||
int i, j;
|
||||
GList *list;
|
||||
guchar *buf;
|
||||
int bpp;
|
||||
|
||||
buf = gximage_get_data ();
|
||||
bpp = gximage_get_bpp ();
|
||||
|
||||
sx = SCALEX (gdisp, gdisp->gimage->width);
|
||||
sy = SCALEY (gdisp, gdisp->gimage->height);
|
||||
|
@ -1333,6 +1342,15 @@ gdisplay_display_area (GDisplay *gdisp,
|
|||
dx, dy,
|
||||
0, 0, 0, 0);
|
||||
#endif
|
||||
|
||||
list = gdisp->cd_list;
|
||||
while (list)
|
||||
{
|
||||
ColorDisplayNode *node = (ColorDisplayNode *) list->data;
|
||||
node->cd_convert (node->cd_ID, buf, dx, dy, bpp);
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
gximage_put (gdisp->canvas->window,
|
||||
j, i, dx, dy,
|
||||
gdisp->offset_x,
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "gdisplay_color.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimageP.h"
|
||||
|
@ -39,62 +41,21 @@ struct _ColorDisplayInfo {
|
|||
|
||||
static GHashTable *color_display_table = NULL;
|
||||
|
||||
typedef struct _GammaContext GammaContext;
|
||||
|
||||
struct _GammaContext
|
||||
{
|
||||
double gamma;
|
||||
guchar *lookup;
|
||||
|
||||
GtkWidget *shell;
|
||||
GtkWidget *spinner;
|
||||
};
|
||||
|
||||
static void color_display_foreach (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data);
|
||||
|
||||
static void color_display_foreach_real (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data);
|
||||
static void gdisplay_color_detach_real (GDisplay *gdisp,
|
||||
ColorDisplayNode *node,
|
||||
gboolean unref);
|
||||
static gint node_name_compare (ColorDisplayNode *node,
|
||||
const char *name);
|
||||
|
||||
static gpointer gamma_new (int type);
|
||||
static void gamma_create_lookup_table (GammaContext *context);
|
||||
static void gamma_destroy (gpointer cd_ID);
|
||||
static void gamma_convert (gpointer cd_ID,
|
||||
guchar *buf,
|
||||
int width,
|
||||
int height,
|
||||
int bpp);
|
||||
static void gamma_load (gpointer cd_ID,
|
||||
Parasite *state);
|
||||
static Parasite * gamma_save (gpointer cd_ID);
|
||||
static void gamma_configure_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gamma_configure_cancel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gamma_configure (gpointer cd_ID);
|
||||
|
||||
void
|
||||
gdisplay_color_init (void)
|
||||
color_display_init (void)
|
||||
{
|
||||
GimpColorDisplayMethods methods = {
|
||||
NULL,
|
||||
gamma_new,
|
||||
gamma_convert,
|
||||
gamma_destroy,
|
||||
NULL,
|
||||
gamma_load,
|
||||
gamma_save,
|
||||
gamma_configure
|
||||
};
|
||||
|
||||
gimp_color_display_register ("Gamma", &methods);
|
||||
}
|
||||
|
||||
gboolean
|
||||
G_MODULE_EXPORT gboolean
|
||||
gimp_color_display_register (const char *name,
|
||||
GimpColorDisplayMethods *methods)
|
||||
{
|
||||
|
@ -120,7 +81,7 @@ gimp_color_display_register (const char *name,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
G_MODULE_EXPORT gboolean
|
||||
gimp_color_display_unregister (const char *name)
|
||||
{
|
||||
ColorDisplayInfo *info;
|
||||
|
@ -135,8 +96,9 @@ gimp_color_display_unregister (const char *name)
|
|||
{
|
||||
gdisp = (GDisplay *) refs->data;
|
||||
|
||||
node = g_list_find_custom (gdisp->cd_list, name, node_name_compare);
|
||||
gdisp->cd_list = g_slist_remove_link (gdisp->cd_list, node);
|
||||
node = g_list_find_custom (gdisp->cd_list, (gpointer) name,
|
||||
(GCompareFunc) node_name_compare);
|
||||
gdisp->cd_list = g_list_remove_link (gdisp->cd_list, node);
|
||||
|
||||
gdisplay_color_detach_real (gdisp, node->data, FALSE);
|
||||
|
||||
|
@ -165,29 +127,29 @@ struct _DisplayForeachData
|
|||
};
|
||||
|
||||
void
|
||||
gimp_color_display_foreach (GimpCDFunc func,
|
||||
gpointer user_data)
|
||||
color_display_foreach (GimpCDFunc func,
|
||||
gpointer user_data)
|
||||
{
|
||||
DisplayForeachData data;
|
||||
|
||||
data.func = func;
|
||||
data.user_data = user_data;
|
||||
|
||||
g_hash_table_foreach (color_display_table, color_display_foreach, &data);
|
||||
g_hash_table_foreach (color_display_table, color_display_foreach_real, &data);
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_foreach (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
color_display_foreach_real (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
{
|
||||
DisplayForeachData *data = (DisplayForeachData *) user_data;
|
||||
data->func (key, data->user_data);
|
||||
}
|
||||
|
||||
void
|
||||
ColorDisplayNode *
|
||||
gdisplay_color_attach (GDisplay *gdisp,
|
||||
const char *name)
|
||||
const char *name)
|
||||
{
|
||||
ColorDisplayInfo *info;
|
||||
ColorDisplayNode *node;
|
||||
|
@ -209,23 +171,29 @@ gdisplay_color_attach (GDisplay *gdisp,
|
|||
|
||||
node->cd_convert = info->methods.convert;
|
||||
|
||||
gdisp->cd_list = g_list_append (gdisp->cd_list, name);
|
||||
gdisp->cd_list = g_list_append (gdisp->cd_list, node);
|
||||
|
||||
return node;
|
||||
}
|
||||
else
|
||||
g_warning ("Tried to attach a nonexistant color display");
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
gdisplay_color_detach (GDisplay *gdisp,
|
||||
const char *name)
|
||||
gdisplay_color_detach (GDisplay *gdisp,
|
||||
ColorDisplayNode *node)
|
||||
{
|
||||
GList *node;
|
||||
gdisp->cd_list = g_list_remove (gdisp->cd_list, node);
|
||||
}
|
||||
|
||||
node = g_list_find_custom (gdisp->cd_list, name, node_name_compare);
|
||||
gdisplay_color_detach_real (gdisp, node->data, TRUE);
|
||||
|
||||
gdisp->cd_list = g_list_remove_link (gdisp->cd_list, node);
|
||||
g_list_free_1 (node);
|
||||
void
|
||||
gdisplay_color_detach_destroy (GDisplay *gdisp,
|
||||
ColorDisplayNode *node)
|
||||
{
|
||||
gdisplay_color_detach_real (gdisp, node, TRUE);
|
||||
gdisp->cd_list = g_list_remove (gdisp->cd_list, node);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -266,179 +234,33 @@ gdisplay_color_detach_real (GDisplay *gdisp,
|
|||
g_free (node);
|
||||
}
|
||||
|
||||
void
|
||||
gdisplay_color_reorder_up (GDisplay *gdisp,
|
||||
ColorDisplayNode *node)
|
||||
{
|
||||
GList *node_list;
|
||||
|
||||
node_list = g_list_find (gdisp->cd_list, node);
|
||||
|
||||
node_list->data = node_list->prev->data;
|
||||
node_list->prev->data = node;
|
||||
}
|
||||
|
||||
void
|
||||
gdisplay_color_reorder_down (GDisplay *gdisp,
|
||||
ColorDisplayNode *node)
|
||||
{
|
||||
GList *node_list;
|
||||
|
||||
node_list = g_list_find (gdisp->cd_list, node);
|
||||
|
||||
node_list->data = node_list->next->data;
|
||||
node_list->next->data = node;
|
||||
}
|
||||
|
||||
static gint
|
||||
node_name_compare (ColorDisplayNode *node,
|
||||
const char *name)
|
||||
{
|
||||
return strcmp (node->cd_name, name);
|
||||
}
|
||||
|
||||
/* The Gamma Color Display */
|
||||
|
||||
static gpointer
|
||||
gamma_new (int type)
|
||||
{
|
||||
int i;
|
||||
GammaContext *context = NULL;
|
||||
|
||||
context = g_new (GammaContext, 1);
|
||||
context->gamma = 1.0;
|
||||
context->lookup = g_new (guchar, 256);
|
||||
context->shell = NULL;
|
||||
context->spinner = NULL;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
context->lookup[i] = i;
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_create_lookup_table (GammaContext *context)
|
||||
{
|
||||
double one_over_gamma;
|
||||
double ind;
|
||||
int i;
|
||||
|
||||
if (context->gamma == 0.0)
|
||||
context->gamma = 1.0;
|
||||
|
||||
one_over_gamma = 1.0 / context->gamma;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
ind = (double) i / 255.0;
|
||||
context->lookup[i] = (guchar) (int) (255 * pow (ind, one_over_gamma));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_destroy (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
|
||||
if (context->shell)
|
||||
gtk_widget_destroy (context->shell);
|
||||
|
||||
g_free (context->lookup);
|
||||
g_free (context);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_convert (gpointer cd_ID,
|
||||
guchar *buf,
|
||||
int width,
|
||||
int height,
|
||||
int bpp)
|
||||
{
|
||||
int i;
|
||||
guchar *lookup = ((GammaContext *) cd_ID)->lookup;
|
||||
|
||||
for (i = 0; i < width * height * bpp; i++)
|
||||
*buf++ = lookup[*buf];
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_load (gpointer cd_ID,
|
||||
Parasite *state)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
memcpy (&context->gamma, parasite_data (state), sizeof (double));
|
||||
#else
|
||||
guint32 buf[2], *data = parasite_data (state);
|
||||
|
||||
buf[0] = g_ntohl (data[1]);
|
||||
buf[1] = g_ntohl (data[0]);
|
||||
|
||||
memcpy (&context->gamma, buf, sizeof (double));
|
||||
#endif
|
||||
|
||||
gamma_create_lookup_table (context);
|
||||
}
|
||||
|
||||
static Parasite *
|
||||
gamma_save (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
guint32 buf[2];
|
||||
|
||||
memcpy (buf, &context->gamma, sizeof (double));
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
{
|
||||
guint32 tmp = g_htonl (buf[0]);
|
||||
buf[0] = g_htonl (buf[1]);
|
||||
buf[1] = tmp;
|
||||
}
|
||||
#endif
|
||||
|
||||
return parasite_new ("Display/Gamma", PARASITE_PERSISTENT,
|
||||
sizeof (double), &buf);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) data;
|
||||
|
||||
context->gamma = gtk_spin_button_get_value_as_float (context->spinner);
|
||||
gamma_create_lookup_table (context);
|
||||
|
||||
gtk_widget_hide (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure_cancel_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_widget_hide (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *entry;
|
||||
GtkObject *adjustment;
|
||||
|
||||
if (!context->shell)
|
||||
{
|
||||
context->shell =
|
||||
gimp_dialog_new (_("Gamma"), "gamma",
|
||||
gimp_standard_help_func,
|
||||
"dialogs/display_filters/gamma.html",
|
||||
GTK_WIN_POS_NONE,
|
||||
FALSE, TRUE, FALSE,
|
||||
|
||||
_("OK"), gamma_configure_ok_callback,
|
||||
cd_ID, NULL, FALSE, FALSE,
|
||||
_("Cancel"), gamma_configure_cancel_callback,
|
||||
cd_ID, NULL, TRUE, TRUE,
|
||||
|
||||
NULL);
|
||||
|
||||
hbox = gtk_hbox_new (TRUE, 2);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (context->shell)->vbox),
|
||||
hbox, FALSE, FALSE, 0);
|
||||
|
||||
label = gtk_label_new (_("Gamma:"));
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
|
||||
|
||||
adjustment = gtk_adjustment_new (1.0, 0.01, 10.0, 0.01, 0.1, 0.0);
|
||||
context->spinner = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment),
|
||||
0.1, 3);
|
||||
gtk_widget_set_usize (context->spinner, 100, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
|
||||
|
||||
gtk_widget_show_all (hbox);
|
||||
}
|
||||
|
||||
gtk_widget_show (context->shell);
|
||||
}
|
||||
|
|
|
@ -24,22 +24,28 @@
|
|||
typedef struct _ColorDisplayNode ColorDisplayNode;
|
||||
|
||||
struct _ColorDisplayNode {
|
||||
char *cd_name;
|
||||
gpointer cd_ID;
|
||||
char *cd_name;
|
||||
GimpColorDisplayConvert cd_convert;
|
||||
};
|
||||
|
||||
void gdisplay_color_init (void);
|
||||
void gdisplay_color_attach (GDisplay *gdisp,
|
||||
const char *name);
|
||||
void gdisplay_color_detach (GDisplay *gdisp,
|
||||
const char *name);
|
||||
void gdisplay_color_detach_all (GDisplay *gdisp);
|
||||
|
||||
typedef void (*GimpCDFunc) (const char *name,
|
||||
gpointer user_data);
|
||||
|
||||
void gimp_color_display_foreach (GimpCDFunc func,
|
||||
gpointer user_data);
|
||||
void color_display_init (void);
|
||||
void color_display_foreach (GimpCDFunc func,
|
||||
gpointer user_data);
|
||||
|
||||
ColorDisplayNode * gdisplay_color_attach (GDisplay *gdisp,
|
||||
const char *name);
|
||||
void gdisplay_color_detach (GDisplay *gdisp,
|
||||
ColorDisplayNode *node);
|
||||
void gdisplay_color_detach_destroy (GDisplay *gdisp,
|
||||
ColorDisplayNode *node);
|
||||
void gdisplay_color_detach_all (GDisplay *gdisp);
|
||||
void gdisplay_color_reorder_up (GDisplay *gdisp,
|
||||
ColorDisplayNode *node);
|
||||
void gdisplay_color_reorder_down (GDisplay *gdisp,
|
||||
ColorDisplayNode *node);
|
||||
|
||||
#endif /* __GDISPLAY_COLOR_H__ */
|
||||
|
|
|
@ -29,11 +29,21 @@ typedef struct _ColorDisplayDialog ColorDisplayDialog;
|
|||
struct _ColorDisplayDialog
|
||||
{
|
||||
GtkWidget *shell;
|
||||
|
||||
GtkWidget *src;
|
||||
GtkWidget *dest;
|
||||
|
||||
gint src_row;
|
||||
gint dest_row;
|
||||
|
||||
gboolean modified;
|
||||
|
||||
GList *old_nodes;
|
||||
|
||||
GDisplay *gdisp;
|
||||
};
|
||||
|
||||
static ColorDisplayDialog cdd = { NULL, NULL, NULL };
|
||||
static ColorDisplayDialog cdd = { NULL, NULL, NULL, 0, 0, FALSE, NULL, NULL };
|
||||
|
||||
typedef void (*ButtonCallback) (GtkWidget *, gpointer);
|
||||
|
||||
|
@ -45,17 +55,38 @@ struct _ButtonInfo
|
|||
ButtonCallback callback;
|
||||
};
|
||||
|
||||
static void color_display_ok_callback (GtkWidget *, gpointer);
|
||||
static void color_display_cancel_callback (GtkWidget *, gpointer);
|
||||
static gint color_display_destroy_callback (GtkWidget *, gpointer);
|
||||
static void color_display_add_callback (GtkWidget *, gpointer);
|
||||
static void color_display_remove_callback (GtkWidget *, gpointer);
|
||||
static void color_display_up_callback (GtkWidget *, gpointer);
|
||||
static void color_display_down_callback (GtkWidget *, gpointer);
|
||||
static void color_display_configure_callback (GtkWidget *, gpointer);
|
||||
static void color_display_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_cancel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_add_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_remove_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_up_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_down_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_configure_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
static void src_list_populate (const char *name,
|
||||
gpointer user_data);
|
||||
static void src_list_populate (const char *name,
|
||||
gpointer data);
|
||||
static void dest_list_populate (GList *node_list);
|
||||
|
||||
static void select_src (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data);
|
||||
static void select_dest (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data);
|
||||
|
||||
#define LIST_WIDTH 180
|
||||
#define LIST_HEIGHT 180
|
||||
|
||||
static void
|
||||
make_dialog (void)
|
||||
|
@ -102,10 +133,15 @@ make_dialog (void)
|
|||
titles[0] = _("Available Filters");
|
||||
titles[1] = NULL;
|
||||
cdd.src = gtk_clist_new_with_titles (1, titles);
|
||||
gtk_widget_set_usize (cdd.src, LIST_WIDTH, LIST_HEIGHT);
|
||||
gtk_clist_column_titles_passive (GTK_CLIST (cdd.src));
|
||||
gtk_clist_set_auto_sort (GTK_CLIST (cdd.src), TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_win), cdd.src);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (cdd.src), "select_row",
|
||||
GTK_SIGNAL_FUNC (select_src),
|
||||
NULL);
|
||||
|
||||
vbbox = gtk_vbutton_box_new ();
|
||||
gtk_vbutton_box_set_layout_default (GTK_BUTTONBOX_START);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), vbbox, FALSE, FALSE, 2);
|
||||
|
@ -120,9 +156,14 @@ make_dialog (void)
|
|||
titles[0] = _("Active Filters");
|
||||
titles[1] = NULL;
|
||||
cdd.dest = gtk_clist_new_with_titles (1, titles);
|
||||
gtk_widget_set_usize (cdd.dest, LIST_WIDTH, LIST_HEIGHT);
|
||||
gtk_clist_column_titles_passive (GTK_CLIST (cdd.dest));
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_win), cdd.dest);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (cdd.src), "select_row",
|
||||
GTK_SIGNAL_FUNC (select_dest),
|
||||
NULL);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
@ -142,46 +183,126 @@ static void
|
|||
color_display_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
|
||||
if (cdd.modified)
|
||||
{
|
||||
list = cdd.old_nodes;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (!g_list_find (cdd.gdisp->cd_list, list->data))
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, list->data);
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
g_list_free (cdd.old_nodes);
|
||||
}
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_cancel_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
}
|
||||
GList *list;
|
||||
|
||||
static gint
|
||||
color_display_destroy_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
g_free (data);
|
||||
return FALSE;
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
|
||||
if (cdd.modified)
|
||||
{
|
||||
list = cdd.gdisp->cd_list;
|
||||
cdd.gdisp->cd_list = cdd.old_nodes;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (!g_list_find (cdd.old_nodes, list->data))
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, list->data);
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_add_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gchar *name = NULL;
|
||||
ColorDisplayNode *node;
|
||||
gint row;
|
||||
|
||||
gtk_clist_get_text (GTK_CLIST (cdd.src), cdd.src_row, 0, &name);
|
||||
|
||||
cdd.modified = TRUE;
|
||||
|
||||
node = gdisplay_color_attach (cdd.gdisp, name);
|
||||
|
||||
row = gtk_clist_append (GTK_CLIST (cdd.dest), &name);
|
||||
gtk_clist_set_row_data (GTK_CLIST (cdd.dest), row, node);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_remove_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_remove (GTK_CLIST (cdd.dest), cdd.dest_row);
|
||||
|
||||
cdd.modified = TRUE;
|
||||
|
||||
if (g_list_find (cdd.old_nodes, node))
|
||||
gdisplay_color_detach (cdd.gdisp, node);
|
||||
else
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, node);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_up_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_row_move (GTK_CLIST (cdd.dest), cdd.dest_row, cdd.dest_row - 1);
|
||||
|
||||
gdisplay_color_reorder_up (cdd.gdisp, node);
|
||||
cdd.modified = TRUE;
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_down_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_row_move (GTK_CLIST (cdd.dest), cdd.dest_row, cdd.dest_row + 1);
|
||||
|
||||
gdisplay_color_reorder_down (cdd.gdisp, node);
|
||||
cdd.modified = TRUE;
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -199,14 +320,60 @@ gdisplay_color_ui (GDisplay *gdisp)
|
|||
gtk_clist_clear (GTK_CLIST (cdd.src));
|
||||
gtk_clist_clear (GTK_CLIST (cdd.dest));
|
||||
|
||||
gimp_color_display_foreach (src_list_populate, cdd.src);
|
||||
color_display_foreach (src_list_populate, cdd.src);
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
cdd.old_nodes = gdisp->cd_list;
|
||||
dest_list_populate (gdisp->cd_list);
|
||||
gdisp->cd_list = g_list_copy (cdd.old_nodes);
|
||||
}
|
||||
|
||||
cdd.gdisp = gdisp;
|
||||
|
||||
gtk_widget_show (cdd.shell);
|
||||
}
|
||||
|
||||
static void
|
||||
src_list_populate (const char *name,
|
||||
gpointer user_data)
|
||||
gpointer data)
|
||||
{
|
||||
gtk_clist_append (GTK_CLIST (user_data), &name);
|
||||
gtk_clist_append (GTK_CLIST (data), (gchar **) &name);
|
||||
}
|
||||
|
||||
static void
|
||||
dest_list_populate (GList *node_list)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
int row;
|
||||
|
||||
while (node_list)
|
||||
{
|
||||
node = (ColorDisplayNode *) node_list->data;
|
||||
|
||||
row = gtk_clist_append (GTK_CLIST (cdd.dest), &node->cd_name);
|
||||
gtk_clist_set_row_data (GTK_CLIST (cdd.dest), row, node);
|
||||
|
||||
node_list = node_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
select_src (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
cdd.src_row = row;
|
||||
}
|
||||
|
||||
static void
|
||||
select_dest (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
cdd.dest_row = row;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#ifndef S_ISREG
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
#endif
|
||||
|
|
|
@ -2683,7 +2683,7 @@ open_backup_file (char *filename,
|
|||
{
|
||||
*name_used = filename;
|
||||
oldfilename = g_strdup_printf ("%s.old", filename);
|
||||
#if defined(NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined(__EMX__)
|
||||
/* Can't rename open files... */
|
||||
fclose (*fp_old);
|
||||
/* Also, can't rename to an existing file name */
|
||||
|
@ -2695,7 +2695,7 @@ open_backup_file (char *filename,
|
|||
return g_strdup_printf (_("Can't rename %s to %s.old; %s"),
|
||||
filename, filename, g_strerror (errno));
|
||||
}
|
||||
#if defined(NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined(__EMX__)
|
||||
/* Can't rename open files... */
|
||||
if ((*fp_old = fopen (oldfilename, "rt")) == NULL)
|
||||
g_error (_("Couldn't reopen %s\n"), oldfilename);
|
||||
|
|
|
@ -453,7 +453,7 @@ valid_module_name (const char *filename)
|
|||
|
||||
len = strlen (basename);
|
||||
|
||||
#if !defined(WIN32) && !defined(__EMX__)
|
||||
#if !defined(G_OS_WIN32) && !defined(G_HAVE_CYGWIN) && !defined(__EMX__)
|
||||
if (len < 3 + 1 + 3)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "libgimp/gimpintl.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
# ifndef __EMX__
|
||||
# define USER_INSTALL "user_install"
|
||||
# else
|
||||
|
@ -339,7 +339,7 @@ help_quit_callback (GtkWidget *widget,
|
|||
gtk_exit (0);
|
||||
}
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
char *
|
||||
quote_spaces (char *string)
|
||||
|
@ -430,7 +430,7 @@ install_run (InstallCallback callback)
|
|||
/* Realize the text widget before inserting text strings */
|
||||
gtk_widget_realize (text);
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, _("User Installation Log\n\n"), -1);
|
||||
#endif
|
||||
|
||||
|
@ -456,7 +456,7 @@ install_run (InstallCallback callback)
|
|||
|
||||
if (executable == TRUE)
|
||||
{
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
char *quoted_data_dir, *quoted_user_dir;
|
||||
|
||||
/* On Windows, it is common for the GIMP data directory
|
||||
|
@ -519,7 +519,7 @@ install_run (InstallCallback callback)
|
|||
}
|
||||
else
|
||||
executable = FALSE;
|
||||
#endif /* !NATIVE_WIN32 */
|
||||
#endif /* !G_OS_WIN32 */
|
||||
}
|
||||
|
||||
if (executable == FALSE)
|
||||
|
@ -538,7 +538,7 @@ install_continue_callback (GtkWidget *widget,
|
|||
{
|
||||
InstallCallback callback;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
FreeConsole ();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "libgimp/gimpintl.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
# ifndef __EMX__
|
||||
# define USER_INSTALL "user_install"
|
||||
# else
|
||||
|
@ -339,7 +339,7 @@ help_quit_callback (GtkWidget *widget,
|
|||
gtk_exit (0);
|
||||
}
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
char *
|
||||
quote_spaces (char *string)
|
||||
|
@ -430,7 +430,7 @@ install_run (InstallCallback callback)
|
|||
/* Realize the text widget before inserting text strings */
|
||||
gtk_widget_realize (text);
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, _("User Installation Log\n\n"), -1);
|
||||
#endif
|
||||
|
||||
|
@ -456,7 +456,7 @@ install_run (InstallCallback callback)
|
|||
|
||||
if (executable == TRUE)
|
||||
{
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
char *quoted_data_dir, *quoted_user_dir;
|
||||
|
||||
/* On Windows, it is common for the GIMP data directory
|
||||
|
@ -519,7 +519,7 @@ install_run (InstallCallback callback)
|
|||
}
|
||||
else
|
||||
executable = FALSE;
|
||||
#endif /* !NATIVE_WIN32 */
|
||||
#endif /* !G_OS_WIN32 */
|
||||
}
|
||||
|
||||
if (executable == FALSE)
|
||||
|
@ -538,7 +538,7 @@ install_continue_callback (GtkWidget *widget,
|
|||
{
|
||||
InstallCallback callback;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
FreeConsole ();
|
||||
#endif
|
||||
|
||||
|
|
14
app/main.c
14
app/main.c
|
@ -46,7 +46,7 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
static RETSIGTYPE on_signal (int);
|
||||
#ifdef SIGCHLD
|
||||
static RETSIGTYPE on_sig_child (int);
|
||||
|
@ -140,7 +140,7 @@ main (int argc, char **argv)
|
|||
no_splash = FALSE;
|
||||
no_splash_image = FALSE;
|
||||
|
||||
#if defined (HAVE_SHM_H) || defined (NATIVE_WIN32)
|
||||
#if defined (HAVE_SHM_H) || defined (G_OS_WIN32)
|
||||
use_shm = TRUE;
|
||||
#else
|
||||
use_shm = FALSE;
|
||||
|
@ -303,7 +303,7 @@ main (int argc, char **argv)
|
|||
|
||||
g_set_message_handler ((GPrintFunc) gimp_message_func);
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
/* No use catching these on Win32, the user won't get any
|
||||
* stack trace from glib anyhow. It's better to let Windows inform
|
||||
* about the program error, and offer debugging (if the use
|
||||
|
@ -364,7 +364,7 @@ main (int argc, char **argv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
/* In case we build this as a windowed application */
|
||||
|
||||
|
@ -399,13 +399,13 @@ on_error (const gchar *domain,
|
|||
|
||||
static int caught_fatal_sig = 0;
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
|
||||
static RETSIGTYPE
|
||||
on_signal (int sig_num)
|
||||
{
|
||||
if (caught_fatal_sig)
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
raise (sig_num);
|
||||
#else
|
||||
kill (getpid (), sig_num);
|
||||
|
@ -544,7 +544,7 @@ test_gserialize (void)
|
|||
if (to->test_array[1] != ts->test_array[1])
|
||||
g_message("int16array value 1 test failed(please email your system configuration to jaycox@earthlink.net): %d\n", to->test_array[1]);
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
g_message("Passed serialization test\n");
|
||||
#endif
|
||||
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -453,7 +453,7 @@ valid_module_name (const char *filename)
|
|||
|
||||
len = strlen (basename);
|
||||
|
||||
#if !defined(WIN32) && !defined(__EMX__)
|
||||
#if !defined(G_OS_WIN32) && !defined(G_HAVE_CYGWIN) && !defined(__EMX__)
|
||||
if (len < 3 + 1 + 3)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <process.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __CYGWIN32__
|
||||
#ifdef G_HAVE_CYGWIN
|
||||
#define O_TEXT 0x0100 /* text file */
|
||||
#define _O_TEXT 0x0100 /* text file */
|
||||
#define O_BINARY 0x0200 /* binary file */
|
||||
|
@ -183,7 +183,7 @@ static ProcRecord *last_plug_in = NULL;
|
|||
static int shm_ID = -1;
|
||||
static guchar *shm_addr = NULL;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -220,7 +220,7 @@ plug_in_init_shm (void)
|
|||
#endif
|
||||
}
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data.
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@ plug_in_kill (void)
|
|||
GSList *tmp;
|
||||
PlugIn *plug_in;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -829,7 +829,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__CYGWIN32__) || defined(__EMX__)
|
||||
#if defined(G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
/* Set to binary mode */
|
||||
setmode(my_read[0], _O_BINARY);
|
||||
setmode(my_write[0], _O_BINARY);
|
||||
|
@ -837,7 +837,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
setmode(my_write[1], _O_BINARY);
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#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]);
|
||||
|
@ -852,7 +852,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
|
||||
/* Remember the file descriptors for the pipes.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
sprintf (plug_in->args[2], "%d",
|
||||
g_io_channel_unix_get_fd (plug_in->his_read));
|
||||
sprintf (plug_in->args[3], "%d",
|
||||
|
@ -889,7 +889,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
fcntl(my_read[0], F_SETFD, 1);
|
||||
fcntl(my_write[1], F_SETFD, 1);
|
||||
#endif
|
||||
#if defined (__CYGWIN32__) || defined (NATIVE_WIN32) || defined(__EMX__)
|
||||
#if defined(G_OS_WIN32) || defined (G_HAVE_CYGWIN) || defined(__EMX__)
|
||||
plug_in->pid = _spawnv (_P_NOWAIT, plug_in->args[0], plug_in->args);
|
||||
if (plug_in->pid == -1)
|
||||
#else
|
||||
|
@ -926,7 +926,7 @@ plug_in_open (PlugIn *plug_in)
|
|||
g_io_channel_unref (plug_in->his_write);
|
||||
plug_in->his_write = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* The plug-in tells us its thread id */
|
||||
if (!plug_in->query)
|
||||
{
|
||||
|
@ -961,7 +961,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
int kill_it)
|
||||
{
|
||||
int status;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
struct timeval tv;
|
||||
#endif
|
||||
|
||||
|
@ -978,7 +978,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
plug_in_pop ();
|
||||
|
||||
/* give the plug-in some time (10 ms) */
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100; /* But this is 0.1 ms? */
|
||||
select (0, NULL, NULL, NULL, &tv);
|
||||
|
@ -989,7 +989,7 @@ plug_in_close (PlugIn *plug_in,
|
|||
|
||||
/* If necessary, kill the filter.
|
||||
*/
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (kill_it && plug_in->pid)
|
||||
status = kill (plug_in->pid, SIGKILL);
|
||||
|
||||
|
@ -1364,7 +1364,7 @@ plug_in_handle_message (WireMessage *msg)
|
|||
gtk_main_quit ();
|
||||
break;
|
||||
case GP_REQUEST_WAKEUPS:
|
||||
#ifdef NATIVE_WIN32
|
||||
#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);
|
||||
|
|
|
@ -58,7 +58,7 @@ struct _PlugIn
|
|||
|
||||
GIOChannel *my_read, *my_write; /* App's read and write channels */
|
||||
GIOChannel *his_read, *his_write; /* Plug-in's read and write channels */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
guint his_thread_id; /* Plug-in's thread ID */
|
||||
int his_read_fd; /* Plug-in's read pipe fd */
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include "libgimp/gimpintl.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
# ifndef __EMX__
|
||||
# define USER_INSTALL "user_install"
|
||||
# else
|
||||
|
@ -339,7 +339,7 @@ help_quit_callback (GtkWidget *widget,
|
|||
gtk_exit (0);
|
||||
}
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
char *
|
||||
quote_spaces (char *string)
|
||||
|
@ -430,7 +430,7 @@ install_run (InstallCallback callback)
|
|||
/* Realize the text widget before inserting text strings */
|
||||
gtk_widget_realize (text);
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
gtk_text_insert (GTK_TEXT (text), font_strong, NULL, NULL, _("User Installation Log\n\n"), -1);
|
||||
#endif
|
||||
|
||||
|
@ -456,7 +456,7 @@ install_run (InstallCallback callback)
|
|||
|
||||
if (executable == TRUE)
|
||||
{
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
char *quoted_data_dir, *quoted_user_dir;
|
||||
|
||||
/* On Windows, it is common for the GIMP data directory
|
||||
|
@ -519,7 +519,7 @@ install_run (InstallCallback callback)
|
|||
}
|
||||
else
|
||||
executable = FALSE;
|
||||
#endif /* !NATIVE_WIN32 */
|
||||
#endif /* !G_OS_WIN32 */
|
||||
}
|
||||
|
||||
if (executable == FALSE)
|
||||
|
@ -538,7 +538,7 @@ install_continue_callback (GtkWidget *widget,
|
|||
{
|
||||
InstallCallback callback;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
FreeConsole ();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -29,11 +29,21 @@ typedef struct _ColorDisplayDialog ColorDisplayDialog;
|
|||
struct _ColorDisplayDialog
|
||||
{
|
||||
GtkWidget *shell;
|
||||
|
||||
GtkWidget *src;
|
||||
GtkWidget *dest;
|
||||
|
||||
gint src_row;
|
||||
gint dest_row;
|
||||
|
||||
gboolean modified;
|
||||
|
||||
GList *old_nodes;
|
||||
|
||||
GDisplay *gdisp;
|
||||
};
|
||||
|
||||
static ColorDisplayDialog cdd = { NULL, NULL, NULL };
|
||||
static ColorDisplayDialog cdd = { NULL, NULL, NULL, 0, 0, FALSE, NULL, NULL };
|
||||
|
||||
typedef void (*ButtonCallback) (GtkWidget *, gpointer);
|
||||
|
||||
|
@ -45,17 +55,38 @@ struct _ButtonInfo
|
|||
ButtonCallback callback;
|
||||
};
|
||||
|
||||
static void color_display_ok_callback (GtkWidget *, gpointer);
|
||||
static void color_display_cancel_callback (GtkWidget *, gpointer);
|
||||
static gint color_display_destroy_callback (GtkWidget *, gpointer);
|
||||
static void color_display_add_callback (GtkWidget *, gpointer);
|
||||
static void color_display_remove_callback (GtkWidget *, gpointer);
|
||||
static void color_display_up_callback (GtkWidget *, gpointer);
|
||||
static void color_display_down_callback (GtkWidget *, gpointer);
|
||||
static void color_display_configure_callback (GtkWidget *, gpointer);
|
||||
static void color_display_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_cancel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_add_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_remove_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_up_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_down_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void color_display_configure_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
static void src_list_populate (const char *name,
|
||||
gpointer user_data);
|
||||
static void src_list_populate (const char *name,
|
||||
gpointer data);
|
||||
static void dest_list_populate (GList *node_list);
|
||||
|
||||
static void select_src (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data);
|
||||
static void select_dest (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data);
|
||||
|
||||
#define LIST_WIDTH 180
|
||||
#define LIST_HEIGHT 180
|
||||
|
||||
static void
|
||||
make_dialog (void)
|
||||
|
@ -102,10 +133,15 @@ make_dialog (void)
|
|||
titles[0] = _("Available Filters");
|
||||
titles[1] = NULL;
|
||||
cdd.src = gtk_clist_new_with_titles (1, titles);
|
||||
gtk_widget_set_usize (cdd.src, LIST_WIDTH, LIST_HEIGHT);
|
||||
gtk_clist_column_titles_passive (GTK_CLIST (cdd.src));
|
||||
gtk_clist_set_auto_sort (GTK_CLIST (cdd.src), TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_win), cdd.src);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (cdd.src), "select_row",
|
||||
GTK_SIGNAL_FUNC (select_src),
|
||||
NULL);
|
||||
|
||||
vbbox = gtk_vbutton_box_new ();
|
||||
gtk_vbutton_box_set_layout_default (GTK_BUTTONBOX_START);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), vbbox, FALSE, FALSE, 2);
|
||||
|
@ -120,9 +156,14 @@ make_dialog (void)
|
|||
titles[0] = _("Active Filters");
|
||||
titles[1] = NULL;
|
||||
cdd.dest = gtk_clist_new_with_titles (1, titles);
|
||||
gtk_widget_set_usize (cdd.dest, LIST_WIDTH, LIST_HEIGHT);
|
||||
gtk_clist_column_titles_passive (GTK_CLIST (cdd.dest));
|
||||
gtk_container_add (GTK_CONTAINER (scrolled_win), cdd.dest);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (cdd.src), "select_row",
|
||||
GTK_SIGNAL_FUNC (select_dest),
|
||||
NULL);
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
@ -142,46 +183,126 @@ static void
|
|||
color_display_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
|
||||
if (cdd.modified)
|
||||
{
|
||||
list = cdd.old_nodes;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (!g_list_find (cdd.gdisp->cd_list, list->data))
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, list->data);
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
g_list_free (cdd.old_nodes);
|
||||
}
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_cancel_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
}
|
||||
GList *list;
|
||||
|
||||
static gint
|
||||
color_display_destroy_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
g_free (data);
|
||||
return FALSE;
|
||||
gtk_widget_hide (GTK_WIDGET (data));
|
||||
|
||||
if (cdd.modified)
|
||||
{
|
||||
list = cdd.gdisp->cd_list;
|
||||
cdd.gdisp->cd_list = cdd.old_nodes;
|
||||
|
||||
while (list)
|
||||
{
|
||||
if (!g_list_find (cdd.old_nodes, list->data))
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, list->data);
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_add_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gchar *name = NULL;
|
||||
ColorDisplayNode *node;
|
||||
gint row;
|
||||
|
||||
gtk_clist_get_text (GTK_CLIST (cdd.src), cdd.src_row, 0, &name);
|
||||
|
||||
cdd.modified = TRUE;
|
||||
|
||||
node = gdisplay_color_attach (cdd.gdisp, name);
|
||||
|
||||
row = gtk_clist_append (GTK_CLIST (cdd.dest), &name);
|
||||
gtk_clist_set_row_data (GTK_CLIST (cdd.dest), row, node);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_remove_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_remove (GTK_CLIST (cdd.dest), cdd.dest_row);
|
||||
|
||||
cdd.modified = TRUE;
|
||||
|
||||
if (g_list_find (cdd.old_nodes, node))
|
||||
gdisplay_color_detach (cdd.gdisp, node);
|
||||
else
|
||||
gdisplay_color_detach_destroy (cdd.gdisp, node);
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_up_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_row_move (GTK_CLIST (cdd.dest), cdd.dest_row, cdd.dest_row - 1);
|
||||
|
||||
gdisplay_color_reorder_up (cdd.gdisp, node);
|
||||
cdd.modified = TRUE;
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
color_display_down_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
|
||||
node = (ColorDisplayNode *) gtk_clist_get_row_data (GTK_CLIST (cdd.dest),
|
||||
cdd.dest_row);
|
||||
|
||||
gtk_clist_row_move (GTK_CLIST (cdd.dest), cdd.dest_row, cdd.dest_row + 1);
|
||||
|
||||
gdisplay_color_reorder_down (cdd.gdisp, node);
|
||||
cdd.modified = TRUE;
|
||||
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -199,14 +320,60 @@ gdisplay_color_ui (GDisplay *gdisp)
|
|||
gtk_clist_clear (GTK_CLIST (cdd.src));
|
||||
gtk_clist_clear (GTK_CLIST (cdd.dest));
|
||||
|
||||
gimp_color_display_foreach (src_list_populate, cdd.src);
|
||||
color_display_foreach (src_list_populate, cdd.src);
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
cdd.old_nodes = gdisp->cd_list;
|
||||
dest_list_populate (gdisp->cd_list);
|
||||
gdisp->cd_list = g_list_copy (cdd.old_nodes);
|
||||
}
|
||||
|
||||
cdd.gdisp = gdisp;
|
||||
|
||||
gtk_widget_show (cdd.shell);
|
||||
}
|
||||
|
||||
static void
|
||||
src_list_populate (const char *name,
|
||||
gpointer user_data)
|
||||
gpointer data)
|
||||
{
|
||||
gtk_clist_append (GTK_CLIST (user_data), &name);
|
||||
gtk_clist_append (GTK_CLIST (data), (gchar **) &name);
|
||||
}
|
||||
|
||||
static void
|
||||
dest_list_populate (GList *node_list)
|
||||
{
|
||||
ColorDisplayNode *node;
|
||||
int row;
|
||||
|
||||
while (node_list)
|
||||
{
|
||||
node = (ColorDisplayNode *) node_list->data;
|
||||
|
||||
row = gtk_clist_append (GTK_CLIST (cdd.dest), &node->cd_name);
|
||||
gtk_clist_set_row_data (GTK_CLIST (cdd.dest), row, node);
|
||||
|
||||
node_list = node_list->next;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
select_src (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
cdd.src_row = row;
|
||||
}
|
||||
|
||||
static void
|
||||
select_dest (GtkWidget *widget,
|
||||
gint row,
|
||||
gint column,
|
||||
GdkEventButton *event,
|
||||
gpointer data)
|
||||
{
|
||||
cdd.dest_row = row;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
# define STRICT
|
||||
# include <windows.h>
|
||||
# undef RGB
|
||||
|
@ -72,7 +72,7 @@ void gimp_extension_ack (void);
|
|||
void gimp_read_expect_msg(WireMessage *msg, int type);
|
||||
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
static RETSIGTYPE gimp_signal (int signum);
|
||||
#endif
|
||||
static int gimp_write (GIOChannel *channel , guint8 *buf, gulong count);
|
||||
|
@ -96,7 +96,7 @@ guint gimp_major_version = GIMP_MAJOR_VERSION;
|
|||
guint gimp_minor_version = GIMP_MINOR_VERSION;
|
||||
guint gimp_micro_version = GIMP_MICRO_VERSION;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
static HANDLE shm_handle;
|
||||
#endif
|
||||
|
||||
|
@ -112,7 +112,7 @@ static guint write_buffer_index = 0;
|
|||
|
||||
static GHashTable *temp_proc_ht = NULL;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
static GPlugInInfo *PLUG_IN_INFO_PTR;
|
||||
#define PLUG_IN_INFO (*PLUG_IN_INFO_PTR)
|
||||
void
|
||||
|
@ -137,7 +137,7 @@ int
|
|||
gimp_main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
char *peer, *peer_fd;
|
||||
guint32 thread;
|
||||
int i, j, k;
|
||||
|
@ -145,7 +145,7 @@ gimp_main (int argc,
|
|||
|
||||
setlocale (LC_NUMERIC, "C");
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* 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.
|
||||
|
@ -187,7 +187,7 @@ gimp_main (int argc,
|
|||
|
||||
progname = argv[0];
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
/* No use catching these on Win32, the user won't get any meaningful
|
||||
* stack trace from glib anyhow. It's better to let Windows inform
|
||||
* about the program error, and offer debugging if the plug-in
|
||||
|
@ -215,7 +215,7 @@ gimp_main (int argc,
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
_readchannel = g_io_channel_unix_new (atoi (argv[2]));
|
||||
_writechannel = g_io_channel_unix_new (atoi (argv[3]));
|
||||
#ifdef __EMX__
|
||||
|
@ -243,7 +243,7 @@ gimp_main (int argc,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* Tell the GIMP our thread id */
|
||||
thread = GetCurrentThreadId ();
|
||||
wire_write_int32 (_writechannel, &thread, 1);
|
||||
|
@ -259,12 +259,12 @@ gimp_main (int argc,
|
|||
}
|
||||
|
||||
static void
|
||||
gimp_close ()
|
||||
gimp_close (void)
|
||||
{
|
||||
if (PLUG_IN_INFO.quit_proc)
|
||||
(* PLUG_IN_INFO.quit_proc) ();
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
CloseHandle (shm_handle);
|
||||
#else
|
||||
#ifdef HAVE_SHM_H
|
||||
|
@ -277,7 +277,7 @@ gimp_close ()
|
|||
}
|
||||
|
||||
void
|
||||
gimp_quit ()
|
||||
gimp_quit (void)
|
||||
{
|
||||
gimp_close ();
|
||||
exit (0);
|
||||
|
@ -1076,7 +1076,7 @@ gimp_single_message()
|
|||
void
|
||||
gimp_extension_process (guint timeout)
|
||||
{
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
fd_set readfds;
|
||||
int select_val;
|
||||
struct timeval tv;
|
||||
|
@ -1120,11 +1120,10 @@ gimp_extension_process (guint timeout)
|
|||
if (PeekMessage (&msg, (HWND) -1, message, message, PM_NOREMOVE))
|
||||
gimp_single_message ();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
gimp_extension_ack ()
|
||||
gimp_extension_ack (void)
|
||||
{
|
||||
/* Send an extension initialization acknowledgement */
|
||||
if (! gp_extension_ack_write (_writechannel))
|
||||
|
@ -1132,7 +1131,7 @@ gimp_extension_ack ()
|
|||
}
|
||||
|
||||
void
|
||||
gimp_run_temp()
|
||||
gimp_run_temp (void)
|
||||
{
|
||||
gimp_single_message();
|
||||
}
|
||||
|
@ -1144,18 +1143,15 @@ gimp_request_wakeups (void)
|
|||
gimp_quit ();
|
||||
}
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
static RETSIGTYPE
|
||||
gimp_signal (int signum)
|
||||
{
|
||||
static int caught_fatal_sig = 0;
|
||||
|
||||
if (caught_fatal_sig)
|
||||
#ifdef NATIVE_WIN32
|
||||
raise (signum);
|
||||
#else
|
||||
kill (getpid (), signum);
|
||||
#endif
|
||||
|
||||
caught_fatal_sig = 1;
|
||||
|
||||
fprintf (stderr, "\n%s: %s caught\n", progname, g_strsignal (signum));
|
||||
|
@ -1172,11 +1168,7 @@ gimp_signal (int signum)
|
|||
case SIGFPE:
|
||||
#endif
|
||||
case 123456: /* Must have some case value... */
|
||||
#ifndef NATIVE_WIN32
|
||||
g_on_error_query (progname);
|
||||
#else
|
||||
abort ();
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1327,7 +1319,7 @@ gimp_config (GPConfig *config)
|
|||
|
||||
if (_shm_ID != -1)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if defined(G_OS_WIN32) || defined(G_HAVE_CYGWIN)
|
||||
/*
|
||||
* Use Win32 shared memory mechanisms for
|
||||
* transfering tile data
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
#include "libgimp/parasiteP.h"
|
||||
#include "libgimp/gimpunit.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
# ifdef LIBGIMP_COMPILATION
|
||||
# define GIMPVAR __declspec(dllexport)
|
||||
# else /* !LIBGIMP_COMPILATION */
|
||||
# define GIMPVAR extern __declspec(dllimport)
|
||||
# endif /* !LIBGIMP_COMPILATION */
|
||||
#else /* !NATIVE_WIN32 */
|
||||
#else /* !G_OS_WIN32 */
|
||||
# define GIMPVAR extern
|
||||
#endif
|
||||
|
||||
|
@ -178,7 +178,7 @@ struct _GParam
|
|||
};
|
||||
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* Define WinMain() because plug-ins are built as GUI applications. Also
|
||||
* define a main() in case some plug-in still is built as a console
|
||||
* application.
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "gimpenv.h"
|
||||
#include "gimpintl.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
#include <windows.h> /* For GetModuleFileName */
|
||||
#endif
|
||||
|
@ -82,7 +82,7 @@ gimp_directory ()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
g_message (_("warning: no home directory."));
|
||||
#endif
|
||||
gimp_dir = g_strconcat (gimp_data_directory (),
|
||||
|
@ -129,7 +129,7 @@ gimp_data_directory ()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
#ifndef __EMX__
|
||||
gimp_data_dir = DATADIR;
|
||||
#else
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "pixmaps/yes.xpm"
|
||||
#include "pixmaps/no.xpm"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
# ifndef S_ISDIR
|
||||
# define S_ISDIR(m) ((m) & _S_IFDIR)
|
||||
# endif
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
|
||||
#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include "gimpenv.h"
|
||||
#include "gimpintl.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
#include <windows.h> /* For GetModuleFileName */
|
||||
#endif
|
||||
|
@ -82,7 +82,7 @@ gimp_directory ()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
g_message (_("warning: no home directory."));
|
||||
#endif
|
||||
gimp_dir = g_strconcat (gimp_data_directory (),
|
||||
|
@ -129,7 +129,7 @@ gimp_data_directory ()
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
#ifndef __EMX__
|
||||
gimp_data_dir = DATADIR;
|
||||
#else
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
#endif
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "pixmaps/yes.xpm"
|
||||
#include "pixmaps/no.xpm"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
# ifndef S_ISDIR
|
||||
# define S_ISDIR(m) ((m) & _S_IFDIR)
|
||||
# endif
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include "pixmaps/yes.xpm"
|
||||
#include "pixmaps/no.xpm"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
# ifndef S_ISDIR
|
||||
# define S_ISDIR(m) ((m) & _S_IFDIR)
|
||||
# endif
|
||||
|
|
|
@ -19,16 +19,21 @@ EXTRA_DIST = \
|
|||
libexec_LTLIBRARIES = \
|
||||
libcolorsel_gtk.la \
|
||||
libcolorsel_triangle.la \
|
||||
libcolorsel_water.la
|
||||
libcolorsel_water.la \
|
||||
libcdisplay_gamma.la
|
||||
|
||||
libcolorsel_gtk_la_SOURCES = colorsel_gtk.c
|
||||
libcolorsel_gtk_la_LDFLAGS = -avoid-version -module
|
||||
libcolorsel_gtk_la_LIBADD = @GTK_LIBS@
|
||||
libcolorsel_gtk_la_LIBADD = $(GTK_LIBS)
|
||||
|
||||
libcolorsel_triangle_la_SOURCES = colorsel_triangle.c
|
||||
libcolorsel_triangle_la_LDFLAGS = -avoid-version -module
|
||||
libcolorsel_triangle_la_LIBADD = @GTK_LIBS@
|
||||
libcolorsel_triangle_la_LIBADD = $(GTK_LIBS)
|
||||
|
||||
libcolorsel_water_la_SOURCES = colorsel_water.c
|
||||
libcolorsel_water_la_LDFLAGS = -avoid-version -module
|
||||
libcolorsel_water_la_LIBADD = @GTK_LIBS@
|
||||
libcolorsel_water_la_LIBADD = $(GTK_LIBS)
|
||||
|
||||
libcdisplay_gamma_la_SOURCES = cdisplay_gamma.c
|
||||
libcdisplay_gamma_la_LDFLAGS = -avoid-version -module
|
||||
libcdisplay_gamma_la_LIBADD = $(GTK_LIBS)
|
||||
|
|
|
@ -0,0 +1,292 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1999 Manish Singh
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libgimp/color_display.h>
|
||||
#include <libgimp/gimpmodule.h>
|
||||
#include <libgimp/parasite.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define COLOR_DISPLAY_NAME "Gamma"
|
||||
|
||||
typedef struct _GammaContext GammaContext;
|
||||
|
||||
struct _GammaContext
|
||||
{
|
||||
double gamma;
|
||||
guchar *lookup;
|
||||
|
||||
GtkWidget *shell;
|
||||
GtkWidget *spinner;
|
||||
};
|
||||
|
||||
static gpointer gamma_new (int type);
|
||||
static void gamma_create_lookup_table (GammaContext *context);
|
||||
static void gamma_destroy (gpointer cd_ID);
|
||||
static void gamma_convert (gpointer cd_ID,
|
||||
guchar *buf,
|
||||
int width,
|
||||
int height,
|
||||
int bpp);
|
||||
static void gamma_load (gpointer cd_ID,
|
||||
Parasite *state);
|
||||
static Parasite * gamma_save (gpointer cd_ID);
|
||||
static void gamma_configure_ok_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void gamma_configure_cancel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static gint gamma_configure_delete_callback (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
static void gamma_configure (gpointer cd_ID);
|
||||
|
||||
static GimpColorDisplayMethods methods = {
|
||||
NULL,
|
||||
gamma_new,
|
||||
gamma_convert,
|
||||
gamma_destroy,
|
||||
NULL,
|
||||
gamma_load,
|
||||
gamma_save,
|
||||
gamma_configure
|
||||
};
|
||||
|
||||
static GimpModuleInfo info = {
|
||||
NULL,
|
||||
"Gamma color display filter",
|
||||
"Manish Singh <yosh@gimp.org>",
|
||||
"v0.1",
|
||||
"(c) 1999, released under the GPL",
|
||||
"October 3, 1999"
|
||||
};
|
||||
|
||||
G_MODULE_EXPORT GimpModuleStatus
|
||||
module_init (GimpModuleInfo **inforet)
|
||||
{
|
||||
if (gimp_color_display_register (COLOR_DISPLAY_NAME, &methods))
|
||||
{
|
||||
*inforet = &info;
|
||||
return GIMP_MODULE_OK;
|
||||
}
|
||||
else
|
||||
return GIMP_MODULE_UNLOAD;
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT void
|
||||
module_unload (void *shutdown_data,
|
||||
void (*completed_cb)(void *),
|
||||
void *completed_data)
|
||||
{
|
||||
gimp_color_display_unregister (COLOR_DISPLAY_NAME);
|
||||
}
|
||||
|
||||
|
||||
static gpointer
|
||||
gamma_new (int type)
|
||||
{
|
||||
int i;
|
||||
GammaContext *context = NULL;
|
||||
|
||||
context = g_new (GammaContext, 1);
|
||||
context->gamma = 2.2;
|
||||
context->lookup = g_new (guchar, 256);
|
||||
context->shell = NULL;
|
||||
context->spinner = NULL;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
context->lookup[i] = i;
|
||||
|
||||
gamma_create_lookup_table (context);
|
||||
return context;
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_create_lookup_table (GammaContext *context)
|
||||
{
|
||||
double one_over_gamma;
|
||||
double ind;
|
||||
int i;
|
||||
|
||||
if (context->gamma == 0.0)
|
||||
context->gamma = 1.0;
|
||||
|
||||
one_over_gamma = 1.0 / context->gamma;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
ind = (double) i / 255.0;
|
||||
context->lookup[i] = (guchar) (int) (255 * pow (ind, one_over_gamma));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_destroy (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
|
||||
if (context->shell)
|
||||
gtk_widget_destroy (context->shell);
|
||||
|
||||
g_free (context->lookup);
|
||||
g_free (context);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_convert (gpointer cd_ID,
|
||||
guchar *buf,
|
||||
int width,
|
||||
int height,
|
||||
int bpp)
|
||||
{
|
||||
int i;
|
||||
guchar *lookup = ((GammaContext *) cd_ID)->lookup;
|
||||
|
||||
for (i = 0; i < width * height * bpp; i++)
|
||||
*buf++ = lookup[*buf];
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_load (gpointer cd_ID,
|
||||
Parasite *state)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
|
||||
#if G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
memcpy (&context->gamma, parasite_data (state), sizeof (double));
|
||||
#else
|
||||
guint32 buf[2], *data = parasite_data (state);
|
||||
|
||||
buf[0] = g_ntohl (data[1]);
|
||||
buf[1] = g_ntohl (data[0]);
|
||||
|
||||
memcpy (&context->gamma, buf, sizeof (double));
|
||||
#endif
|
||||
|
||||
gamma_create_lookup_table (context);
|
||||
}
|
||||
|
||||
static Parasite *
|
||||
gamma_save (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
guint32 buf[2];
|
||||
|
||||
memcpy (buf, &context->gamma, sizeof (double));
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
{
|
||||
guint32 tmp = g_htonl (buf[0]);
|
||||
buf[0] = g_htonl (buf[1]);
|
||||
buf[1] = tmp;
|
||||
}
|
||||
#endif
|
||||
|
||||
return parasite_new ("Display/Gamma", PARASITE_PERSISTENT,
|
||||
sizeof (double), &buf);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure_ok_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) data;
|
||||
|
||||
context->gamma = gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (context->spinner));
|
||||
gamma_create_lookup_table (context);
|
||||
|
||||
gtk_widget_hide (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure_cancel_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_widget_hide (widget);
|
||||
}
|
||||
|
||||
static gint
|
||||
gamma_configure_delete_callback (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
gamma_configure_cancel_callback (widget, data);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gamma_configure (gpointer cd_ID)
|
||||
{
|
||||
GammaContext *context = (GammaContext *) cd_ID;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *hbbox;
|
||||
GtkWidget *button;
|
||||
GtkObject *adjustment;
|
||||
|
||||
if (!context->shell)
|
||||
{
|
||||
context->shell = gtk_dialog_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (context->shell), "gamma", "Gimp");
|
||||
gtk_window_set_title (GTK_WINDOW (context->shell), "Gamma");
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (context->shell), "delete_event",
|
||||
GTK_SIGNAL_FUNC (gamma_configure_delete_callback),
|
||||
NULL);
|
||||
|
||||
hbox = gtk_hbox_new (TRUE, 2);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (context->shell)->vbox),
|
||||
hbox, FALSE, FALSE, 0);
|
||||
|
||||
label = gtk_label_new ("Gamma:");
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
|
||||
|
||||
adjustment = gtk_adjustment_new (1.0, 0.01, 10.0, 0.01, 0.1, 0.0);
|
||||
context->spinner = gtk_spin_button_new (GTK_ADJUSTMENT (adjustment),
|
||||
0.1, 3);
|
||||
gtk_widget_set_usize (context->spinner, 100, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, FALSE, 0);
|
||||
|
||||
hbbox = gtk_hbutton_box_new ();
|
||||
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbbox), 4);
|
||||
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (context->shell)->action_area),
|
||||
hbbox, FALSE, FALSE, 0);
|
||||
|
||||
button = gtk_button_new_with_label ("OK");
|
||||
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (gamma_configure_ok_callback),
|
||||
cd_ID);
|
||||
|
||||
button = gtk_button_new_with_label ("Cancel");
|
||||
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC (gamma_configure_cancel_callback),
|
||||
cd_ID);
|
||||
|
||||
gtk_widget_show_all (hbox);
|
||||
}
|
||||
|
||||
gtk_widget_show (context->shell);
|
||||
}
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h> /* Include early for NATIVE_WIN32 */
|
||||
#include <glib.h> /* Include early for G_OS_WIN32 */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -60,7 +60,7 @@
|
|||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
|
||||
#ifndef W_OK
|
||||
|
|
|
@ -58,9 +58,9 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h> /* For NATIVE_WIN32 */
|
||||
#include <glib.h> /* For G_OS_WIN32 */
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
#define WinMain WinMain_foo
|
||||
#include <windows.h>
|
||||
|
@ -297,7 +297,7 @@ save_image (char *filename,
|
|||
gint retvals;
|
||||
char* ext;
|
||||
char* tmpname;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
FILE* f;
|
||||
int pid;
|
||||
int status;
|
||||
|
@ -343,7 +343,7 @@ save_image (char *filename,
|
|||
/* return -1; */
|
||||
/* } */
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
|
||||
#ifndef __EMX__
|
||||
|
||||
|
@ -385,7 +385,7 @@ save_image (char *filename,
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
#else /* NATIVE_WIN32 */
|
||||
#else /* G_OS_WIN32 */
|
||||
secattr.nLength = sizeof (SECURITY_ATTRIBUTES);
|
||||
secattr.lpSecurityDescriptor = NULL;
|
||||
secattr.bInheritHandle = TRUE;
|
||||
|
@ -424,7 +424,7 @@ save_image (char *filename,
|
|||
CloseHandle (processinfo.hThread);
|
||||
WaitForSingleObject (processinfo.hProcess, INFINITE);
|
||||
|
||||
#endif /* NATIVE_WIN32 */
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
unlink (tmpname);
|
||||
|
||||
|
@ -438,7 +438,7 @@ load_image (char *filename, gint32 run_mode)
|
|||
gint retvals;
|
||||
char* ext;
|
||||
char* tmpname;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
int pid;
|
||||
int status;
|
||||
#else
|
||||
|
@ -462,7 +462,7 @@ load_image (char *filename, gint32 run_mode)
|
|||
|
||||
tmpname = params[1].data.d_string;
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
|
||||
#ifndef __EMX__
|
||||
|
||||
|
@ -543,7 +543,7 @@ load_image (char *filename, gint32 run_mode)
|
|||
CloseHandle (processinfo.hThread);
|
||||
WaitForSingleObject (processinfo.hProcess, INFINITE);
|
||||
|
||||
#endif /* NATIVE_WIN32 */
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
/* now that we un-gziped it, load the temp file */
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h> /* Include early for NATIVE_WIN32 */
|
||||
#include <glib.h> /* Include early for G_OS_WIN32 */
|
||||
#include <setjmp.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -27,7 +27,7 @@
|
|||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -58,9 +58,9 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h> /* For NATIVE_WIN32 */
|
||||
#include <glib.h> /* For G_OS_WIN32 */
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
#define WinMain WinMain_foo
|
||||
#include <windows.h>
|
||||
|
@ -297,7 +297,7 @@ save_image (char *filename,
|
|||
gint retvals;
|
||||
char* ext;
|
||||
char* tmpname;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
FILE* f;
|
||||
int pid;
|
||||
int status;
|
||||
|
@ -343,7 +343,7 @@ save_image (char *filename,
|
|||
/* return -1; */
|
||||
/* } */
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
|
||||
#ifndef __EMX__
|
||||
|
||||
|
@ -385,7 +385,7 @@ save_image (char *filename,
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
#else /* NATIVE_WIN32 */
|
||||
#else /* G_OS_WIN32 */
|
||||
secattr.nLength = sizeof (SECURITY_ATTRIBUTES);
|
||||
secattr.lpSecurityDescriptor = NULL;
|
||||
secattr.bInheritHandle = TRUE;
|
||||
|
@ -424,7 +424,7 @@ save_image (char *filename,
|
|||
CloseHandle (processinfo.hThread);
|
||||
WaitForSingleObject (processinfo.hProcess, INFINITE);
|
||||
|
||||
#endif /* NATIVE_WIN32 */
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
unlink (tmpname);
|
||||
|
||||
|
@ -438,7 +438,7 @@ load_image (char *filename, gint32 run_mode)
|
|||
gint retvals;
|
||||
char* ext;
|
||||
char* tmpname;
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
int pid;
|
||||
int status;
|
||||
#else
|
||||
|
@ -462,7 +462,7 @@ load_image (char *filename, gint32 run_mode)
|
|||
|
||||
tmpname = params[1].data.d_string;
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
|
||||
#ifndef __EMX__
|
||||
|
||||
|
@ -543,7 +543,7 @@ load_image (char *filename, gint32 run_mode)
|
|||
CloseHandle (processinfo.hThread);
|
||||
WaitForSingleObject (processinfo.hProcess, INFINITE);
|
||||
|
||||
#endif /* NATIVE_WIN32 */
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
/* now that we un-gziped it, load the temp file */
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <gtk/gtk.h>
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include <gtk/gtk.h>
|
||||
#include <libgimp/gimp.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ static char ident[] = "@(#) GIMP PostScript/PDF file-plugin v1.07 14-Sep-99";
|
|||
#include "libgimp/gimpui.h"
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
|
||||
#define USE_REAL_OUTPUTFILE
|
||||
|
@ -964,7 +964,7 @@ get_bbox (char *filename,
|
|||
}
|
||||
|
||||
static char *pnmfile;
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
static char *indirfile = NULL;
|
||||
#endif
|
||||
|
||||
|
@ -1038,7 +1038,7 @@ ps_open (char *filename,
|
|||
#endif
|
||||
|
||||
gs = getenv ("GS_PROG");
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (gs == NULL) gs = "gs";
|
||||
#else
|
||||
/* We want the console ghostscript application. It should be in the PATH */
|
||||
|
@ -1085,7 +1085,7 @@ ps_open (char *filename,
|
|||
/* ghostscript with a real outputfile. When ghostscript has finished, */
|
||||
/* open the outputfile and return its filepointer. But be sure */
|
||||
/* to close and remove the file within ps_close(). */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* Work around braindead command line length limit.
|
||||
* Hmm, I wonder if this is necessary, but it doesn't harm...
|
||||
*/
|
||||
|
@ -1125,7 +1125,7 @@ ps_close (FILE *ifp)
|
|||
/* If a real outputfile was used, close the file and remove it. */
|
||||
fclose (ifp);
|
||||
unlink (pnmfile);
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
if (indirfile != NULL)
|
||||
unlink (indirfile);
|
||||
#endif
|
||||
|
|
|
@ -57,7 +57,7 @@ static char ident[] = "@(#) GIMP PostScript/PDF file-plugin v1.07 14-Sep-99";
|
|||
#include "libgimp/gimpui.h"
|
||||
#include "libgimp/stdplugins-intl.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <process.h> /* For _getpid() */
|
||||
|
||||
#define USE_REAL_OUTPUTFILE
|
||||
|
@ -964,7 +964,7 @@ get_bbox (char *filename,
|
|||
}
|
||||
|
||||
static char *pnmfile;
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
static char *indirfile = NULL;
|
||||
#endif
|
||||
|
||||
|
@ -1038,7 +1038,7 @@ ps_open (char *filename,
|
|||
#endif
|
||||
|
||||
gs = getenv ("GS_PROG");
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
if (gs == NULL) gs = "gs";
|
||||
#else
|
||||
/* We want the console ghostscript application. It should be in the PATH */
|
||||
|
@ -1085,7 +1085,7 @@ ps_open (char *filename,
|
|||
/* ghostscript with a real outputfile. When ghostscript has finished, */
|
||||
/* open the outputfile and return its filepointer. But be sure */
|
||||
/* to close and remove the file within ps_close(). */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* Work around braindead command line length limit.
|
||||
* Hmm, I wonder if this is necessary, but it doesn't harm...
|
||||
*/
|
||||
|
@ -1125,7 +1125,7 @@ ps_close (FILE *ifp)
|
|||
/* If a real outputfile was used, close the file and remove it. */
|
||||
fclose (ifp);
|
||||
unlink (pnmfile);
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
if (indirfile != NULL)
|
||||
unlink (indirfile);
|
||||
#endif
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h> /* For NATIVE_WIN32 */
|
||||
#include <glib.h> /* For G_OS_WIN32 */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -36,7 +36,7 @@
|
|||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "libgimp/gimp.h"
|
||||
|
||||
/* G_DIR_SEPARATOR (is defined in glib.h if you have glib-1.2.0 or later) */
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
/* Filenames in WIN/DOS Style */
|
||||
#ifndef G_DIR_SEPARATOR
|
||||
|
@ -49,7 +49,7 @@
|
|||
#endif
|
||||
#define DIR_ROOT ':'
|
||||
|
||||
#else /* !NATIVE_WIN32 */
|
||||
#else /* !G_OS_WIN32 */
|
||||
|
||||
/* Filenames in UNIX Style */
|
||||
#ifndef G_DIR_SEPARATOR
|
||||
|
@ -57,7 +57,7 @@
|
|||
#endif
|
||||
#define DIR_ROOT '/'
|
||||
|
||||
#endif /* !NATIVE_WIN32 */
|
||||
#endif /* !G_OS_WIN32 */
|
||||
|
||||
|
||||
typedef struct t_anim_info {
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#include <math.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
# include <io.h>
|
||||
# ifndef W_OK
|
||||
# define W_OK 2
|
||||
|
|
|
@ -530,7 +530,7 @@ char *standalone = NULL;
|
|||
|
||||
extern GPlugInInfo PLUG_IN_INFO;
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* No standalone on win32. */
|
||||
MAIN()
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
@ -435,7 +435,7 @@ myruntime (void)
|
|||
total = b.tms_utime;
|
||||
total += b.tms_stime;
|
||||
return (total / 60.0);
|
||||
#elif NATIVE_WIN32
|
||||
#elif G_OS_WIN32
|
||||
FILETIME creation, exit, kernel, user;
|
||||
GetProcessTimes (GetCurrentProcess (), &creation, &exit, &kernel, &user);
|
||||
return (kernel.dwLowDateTime * 1e7 + user.dwLowDateTime * 1e7);
|
||||
|
|
|
@ -42,12 +42,12 @@
|
|||
#include "script-fu-console.h"
|
||||
#include <plug-ins/dbbrowser/dbbrowser.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
|
||||
#define TEXT_WIDTH 400
|
||||
#define TEXT_HEIGHT 400
|
||||
|
@ -560,7 +560,7 @@ script_fu_cc_key_function (GtkWidget *widget,
|
|||
|
||||
|
||||
static FILE *
|
||||
script_fu_open_siod_console ()
|
||||
script_fu_open_siod_console (void)
|
||||
{
|
||||
if (siod_output == stdout)
|
||||
{
|
||||
|
@ -584,7 +584,7 @@ script_fu_open_siod_console ()
|
|||
}
|
||||
|
||||
static void
|
||||
script_fu_close_siod_console ()
|
||||
script_fu_close_siod_console (void)
|
||||
{
|
||||
if (siod_output != stdout)
|
||||
fclose (siod_output);
|
||||
|
@ -592,7 +592,7 @@ script_fu_close_siod_console ()
|
|||
close (siod_output_pipe[1]);
|
||||
}
|
||||
|
||||
#endif /* !NATIVE_WIN32 */
|
||||
#endif /* !G_OS_WIN32 */
|
||||
|
||||
void
|
||||
script_fu_eval_run (char *name,
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "siod.h"
|
||||
#include "script-fu-scripts.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
|||
#define S_ISREG(m) ((m) & _S_IFREG)
|
||||
#endif
|
||||
|
||||
#endif /* NATIVE_WIN32 */
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
#if defined (GLIB_CHECK_VERSION) && GLIB_CHECK_VERSION (1,3,1)
|
||||
#define ESCAPE(string) g_strescape (string, NULL)
|
||||
|
@ -378,7 +378,7 @@ script_fu_find_scripts ()
|
|||
command = g_strdup_printf ("(load \"%s\")", qf);
|
||||
g_free (qf);
|
||||
repl_c_string (command, 0, 0, 1);
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* No, I don't know why, but this is
|
||||
* necessary on NT 4.0.
|
||||
*/
|
||||
|
@ -631,7 +631,7 @@ script_fu_add_script (LISP a)
|
|||
return my_err ("script-fu-register: filename defaults must be string values", NIL);
|
||||
script->arg_defaults[i].sfa_file.filename = g_strdup (get_c_string (car (a)));
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* Replace POSIX slashes with Win32 backslashes. This
|
||||
* is just so script-fus can be written with only
|
||||
* POSIX directory separators.
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "siod.h"
|
||||
#include "script-fu-scripts.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
|||
#define S_ISREG(m) ((m) & _S_IFREG)
|
||||
#endif
|
||||
|
||||
#endif /* NATIVE_WIN32 */
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
#if defined (GLIB_CHECK_VERSION) && GLIB_CHECK_VERSION (1,3,1)
|
||||
#define ESCAPE(string) g_strescape (string, NULL)
|
||||
|
@ -378,7 +378,7 @@ script_fu_find_scripts ()
|
|||
command = g_strdup_printf ("(load \"%s\")", qf);
|
||||
g_free (qf);
|
||||
repl_c_string (command, 0, 0, 1);
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* No, I don't know why, but this is
|
||||
* necessary on NT 4.0.
|
||||
*/
|
||||
|
@ -631,7 +631,7 @@ script_fu_add_script (LISP a)
|
|||
return my_err ("script-fu-register: filename defaults must be string values", NIL);
|
||||
script->arg_defaults[i].sfa_file.filename = g_strdup (get_c_string (car (a)));
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
/* Replace POSIX slashes with Win32 backslashes. This
|
||||
* is just so script-fus can be written with only
|
||||
* POSIX directory separators.
|
||||
|
|
|
@ -147,7 +147,7 @@ query (void)
|
|||
PROC_EXTENSION,
|
||||
0, 0, NULL, NULL);
|
||||
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
gimp_install_procedure ("extension_script_fu_console",
|
||||
"Provides a console mode for script-fu development",
|
||||
"Provides an interface which allows interactive scheme development.",
|
||||
|
@ -238,7 +238,7 @@ run (char *name,
|
|||
values[0].type = PARAM_STATUS;
|
||||
values[0].data.d_status = status;
|
||||
}
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
/*
|
||||
* The script-fu console for interactive SIOD development
|
||||
*/
|
||||
|
@ -958,7 +958,7 @@ marshall_proc_db_call (LISP a)
|
|||
|
||||
/* reverse the return values */
|
||||
return_val = nreverse (return_val);
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
/* if we're in server mode, listen for additional commands for 10 ms */
|
||||
if (server_mode)
|
||||
script_fu_server_listen (10);
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
@ -435,7 +435,7 @@ myruntime (void)
|
|||
total = b.tms_utime;
|
||||
total += b.tms_stime;
|
||||
return (total / 60.0);
|
||||
#elif NATIVE_WIN32
|
||||
#elif G_OS_WIN32
|
||||
FILETIME creation, exit, kernel, user;
|
||||
GetProcessTimes (GetCurrentProcess (), &creation, &exit, &kernel, &user);
|
||||
return (kernel.dwLowDateTime * 1e7 + user.dwLowDateTime * 1e7);
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
#include <errno.h>
|
||||
#include "gcg.h"
|
||||
#include "parse.h"
|
||||
#ifndef NATIVE_WIN32
|
||||
#ifndef G_OS_WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "output.h"
|
||||
#include "marshall.h"
|
||||
|
||||
#ifdef NATIVE_WIN32
|
||||
#ifdef G_OS_WIN32
|
||||
extern int opterr, optind, optopt;
|
||||
extern char *optarg;
|
||||
extern int getopt(int nargc, char** nargv, char* ostr);
|
||||
|
|
Loading…
Reference in New Issue