tslib improvements
This commit is contained in:
parent
7e1a564c41
commit
598c5d549a
|
@ -6,17 +6,16 @@ noinst_LIBRARIES = libfbdev.a
|
||||||
|
|
||||||
bin_PROGRAMS = Xfbdev
|
bin_PROGRAMS = Xfbdev
|
||||||
|
|
||||||
|
if TSLIB
|
||||||
|
TSLIB_FLAG = -lts
|
||||||
|
endif
|
||||||
|
|
||||||
libfbdev_a_SOURCES = \
|
libfbdev_a_SOURCES = \
|
||||||
fbdev.c
|
fbdev.c
|
||||||
|
|
||||||
Xfbdev_SOURCES = \
|
Xfbdev_SOURCES = \
|
||||||
fbinit.c
|
fbinit.c
|
||||||
|
|
||||||
|
|
||||||
if TSLIB
|
|
||||||
TSLIB_FLAG = -lts
|
|
||||||
endif
|
|
||||||
|
|
||||||
Xfbdev_LDADD = \
|
Xfbdev_LDADD = \
|
||||||
libfbdev.a \
|
libfbdev.a \
|
||||||
@KDRIVE_LIBS@ \
|
@KDRIVE_LIBS@ \
|
||||||
|
@ -25,5 +24,5 @@ Xfbdev_LDADD = \
|
||||||
|
|
||||||
Xfbdev_DEPENDENCIES = \
|
Xfbdev_DEPENDENCIES = \
|
||||||
libfbdev.a \
|
libfbdev.a \
|
||||||
@KDRIVE_LIBS@
|
@KDRIVE_LIBS@
|
||||||
|
|
||||||
|
|
|
@ -62,19 +62,27 @@
|
||||||
static long lastx = 0, lasty = 0;
|
static long lastx = 0, lasty = 0;
|
||||||
static struct tsdev *tsDev = NULL;
|
static struct tsdev *tsDev = NULL;
|
||||||
|
|
||||||
void
|
/* extern int TSLibWantRawData; */
|
||||||
|
|
||||||
|
int KdTsPhyScreen = 0;
|
||||||
|
|
||||||
|
static void
|
||||||
TsRead (int tsPort, void *closure)
|
TsRead (int tsPort, void *closure)
|
||||||
{
|
{
|
||||||
KdMouseInfo *mi = closure;
|
KdMouseInfo *mi = closure;
|
||||||
int fd = (int) mi->driver;
|
|
||||||
struct ts_sample event;
|
struct ts_sample event;
|
||||||
int n;
|
int n;
|
||||||
long pressure;
|
|
||||||
long x, y;
|
long x, y;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned long buttons;
|
|
||||||
|
/*
|
||||||
|
if (TSLibWantRawData)
|
||||||
|
n = ts_read_raw(tsDev, &event, 1);
|
||||||
|
else
|
||||||
|
*/
|
||||||
|
|
||||||
n = ts_read(tsDev, &event, 1);
|
n = ts_read(tsDev, &event, 1);
|
||||||
|
|
||||||
if (n == 1)
|
if (n == 1)
|
||||||
{
|
{
|
||||||
if (event.pressure)
|
if (event.pressure)
|
||||||
|
@ -85,7 +93,7 @@ TsRead (int tsPort, void *closure)
|
||||||
* touch screen, if it is we send absolute coordinates. If not,
|
* touch screen, if it is we send absolute coordinates. If not,
|
||||||
* then we send delta's so that we can track the entire vga screen.
|
* then we send delta's so that we can track the entire vga screen.
|
||||||
*/
|
*/
|
||||||
if (KdTsCurScreen == KdTsPhyScreen) {
|
if (KdCurScreen == KdTsPhyScreen) {
|
||||||
flags = KD_BUTTON_1;
|
flags = KD_BUTTON_1;
|
||||||
x = event.x;
|
x = event.x;
|
||||||
y = event.y;
|
y = event.y;
|
||||||
|
@ -108,11 +116,13 @@ TsRead (int tsPort, void *closure)
|
||||||
lastx = 0;
|
lastx = 0;
|
||||||
lasty = 0;
|
lasty = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
KdEnqueueMouseEvent (mi, flags, x, y);
|
KdEnqueueMouseEvent (mi, flags, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *TsNames[] = {
|
static char *TsNames[] = {
|
||||||
|
NULL,
|
||||||
"/dev/ts",
|
"/dev/ts",
|
||||||
"/dev/touchscreen/0",
|
"/dev/touchscreen/0",
|
||||||
};
|
};
|
||||||
|
@ -121,12 +131,14 @@ static char *TsNames[] = {
|
||||||
|
|
||||||
int TsInputType;
|
int TsInputType;
|
||||||
|
|
||||||
int
|
static int
|
||||||
TslibEnable (int not_needed_fd, void *closure)
|
TslibEnable (int not_needed_fd, void *closure)
|
||||||
{
|
{
|
||||||
KdMouseInfo *mi = closure;
|
KdMouseInfo *mi = closure;
|
||||||
int fd = 0;
|
int fd = 0;
|
||||||
|
|
||||||
|
fprintf(stderr, "%s() called\n", __func__);
|
||||||
|
|
||||||
if(!(tsDev = ts_open(mi->name, 0))) {
|
if(!(tsDev = ts_open(mi->name, 0))) {
|
||||||
fprintf(stderr, "%s() failed to open %s\n", __func__, mi->name );
|
fprintf(stderr, "%s() failed to open %s\n", __func__, mi->name );
|
||||||
return -1; /* XXX Not sure what to return here */
|
return -1; /* XXX Not sure what to return here */
|
||||||
|
@ -138,16 +150,16 @@ TslibEnable (int not_needed_fd, void *closure)
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
TslibDisable (int fd, void *closure)
|
TslibDisable (int fd, void *closure)
|
||||||
{
|
{
|
||||||
ts_close(tsDev);
|
ts_close(tsDev);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
TslibInit (void)
|
TslibInit (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i, j = 0;
|
||||||
KdMouseInfo *mi, *next;
|
KdMouseInfo *mi, *next;
|
||||||
int fd= 0;
|
int fd= 0;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
@ -161,10 +173,17 @@ TslibInit (void)
|
||||||
if (mi->inputType)
|
if (mi->inputType)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Check for tslib env var device setting */
|
||||||
|
if ((TsNames[0] = getenv("TSLIB_TSDEVICE")) == NULL)
|
||||||
|
j++;
|
||||||
|
|
||||||
if (!mi->name)
|
if (!mi->name)
|
||||||
{
|
{
|
||||||
for (i = 0; i < NUM_TS_NAMES; i++)
|
for (i = j; i < NUM_TS_NAMES; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/* XXX Should check for */
|
||||||
|
|
||||||
if(!(tsDev = ts_open(TsNames[i],0))) continue;
|
if(!(tsDev = ts_open(TsNames[i],0))) continue;
|
||||||
ts_config(tsDev);
|
ts_config(tsDev);
|
||||||
fd=ts_fd(tsDev);
|
fd=ts_fd(tsDev);
|
||||||
|
@ -195,11 +214,18 @@ TslibInit (void)
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (fd > 0) close(fd);
|
{
|
||||||
|
fprintf(stderr, "%s() failed to open tslib\n", __func__);
|
||||||
|
if (fd > 0) close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
TslibFini (void)
|
TslibFini (void)
|
||||||
{
|
{
|
||||||
KdMouseInfo *mi;
|
KdMouseInfo *mi;
|
||||||
|
|
|
@ -5,6 +5,11 @@ INCLUDES = \
|
||||||
|
|
||||||
bin_PROGRAMS = Xmach64
|
bin_PROGRAMS = Xmach64
|
||||||
|
|
||||||
|
if TSLIB
|
||||||
|
TSLIB_FLAG = -lts
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
noinst_LIBRARIES = libmach64.a
|
noinst_LIBRARIES = libmach64.a
|
||||||
|
|
||||||
libmach64_a_SOURCES = \
|
libmach64_a_SOURCES = \
|
||||||
|
@ -20,11 +25,14 @@ Xmach64_SOURCES = \
|
||||||
|
|
||||||
MACH64_LIBS = \
|
MACH64_LIBS = \
|
||||||
libmach64.a \
|
libmach64.a \
|
||||||
$(top_builddir)/hw/kdrive/vesa/libvesa.a
|
$(top_builddir)/hw/kdrive/vesa/libvesa.a
|
||||||
|
|
||||||
|
|
||||||
Xmach64_LDADD = \
|
Xmach64_LDADD = \
|
||||||
$(MACH64_LIBS) \
|
$(MACH64_LIBS) \
|
||||||
@KDRIVE_LIBS@ \
|
@KDRIVE_LIBS@ \
|
||||||
@XSERVER_LIBS@
|
@XSERVER_LIBS@ \
|
||||||
|
$(TSLIB_FLAG)
|
||||||
|
|
||||||
|
|
||||||
Xmach64_DEPENDENCIES = $(MACH64_LIBS) @KDRIVE_LIBS@
|
Xmach64_DEPENDENCIES = $(MACH64_LIBS) @KDRIVE_LIBS@
|
||||||
|
|
|
@ -7,6 +7,10 @@ bin_PROGRAMS = Xmga
|
||||||
|
|
||||||
noinst_LIBRARIES = libmga.a
|
noinst_LIBRARIES = libmga.a
|
||||||
|
|
||||||
|
if TSLIB
|
||||||
|
TSLIB_FLAG = -lts
|
||||||
|
endif
|
||||||
|
|
||||||
libmga_a_SOURCES = \
|
libmga_a_SOURCES = \
|
||||||
mgadraw.c \
|
mgadraw.c \
|
||||||
mga.c \
|
mga.c \
|
||||||
|
@ -19,4 +23,6 @@ Xmga_LDADD = \
|
||||||
libmga.a \
|
libmga.a \
|
||||||
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
|
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
|
||||||
@KDRIVE_LIBS@ \
|
@KDRIVE_LIBS@ \
|
||||||
@XSERVER_LIBS@
|
@XSERVER_LIBS@ \
|
||||||
|
$(TSLIB_FLAG)
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@ INCLUDES = \
|
||||||
|
|
||||||
bin_PROGRAMS = Xr128
|
bin_PROGRAMS = Xr128
|
||||||
|
|
||||||
|
if TSLIB
|
||||||
|
TSLIB_FLAG = -lts
|
||||||
|
endif
|
||||||
|
|
||||||
noinst_LIBRARIES = libr128.a
|
noinst_LIBRARIES = libr128.a
|
||||||
|
|
||||||
libr128_a_SOURCES = \
|
libr128_a_SOURCES = \
|
||||||
|
@ -19,4 +23,6 @@ Xr128_LDADD = \
|
||||||
libr128.a \
|
libr128.a \
|
||||||
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
|
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
|
||||||
@KDRIVE_LIBS@ \
|
@KDRIVE_LIBS@ \
|
||||||
@XSERVER_LIBS@
|
@XSERVER_LIBS@ \
|
||||||
|
$(TSLIB_FLAG)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,10 @@ INCLUDES = \
|
||||||
|
|
||||||
bin_PROGRAMS = Xsmi
|
bin_PROGRAMS = Xsmi
|
||||||
|
|
||||||
|
if TSLIB
|
||||||
|
TSLIB_FLAG = -lts
|
||||||
|
endif
|
||||||
|
|
||||||
noinst_LIBRARIES = libsmi.a
|
noinst_LIBRARIES = libsmi.a
|
||||||
|
|
||||||
# smivideo.c # not ready yet
|
# smivideo.c # not ready yet
|
||||||
|
@ -22,4 +26,5 @@ Xsmi_LDADD = \
|
||||||
$(top_builddir)/hw/kdrive/fbdev/libfbdev.a \
|
$(top_builddir)/hw/kdrive/fbdev/libfbdev.a \
|
||||||
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
|
$(top_builddir)/hw/kdrive/vesa/libvesa.a \
|
||||||
@KDRIVE_LIBS@ \
|
@KDRIVE_LIBS@ \
|
||||||
@XSERVER_LIBS@
|
@XSERVER_LIBS@ \
|
||||||
|
$(TSLIB_FLAG)
|
||||||
|
|
|
@ -6,6 +6,11 @@ noinst_LIBRARIES = libvesa.a
|
||||||
|
|
||||||
bin_PROGRAMS = Xvesa
|
bin_PROGRAMS = Xvesa
|
||||||
|
|
||||||
|
if TSLIB
|
||||||
|
TSLIB_FLAG = -lts
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
libvesa_a_SOURCES = \
|
libvesa_a_SOURCES = \
|
||||||
vesa.c \
|
vesa.c \
|
||||||
vbe.c \
|
vbe.c \
|
||||||
|
@ -18,8 +23,9 @@ Xvesa_SOURCES = \
|
||||||
Xvesa_LDADD = \
|
Xvesa_LDADD = \
|
||||||
libvesa.a \
|
libvesa.a \
|
||||||
@KDRIVE_LIBS@ \
|
@KDRIVE_LIBS@ \
|
||||||
@XSERVER_LIBS@
|
@XSERVER_LIBS@ \
|
||||||
|
$(TSLIB_FLAG)
|
||||||
|
|
||||||
Xvesa_DEPENDENCIES = \
|
Xvesa_DEPENDENCIES = \
|
||||||
libvesa.a \
|
libvesa.a \
|
||||||
@KDRIVE_LIBS@
|
@KDRIVE_LIBS@
|
||||||
|
|
Loading…
Reference in New Issue
Block a user