summaryrefslogtreecommitdiff
path: root/src/synaptics.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/synaptics.h')
-rw-r--r--src/synaptics.h78
1 files changed, 41 insertions, 37 deletions
diff --git a/src/synaptics.h b/src/synaptics.h
index 6f4e662..47971d9 100644
--- a/src/synaptics.h
+++ b/src/synaptics.h
@@ -24,50 +24,54 @@
#include "synproto.h"
#include "synapticsstr.h"
+#include <stdarg.h>
-/**
- * Generic messaging call. Called by the core driver to output driver log
- * messages.
- * Implemented by: front-end
- */
-void SynapticsMsg(SynapticsPrivate *priv, enum MessageType type, const char *format, ...);
-/**
- * Return the current time in milliseconds.
- * Implemented-by: frontend
- */
-unsigned int SynapticsGetCurrentMillis(void);
+struct SynapticsFrontend {
+ /**
+ * Generic messaging call. Called by the core driver to output driver log
+ * messages.
+ */
+ void (*Msg)(SynapticsPrivate *priv, enum MessageType type,
+ const char *format, va_list args);
+ /**
+ * Return the current time in milliseconds.
+ */
+ unsigned int (*GetCurrentMillis)(void);
+ /**
+ * Post a button event of the given type.
+ */
+ void (*ButtonEvent)(SynapticsPrivate *priv, int button, enum ButtonEventType press);
+ /**
+ * Post a motion event.
+ */
+ void (*MotionEvent)(SynapticsPrivate *priv, int x, int y);
+ /**
+ * Post a scroll event.
+ */
+ void (*ScrollEvent)(SynapticsPrivate *priv, unsigned int which,
+ double vert, double horiz);
+ /**
+ * Post a touch event for the given touchid of the given type.
+ */
+ void (*TouchEvent)(SynapticsPrivate *priv, unsigned int touchid,
+ enum TouchEventType type, VMask *mask);
+ /**
+ * Set a timer to be called delay milliseconds after now. That timer should
+ * call the SynapticsTimerFunc when it fires.
+ */
+ void (*SetTimer)(SynapticsPrivate *priv, unsigned int now, unsigned int delay);
+};
-/**
- * Post a button event of the given type.
- * Implemented-by: frontend
- */
-void SynapticsButtonEvent(SynapticsPrivate *priv, int button, enum ButtonEventType press);
-/**
- * Post a motion event.
- * Implemented-by: frontend
- */
+/* Wrappers the drivers uses to call the matching frontend calls */
+void SynapticsMsg(SynapticsPrivate *priv, enum MessageType type, const char *format, ...);
+unsigned int SynapticsGetCurrentMillis(SynapticsPrivate *priv);
+void SynapticsButtonEvent(SynapticsPrivate *priv, int button, enum ButtonEventType press);
void SynapticsMotionEvent(SynapticsPrivate *priv, int x, int y);
-
-/**
- * Post a scroll event.
- * Implemented-by: frontend
- */
void SynapticsScrollEvent(SynapticsPrivate *priv, unsigned int which, double vert, double horiz);
-
-/**
- * Post a touch event for the given touchid of the given type.
- * Implemented-by: frontend
- */
void SynapticsTouchEvent(SynapticsPrivate *priv, unsigned int touchid,
enum TouchEventType type, VMask *mask);
-
-/**
- * Set a timer to be called delay milliseconds after now. That timer should
- * call the SynapticsTimerFunc when it fires.
- * Implemented-by: frontend
- */
void SynapticsSetTimer(SynapticsPrivate *priv, unsigned int now, unsigned int delay);
/**
@@ -76,7 +80,7 @@ void SynapticsSetTimer(SynapticsPrivate *priv, unsigned int now, unsigned int de
* Implemented by: core
* @see SynapticsFreePrivate
*/
-SynapticsPrivate * SynapticsInitPrivate(void);
+SynapticsPrivate * SynapticsInitPrivate(struct SynapticsFrontend *frontend);
/**
* Deletes driver-associated memory regions.
* Implemented by: core