app/cursorutil.c (gtkutil_compress_motion) Guard against gdk_event_get

2000-03-08  Tor Lillqvist  <tml@iki.fi>

* app/cursorutil.c (gtkutil_compress_motion)
* app/edit_selection.c (process_event_queue_keys): Guard against
gdk_event_get returning NULL (which can happen at least on Win32).

* libgimp/gimp.def: Add a couple of new entry points.

* plug-ins/makefile.{cygwin,msc}: Update according to the source
file changes. Fix some typos in the .msc file.

Fixes by Hans Breuer:

* app/resize.c: Add some more includes.

* libgimp/gimpenv.c
* plug-ins/gflare/gflare.c: Win32 header lossage fixup.
This commit is contained in:
Tor Lillqvist 2000-03-08 18:32:31 +00:00 committed by Tor Lillqvist
parent 187f5812d2
commit 85f0393bae
15 changed files with 83 additions and 38 deletions

View File

@ -1,3 +1,21 @@
2000-03-08 Tor Lillqvist <tml@iki.fi>
* app/cursorutil.c (gtkutil_compress_motion)
* app/edit_selection.c (process_event_queue_keys): Guard against
gdk_event_get returning NULL (which can happen at least on Win32).
* libgimp/gimp.def: Add a couple of new entry points.
* plug-ins/makefile.{cygwin,msc}: Update according to the source
file changes. Fix some typos in the .msc file.
Fixes by Hans Breuer:
* app/resize.c: Add some more includes.
* libgimp/gimpenv.c
* plug-ins/gflare/gflare.c: Win32 header lossage fixup.
Wed Mar 8 14:50:57 CET 2000 Sven Neumann <sven@gimp.org> Wed Mar 8 14:50:57 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/common/align_layers.c * plug-ins/common/align_layers.c

View File

