Add horrible hack that seems to help script-fu startup on NT 4.0, by

2000-07-18  Tor Lillqvist  <tml@iki.fi>

* libgimp/gimp.c (gimp_flush): Add horrible hack that seems to
help script-fu startup on NT 4.0, by avoiding some bug in GLib.
Yes, it would be better to fix GLib's main loop and GIOChannel
code for Win32. Unfortunately, it's kinda hairy...

* libgimp/gimp.h: Add extern "C" to the Win32 part for compiling
C++ plug-ins.

* plug-ins/makefile.cygwin: Add a couple of new unofficial
plug-ins. Use macros from build/win32/make.mingw.

* plug-ins/common/warp.c: Use G_PI.
This commit is contained in:
Tor Lillqvist 2000-07-18 21:49:50 +00:00 committed by Tor Lillqvist
parent 1d1ead8aa1
commit e153e7cd6b
5 changed files with 66 additions and 13 deletions

View File

@ -1,3 +1,18 @@
2000-07-18 Tor Lillqvist <tml@iki.fi>
* libgimp/gimp.c (gimp_flush): Add horrible hack that seems to
help script-fu startup on NT 4.0, by avoiding some bug in GLib.
Yes, it would be better to fix GLib's main loop and GIOChannel
code for Win32. Unfortunately, it's kinda hairy...
* libgimp/gimp.h: Add extern "C" to the Win32 part for compiling
C++ plug-ins.
* plug-ins/makefile.cygwin: Add a couple of new unofficial
plug-ins. Use macros from build/win32/make.mingw.
* plug-ins/common/warp.c: Use G_PI.
2000-07-16 Michael Natterer <mitch@gimp.org>
Sven Neumann <sven@gimp.org>

View File

