filter: add a filter-private.h header file
authorPeter Hutterer <peter.hutterer@who-t.net>
Thu, 3 Jul 2014 23:29:11 +0000 (09:29 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 23 Sep 2014 00:46:22 +0000 (10:46 +1000)
To keep the implementation of a filter separate from the users of a filter.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/Makefile.am
src/filter-private.h [new file with mode: 0644]
src/filter.c
src/filter.h

index 44e73d3f2b06d6e1c3cf6553c68c3ccf938ba7d6..5cc52a66c70692f32a25a2c58f10f90295b4762c 100644 (file)
@@ -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 (file)
index 0000000..283a747
--- /dev/null
@@ -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
index 804058a403ea32c542f9fcf83a582d7757ff73cc..12bf8f6a20ff673d4596fb5f47dd5d87d9d492b2 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "filter.h"
 #include "libinput-util.h"
+#include "filter-private.h"
 
 void
 filter_dispatch(struct motion_filter *filter,
index be48838c8ec95613a97c1658987f25a97cc3dad4..b79f0e34ba5f53aeede0ebb531af31c56659e811 100644 (file)
@@ -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,