changes to allow to build on win32 with msvc again

This commit is contained in:
Hans Breuer
2001-02-07 01:16:18 +00:00
parent 5ffb34db38
commit e6928cba2d
42 changed files with 772 additions and 912 deletions

View File

@ -1,10 +1,89 @@
EXPORTS
gimp_hls_to_rgb
gimp_hsv_to_rgb
gimp_hsv_to_rgb4
gimp_hsv_to_rgb_double
gimp_rgb_to_hls
gimp_rgb_to_hsv
gimp_rgb_to_hsv4
gimp_rgb_to_hsv_double
gimp_rgb_to_l
gimp_chain_button_get_active
gimp_chain_button_get_type
gimp_chain_button_new
gimp_chain_button_set_active
gimp_color_area_get_color
gimp_color_area_get_color
gimp_color_area_get_type
gimp_color_area_get_type
gimp_color_area_new
gimp_color_area_new
gimp_color_area_set_color
gimp_color_area_set_color
gimp_color_button_get_color
gimp_color_button_get_color
gimp_color_button_get_type
gimp_color_button_get_type
gimp_color_button_has_alpha
gimp_color_button_new
gimp_color_button_set_color
gimp_color_button_set_color
gimp_color_button_set_type
gimp_context_help
gimp_coordinates_new
gimp_dialog_create_action_area
gimp_dialog_create_action_areav
gimp_dialog_new
gimp_dialog_newv
gimp_dialog_set_icon
gimp_double_adjustment_update
gimp_file_selection_get_filename
gimp_file_selection_get_type
gimp_file_selection_new
gimp_file_selection_set_filename
gimp_float_adjustment_update
gimp_help_connect_help_accel
gimp_help_disable_tooltips
gimp_help_enable_tooltips
gimp_help_free
gimp_help_init
gimp_help_set_help_data
gimp_int_adjustment_update
gimp_mem_size_entry_new
gimp_menu_item_update
gimp_option_menu_new
gimp_option_menu_new2
gimp_option_menu_set_history
gimp_path_editor_get_path
gimp_path_editor_get_type
gimp_path_editor_new
gimp_pixmap_button_new
gimp_pixmap_get_type
gimp_pixmap_new
gimp_pixmap_set
gimp_query_boolean_box
gimp_query_double_box
gimp_query_int_box
gimp_query_size_box
gimp_query_string_box
gimp_radio_button_update
gimp_radio_group_new
gimp_radio_group_new2
gimp_random_seed_new
gimp_scale_entry_new
gimp_size_entry_add_field
gimp_size_entry_attach_label
gimp_size_entry_get_refval
gimp_size_entry_get_type
gimp_size_entry_get_unit
gimp_size_entry_get_value
gimp_size_entry_grab_focus
gimp_size_entry_new
gimp_size_entry_set_refval
gimp_size_entry_set_refval_boundaries
gimp_size_entry_set_refval_digits
gimp_size_entry_set_resolution
gimp_size_entry_set_size
gimp_size_entry_set_unit
gimp_size_entry_set_value
gimp_size_entry_set_value_boundaries
gimp_spin_button_new
gimp_table_attach_aligned
gimp_toggle_button_sensitive_update
gimp_toggle_button_update
gimp_uint_adjustment_update
gimp_unit_menu_get_type
gimp_unit_menu_new
gimp_unit_menu_set_unit
gimp_unit_menu_update

View File

