Commit f6b4585c authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Build Wintab support always on Windows. Don't require the Wintab SDK.

2007-01-19  Tor Lillqvist  <tml@novell.com>

	Build Wintab support always on Windows. Don't require the Wintab
	SDK.

	* configure.in: Drop the --with-wintab option. Drop the
	HAVE_WINTAB feature test macro and Automake variable.

	* acconfig.h
	* config.h.win32.in: Drop HAVE_WINTAB.

	* gdk/win32/gdkevents-win32.c 
	* gdk/win32/gdkinput.c 
	* gdk/win32/gdkinput-win32.h 	
	* gdk/win32/gdkinput-win32.c
	* gdk/win32/gdkmain-win32.c: Make HAVE_WINTAB ifdef blocks
	unconditional.

	* gdk/win32/gdkinput-win32.c (_gdk_input_wintab_init_check): Try
	to load wintab32.dll dynamically here. If it is found look up the
	handful Wintab functions we use.
	(rest of file): Use these function pointers instead of calling the
	functions from wntab32x.lib. The code in wntab32x.lib did the same
	thing anyway: tried to load wintab32.dll, and looked up the
	addresses of the actual functions from it.

	* gdk/Makefile.am
	* gdk/win32/Makefile.am: Drop the libwntab32x hacks.

	* gdk/win32/wintab.h
	* gdk/win32/pktdef.h: New files. Copied from the Wintab
	SDK. Copyright blurb says: "The text and information contained in
	this file may be freely used, copied, or distributed without
	compensation or licensing restrictions."

	* README.win32: Update a bit. Remove the text about the Wintab
	SDK.


