Commit 6cb914db authored by Hans Breuer's avatar Hans Breuer Committed by Hans Breuer

from now on use make.msc from $(TOP)/glib/build/win32; all occurences of

2001-02-17  Hans Breuer  <hans@breuer.org>

	* */*/makefile.msc */makefile.msc : from now on use
	make.msc from $(TOP)/glib/build/win32; all occurences
	of DIRENT removed and general update

	* app/config/makefile.msc app/paint/makefile.msc
	  app/plug-in/makefile.msc themes/Default/makefile.msc :
	new files

	* app/base/base.c : ported to GDir usage

	* app/config/gimpconfig-serialize.c :
	  app/config/gimpconfig-deserialize.c : HAVE_UNISTD_H
	* app/config/gimpconfig.c :
	  app/config/gimprc.c : HAVE_UNISTD_H, use <io.h> for
	open() prototype and merged pmode parameter
	(_S_IREAD | _S_IWRITE)

	* app/core/cpercep.c : msvc doesn't have cbrt(), provide
	it via pow(). Also include <glib.h> for painless 'inline'
	definition.

	* app/core/gimpdatafiles.c : ported to GDir usage

	* app/core/gimpimage-convert.c : work around a msvc compiler
	limitation (can't convert from uint64 to double)

	* app/file/file-open.c app/file/file-save.c :
	access() -> _access() for G_OS_WIN32

	* app/plug-in/plug-in.c : HAVE_UNISTD_H and <io.h>

	* libgimpbase/gimpbase.def : updated externals

	* libgimpbase/gimpenv.c : define WIN32_LEAN_AND_MEAN to
	avoid clashes with incompatible DATADIR definitions

	* libgimpcolor/gimpcolor.def : updated externals

	* lingimpmath/gimpmath.def : updated externals

	* libgimpwidgets/gimpwidgets.def : updated externals

	* libgimpwidgets/libgimp-glue.c : adapt to const changes
	of some prototypes

	* plug-ins/makefile.msc : disabled gdyntext

	* plug-ins/gap/iter_ALT/*/*.inc : GimpRunModeType -> GimpRunMode

	* plug-ins/FractalExplorer/FractalExplorer.c :
	* plug-ins/gap/gap_lib.c :
	* plug-ins/gfig/gfig.c :
	* plug-ins/gflare/gflare.c :
	* plug-ins/gimpressionist/gimpressionist.c :
	replaced DIRENT usage with GDir

	* plug-ins/script-fu/script-fu-scripts.c : #include <windows.h>
	to get the Sleep() prototype
parent 91ada344
......@@ -18,9 +18,6 @@
#include "config.h"
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <signal.h>
#include <stdlib.h>
#include <string.h>
......@@ -96,17 +93,17 @@ base_exit (void)
static void
toast_old_temp_files (void)
{
DIR *dir = NULL;
struct dirent *entry;
GDir *dir = NULL;
const char *entry;
if (base_config->swap_path)
dir = opendir (base_config->swap_path);
dir = g_dir_open (base_config->swap_path, 0, NULL);
if (!dir)
return;
while ((entry = readdir (dir)) != NULL)
if (! strncmp (entry->d_name, "gimpswap.", 9))
while ((entry = g_dir_read_name (dir)) != NULL)
if (! strncmp (entry, "gimpswap.", 9))
{
/* don't try to kill swap files of running processes
* yes, I know they might not all be gimp processes, and when you
......@@ -116,7 +113,7 @@ toast_old_temp_files (void)
* we'll probably get it the next time around
*/
gint pid = atoi (entry->d_name + 9);
gint pid = atoi (entry + 9);
/* On Windows, you can't remove open files anyhow,
* so no harm trying.
......@@ -127,7 +124,7 @@ toast_old_temp_files (void)
{
gchar *filename;
filename = g_build_filename (base_config->swap_path, entry->d_name,
filename = g_build_filename (base_config->swap_path, entry,
NULL);
unlink (filename);
......@@ -136,5 +133,5 @@ toast_old_temp_files (void)
}
}
closedir (dir);
g_dir_close (dir);
}
......@@ -57,6 +57,13 @@ from the Author.
#include <stdlib.h>
#include <math.h>
#ifdef _MSC_VER
/* msvc does not now cbrt() is it nonstandard ? */
#define cbrt(x) (pow(x, 1.0/3.0))
#endif
#include <glib.h> /* to get working 'inline' */
/* defines:
SANITY: emits warnings when passed non-sane colours (and usually
......
......@@ -5,10 +5,10 @@ TOP = ..\..\..
PRJ_TOP = ..\..
PACKAGE = appbase
PKG_VER = 1.3
!INCLUDE $(TOP)\build\win32\make.msc
!INCLUDE $(TOP)\glib\build\win32\make.msc
PKG_LINK = \
$(GLIB_LIBS) $(DIRENT_LIBS) \
$(GLIB_LIBS) \
..\..\libgimpcolor\gimpcolor-$(PKG_VER).lib \
..\paint-funcs\apppaint-funcs.lib
......@@ -33,7 +33,7 @@ OBJECTS = \
INCLUDES = \
-I $(PRJ_TOP) \
-I $(PRJ_TOP)/app \
$(GLIB_CFLAGS) $(DIRENT_CFLAGS) \
$(GLIB_CFLAGS) \
all : \
$(PRJ_TOP)\config.h \
......
......@@ -25,7 +25,9 @@
#include <string.h>
#include <sys/types.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <glib-object.h>
......
......@@ -23,7 +23,9 @@
#include <stdio.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <glib-object.h>
......
......@@ -24,12 +24,18 @@
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <glib-object.h>
#ifdef G_OS_WIN32
#include <io.h>
#endif
#include "gimpconfig.h"
#include "gimpconfig-serialize.h"
#include "gimpconfig-deserialize.h"
......@@ -111,7 +117,11 @@ gimp_config_serialize (GObject *object,
g_return_val_if_fail (gimp_config_iface != NULL, FALSE);
fd = open (filename, O_WRONLY | O_CREAT,
#ifndef G_OS_WIN32
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#else
_S_IREAD | _S_IWRITE);
#endif
if (fd == -1)
{
......
......@@ -24,12 +24,18 @@
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <glib-object.h>
#ifdef G_OS_WIN32
#include <io.h>
#endif
#include "libgimpbase/gimpbase.h"
#include "gimpconfig.h"
......@@ -204,7 +210,11 @@ gimp_rc_write_changes (GimpRc *new_rc,
if (filename)
fd = open (filename, O_WRONLY | O_CREAT,
#ifndef G_OS_WIN32
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
#else
_S_IREAD | _S_IWRITE);
#endif
else
fd = 1; /* stdout */
......
# autogenerated from automake.am with automake.py
# and slightly modified
TOP = ..\..\..
PRJ_TOP = ..\..
PACKAGE = appconfig
PKG_VER = 1.3
!INCLUDE $(TOP)\glib\build\win32\make.msc
PKG_LINK = \
$(GLIB_LIBS)
OBJECTS = \
gimpbaseconfig.obj \
gimpconfig.obj \
gimpconfig-deserialize.obj \
gimpconfig-params.obj \
gimpconfig-serialize.obj \
gimpconfig-substitute.obj \
gimpconfig-types.obj \
gimpconfig-utils.obj \
gimpcoreconfig.obj \
gimpdisplayconfig.obj \
gimpguiconfig.obj \
gimprc.obj \
INCLUDES = \
-I $(PRJ_TOP) \
-I $(PRJ_TOP)/app \
$(GLIB_CFLAGS) \
all : \
$(PRJ_TOP)\config.h \
$(PACKAGE).lib \
$(PACKAGE)-$(PKG_VER).dll
$(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32
copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h
RESOURCE = $(PACKAGE).res
$(PACKAGE).lib : $(OBJECTS)
lib /out:$(PACKAGE).lib $(OBJECTS)
$(PACKAGE)-$(PKG_VER).dll : $(OBJECTS) $(PACKAGE).def
$(CC) $(CFLAGS) -LD -Fe$(PACKAGE)-$(PKG_VER).dll $(OBJECTS) $(PKG_LINK) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:$(PACKAGE).def
$(PACKAGE).exe : $(OBJECTS) $(PACKAGE).def $(PACKAGE).res
$(CC) $(CFLAGS) -Fe$(PACKAGE).exe $(PACKAGE).res $(OBJECTS) $(PKG_LINK) \
user32.lib advapi32.lib shell32.lib wsock32.lib winspool.lib $(LDFLAGS) /def:$(PACKAGE).def
.c.obj :
$(CC) $(CFLAGS) -GD -c $(PKG_CFLAGS) $<
......@@ -57,6 +57,13 @@ from the Author.
#include <stdlib.h>
#include <math.h>
#ifdef _MSC_VER
/* msvc does not now cbrt() is it nonstandard ? */
#define cbrt(x) (pow(x, 1.0/3.0))
#endif
#include <glib.h> /* to get working 'inline' */
/* defines:
SANITY: emits warnings when passed non-sane colours (and usually
......
......@@ -29,9 +29,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <glib-object.h>
......@@ -131,8 +128,8 @@ gimp_datafiles_read_directories (const gchar *path_str,
GList *list;
gchar *filename;
gint err;
DIR *dir;
struct dirent *dir_ent;
GDir *dir;
const gchar *dir_ent;
g_return_if_fail (path_str != NULL);
g_return_if_fail (loader_func != NULL);
......@@ -154,7 +151,7 @@ gimp_datafiles_read_directories (const gchar *path_str,
for (list = path; list; list = g_list_next (list))
{
/* Open directory */
dir = opendir ((gchar *) list->data);
dir = g_dir_open ((gchar *) list->data, 0, NULL);
if (!dir)
{
......@@ -163,16 +160,10 @@ gimp_datafiles_read_directories (const gchar *path_str,
}
else
{
while ((dir_ent = readdir (dir)))
while ((dir_ent = g_dir_read_name (dir)))
{
if (! strcmp (dir_ent->d_name, ".") ||
! strcmp (dir_ent->d_name, ".."))
{
continue;
}
filename = g_build_filename ((gchar *) list->data,
dir_ent->d_name, NULL);
dir_ent, NULL);
/* Check the file and see that it is not a sub-directory */
err = stat (filename, &filestat);
......@@ -199,7 +190,7 @@ gimp_datafiles_read_directories (const gchar *path_str,
g_free (filename);
}
closedir (dir);
g_dir_close (dir);
}
}
......
......@@ -1450,9 +1450,20 @@ find_split_candidate (const boxptr boxlist,
{
if (boxp->volume > 0)
{
#ifndef _MSC_VER
etype rpe = (double)((boxp->rerror) * R_SCALE * R_SCALE);
etype gpe = (double)((boxp->gerror) * G_SCALE * G_SCALE);
etype bpe = (double)((boxp->berror) * B_SCALE * B_SCALE);
#else
/*
* Sorry about the mess, otherwise would get :
* error C2520: conversion from unsigned __int64 to double
* not implemented, use signed __int64
*/
etype rpe = (double)(((__int64)boxp->rerror) * R_SCALE * R_SCALE);
etype gpe = (double)(((__int64)boxp->gerror) * G_SCALE * G_SCALE);
etype bpe = (double)(((__int64)boxp->berror) * B_SCALE * B_SCALE);
#endif
if (Lbias * rpe > maxc &&
boxp->Rmin < boxp->Rmax)
......
......@@ -3,10 +3,10 @@ TOP = ..\..\..
PRJ_TOP = ..\..
PACKAGE = appcore
PKG_VER = 1.3
!INCLUDE $(TOP)\build\win32\make.msc
!INCLUDE $(TOP)\glib\build\win32\make.msc
PKG_LINK = \
$(GLIB_LIBS) $(DIRENT_LIBS) $(GTK2_LIBS) $(INTL_LIBS) \
$(GLIB_LIBS) $(GTK2_LIBS) $(INTL_LIBS) \
..\base\appbase-$(PKG_VER).lib \
..\paint-funcs\apppaint-funcs-$(PKG_VER).lib \
..\xcf\xcf.lib \
......@@ -15,6 +15,7 @@ PKG_LINK = \
..\..\libgimpwidgets\gimpwidgets-$(PKG_VER).lib
OBJECTS = \
cpercep.obj \
gimp.obj \
gimpbrush.obj \
gimpbrushgenerated.obj \
......@@ -30,12 +31,16 @@ OBJECTS = \
gimpdatalist.obj \
gimpdocuments.obj \
gimpdrawable.obj \
gimpdrawable-blend.obj \
gimpdrawable-bucket-fill.obj \
gimpdrawable-desaturate.obj \
gimpdrawable-equalize.obj \
gimpdrawable-histogram.obj \
gimpdrawable-invert.obj \
gimpdrawable-offset.obj \
gimpdrawable-preview.obj \
gimpdrawable-transform.obj \
gimpdrawable-transform-utils.obj \
gimpedit.obj \
gimpgradient.obj \
gimpimage.obj \
......@@ -44,9 +49,16 @@ OBJECTS = \
gimpimage-convert.obj \
gimpimage-crop.obj \
gimpimage-duplicate.obj \
gimpimage-guides.obj \
gimpimage-mask.obj \
gimpimage-mask-select.obj \
gimpimage-merge.obj \
gimpimage-new.obj \
gimpimage-pick-color.obj \
gimpimage-projection.obj \
gimpimage-qmask.obj \
gimpimage-resize.obj \
gimpimage-scale.obj \
gimpimage-undo.obj \
gimpimagefile.obj \
gimplayer.obj \
......@@ -84,7 +96,7 @@ OTHER_FILES = \
INCLUDES = \
-I$(PRJ_TOP) \
-I$(PRJ_TOP)/app \
$(DIRENT_CFLAGS) $(GTK2_CFLAGS) \
$(GTK2_CFLAGS) \
all : \
$(PRJ_TOP)\config.h \
......@@ -98,7 +110,7 @@ all : \
gimpmarshal.h : gimpmarshal.list
echo #ifndef __GIMP_MARSHAL_H__ > xgen-gmh
echo #define __GIMP_MARSHAL_H__ >> xgen-gmh
$(GLIB)\gobject\glib-genmarshal --nostdinc --prefix=gimp_cclosure_marshal gimpmarshal.list --header >> xgen-gmh
$(GLIB)\gobject\glib-genmarshal --nostdinc --prefix=gimp_marshal gimpmarshal.list --header >> xgen-gmh
echo #endif /* __GIMP_MARSHAL_H__ */ >> xgen-gmh
copy xgen-gmh gimpmarshal.h
......@@ -106,7 +118,7 @@ gimpmarshal.c : gimpmarshal.h gimpmarshal.list
echo #include "glib.h" > xgen-gmc
echo #include "glib-object.h" >> xgen-gmc
echo #include "gimpmarshal.h" >> xgen-gmc
$(GLIB)\gobject\glib-genmarshal --nostdinc --prefix=gimp_cclosure_marshal gimpmarshal.list --body >> xgen-gmc
$(GLIB)\gobject\glib-genmarshal --nostdinc --prefix=gimp_marshal gimpmarshal.list --body >> xgen-gmc
copy xgen-gmc gimpmarshal.c
$(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32
......
......@@ -4,7 +4,7 @@ TOP = ..\..\..
PRJ_TOP = ..\..
PACKAGE = appdisplay
PKG_VER = 1.3
!INCLUDE $(TOP)\build\win32\make.msc
!INCLUDE $(TOP)\glib\build\win32\make.msc
INCLUDES = \
-I$(PRJ_TOP) \
......@@ -13,15 +13,22 @@ INCLUDES = \
OBJECTS = \
gimpdisplay.obj \
gimpdisplay-callbacks.obj \
gimpdisplay-area.obj \
gimpdisplay-foreach.obj \
gimpdisplay-ops.obj \
gimpdisplay-render.obj \
gimpdisplay-scale.obj \
gimpdisplay-scroll.obj \
gimpdisplay-selection.obj \
gimpdisplay-handlers.obj \
gimpdisplayshell.obj \
gximage.obj \
gimpdisplayshell-callbacks.obj \
gimpdisplayshell-dnd.obj \
# gimpdisplayshell-filter.obj \
# gimpdisplayshell-filter-dialog.obj \
gimpdisplayshell-handlers.obj \
gimpdisplayshell-layer-select.obj \
gimpdisplayshell-render.obj \
gimpdisplayshell-scale.obj \
gimpdisplayshell-scroll.obj \
gimpdisplayshell-selection.obj \
gimpstatusbar.obj \
all : \
$(PRJ_TOP)\config.h \
......
......@@ -34,6 +34,12 @@
#include <glib-object.h>
#ifdef G_OS_WIN32
#include <io.h>
#define R_OK 4
#define access(f,p) _access(f,p)
#endif
#include "core/core-types.h"
#include "core/gimp.h"
......
......@@ -34,6 +34,12 @@
#include <glib-object.h>
#ifdef G_OS_WIN32
#include <io.h>
#define W_OK 2
#define access(f,p) _access(f,p)
#endif
#include "core/core-types.h"
#include "core/gimp.h"
......
......@@ -3,7 +3,7 @@ TOP = ..\..\..
PRJ_TOP = ..\..
PACKAGE = appfile
PKG_VER = 1.3
!INCLUDE $(TOP)\build\win32\make.msc
!INCLUDE $(TOP)\glib\build\win32\make.msc
OBJECTS = \
file-open.obj \
......
......@@ -3,7 +3,7 @@ TOP = ..\..\..
PRJ_TOP = ..\..
PACKAGE = appgui
PKG_VER = 1.3
!INCLUDE $(TOP)\build\win32\make.msc
!INCLUDE $(TOP)\glib\build\win32\make.msc
top_srcdir = $(PRJ_TOP)
top_builddir = $(PRJ_TOP)
......@@ -21,17 +21,18 @@ PKG_LINK = \
OBJECTS = \
about-dialog.obj \
brush-editor.obj \
brush-select.obj \
brushes-commands.obj \
brush-select.obj \
buffers-commands.obj \
channels-commands.obj \
color-area.obj \
colormap-dialog.obj \
color-notebook.obj \
color-select.obj \
colormap-dialog.obj \
commands.obj \
convert-dialog.obj \
data-commands.obj \
device-status-dialog.obj \
dialogs.obj \
dialogs-commands.obj \
dialogs-constructors.obj \
......@@ -44,26 +45,28 @@ OBJECTS = \
file-open-dialog.obj \
file-save-dialog.obj \
gradient-editor.obj \
gradient-select.obj \
gradient-editor-commands.obj \
gradients-commands.obj \
gradient-select.obj \
gui.obj \
image-commands.obj \
indicator-area.obj \
info-dialog.obj \
info-window.obj \
layer-select.obj \
input-dialog.obj \
layers-commands.obj \
menus.obj \
module-browser.obj \
offset-dialog.obj \
palette-editor.obj \
palette-import-dialog.obj \
palette-select.obj \
palettes-commands.obj \
palette-select.obj \
paths-dialog.obj \
pattern-select.obj \
patterns-commands.obj \
pattern-select.obj \
preferences-dialog.obj \
qmask-commands.obj \
resize-dialog.obj \
resolution-calibrate-dialog.obj \
select-commands.obj \
......@@ -71,9 +74,10 @@ OBJECTS = \
splash.obj \
test-commands.obj \
tips-dialog.obj \
tool-options-dialog.obj \
toolbox.obj \
tool-options-dialog.obj \
tools-commands.obj \
user-install-dialog.obj \
view-commands.obj \
INCLUDES = \
......
......@@ -5,7 +5,7 @@ TOP = ..\..
PRJ_TOP = ..
PACKAGE = gimp
PKG_VER = 1.3
!INCLUDE $(TOP)\build\win32\make.msc
!INCLUDE $(TOP)\glib\build\win32\make.msc
top_srcdir = $(PRJ_TOP)
top_builddir = $(PRJ_TOP)
......@@ -22,7 +22,9 @@ sub-one:
cd ..
PKG_LINK = \
paint/apppaint.lib \
paint-funcs/apppaint-funcs.lib \
plug-in/appplug-in.lib \
pdb/apppdb.lib \
tools/apptools.lib \
gui/appgui.lib \
......@@ -37,7 +39,6 @@ PKG_LINK = \
$(top_builddir)/libgimpmath/gimpmath-$(LT_RELEASE).lib \
$(top_builddir)/libgimpbase/gimpbase-$(LT_RELEASE).lib \
$(top_builddir)/libgimpwidgets/gimpwidgets-$(LT_RELEASE).lib \
$(DIRENT_LIBS) \
$(GLIB_LIBS) \
$(GTK2_LIBS) \
$(GIMP_THREAD_LIBS) \
......@@ -61,19 +62,14 @@ mmx_sources = \
OBJECTS = \
colormaps.obj \
devices.obj \
gimpprogress.obj \
nav_window.obj \
ops_buttons.obj \
qmask.obj \
undo_history.obj \
image_map.obj \
user_install.obj \
floating_sel.obj \
general.obj \
gimprc.obj \
plug_in.obj \
path.obj \
path_curves.obj \
path_bezier.obj \
......
......@@ -3,7 +3,7 @@ TOP = ..\..\..
PRJ_TOP = ..\..
PACKAGE = apppaint-funcs
PKG_VER = 1.3
!INCLUDE $(TOP)\build\win32\make.msc
!INCLUDE $(TOP)\glib\build\win32\make.msc
top_srcdir = $(PRJ_TOP)
top_builddir = $(PRJ_TOP)
......
# autogenerated from automake.am with automake.py
TOP = ..\..\..
PRJ_TOP = ..\..
PACKAGE = apppaint
PKG_VER = 1.3
!INCLUDE $(TOP)\glib\build\win32\make.msc
top_srcdir = $(PRJ_TOP)
top_builddir = $(PRJ_TOP)
includedir = $(PRJ_TOP)
LT_RELEASE = $(PKG_VER)
PKG_LINK = \
$(GLIB_LIBS) $(GTK2_LIBS) $(INTL_LIBS) \
..\..\libgimpbase\gimpbase-$(PKG_VER).lib \
..\..\libgimpcolor\gimpcolor-$(PKG_VER).lib \
..\..\libgimpmath\gimpmath-$(PKG_VER).lib \
..\..\libgimpwidgets\gimpwidgets-$(PKG_VER).lib \
..\paint-funcs\apppaint-funcs-$(PKG_VER).lib \
..\base\appbase-$(PKG_VER).lib \
..\core\appcore-$(PKG_VER).lib \
..\gui\appgui-$(PKG_VER).lib \
..\widgets\appwidgets-$(PKG_VER).lib \
OBJECTS = \
gimpairbrush.obj \
gimpclone.obj \
gimpconvolve.obj \
gimpdodgeburn.obj \
gimperaser.obj \
gimppaintbrush.obj \
gimppaintcore.obj \
gimppencil.obj \
gimpsmudge.obj \
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/app \
$(GTK2_CFLAGS) \
-I$(includedir)
# $(FREETYPE2_CFLAGS)
all : \
$(PRJ_TOP)\config.h \
$(PACKAGE).lib \
$(PACKAGE)-$(PKG_VER).dll
$(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32
copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h
RESOURCE = $(PACKAGE).res