Similar additions for Win32 as in the other libgimp*/Makefile.am files:
2002-12-25 Tor Lillqvist <tml@iki.fi> * libgimptool/Makefile.am: Similar additions for Win32 as in the other libgimp*/Makefile.am files: Use -no-undefined. Use the .def file. Produce MS style import library if possible. Install and uninstall import libraries. * libgimptool/gimptool.def: New file. * libgimptool/glue.c: New file. Used on Win32 to be able to link at run-time against entries in the main executable that has loaded the libgimptool DLL. (If I understand correctly how things are supposed to work, this will be either gimp.exe or tool-safe-mode.exe, but that doesn't matter.)
This commit is contained in:

committed by
Tor Lillqvist

parent
2998b4048a
commit
48cecc04dc
12
ChangeLog
12
ChangeLog
@ -1,11 +1,19 @@
|
||||
2002-12-25 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
* libgimpproxy/Makefile.am: Similar additions for Win32 as in the
|
||||
* libgimpproxy/Makefile.am
|
||||
* libgimptool/Makefile.am: Similar additions for Win32 as in the
|
||||
other libgimp*/Makefile.am files: Use -no-undefined. Use the .def
|
||||
file. Produce MS style import library if possible. Install and
|
||||
uninstall import libraries.
|
||||
|
||||
* libgimpproxy/gimpproxy.def: New file.
|
||||
* libgimpproxy/gimpproxy.def
|
||||
* libgimptool/gimptool.def: New files.
|
||||
|
||||
* libgimptool/glue.c: New file. Used on Win32 to be able to link
|
||||
at run-time against entries in the main executable that has loaded
|
||||
the libgimptool DLL. (If I understand correctly how things are
|
||||
supposed to work, this will be either gimp.exe or
|
||||
tool-safe-mode.exe, but that doesn't matter.)
|
||||
|
||||
2002-12-23 Maurits Rijk <lpeek.mrijk@consunet.nl>
|
||||
|
||||
|
@ -1,5 +1,40 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
if PLATFORM_WIN32
|
||||
no_undefined = -no-undefined
|
||||
endif
|
||||
|
||||
if OS_WIN32
|
||||
gimptool_def = gimptool.def
|
||||
libgimptool_export_symbols = -export-symbols gimptool.def
|
||||
|
||||
install-libtool-import-lib:
|
||||
$(INSTALL) .libs/libgimptool-1.3.dll.a $(DESTDIR)$(libdir)
|
||||
|
||||
uninstall-libtool-import-lib:
|
||||
-rm $(DESTDIR)$(libdir)/libgimptool-1.3.dll.a
|
||||
else
|
||||
install-libtool-import-lib:
|
||||
uninstall-libtool-import-lib:
|
||||
endif
|
||||
|
||||
if MS_LIB_AVAILABLE
|
||||
noinst_DATA = gimptool-1.3.lib
|
||||
|
||||
install-ms-lib:
|
||||
$(INSTALL) gimptool-1.3.lib $(DESTDIR)$(libdir)
|
||||
|
||||
uninstall-ms-lib:
|
||||
-rm $(DESTDIR)$(libdir)/gimptool-1.3.lib
|
||||
|
||||
gimptool-1.3.lib: gimptool.def
|
||||
lib -name:libgimptool-1.3-@LT_CURRENT_MINUS_AGE@.dll -def:gimptool.def -out:$@
|
||||
|
||||
else
|
||||
install-ms-lib:
|
||||
uninstall-ms-lib:
|
||||
endif
|
||||
|
||||
libgimptoolincludedir = $(includedir)/gimp-$(LT_RELEASE)/libgimptool
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
@ -9,6 +44,7 @@ AM_CPPFLAGS = \
|
||||
INCLUDES = \
|
||||
-I$(top_srcdir) \
|
||||
$(GTK_CFLAGS) \
|
||||
$(GMODULE_CFLAGS) \
|
||||
-I$(includedir)
|
||||
|
||||
lib_LTLIBRARIES = libgimptool-1.3.la
|
||||
@ -21,7 +57,8 @@ libgimptool_1_3_la_SOURCES = \
|
||||
gimptool.h \
|
||||
gimptoolcontrol.h \
|
||||
gimptoolmodule.c \
|
||||
gimptoolmodule.h
|
||||
gimptoolmodule.h \
|
||||
glue.c
|
||||
|
||||
libgimptoolinclude_HEADERS = \
|
||||
gimptool.h \
|
||||
@ -30,9 +67,13 @@ libgimptoolinclude_HEADERS = \
|
||||
gimptoolmodule.h
|
||||
|
||||
libgimptool_1_3_la_LDFLAGS = \
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
|
||||
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
|
||||
$(no_undefined) \
|
||||
$(libgimptool_export_symbols)
|
||||
|
||||
libgimptool_1_3_la_LIBADD = $(GLIB_LIBS)
|
||||
libgimptool_1_3_la_LIBADD = $(GLIB_LIBS) $(GMODULE_LIBS)
|
||||
|
||||
libgimptool_1_3_la_DEPENDENCIES = $(gimptool_def)
|
||||
|
||||
#
|
||||
# rules to generate built sources
|
||||
@ -51,3 +92,7 @@ $(srcdir)/gimptoolenums.c: $(srcdir)/gimptoolenums.h $(GIMP_MKENUMS)
|
||||
$(srcdir)/gimptoolenums.h > xgen-tec \
|
||||
&& cp xgen-tec $(@F) \
|
||||
&& rm -f xgen-tec
|
||||
|
||||
install-data-local: install-ms-lib install-libtool-import-lib
|
||||
|
||||
uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
|
||||
|
14
libgimptool/gimptool.def
Normal file
14
libgimptool/gimptool.def
Normal file
@ -0,0 +1,14 @@
|
||||
EXPORTS
|
||||
gimp_tool_arrow_key
|
||||
gimp_tool_button_press
|
||||
gimp_tool_button_release
|
||||
gimp_tool_control
|
||||
gimp_tool_cursor_update
|
||||
gimp_tool_get_type
|
||||
gimp_tool_initialize
|
||||
gimp_tool_modifier_key
|
||||
gimp_tool_module_get_type
|
||||
gimp_tool_module_new
|
||||
gimp_tool_motion
|
||||
gimp_tool_oper_update
|
||||
gimp_tool_set_cursor
|
121
libgimptool/glue.c
Normal file
121
libgimptool/glue.c
Normal file
@ -0,0 +1,121 @@
|
||||
/* libgimptool/glue.c
|
||||
* Copyright (C) 2002 Tor Lillqvist <tml@iki.fi>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Used in the libgimptool shared library for dynamic linking at
|
||||
* run-time against the main executable libgimptool is used by (either
|
||||
* gimp itself or tool-safe-mode, as far as I understand).
|
||||
*
|
||||
* Idea based upon libgimpwidgets/libgimp-glue.c.
|
||||
*
|
||||
* gimp_object_get_type
|
||||
* gimp_tool_control_get_cursor
|
||||
* gimp_tool_control_get_cursor_modifier
|
||||
* gimp_tool_control_get_toggle_cursor
|
||||
* gimp_tool_control_get_toggle_cursor_modifier
|
||||
* gimp_tool_control_get_toggle_tool_cursor
|
||||
* gimp_tool_control_get_tool_cursor
|
||||
* gimp_tool_control_get_type
|
||||
* gimp_tool_control_halt
|
||||
* gimp_tool_control_is_paused
|
||||
* gimp_tool_control_is_toggled
|
||||
* gimp_tool_control_pause
|
||||
* gimp_tool_control_resume
|
||||
* gimp_tool_real_button_press
|
||||
* gimp_tool_real_button_release
|
||||
* gimp_tool_set_cursor
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef G_OS_WIN32 /* Bypass whole file otherwise */
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
#include "libgimpproxy/gimpproxytypes.h"
|
||||
#include "gimptooltypes.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
typedef int voidish;
|
||||
|
||||
static FARPROC
|
||||
dynamic_resolve (const gchar* name)
|
||||
{
|
||||
FARPROC fn = NULL;
|
||||
|
||||
fn = GetProcAddress (GetModuleHandle (NULL), name);
|
||||
|
||||
if (!fn)
|
||||
g_error ("GetProcAddress of %s failed!", name);
|
||||
|
||||
return fn;
|
||||
}
|
||||
|
||||
#define ENTRY(type, name, parlist, arglist) \
|
||||
type \
|
||||
name parlist \
|
||||
{ \
|
||||
typedef type (*p_##name) parlist; \
|
||||
static gboolean beenhere = FALSE; \
|
||||
static p_##name fn; \
|
||||
if (!beenhere) \
|
||||
beenhere = TRUE, fn = (p_##name) dynamic_resolve (#name); \
|
||||
return (fn) arglist; \
|
||||
}
|
||||
|
||||
ENTRY (GType, gimp_object_get_type, (void), ());
|
||||
ENTRY (GdkCursorType, gimp_tool_control_get_cursor, (GimpToolControl *control), (control));
|
||||
ENTRY (GimpCursorModifier, gimp_tool_control_get_cursor_modifier, (GimpToolControl *control), (control));
|
||||
ENTRY (GdkCursorType, gimp_tool_control_get_toggle_cursor, (GimpToolControl *control), (control));
|
||||
ENTRY (GimpCursorModifier, gimp_tool_control_get_toggle_cursor_modifier, (GimpToolControl *control), (control));
|
||||
ENTRY (GimpToolCursorType, gimp_tool_control_get_toggle_tool_cursor, (GimpToolControl *control), (control));
|
||||
ENTRY (GimpToolCursorType, gimp_tool_control_get_tool_cursor, (GimpToolControl *control), (control));
|
||||
ENTRY (GType, gimp_tool_control_get_type, (void), ());
|
||||
ENTRY (voidish, gimp_tool_control_halt, (GimpToolControl *control), (control));
|
||||
ENTRY (gboolean, gimp_tool_control_is_paused, (GimpToolControl *control), (control));
|
||||
ENTRY (gboolean, gimp_tool_control_is_toggled, (GimpToolControl *control), (control));
|
||||
ENTRY (voidish, gimp_tool_control_pause, (GimpToolControl *control), (control));
|
||||
ENTRY (voidish, gimp_tool_control_resume, (GimpToolControl *control), (control));
|
||||
ENTRY (voidish, gimp_tool_real_button_press, \
|
||||
(GimpTool *tool, \
|
||||
GimpCoords *coords, \
|
||||
guint32 time, \
|
||||
GdkModifierType state, \
|
||||
GimpDisplay *gdisp), \
|
||||
(tool, coords, time, state, gdisp));
|
||||
ENTRY (voidish, gimp_tool_real_button_release, \
|
||||
(GimpTool *tool, \
|
||||
GimpCoords *coords, \
|
||||
guint32 time, \
|
||||
GdkModifierType state, \
|
||||
GimpDisplay *gdisp), \
|
||||
(tool, coords, time, state, gdisp));
|
||||
ENTRY (voidish, gimp_tool_set_cursor, \
|
||||
(GimpTool *tool, \
|
||||
GimpDisplay *gdisp, \
|
||||
GdkCursorType cursor, \
|
||||
GimpToolCursorType tool_cursor, \
|
||||
GimpCursorModifier modifier), \
|
||||
(tool, gdisp, cursor, tool_cursor, modifier));
|
||||
|
||||
#endif /* G_OS_WIN32 */
|
Reference in New Issue
Block a user