svn path=/trunk/; revision=17186
parent f1ce05ca
2007-01-19 Tor Lillqvist <tml@novell.com>
Build Wintab support always on Windows. Don't require the Wintab
SDK.
* configure.in: Drop the --with-wintab option. Drop the
HAVE_WINTAB feature test macro and Automake variable.
* acconfig.h
* config.h.win32.in: Drop HAVE_WINTAB.
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkinput.c
* gdk/win32/gdkinput-win32.h
* gdk/win32/gdkinput-win32.c
* gdk/win32/gdkmain-win32.c: Make HAVE_WINTAB ifdef blocks
unconditional.
* gdk/win32/gdkinput-win32.c (_gdk_input_wintab_init_check): Try
to load wintab32.dll dynamically here. If it is found look up the
handful Wintab functions we use.
(rest of file): Use these function pointers instead of calling the
functions from wntab32x.lib. The code in wntab32x.lib did the same
thing anyway: tried to load wintab32.dll, and looked up the
addresses of the actual functions from it.
* gdk/Makefile.am
* gdk/win32/Makefile.am: Drop the libwntab32x hacks.
* gdk/win32/wintab.h
* gdk/win32/pktdef.h: New files. Copied from the Wintab
SDK. Copyright blurb says: "The text and information contained in
this file may be freely used, copied, or distributed without
compensation or licensing restrictions."
* README.win32: Update a bit. Remove the text about the Wintab
SDK.
2007-01-18 Tor Lillqvist <tml@novell.com>
* gdk-pixbuf/Makefile.am
......
......@@ -19,25 +19,21 @@ There are two ways to build GTK+ for win32.
Makefiles (which use libtool and gcc to do the compilation). I use
this myself, but it can be hard to setup correctly.
Personally I run configure with:
CC='gcc -mpentium -fnative-struct' CPPFLAGS='-I/target/include' CFLAGS=-O2 LDFLAGS='-L/target/lib' ./configure --disable-static --prefix=/target --with-gdktarget=win32 --with-wintab=/src/wtkit126 --with-ie55=/src/workshop/ie55_lib --host=i386-pc-mingw32
Then, in theory, you can just say "make", like on Unix. In reality,
there are a few hickups that require manual intervention, and it's
best to run make separately in each subdirectory. At least for me,
when libtool creates an .exe file, it puts the real .exe in the .libs
directory, and leaves a wrapper .exe in the work directory. For some
reason that wrapper doesn't work for me, it doesn't do anything. So, I
always do a "cp .libs/*.exe ." after running a make that has produced
some exes.
Another issue is with the gdk-pixbuf.loaders file. It's probably best
to do a "make install" in the gdk-pixbuf directory, and let that set
up a mostly correct gdk-pixbuf.loaders in the target directory. Then
copy that back to the source directory. It's needed in gtk/stock-icons
Note that I first always edit the ltmain.sh file like this:
sed -e 's/need_relink=yes/need_relink=no # no way --tml/' <ltmain.sh >ltmain.temp && mv ltmain.temp ltmain.sh
Personally I run configure with something like:
CC='gcc -mtune=pentium3 -mthreads' CPPFLAGS='-I/opt/gnuwin32/include -I/opt/gnu/include -I/opt/misc/include' CFLAGS=-g LIBS=-lintl LDFLAGS='-L/opt/gnuwin32/lib -L/opt/gnu/lib -L/opt/misc/lib' ./configure --prefix=c:/devel/target/HEAD --with-gdktarget=win32 --enable-maintainer-mode --enable-debug=yes --enable-explicit-deps=no --with-included-loaders=png,bmp,gif,ico,jpeg,tiff,xpm
Then you should just be able to run "make", like on Unix.
An issue is with the gdk-pixbuf.loaders file. It's probably best to do
a "make install" in the gdk-pixbuf directory, and let that set up a
mostly correct gdk-pixbuf.loaders in the target directory. Then copy
that back to the source directory. It's needed in gtk/stock-icons
where make runs gdk-pixbuf-csource.
Etc, you get the idea. It can be a bit of a pain.
Etc, you get the idea.
2) Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
makefile.msc in gdk and gtk. Be prepared to manually edit various
......@@ -72,22 +68,8 @@ all. Possible ways to fix this are being investigated.
Wintab
======
The tablet support uses the Wintab API. The Wintab development kit can
be downloaded from http://www.pointing.com. Pass the --with-wintab
flag to configure if you use that. If you use nmake and you don't care
for Wintab, undefine HAVE_WINTAB in config.h.win32 and remove
references to the wntab32x library from the makefile before building.
ActiveIMM
=========
If you want to build a GTK+ that supports ActiveIMM (the Input Method
Manager for non-EastAsia locales that can be used on Win9x/NT4), you
need the dimm.h header file. That is somewhat difficult to find, but
http://msdn.microsoft.com/downloads/samples/internet/wizard/ seems to
be a good place to look nowadays. If you use "autoconfiscated" build,
pass the --with-ie55 flag to configure specifying the location of the
ie55_lib directory created by downloading the IE5.5 headers and libs
from the above URL.
The tablet support uses the Wintab API. Unfortunately it seems that
only Wacom tablet software comes with the required wintab32.dll
nowadays.
--Tor Lillqvist <tml@iki.fi>
......@@ -33,7 +33,6 @@
#undef HAVE_SYS_TIME_H
#undef HAVE_XFREE_XINERAMA
#undef HAVE_XINERAMA
#undef HAVE_WINTAB
#undef HAVE_XCONVERTCASE
#undef HAVE_XFT
......
......@@ -40,7 +40,6 @@
#endif /* _MSC_VER */
/* #undef HAVE_XFREE_XINERAMA */
/* #undef HAVE_XINERAMA */
#define HAVE_WINTAB 1
/* #undef HAVE_XCONVERTCASE */
/* #undef HAVE_XFT */
......
......@@ -211,9 +211,6 @@ AC_ARG_ENABLE(visibility,
AC_ARG_WITH(xinput,
[AC_HELP_STRING([--with-xinput=@<:@no/yes@:>@], [support XInput])])
AC_ARG_WITH(wintab,
[AC_HELP_STRING([--with-wintab=DIRECTORY],
[use Wintab API with win32 backend])])
if test "$platform_win32" = yes; then
gdktarget=win32
else
......@@ -568,33 +565,6 @@ AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H))
AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
if test "${with_wintab+set}" = set && test $with_wintab != no; then
AC_MSG_CHECKING([for wintab.h])
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I$with_wintab/include"
AC_TRY_COMPILE([#include <windows.h>
#include <wintab.h>],
[],
[AC_MSG_RESULT(yes)
AC_MSG_CHECKING([for wntab32x.lib])
if test -f $with_wintab/lib/i386/wntab32x.lib ; then
AC_MSG_RESULT(yes)
have_wintab=yes
AC_DEFINE(HAVE_WINTAB)
WINTAB_LIB="$with_wintab/lib/i386/wntab32x.lib"
AC_SUBST(WINTAB_LIB)
else
AC_MSG_RESULT(no)
CFLAGS="$saved_cflags"
have_wintab=no
fi
],
[AC_MSG_RESULT(no)
CFLAGS="$saved_cflags"
have_wintab=no])
fi
AM_CONDITIONAL(HAVE_WINTAB, test x$have_wintab = xyes)
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
......@@ -1341,13 +1311,6 @@ else
fi
if test "x$gdktarget" = "xwin32"; then
# We start off with the libraries from Pango
if test x$have_wintab = xyes; then
GDK_WIN32_EXTRA_CFLAGS="-I $with_wintab/include"
AC_SUBST(GDK_WIN32_EXTRA_CFLAGS)
fi
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -user32 -limm32 -lshell32 -lole32 -Wl,-luuid"
AM_CONDITIONAL(USE_WIN32, true)
else
......
......@@ -159,9 +159,6 @@ libgdk_win32_2_0_la_LIBADD = win32/libgdk-win32.la $(GDK_DEP_LIBS) \
$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la
libgdk_win32_2_0_la_DEPENDENCIES = win32/libgdk-win32.la win32/rc/gdk-win32-res.o gdk.def
libgdk_win32_2_0_la_LDFLAGS = -Wl,win32/rc/gdk-win32-res.o -export-symbols $(srcdir)/gdk.def $(LDADD)
if HAVE_WINTAB
libgdk_win32_2_0_la_LDFLAGS += -Wl,win32/libwntab32x.a
endif
if OS_WIN32
install-def-file: gdk.def
......
......@@ -15,15 +15,6 @@ INCLUDES = \
LDADDS = $(GDK_DEP_LIBS)
if HAVE_WINTAB
libwntab32x_a = libwntab32x.a
libwntab32x.a: $(WINTAB_LIB)
cp $< $@
endif
noinst_DATA = $(libwntab32x_a)
noinst_LTLIBRARIES = libgdk-win32.la
SUBDIRS=rc
......@@ -63,7 +54,9 @@ libgdk_win32_la_SOURCES = \
gdkwin32.h \
gdkwin32id.c \
gdkwindow-win32.c \
gdkwindow-win32.h
gdkwindow-win32.h \
wintab.h \
pktdef.h
libgdkinclude_HEADERS = \
gdkwin32.h
......@@ -3442,7 +3442,6 @@ gdk_event_translate (MSG *msg,
}
break;
#ifdef HAVE_WINTAB
case WM_ACTIVATE:
/* Bring any tablet contexts to the top of the overlap order when
* one of our windows is activated.
......@@ -3483,7 +3482,6 @@ gdk_event_translate (MSG *msg,
else
gdk_event_free (event);
break;
#endif
}
done:
......
This diff is collapsed.
......@@ -27,9 +27,8 @@
#ifndef __GDK_INPUT_WIN32_H__
#define __GDK_INPUT_WIN32_H__
#ifdef HAVE_WINTAB
#include <windows.h>
#include <wintab.h>
#endif
typedef struct _GdkAxisInfo GdkAxisInfo;
typedef struct _GdkDevicePrivate GdkDevicePrivate;
......@@ -85,7 +84,6 @@ struct _GdkDevicePrivate
gint *last_axis_data;
gint last_buttons;
#ifdef HAVE_WINTAB
/* WINTAB stuff: */
HCTX hctx;
/* Cursor number */
......@@ -96,7 +94,6 @@ struct _GdkDevicePrivate
UINT npbtnmarks[2];
/* Azimuth and altitude axis */
AXIS orientation_axes[2];
#endif
};
struct _GdkInputWindow
......@@ -166,9 +163,7 @@ gboolean _gdk_device_get_history (GdkDevice *device,
GdkTimeCoord ***events,
gint *n_events);
#ifdef HAVE_WINTAB
void _gdk_input_wintab_init_check (void);
void _gdk_input_set_tablet_active (void);
#endif /* HAVE_WINTAB */
#endif /* __GDK_INPUT_WIN32_H__ */
......@@ -37,16 +37,6 @@
#include "gdkinput.h"
#include "gdkprivate.h"
/* When ther necessary stuff is in
* gdkinput.h, gdkinternals.h and
* gdkprivate.h, these includes shouldn't be here.
*/
#include <windows.h>
#ifdef HAVE_WINTAB
#include <wintab.h>
#endif
#include "gdkinput-win32.h"
static GdkDeviceAxis gdk_input_core_axes[] = {
......@@ -119,18 +109,14 @@ gdk_device_get_type (void)
GList *
gdk_devices_list (void)
{
#ifdef HAVE_WINTAB
_gdk_input_wintab_init_check ();
#endif /* HAVE_WINTAB */
return _gdk_input_devices;
}
GList *
gdk_display_list_devices (GdkDisplay *dpy)
{
#ifdef HAVE_WINTAB
_gdk_input_wintab_init_check ();
#endif /* HAVE_WINTAB */
return _gdk_input_devices;
}
......@@ -276,9 +262,8 @@ gdk_input_set_extension_events (GdkWindow *window, gint mask,
if (mask != 0)
{
#ifdef HAVE_WINTAB
_gdk_input_wintab_init_check ();
#endif /* HAVE_WINTAB */
iw = g_new(GdkInputWindow,1);
iw->window = window;
......
......@@ -79,12 +79,10 @@ _gdk_windowing_init (void)
{
gchar buf[10];
#ifdef HAVE_WINTAB
if (getenv ("GDK_IGNORE_WINTAB") != NULL)
_gdk_input_ignore_wintab = TRUE;
else if (getenv ("GDK_USE_WINTAB") != NULL)
_gdk_input_ignore_wintab = FALSE;
#endif
if (gdk_synchronize)
GdiSetBatchLimit (1);
......@@ -862,11 +860,9 @@ _gdk_win32_message_to_string (UINT msg)
CASE (WM_PENWINFIRST);
CASE (WM_PENWINLAST);
CASE (WM_APP);
#ifdef HAVE_WINTAB
CASE (WT_PACKET);
CASE (WT_CSRCHANGE);
CASE (WT_PROXIMITY);
#endif
#undef CASE
default:
if (msg >= WM_HANDHELDFIRST && msg <= WM_HANDHELDLAST)
......
/* -------------------------------- pktdef.h -------------------------------- */
/* Combined 16 & 32-bit version. */
/*------------------------------------------------------------------------------
The text and information contained in this file may be freely used,
copied, or distributed without compensation or licensing restrictions.
This file is copyright 1991-1998 by LCS/Telegraphics.
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
How to use pktdef.h:
1. Include wintab.h
2. if using just one packet format:
a. Define PACKETDATA and PACKETMODE as or'ed combinations of WTPKT bits
(use the PK_* identifiers).
b. Include pktdef.h.
c. The generated structure typedef will be called PACKET. Use PACKETDATA
and PACKETMODE to fill in the LOGCONTEXT structure.
3. If using multiple packet formats, for each one:
a. Define PACKETNAME. Its text value will be a prefix for this packet's
parameters and names.
b. Define <PACKETNAME>PACKETDATA and <PACKETNAME>PACKETMODE similar to
2.a. above.
c. Include pktdef.h.
d. The generated structure typedef will be called
<PACKETNAME>PACKET. Compare with 2.c. above and example #2 below.
4. If using extension packet data, do the following additional steps
for each extension:
a. Before including pktdef.h, define <PACKETNAME>PACKET<EXTENSION>
as either PKEXT_ABSOLUTE or PKEXT_RELATIVE.
b. The generated structure typedef will contain a field for the
extension data.
c. Scan the WTI_EXTENSION categories to find the extension's
packet mask bit.
d. OR the packet mask bit with <PACKETNAME>PACKETDATA and use the
result in the lcPktData field of the LOGCONTEXT structure.
e. If <PACKETNAME>PACKET<EXTENSION> was PKEXT_RELATIVE, OR the
packet mask bit with <PACKETNAME>PACKETMODE and use the result
in the lcPktMode field of the LOGCONTEXT structure.
Example #1. -- single packet format
#include <wintab.h>
#define PACKETDATA PK_X | PK_Y | PK_BUTTONS /@ x, y, buttons @/
#define PACKETMODE PK_BUTTONS /@ buttons relative mode @/
#include <pktdef.h>
...
lc.lcPktData = PACKETDATA;
lc.lcPktMode = PACKETMODE;
Example #2. -- multiple formats
#include <wintab.h>
#define PACKETNAME MOE
#define MOEPACKETDATA PK_X | PK_Y | PK_BUTTONS /@ x, y, buttons @/
#define MOEPACKETMODE PK_BUTTONS /@ buttons relative mode @/
#include <pktdef.h>
#define PACKETNAME LARRY
#define LARRYPACKETDATA PK_Y | PK_Z | PK_BUTTONS /@ y, z, buttons @/
#define LARRYPACKETMODE PK_BUTTONS /@ buttons relative mode @/
#include <pktdef.h>
#define PACKETNAME CURLY
#define CURLYPACKETDATA PK_X | PK_Z | PK_BUTTONS /@ x, z, buttons @/
#define CURLYPACKETMODE PK_BUTTONS /@ buttons relative mode @/
#include <pktdef.h>
...
lcMOE.lcPktData = MOEPACKETDATA;
lcMOE.lcPktMode = MOEPACKETMODE;
...
lcLARRY.lcPktData = LARRYPACKETDATA;
lcLARRY.lcPktMode = LARRYPACKETMODE;
...
lcCURLY.lcPktData = CURLYPACKETDATA;
lcCURLY.lcPktMode = CURLYPACKETMODE;
Example #3. -- extension packet data "XFOO".
#include <wintab.h>
#define PACKETDATA PK_X | PK_Y | PK_BUTTONS /@ x, y, buttons @/
#define PACKETMODE PK_BUTTONS /@ buttons relative mode @/
#define PACKETXFOO PKEXT_ABSOLUTE /@ XFOO absolute mode @/
#include <pktdef.h>
...
UINT ScanExts(UINT wTag)
{
UINT i;
UINT wScanTag;
/@ scan for wTag's info category. @/
for (i = 0; WTInfo(WTI_EXTENSIONS + i, EXT_TAG, &wScanTag); i++) {
if (wTag == wScanTag) {
/@ return category offset from WTI_EXTENSIONS. @/
return i;
}
}
/@ return error code. @/
return 0xFFFF;
}
...
lc.lcPktData = PACKETDATA;
lc.lcPktMode = PACKETMODE;
#ifdef PACKETXFOO
categoryXFOO = ScanExts(WTX_XFOO);
WTInfo(WTI_EXTENSIONS + categoryXFOO, EXT_MASK, &maskXFOO);
lc.lcPktData |= maskXFOO;
#if PACKETXFOO == PKEXT_RELATIVE
lc.lcPktMode |= maskXFOO;
#endif
#endif
WTOpen(hWnd, &lc, TRUE);
------------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifndef PACKETNAME
/* if no packet name prefix */
#define __PFX(x) x
#define __IFX(x,y) x ## y
#else
/* add prefixes and infixes to packet format names */
#define __PFX(x) __PFX2(PACKETNAME,x)
#define __PFX2(p,x) __PFX3(p,x)
#define __PFX3(p,x) p ## x
#define __IFX(x,y) __IFX2(x,PACKETNAME,y)
#define __IFX2(x,i,y) __IFX3(x,i,y)
#define __IFX3(x,i,y) x ## i ## y
#endif
#define __SFX2(x,s) __SFX3(x,s)
#define __SFX3(x,s) x ## s
#define __TAG __IFX(tag,PACKET)
#define __TYPES __PFX(PACKET), * __IFX(P,PACKET), NEAR * __IFX(NP,PACKET), \
FAR * __IFX(LP,PACKET)
#define __DATA (__PFX(PACKETDATA))
#define __MODE (__PFX(PACKETMODE))
#define __EXT(x) __SFX2(__PFX(PACKET),x)
typedef struct __TAG {
#if (__DATA & PK_CONTEXT)
HCTX pkContext;
#endif
#if (__DATA & PK_STATUS)
UINT pkStatus;
#endif
#if (__DATA & PK_TIME)
DWORD pkTime;
#endif
#if (__DATA & PK_CHANGED)
WTPKT pkChanged;
#endif
#if (__DATA & PK_SERIAL_NUMBER)
UINT pkSerialNumber;
#endif
#if (__DATA & PK_CURSOR)
UINT pkCursor;
#endif
#if (__DATA & PK_BUTTONS)
DWORD pkButtons;
#endif
#if (__DATA & PK_X)
LONG pkX;
#endif
#if (__DATA & PK_Y)
LONG pkY;
#endif
#if (__DATA & PK_Z)
LONG pkZ;
#endif
#if (__DATA & PK_NORMAL_PRESSURE)
#if (__MODE & PK_NORMAL_PRESSURE)
/* relative */
int pkNormalPressure;
#else
/* absolute */
UINT pkNormalPressure;
#endif
#endif
#if (__DATA & PK_TANGENT_PRESSURE)
#if (__MODE & PK_TANGENT_PRESSURE)
/* relative */
int pkTangentPressure;
#else
/* absolute */
UINT pkTangentPressure;
#endif
#endif
#if (__DATA & PK_ORIENTATION)
ORIENTATION pkOrientation;
#endif
#if (__DATA & PK_ROTATION)
ROTATION pkRotation; /* 1.1 */
#endif
#ifndef NOWTEXTENSIONS
/* extensions begin here. */
#if (__EXT(FKEYS) == PKEXT_RELATIVE) || (__EXT(FKEYS) == PKEXT_ABSOLUTE)
UINT pkFKeys;
#endif
#if (__EXT(TILT) == PKEXT_RELATIVE) || (__EXT(TILT) == PKEXT_ABSOLUTE)
TILT pkTilt;
#endif
#endif
} __TYPES ;
#undef PACKETNAME
#undef __TAG
#undef __TAG2
#undef __TYPES
#undef __TYPES2
#undef __DATA
#undef __MODE
#undef __PFX
#undef __PFX2
#undef __PFX3
#undef __IFX
#undef __IFX2
#undef __IFX3
#undef __SFX2
#undef __SFX3
#ifdef __cplusplus
}
#endif /* __cplusplus */
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment