1. Make sure you have the latest version of automake, autoconf, gettex, indent, and libtool.
2. Make sure you have the latest version of glib and gtk
gunzip gtk+-1.2.8.tar.gz
tar -xvf gtk+-1.2.8.tar
cd gtk+-1.2.8/
./configure -prefix=/usr/local
make
make install
To get pressure sensitivity working you will have to make the following changes to GTK
When configuering gtk add the following flag--- gdkinputcommon.h.orig Mon May 29 05:30:17 2000
+++ gdkinputcommon.h Mon May 29 05:41:14 2000
@@ -235,6 +235,10 @@
if (j<xvi->num_axes)
gdkdev->info.axes[j++] = GDK_AXIS_PRESSURE;
if (j<xvi->num_axes)
+ gdkdev->info.axes[j++] = GDK_AXIS_BUTVAL_SGI;
+ if (j<xvi->num_axes)
+ gdkdev->info.axes[j++] = GDK_AXIS_TRANSDUCER_SGI;
+ if (j<xvi->num_axes)
gdkdev->info.axes[j++] = GDK_AXIS_XTILT;
if (j<xvi->num_axes)
gdkdev->info.axes[j++] = GDK_AXIS_YTILT;
@@ -374,7 +378,7 @@
{
/* We'll get into trouble if the macros change, but at least we'll
know about it, and we avoid warnings now */
- DevicePointerMotionHint (gdkdev->xdevice, 0, class);
+ DevicePointerMotionHint (gdkdev->xdevice, 0, class);
if (class != 0)
classes[i++] = class;
}
@@ -468,6 +472,30 @@
return TRUE;
}+static gint *
+gdk_input_set_valuators(guchar axes_count, guchar first_axis, gint *axis_data)
+{
+ static gint pvt_axes[8] = {0xcafebeef, 0xcafebeef, 0xcafebeef, 0xcafebeef, 0xcafebeef, 0xcafebeef, 0xcafebeef, 0xcafebeef};
+ static gint accum = 0;
+ int i = first_axis;
+ int j = axes_count;
+ int k = 0;
+
+ while(0 < j)
+ {
+ accum |= (1 << i);
+ pvt_axes[i++] = axis_data[k++];
+ j--;
+ }
+ if(accum == 0x0000007f)
+ {
+ accum = 0;
+ return pvt_axes;
+ }
+ else|
+ return pvt_axes;
+}
+
static void
gdk_input_translate_coordinates (GdkDevicePrivate *gdkdev,
GdkInputWindow *input_window,
@@ -593,6 +621,8 @@
if ((xevent->type == gdkdev->buttonpress_type) ||
(xevent->type == gdkdev->buttonrelease_type))
{
+ gint *valdat = NULL;
+
XDeviceButtonEvent *xdbe = (XDeviceButtonEvent *)(xevent);if (xdbe->type == gdkdev->buttonpress_type)
@@ -610,11 +640,20 @@
event->button.source = gdkdev->info.source;
event->button.deviceid = xdbe->deviceid;- gdk_input_translate_coordinates (gdkdev,input_window, xdbe->axis_data,
- &event->button.x,&event->button.y,
- &event->button.pressure,
- &event->button.xtilt,
- &event->button.ytilt);
+ if(NULL != (valdat = gdk_input_set_valuators(xdbe->axes_count, xdbe->first_axis, xdbe->axis_data)))
+ {
+ gdk_input_translate_coordinates (gdkdev,input_window,
+ valdat,
+ &event->button.x,&event->button.y,
+ &event->button.pressure,
+ &event->button.xtilt,
+ &event->button.ytilt);
+ }
+ else
+ {
+ event->button.type = GDK_NOTHING;
+ /* return -1; */
+ }
event->button.state = gdk_input_translate_state(xdbe->state,xdbe->device_state) ;
event->button.button = xdbe->button;@@ -691,15 +730,25 @@
if (xevent->type == gdkdev->motionnotify_type)
{
- XDeviceMotionEvent *xdme = (XDeviceMotionEvent *)(xevent);
+ gint *valdat = NULL;- gdk_input_translate_coordinates(gdkdev,input_window,xdme->axis_data,
- &event->motion.x,&event->motion.y,
- &event->motion.pressure,
- &event->motion.xtilt,
- &event->motion.ytilt);
+ XDeviceMotionEvent *xdme = (XDeviceMotionEvent *)(xevent);- event->motion.type = GDK_MOTION_NOTIFY;
+ if (NULL != (valdat = gdk_input_set_valuators(xdme->axes_count, xdme->first_axis, xdme->a
xis_data)))
+ {
+ gdk_input_translate_coordinates(gdkdev,input_window,
+ valdat,
+ &event->motion.x,&event->motion.y,
+ &event->motion.pressure,
+ &event->motion.xtilt,
+ &event->motion.ytilt);
+ event->motion.type = GDK_MOTION_NOTIFY;
+ }
+ else
+ {
+ event->motion.type = GDK_NOTHING;
+ /* return -1 */
+ }
event->motion.window = input_window->window;
event->motion.time = xdme->time;
event->motion.deviceid = xdme->deviceid;--- gdktypes.h.orig Mon May 29 05:29:20 2000
+++ gdktypes.h Mon May 29 05:41:14 2000
@@ -575,6 +575,8 @@
GDK_AXIS_X,
GDK_AXIS_Y,
GDK_AXIS_PRESSURE,
+ GDK_AXIS_BUTVAL_SGI,
+ GDK_AXIS_TRANSDUCER_SGI,
GDK_AXIS_XTILT,
GDK_AXIS_YTILT,
GDK_AXIS_LAST
./configure --with-xinput=xfree