@ -294,7 +294,11 @@ gtkutil_compress_motion (GtkWidget *widget,
{ {
event = gdk_event_get (); event = gdk_event_get ();
if ((gtk_get_event_widget (event) == widget) && if (!event)
{
/* Do nothing */
}
else if ((gtk_get_event_widget (event) == widget) &&
(event->any.type == GDK_MOTION_NOTIFY)) (event->any.type == GDK_MOTION_NOTIFY))
{ {
*lastmotion_x = event->motion.x; *lastmotion_x = event->motion.x;

View File

@ -18,7 +18,9 @@
#include <math.h> #include <math.h>
#include "config.h" #include "config.h"
#include "appenv.h" #include "appenv.h"
#include "gdisplay.h"
#include "resize.h" #include "resize.h"
#include "undo.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpui.h" #include "gimpui.h"

View File

@ -675,7 +675,7 @@ process_event_queue_keys (GdkEventKey *kevent, ...)
{ {
discard_event = 0; discard_event = 0;
event = gdk_event_get(); event = gdk_event_get();
if (orig_widget != gtk_get_event_widget(event)) if (!event || orig_widget != gtk_get_event_widget(event))
{ {
done = 1; done = 1;
} }
@ -700,7 +700,9 @@ process_event_queue_keys (GdkEventKey *kevent, ...)
done = 1; done = 1;
} }
if (!discard_event) if (!event)
; /* Do nothing */
else if (!discard_event)
list = g_list_append(list, event); list = g_list_append(list, event);
else else
gdk_event_free(event); gdk_event_free(event);

View File

@ -18,7 +18,9 @@
#include <math.h> #include <math.h>
#include "config.h" #include "config.h"
#include "appenv.h" #include "appenv.h"
#include "gdisplay.h"
#include "resize.h" #include "resize.h"
#include "undo.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpui.h" #include "gimpui.h"

View File

@ -18,7 +18,9 @@
#include <math.h> #include <math.h>
#include "config.h" #include "config.h"
#include "appenv.h" #include "appenv.h"
#include "gdisplay.h"
#include "resize.h" #include "resize.h"
#include "undo.h"
#include "gimprc.h" #include "gimprc.h"
#include "gimpui.h" #include "gimpui.h"

View File

@ -675,7 +675,7 @@ process_event_queue_keys (GdkEventKey *kevent, ...)
{ {
discard_event = 0; discard_event = 0;
event = gdk_event_get(); event = gdk_event_get();
if (orig_widget != gtk_get_event_widget(event)) if (!event || orig_widget != gtk_get_event_widget(event))
{ {
done = 1; done = 1;
} }
@ -700,7 +700,9 @@ process_event_queue_keys (GdkEventKey *kevent, ...)
done = 1; done = 1;
} }
if (!discard_event) if (!event)
; /* Do nothing */
else if (!discard_event)
list = g_list_append(list, event); list = g_list_append(list, event);
else else
gdk_event_free(event); gdk_event_free(event);

View File

@ -675,7 +675,7 @@ process_event_queue_keys (GdkEventKey *kevent, ...)
{ {
discard_event = 0; discard_event = 0;
event = gdk_event_get(); event = gdk_event_get();
if (orig_widget != gtk_get_event_widget(event)) if (!event || orig_widget != gtk_get_event_widget(event))
{ {
done = 1; done = 1;
} }
@ -700,7 +700,9 @@ process_event_queue_keys (GdkEventKey *kevent, ...)
done = 1; done = 1;
} }
if (!discard_event) if (!event)
; /* Do nothing */
else if (!discard_event)
list = g_list_append(list, event); list = g_list_append(list, event);
else else
gdk_event_free(event); gdk_event_free(event);

View File

@ -294,7 +294,11 @@ gtkutil_compress_motion (GtkWidget *widget,
{ {
event = gdk_event_get (); event = gdk_event_get ();
if ((gtk_get_event_widget (event) == widget) && if (!event)
{
/* Do nothing */
}
else if ((gtk_get_event_widget (event) == widget) &&
(event->any.type == GDK_MOTION_NOTIFY)) (event->any.type == GDK_MOTION_NOTIFY))
{ {
*lastmotion_x = event->motion.x; *lastmotion_x = event->motion.x;

View File

@ -222,6 +222,8 @@ EXPORTS
gimp_pixel_rgns_process gimp_pixel_rgns_process
gimp_pixel_rgns_register gimp_pixel_rgns_register
gimp_pixel_rgns_register2 gimp_pixel_rgns_register2
gimp_plugin_domain_add
gimp_plugin_domain_add_with_path
gimp_plugin_help_func gimp_plugin_help_func
gimp_progress_init gimp_progress_init
gimp_progress_update gimp_progress_update

View File

@ -33,10 +33,18 @@
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
#define STRICT #define STRICT
#include <windows.h> /* For GetModuleFileName */ #include <windows.h> /* For GetModuleFileName */
#include <io.h>
#ifndef S_IWUSR
# define S_IWUSR _S_IWRITE
#endif
#ifndef S_IWGRP #ifndef S_IWGRP
#define S_IWGRP (_S_IWRITE>>3) #define S_IWGRP (_S_IWRITE>>3)
#define S_IWOTH (_S_IWRITE>>6) #define S_IWOTH (_S_IWRITE>>6)
#endif #endif
#ifndef S_ISDIR
# define __S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask))
# define S_ISDIR(mode) __S_ISTYPE((mode), _S_IFDIR)
#endif
#define uid_t gint #define uid_t gint
#define gid_t gint #define gid_t gint
#define geteuid() 0 #define geteuid() 0

View File

@ -33,10 +33,18 @@
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
#define STRICT #define STRICT
#include <windows.h> /* For GetModuleFileName */ #include <windows.h> /* For GetModuleFileName */
#include <io.h>
#ifndef S_IWUSR
# define S_IWUSR _S_IWRITE
#endif
#ifndef S_IWGRP #ifndef S_IWGRP
#define S_IWGRP (_S_IWRITE>>3) #define S_IWGRP (_S_IWRITE>>3)
#define S_IWOTH (_S_IWRITE>>6) #define S_IWOTH (_S_IWRITE>>6)
#endif #endif
#ifndef S_ISDIR
# define __S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask))
# define S_ISDIR(mode) __S_ISTYPE((mode), _S_IFDIR)
#endif
#define uid_t gint #define uid_t gint
#define gid_t gint #define gid_t gint
#define geteuid() 0 #define geteuid() 0

View File

@ -60,6 +60,13 @@ static char rcsid[] = "$Id$";
#include <dirent.h> #include <dirent.h>
#endif #endif
#ifdef G_OS_WIN32
#include <io.h>
#ifndef S_ISREG
#define S_ISREG(m) ((m) & _S_IFREG)
#endif
#endif
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <libgimp/gimp.h> #include <libgimp/gimp.h>

View File

@ -27,10 +27,10 @@ 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 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 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 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 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 waves whirlpinch winclipboard wind winprint wmf xbm xwd zealouscrop
# These have own subdirectories each # These have own subdirectories each
SEPARATE = AlienMap AlienMap2 FractalExplorer Lighting MapObject bmp borderaverage dbbrowser faxg3 fits flame fp gdyntext gfig gflare gfli gimpressionist ifscompose imagemap maze mosaic pagecurl rcm sel2path sgi sinus struc twain unsharp winsnap SEPARATE = AlienMap AlienMap2 FractalExplorer Lighting MapObject bmp borderaverage dbbrowser faxg3 fits flame fp gdyntext gfig gflare gfli gimpressionist ifscompose imagemap maze mosaic pagecurl rcm sel2path sgi sinus struc twain winsnap
# These are unofficial, ie not in the CVS. To build these, you should # These are unofficial, ie not in the CVS. To build these, you should
# get tml's source snapshot and copy this makefile to the # get tml's source snapshot and copy this makefile to the
@ -63,7 +63,7 @@ libs-clean :
$(MAKE) -f makefile.cygwin sub-libs TARGET=clean $(MAKE) -f makefile.cygwin sub-libs TARGET=clean
sub-libs: sub-libs:
cd libgck/gck; $(MAKE) -f ../../makefile.cygwin TOP=../../.. LIBRARY=gck OBJECTS="gckcolor.o gckui.o" $(TARGET) cd libgck/gck; $(MAKE) -f ../../makefile.cygwin TOP=../../.. LIBRARY=gck OBJECTS="gckcolor.o" $(TARGET)
@ -153,8 +153,7 @@ OBJECTS = \
Dialogs.o \ Dialogs.o \
Events.o \ Events.o \
FractalExplorer.o \ FractalExplorer.o \
Globals.o \ Globals.o
Languages.o
endif endif
ifdef EXTRA_Lighting ifdef EXTRA_Lighting
@ -218,7 +217,6 @@ OBJECTS = \
fp.o \ fp.o \
fp_gdk.o \ fp_gdk.o \
fp_gtk.o \ fp_gtk.o \
fp_hsv.o \
fp_misc.o fp_misc.o
endif endif
@ -451,13 +449,6 @@ EXTRACFLAGS = -I$(TIFF)
EXTRALIBS = -L $(TIFF) -ltiff -L $(JPEG) -ljpeg -L $(ZLIB) -lz -luser32 EXTRALIBS = -L $(TIFF) -ltiff -L $(JPEG) -ljpeg -L $(ZLIB) -lz -luser32
endif endif
ifdef EXTRA_unsharp
OBJECTS = \
dialog_f.o \
dialog_i.o \
unsharp.o
endif
ifdef EXTRA_gimp_ace ifdef EXTRA_gimp_ace
EXTRACFLAGS = -DGLACE_GIMP EXTRACFLAGS = -DGLACE_GIMP
OBJECTS = \ OBJECTS = \

View File

@ -26,10 +26,10 @@ 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 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 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 randomize ripple rotate COMMON4 = mapcolor max_rgb mblur newsprint nlfilt noisify normalize nova oilify papertile pat pcx pix pixelize plasma plugindetails png pnm polar ps psd 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 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 waves whirlpinch winclipboard wind winprint wmf xbm xwd zealouscrop
# These have own subdirectories each # These have own subdirectories each
SEPARATE = AlienMap AlienMap2 FractalExplorer Lighting MapObject bmp borderaverage dbbrowser faxg3 fits flame fp gdyntext gfig gflare gfli gimpressionist ifscompose imagemap maze mosaic pagecurl rcm sel2path sgi sinus struc twain unsharp winsnap SEPARATE = AlienMap AlienMap2 FractalExplorer Lighting MapObject bmp borderaverage dbbrowser faxg3 fits flame fp gdyntext gfig gflare gfli gimpressionist ifscompose imagemap maze mosaic pagecurl rcm sel2path sgi sinus struc twain winsnap
# These are unofficial, ie not in the CVS. To build these, you should # These are unofficial, ie not in the CVS. To build these, you should
# get tml's source snapshot and copy this makefile to the # get tml's source snapshot and copy this makefile to the
@ -63,7 +63,7 @@ libs-clean :
sub-libs: sub-libs:
cd libgck\gck cd libgck\gck
nmake -nologo -f ..\..\makefile.msc TOP=..\..\.. LIBRARY=gck OBJECTS="gckcolor.obj gckui.obj" $(TARGET) nmake -nologo -f ..\..\makefile.msc TOP=..\..\.. LIBRARY=gck OBJECTS="gckcolor.obj" $(TARGET)
cd ..\.. cd ..\..
@ -162,8 +162,7 @@ OBJECTS = \
Dialogs.obj \ Dialogs.obj \
Events.obj \ Events.obj \
FractalExplorer.obj \ FractalExplorer.obj \
Globals.obj \ Globals.obj
Languages.obj
!ENDIF !ENDIF
!IFDEF EXTRA_Lighting !IFDEF EXTRA_Lighting
@ -228,7 +227,6 @@ OBJECTS = \
fp.obj \ fp.obj \
fp_gdk.obj \ fp_gdk.obj \
fp_gtk.obj \ fp_gtk.obj \
fp_hsv.obj \
fp_misc.obj fp_misc.obj
!ENDIF !ENDIF
@ -276,12 +274,12 @@ OBJECTS = \
message_window.obj message_window.obj
!ENDIF !ENDIF
ifdef EXTRA_gflare !IFDEF EXTRA_gflare
OBJECTS = \ OBJECTS = \
asupsample.obj \ asupsample.obj \
gflare.obj \ gflare.obj \
gtkmultioptionmenu.obj gtkmultioptionmenu.obj
endif !ENDIF
!IFDEF EXTRA_gfli !IFDEF EXTRA_gfli
OBJECTS = \ OBJECTS = \
@ -455,13 +453,6 @@ EXTRACFLAGS = -I$(TIFF)
EXTRALIBS = $(TIFF)\libtiff.lib $(JPEG)\libjpeg.lib $(ZLIB)\zlib.lib user32.lib EXTRALIBS = $(TIFF)\libtiff.lib $(JPEG)\libjpeg.lib $(ZLIB)\zlib.lib user32.lib
!ENDIF !ENDIF
!IFDEF EXTRA_unsharp
OBJECTS = \
dialog_f.obj \
dialog_i.obj \
unsharp.obj
!ENDIF
!IFDEF EXTRA_gimp_ace !IFDEF EXTRA_gimp_ace
EXTRACFLAGS = -DGLACE_GIMP EXTRACFLAGS = -DGLACE_GIMP
OBJECTS = \ OBJECTS = \