@ -993,6 +993,15 @@ gimp_flush (GIOChannel *channel)
do
{
bytes = 0;
#ifdef G_OS_WIN32
/* Horrible hack that seems to prevent script-fu from
* hanging upon startup on NT4. The real solution would
* be to fix (rewrite) the GLib main loop and IO channel code
* for Win32.
*/
if ((write_buffer_index - count) > 100)
Sleep (0);
#endif
error = g_io_channel_write (channel, &write_buffer[count],
(write_buffer_index - count),
&bytes);

View File

@ -166,7 +166,17 @@ struct _GimpParam
};
#ifdef G_OS_WIN32
#ifdef __cplusplus
extern "C" {
#endif
void set_gimp_PLUG_IN_INFO_PTR(GimpPlugInInfo *);
#ifdef __cplusplus
}
#endif
/* 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.
@ -181,7 +191,6 @@ struct _GimpParam
static int \
win32_gimp_main (int argc, char **argv) \
{ \
extern void set_gimp_PLUG_IN_INFO_PTR(GimpPlugInInfo *); \
set_gimp_PLUG_IN_INFO_PTR(&PLUG_IN_INFO); \
return gimp_main (argc, argv); \
} \

View File

@ -990,8 +990,8 @@ diff (GDrawable *drawable,
diff_prepare_row (&srcPR, cr, x1, y1+1, (x2 - x1));
/* fixed-vector (x,y) component scale factors */
scale_vec_x = dvals.vector_scale*cos((90-dvals.vector_angle)*M_PI/180.0)*256.0/10;
scale_vec_y = dvals.vector_scale*sin((90-dvals.vector_angle)*M_PI/180.0)*256.0/10;
scale_vec_x = dvals.vector_scale*cos((90-dvals.vector_angle)*G_PI/180.0)*256.0/10;
scale_vec_y = dvals.vector_scale*sin((90-dvals.vector_angle)*G_PI/180.0)*256.0/10;
if (do_vecmap) {
/* fprintf(stderr,"%f %f x,y vector components.\n",scale_vec_x,scale_vec_y); */
@ -1020,7 +1020,7 @@ diff (GDrawable *drawable,
diff_prepare_row (&magPR, crm, x1, y1, (x2 - x1));
}
dtheta = dvals.angle * M_PI / 180.0;
dtheta = dvals.angle * G_PI / 180.0;
rscalefac = 256.0 / (3*src_bytes); /* note that '3' is rather arbitrary here. */
gscalefac = dvals.grad_scale* 256.0 / (3*gbytes); /* scale factor for gradient map components */

View File

@ -35,17 +35,17 @@ COMMON1 = CEL CML_explorer align_layers animationplay animoptimize apply_lens au
COMMON2 = decompose deinterlace depthmerge despeckle destripe diffraction displace edge emboss engrave exchange film flarefx fractaltrace
COMMON3 = gauss_iir gauss_rle gbr gee gicon gif gifload glasstile gpb gqbist gradmap grid gtm guillotine gz header hot hrz illusion iwarp jigsaw jpeg laplace lic
COMMON4 = mapcolor max_rgb mblur newsprint nlfilt noisify normalize nova oilify papertile pat pcx pix pixelize plasma plugindetails png pnm polar ps psd psp randomize ripple rotate
COMMON5 = sample_colorize scatter_hsv semiflatten sharpen shift smooth_palette snoise sobel sparkle spheredesigner spread sunras tga threshold_alpha tiff tile tileit tiler unsharp video vinvert vpropagate waves whirlpinch winclipboard wind winprint wmf xbm xwd zealouscrop
COMMON5 = sample_colorize scatter_hsv semiflatten sharpen shift smooth_palette snoise sobel sparkle spheredesigner spread sunras tga threshold_alpha tiff tile tileit tiler unsharp video vinvert vpropagate warp waves whirlpinch winclipboard wind winprint wmf xbm xwd zealouscrop
# These have own subdirectories each
SEPARATE = AlienMap AlienMap2 FractalExplorer Lighting MapObject bmp dbbrowser faxg3 fits flame fp gdyntext gfig gflare gfli gimpressionist ifscompose imagemap maze mosaic pagecurl rcm sel2path sgi sinus struc twain webbrowser winsnap
SEPARATE = AlienMap AlienMap2 FractalExplorer Lighting MapObject bmp dbbrowser faxg3 fits flame fp gfig gflare gfli gimpressionist ifscompose imagemap maze mosaic pagecurl rcm sel2path sgi sinus struc twain webbrowser winsnap
# These are unofficial, ie not in the CVS. To build these, you should
# get tml's source snapshot and copy this makefile to the
# ../unofficial-plug-ins directory, go there, and do "make -f
# makefile.cygwin unofficial".
UNOFFICIAL = Anamorphose DigitalSignature RGB_Displace ccanalyze gimp_ace guash kaleidoscope logconv sel_gauss magiceye mathmap psd_save user_filter
UNOFFICIAL = Anamorphose DigitalSignature RGB_Displace ccanalyze fixer gdyntext gimp_ace guash kaleidoscope logconv sel_gauss magiceye mathmap psd_save resynthesizer user_filter
# The main target
@ -212,6 +212,15 @@ OBJECTS = \
fitsrw.o
endif
ifdef EXTRA_fixer
CXX = c++ -mno-cygwin -mpentium -fnative-struct
OBJECTS = \
fixer.o
EXTRALIBS = -lstdc++
.cc.o:
$(CXX) $(CFLAGS) -c $< -o $@
endif
ifdef EXTRA_flame
OBJECTS = \
cmap.o \
@ -268,6 +277,7 @@ OBJECTS = \
charmap_window.o \
font_selection.o \
gdyntext.o \
gdyntextcompat.o \
gdyntext_ui.o \
message_window.o
endif
@ -412,6 +422,15 @@ OBJECTS = \
OPTIMIZE =
endif
ifdef EXTRA_resynthesizer
CXX = c++ -mno-cygwin -mpentium -fnative-struct
OBJECTS = \
resynth.o
EXTRALIBS = -lstdc++
.cc.o:
$(CXX) $(CFLAGS) -c $< -o $@
endif
ifdef EXTRA_script_fu
OBJECTS = \
interp_md5.o \
@ -458,12 +477,13 @@ EXTRALIBS = $(TIFF_LIBS)
endif
ifdef EXTRA_gimp_ace
EXTRACFLAGS = -DGLACE_GIMP -DVERSION=\"0.5.1\"
EXTRACFLAGS = -DGLACE_GIMP -DPLUGIN_NAME=\"gimp_ace\" -DDATA
OBJECTS = \
dialog.o \
gimp_ace.o \
glace.o \
glaceG.o
src/dialog.o \
src/gimp_ace.o \
src/glace.o \
src/glaceG.o \
src/preview.o
endif
ifdef EXTRA_gimpressionist
@ -598,7 +618,7 @@ RESOURCE = ../../app/gimpres.o
endif
$(PLUGIN).exe : $(OBJECTS) $(RESOURCE)
$(CC) $(CFLAGS) -mwindows -s -o $(PLUGIN).exe $(OBJECTS) $(RESOURCE) -L $(PLUGINDIR)/libgck/gck -lgck -L ../../libgimp -lgimp-$(GIMP_VER) -lgimpui-$(GIMP_VER) -L $(GTK)/gtk -lgtk-$(GTK_VER) -L $(GTK)/gdk -lgdk-$(GTK_VER) -L $(INTL) -lgnu-intl -L $(GLIB) -lglib-$(GLIB_VER) $(EXTRALIBS) $(LDFLAGS)
$(CC) $(CFLAGS) -mwindows -o $(PLUGIN).exe $(OBJECTS) $(RESOURCE) -L $(PLUGINDIR)/libgck/gck -lgck -L ../../libgimp -lgimp-$(GIMP_VER) -lgimpui-$(GIMP_VER) $(GTK_LIBS) $(INTL_LIBS) $(GLIB_LIBS) $(EXTRALIBS) $(LDFLAGS)
# Kludge to get the path to the win32 headers
WIN32APIHEADERS=$(shell echo "\#include <winver.h>" | $(CC) -M -E - | tail -1 | sed -e 's![\\/]winver.h!!' | tr -d '\015')