@ -0,0 +1,235 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* libgimp-glue.c
* Copyright (C) 2001 Hans Breuer <Hans@Breuer.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Supports dynamic linking at run-time against
* libgimp (if used by a plug-in, or gimp.exe
* if used by itself)
*
gimp_palette_get_background
gimp_palette_get_foreground
gimp_standard_help_func
gimp_unit_get_abbreviation
gimp_unit_get_digits
gimp_unit_get_factor
gimp_unit_get_number_of_built_in_units
gimp_unit_get_number_of_units
gimp_unit_get_plural
gimp_unit_get_singular
gimp_unit_get_symbol
*/
#include <glib.h>
#include <libgimpcolor/gimpcolortypes.h>
#include "libgimp/gimppalette_pdb.h"
#include "libgimp/gimpunit.h"
/*
too much depencencies
#include "gimphelpui.h"
*/
#include <windows.h>
/* function pointer prototypes */
typedef gboolean (* PFN_QueryColor) (GimpRGB *color);
typedef gchar* (* PFN_GetUnitStr) (GimpUnit);
typedef gdouble (* PFN_GetUnitInt) (GimpUnit);
typedef gdouble (* PFN_GetUnitDouble) (GimpUnit);
typedef gint (* PFN_GetNumber) (void);
typedef void (* PFN_Help) (const char*);
static FARPROC
dynamic_resolve (const gchar* name, HMODULE* hMod)
{
FARPROC fn = NULL;
*hMod = NULL; /* if != NULL, call FreeLibrary */
/* from application ? */
fn = GetProcAddress(GetModuleHandle(NULL), name);
if (!fn)
{
*hMod = LoadLibrary ("gimp-1.3.dll");
fn = GetProcAddress (*hMod, name);
}
if (!fn)
g_warning ("dynamic_resolve of %s failed!", name);
return fn;
}
gboolean
gimp_palette_get_foreground (GimpRGB *color)
{
HMODULE h = NULL;
gboolean ret = FALSE;
PFN_QueryColor fn = (PFN_QueryColor) dynamic_resolve ("gimp_palette_get_foreground", &h);
if (fn)
ret = fn (color);
if (h)
FreeLibrary (h);
return ret;
}
gboolean
gimp_palette_get_background (GimpRGB *color)
{
HMODULE h = NULL;
gboolean ret = FALSE;
PFN_QueryColor fn = (PFN_QueryColor) dynamic_resolve ("gimp_palette_get_background", &h);
if (fn)
ret = fn (color);
if (h)
FreeLibrary (h);
return ret;
}
void
gimp_standard_help_func (const gchar *help_data)
{
HMODULE h = NULL;
PFN_Help fn = (PFN_Help) dynamic_resolve ("gimp_standard_help_func", &h);
if (fn)
fn (help_data);
if (h)
FreeLibrary (h);
}
gchar *
gimp_unit_get_abbreviation (GimpUnit unit)
{
HMODULE h = NULL;
gchar* ret = NULL;
PFN_GetUnitStr fn = (PFN_GetUnitStr) dynamic_resolve ("gimp_unit_get_abbreviation", &h);
if (fn)
ret = fn (unit);
if (h)
FreeLibrary (h);
return ret;
}
gchar *
gimp_unit_get_singular (GimpUnit unit)
{
HMODULE h = NULL;
gchar* ret = NULL;
PFN_GetUnitStr fn = (PFN_GetUnitStr) dynamic_resolve ("gimp_unit_get_singular", &h);
if (fn)
ret = fn (unit);
if (h)
FreeLibrary (h);
return ret;
}
gchar *
gimp_unit_get_plural (GimpUnit unit)
{
HMODULE h = NULL;
gchar* ret = NULL;
PFN_GetUnitStr fn = (PFN_GetUnitStr) dynamic_resolve ("gimp_unit_get_plural", &h);
if (fn)
ret = fn (unit);
if (h)
FreeLibrary (h);
return ret;
}
gint
gimp_unit_get_digits (GimpUnit unit)
{
HMODULE h = NULL;
gint ret = 0;
PFN_GetUnitInt fn = (PFN_GetUnitInt) dynamic_resolve ("gimp_unit_get_digits", &h);
if (fn)
ret = fn (unit);
if (h)
FreeLibrary (h);
return ret;
}
gdouble
gimp_unit_get_factor (GimpUnit unit)
{
HMODULE h = NULL;
gdouble ret = 0.0;
PFN_GetUnitDouble fn = (PFN_GetUnitDouble) dynamic_resolve ("gimp_unit_get_factor", &h);
if (fn)
ret = fn (unit);
if (h)
FreeLibrary (h);
return ret;
}
gint
gimp_unit_get_number_of_built_in_units (void)
{
HMODULE h = NULL;
gint ret = 0;
PFN_GetNumber fn = (PFN_GetNumber) dynamic_resolve ("gimp_unit_get_number_of_built_in_units", &h);
if (fn)
ret = fn ();
if (h)
FreeLibrary (h);
return ret;
}
gint
gimp_unit_get_number_of_units (void)
{
HMODULE h = NULL;
gint ret = 0;
PFN_GetNumber fn = (PFN_GetNumber) dynamic_resolve ("gimp_unit_get_number_of_units", &h);
if (fn)
ret = fn ();
if (h)
FreeLibrary (h);
return ret;
}
gchar *
gimp_unit_get_symbol (GimpUnit unit)
{
HMODULE h = NULL;
gchar* ret = NULL;
PFN_GetUnitStr fn = (PFN_GetUnitStr) dynamic_resolve ("gimp_unit_get_symbol", &h);
if (fn)
ret = fn (unit);
if (h)
FreeLibrary (h);
return ret;
}

