summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile18
-rw-r--r--synaptics.c1
-rw-r--r--synaptics.h46
-rw-r--r--synclient.c12
4 files changed, 46 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 65471f7..323ac3d 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ SERVERSRC = $(XTOP)/programs/Xserver
TOP_X_INCLUDES = -I$(TOP)/exports/include
TOP_INCLUDES = -I$(TOP) $(TOP_X_INCLUDES)
+INSTALLED_X = /usr/X11R6
XF86SRC = $(SERVERSRC)/hw/xfree86
XF86COMSRC = $(XF86SRC)/common
@@ -24,12 +25,12 @@ PROTO_DEFINES = -DFUNCPROTO=15 -DNARROWPROTO
STD_DEFINES = -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DSHAPE -DXINPUT -DXKB -DLBX -DXAPPGROUP -DXCSECURITY -DTOGCUP -DDPMSExtension -DPIXPRIV -DPANORAMIX -DRENDER -DGCCUSESGAS -DAVOID_GLYPHBLT -DPIXPRIV -DSINGLEDEPTH -DXFreeXDGA -DXvExtension -DXFree86LOADER -DXFree86Server -DXF86VIDMODE -DSMART_SCHEDULE -DBUILDDEBUG -DX_BYTE_ORDER=X_LITTLE_ENDIAN -DNDEBUG
ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(MODULE_DEFINES)
-CCOPTIONS = -ansi -pedantic -Wall -Wpointer-arith
+CCOPTIONS = -pedantic -Wall -Wpointer-arith -fno-merge-constants
CDEBUGFLAGS = -O2
CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
+CFLAGSCLIENT = $(CDEBUGFLAGS) $(CCOPTIONS) -I$(INSTALLED_X)/include
CC = gcc
-CCOPTIONS = -ansi -pedantic -Wall -Wpointer-arith -fno-merge-constants
LDCOMBINEFLAGS = -r
@@ -42,18 +43,25 @@ DRIVER = synaptics
$(RM) $@
$(CC) -c $(CFLAGS) $(_NOOP_) $*.c
-all:: $(DRIVER)_drv.o
+all:: $(DRIVER)_drv.o synclient
$(DRIVER)_drv.o: $(OBJS) $(EXTRALIBRARYDEPS)
$(RM) $@
$(LD) $(LDCOMBINEFLAGS) $(OBJS) -o $@
-test:
- $(CC) $(CFLAGS) -o synclient synclient.c
+synclient.o : synclient.c
+ $(CC) $(CFLAGSCLIENT) -c -o $@ $<
+
+synclient : synclient.o
+ $(CC) -o $@ $<
testprotokoll: testprotokoll.c
$(CC) -o testprotokoll testprotokoll.c
+synaptics.o : synaptics.h ps2comm.h
+ps2comm.o : ps2comm.h
+synclient.o : synaptics.h
+
clean::
$(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut synclient "#"*
diff --git a/synaptics.c b/synaptics.c
index 4a4cc14..4572120 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -51,6 +51,7 @@
/*****************************************************************************
* Local Headers
****************************************************************************/
+#define SYNAPTICS_PRIVATE
#include "synaptics.h"
#include "ps2comm.h"
diff --git a/synaptics.h b/synaptics.h
index d8df12f..2e6ebae 100644
--- a/synaptics.h
+++ b/synaptics.h
@@ -1,25 +1,13 @@
-#ifndef _SAMPLE_H_
-#define _SAMPLE_H_
+#ifndef _SYNAPTICS_H_
+#define _SYNAPTICS_H_
/******************************************************************************
- * Definitions
- * structs, typedefs, #defines, enums
+ * Public definitions.
+ * Used by driver and the shared memory configurator
*****************************************************************************/
-#define SYNAPTICS_MOVE_HISTORY 5
#define SHM_SYNAPTICS 23947
-
-typedef struct _SynapticsTapRec
-{
- int x, y;
- unsigned int packet;
-} SynapticsTapRec;
-
-typedef struct _SynapticsMoveHist
+typedef struct _SynapticsSHM
{
- int x, y;
-} SynapticsMoveHistRec;
-
-typedef struct _SynapticsSHM {
/* Current device state */
int x, y; /* actual x, y Coordinates */
int z; /* pressure value */
@@ -47,6 +35,24 @@ typedef struct _SynapticsSHM {
Bool updown_button_scrolling; /* Up/Down-Button scrolling or middle/double-click */
} SynapticsSHM, *SynapticsSHMPtr;
+#ifdef SYNAPTICS_PRIVATE
+/******************************************************************************
+ * Definitions
+ * structs, typedefs, #defines, enums
+ *****************************************************************************/
+#define SYNAPTICS_MOVE_HISTORY 5
+
+typedef struct _SynapticsTapRec
+{
+ int x, y;
+ unsigned int packet;
+} SynapticsTapRec;
+
+typedef struct _SynapticsMoveHist
+{
+ int x, y;
+} SynapticsMoveHistRec;
+
typedef struct _SynapticsPrivateRec
{
/* shared memory pointer */
@@ -107,10 +113,14 @@ static Bool DeviceOff(DeviceIntPtr);
static Bool DeviceInit(DeviceIntPtr);
static Bool SynapticsGetPacket(LocalDevicePtr, SynapticsPrivatePtr);
static void PrintIdent(SynapticsPrivatePtr);
+
+#endif
+
+
/*
* DO NOT PUT ANYTHING AFTER THIS ENDIF
*/
-#endif
+#endif /* _SYNAPTICS_H_ */
/* Local Variables: */
/* tab-width: 4 */
diff --git a/synclient.c b/synclient.c
index ec45b88..327b957 100644
--- a/synclient.c
+++ b/synclient.c
@@ -5,13 +5,8 @@
#include <sys/shm.h>
#include <unistd.h>
-#define SHM_SYNAPTICS 23947
-typedef struct _SynapticsSHM {
- int x, y;
- int z; /* pressure value */
- int w; /* finger width value */
- int left, right, up, down; /* left/right/up/down buttons */
-} SynapticsSHM;
+#include <X11/Xdefs.h>
+#include "synaptics.h"
static int is_equal(SynapticsSHM* s1, SynapticsSHM* s2)
{
@@ -25,7 +20,8 @@ static int is_equal(SynapticsSHM* s1, SynapticsSHM* s2)
(s1->down == s2->down));
}
-int main() {
+int main()
+{
SynapticsSHM *synshm;
int shmid;
SynapticsSHM old;