[PATCH libinput 02/10] filter: add a filter-private.h header file
Peter Hutterer
peter.hutterer at who-t.net
Thu Sep 18 22:44:27 PDT 2014
To keep the implementation of a filter separate from the users of a filter.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/Makefile.am | 1 +
src/filter-private.h | 42 ++++++++++++++++++++++++++++++++++++++++++
src/filter.c | 1 +
src/filter.h | 12 ------------
4 files changed, 44 insertions(+), 12 deletions(-)
create mode 100644 src/filter-private.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 44e73d3..5cc52a6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -17,6 +17,7 @@ libinput_la_SOURCES = \
evdev-mt-touchpad-buttons.c \
filter.c \
filter.h \
+ filter-private.h \
path.h \
path.c \
udev-seat.c \
diff --git a/src/filter-private.h b/src/filter-private.h
new file mode 100644
index 0000000..283a747
--- /dev/null
+++ b/src/filter-private.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2012 Jonas Ådahl
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The copyright holders make
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef FILTER_PRIVATE_H
+#define FILTER_PRIVATE_H
+
+#include "config.h"
+
+#include "filter.h"
+
+struct motion_filter_interface {
+ void (*filter)(struct motion_filter *filter,
+ struct motion_params *motion,
+ void *data, uint64_t time);
+ void (*destroy)(struct motion_filter *filter);
+};
+
+struct motion_filter {
+ struct motion_filter_interface *interface;
+};
+
+
+#endif
diff --git a/src/filter.c b/src/filter.c
index 804058a..12bf8f6 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -30,6 +30,7 @@
#include "filter.h"
#include "libinput-util.h"
+#include "filter-private.h"
void
filter_dispatch(struct motion_filter *filter,
diff --git a/src/filter.h b/src/filter.h
index be48838..b79f0e3 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -40,18 +40,6 @@ filter_dispatch(struct motion_filter *filter,
void
filter_destroy(struct motion_filter *filter);
-
-struct motion_filter_interface {
- void (*filter)(struct motion_filter *filter,
- struct motion_params *motion,
- void *data, uint64_t time);
- void (*destroy)(struct motion_filter *filter);
-};
-
-struct motion_filter {
- struct motion_filter_interface *interface;
-};
-
typedef double (*accel_profile_func_t)(struct motion_filter *filter,
void *data,
double velocity,
--
1.9.3
More information about the wayland-devel
mailing list