View File

@ -1,5 +1,3 @@
## WARNING: Outdated.
## Makefile for building the GIMP DLLs and LIBs with Microsoft C.
## Use: nmake -f makefile.msc
@ -7,8 +5,10 @@
# should be in your PATH. As these DLLs are for the GIMP and its plug-ins
# only, it probably is best to keep them in the GIMP's bin directory.
BIN = C:\install\gimp\bin
TOP = ..\..
!include ..\..\build\win32\make.msc
GIMP_VER = 1.2
GIMP_VER = 1.3
# The name of the directory in your %HOME% where the GIMP's personal settings
# and stuff is saved.
@ -18,173 +18,44 @@ GIMPDIR = _gimp$(GIMP_VER)
# Nothing much configurable below
!IFNDEF DEBUG
# Full optimization:
OPTIMIZE = -Ox -MD
LINKDEBUG =
!ELSE
# Debugging:
OPTIMIZE = -Zi -MDd
LINKDEBUG = /debug
!ENDIF
# cl -? describes the options
CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
LDFLAGS = /link $(LINKDEBUG)
INSTALL = copy
GTK_VER = 1.3
GLIB_VER = 1.3
GTK = ..\..\gtk+
GLIB = ..\..\glib
INTL = ..\..\intl
CFLAGS = -I.. -I$(GLIB) -I$(GTK)\gdk -I$(GTK)\gdk -I$(GTK) -I$(INTL) -DGIMPDIR=\"$(GIMPDIR)\" -DG_LOG_DOMAIN=\"LibGimp\"
INCLUDES = -I..
# DEFINES = -DG_LOG_DOMAIN=\"LibGimpWidgets\"
DEPCFLAGS = $(GLIB_CFLAGS) $(GTK_CFLAGS) $(INTL_CFLAGS)
DEPLIBS = $(GLIB_LIBS) $(GTK_LIBS) $(INTL_LIBS)
all : \
..\config.h \
gimpi.lib \
gimp-$(GIMP_VER).dll \
gimpui-$(GIMP_VER).dll
gimpwidgets-$(GIMP_VER).dll
..\config.h : ..\config.h.win32
copy ..\config.h.win32 ..\config.h
install : all
$(INSTALL) gimp-$(GIMP_VER).dll $(BIN)
$(INSTALL) gimpui-$(GIMP_VER).dll $(BIN)
$(INSTALL) gimpmath-$(GIMP_VER).dll $(BIN)
PDB_WRAPPERS_O = \
gimpbrushes_pdb.obj \
gimpbrushselect_pdb.obj \
gimpchannel_pdb.obj \
gimpchannelops_pdb.obj \
gimpcolor_pdb.obj \
gimpconvert_pdb.obj \
gimpdisplay_pdb.obj \
gimpdrawable_pdb.obj \
gimpedit_pdb.obj \
gimpfileops_pdb.obj \
gimpfloatingsel_pdb.obj \
gimpgimprc_pdb.obj \
gimpgradients_pdb.obj \
gimpgradientselect_pdb.obj \
gimpguides_pdb.obj \
gimphelp_pdb.obj \
gimpimage_pdb.obj \
gimplayer_pdb.obj \
gimpmessage_pdb.obj \
gimppalette_pdb.obj \
gimpparasite_pdb.obj \
gimppatterns_pdb.obj \
gimppatternselect_pdb.obj \
gimpplugin_pdb.obj \
gimpproceduraldb_pdb.obj \
gimpselection_pdb.obj \
gimptexttool_pdb.obj \
gimptools_pdb.obj \
gimpundo_pdb.obj \
gimpunit_pdb.obj
gimpi_OBJECTS = \
gimpenv.obj \
OBJECTS = \
gimpchainbutton.obj \
gimpcolorbutton.obj \
gimpcolorspace.obj \
gimpcolorarea.obj \
gimpdialog.obj \
gimpfileselection.obj \
gimphelpui.obj \
gimpmatrix.obj \
gimpparasite.obj \
gimpparasiteio.obj \
gimppatheditor.obj \
gimppixmap.obj \
gimpprotocol.obj \
gimpquerybox.obj \
gimpsizeentry.obj \
gimpunitmenu.obj \
gimputils.c \
gimpvector.obj \
gimpwidgets.obj \
gimpwire.obj
gimpi.lib : $(gimpi_OBJECTS)
lib /out:gimpi.lib $(gimpi_OBJECTS)
gimp_OBJECTS = \
gimp.obj \
$(PDB_WRAPPERS_O) \
gimpchannel.obj \
gimpcolorspace.obj \
gimpdrawable.obj \
gimpenv.obj \
gimpgradientselect.obj \
gimphelp.obj \
gimpimage.obj \
gimplayer.obj \
gimpmatrix.obj \
gimpparasite.obj \
gimpparasiteio.obj \
gimppixelrgn.obj \
gimpproceduraldb.obj \
gimpprotocol.obj \
gimpselection.obj \
gimptile.obj \
gimpunit.obj \
gimpvector.obj \
gimpwire.obj
gimp-$(GIMP_VER).dll : $(gimp_OBJECTS) gimp.def
$(CC) $(CFLAGS) -LD -Fegimp-$(GIMP_VER).dll $(gimp_OBJECTS) $(INTL)\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS) user32.lib /def:gimp.def
# Pass -DLIBGIMP_COMPILATION when compiling gimp.c
gimp.obj : gimp.c
$(CC) $(CFLAGS) -GD -c -DLIBGIMP_COMPILATION gimp.c
gimpui_OBJECTS = \
gimpmenu.obj \
gimpbrushmenu.obj \
gimpchainbutton.obj \
gimpcolorbutton.obj \
gimpdialog.obj \
gimpexport.obj \
gimpfileselection.obj \
gimphelpui.obj \
gimpgradientmenu.obj \
gimppatheditor.obj \
gimppatternmenu.obj \
gimppixmap.obj \
gimpquerybox.obj \
gimpsizeentry.obj \
gimpui.obj \
gimpunitmenu.obj \
gimpwidgets.obj
libgimp-glue.obj
gimpui-$(GIMP_VER).dll : $(gimpui_OBJECTS) gimpui.def
$(CC) $(CFLAGS) -LD -Fegimpui-$(GIMP_VER).dll $(gimpui_OBJECTS) gimp-$(GIMP_VER).lib $(GTK)\gtk\gtk-$(GTK_VER).lib $(GTK)\gdk\gdk-$(GTK_VER).lib $(INTL)\gnu-intl.lib $(GLIB)\glib-$(GLIB_VER).lib $(LDFLAGS) /def:gimpui.def
# questionable dependency between libgimpui/libgimpwidgets
gimpunit.obj : ..\app\gimpunit.c
$(CC) $(CFLAGS) -GD -c ..\app\gimpunit.c
gimpmenu.obj : gimpmenu.c
$(CC) $(CFLAGS) -GD -c gimpmenu.c
gimpwidgets-$(GIMP_VER).dll : $(OBJECTS) gimpwidgets.def
$(CC) $(CFLAGS) -LD -Fegimpwidgets-$(GIMP_VER).dll $(OBJECTS) \
..\libgimpcolor\gimpcolor-$(GIMP_VER).lib \
$(DEPLIBS) $(LDFLAGS) user32.lib /def:gimpwidgets.def
gimpbrushmenu.obj : gimpbrushmenu.c
$(CC) $(CFLAGS) -GD -c gimpbrushmenu.c
gimpgradientmenu.obj : gimpgradientmenu.c
$(CC) $(CFLAGS) -GD -c gimpgradientmenu.c
gimppatternmenu.obj : gimppatternmenu.c
$(CC) $(CFLAGS) -GD -c gimppatternmenu.c
# General rule for compiling, used by the objects that don't go into
# gimp-$(GIMP_VER).dll.
.c.obj:
$(CC) $(CFLAGS) -c $<
clean:
del *.exe
del *.obj
del *.exp
del *.err
del *.map
# ..\app\gimp.lib \
# ..\libgimp\gimpui-$(GIMP_VER).lib ..\libgimp\gimp-$(GIMP_VER).lib \