* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef _FILTER_H_
-#define _FILTER_H_
+#ifndef FILTER_H
+#define FILTER_H
-#include <wayland-util.h>
+#include "config.h"
-#include "compositor.h"
+#include <stdint.h>
-struct weston_motion_params {
- double dx, dy;
+struct motion_params {
+ double dx, dy; /* in units/ms @ 400dpi */
};
-struct weston_motion_filter;
+struct motion_filter;
-WL_EXPORT void
-weston_filter_dispatch(struct weston_motion_filter *filter,
- struct weston_motion_params *motion,
- void *data, uint32_t time);
+void
+filter_dispatch(struct motion_filter *filter,
+ struct motion_params *motion,
+ void *data, uint64_t time);
+void
+filter_destroy(struct motion_filter *filter);
-struct weston_motion_filter_interface {
- void (*filter)(struct weston_motion_filter *filter,
- struct weston_motion_params *motion,
- void *data, uint32_t time);
- void (*destroy)(struct weston_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 weston_motion_filter {
- struct weston_motion_filter_interface *interface;
- struct wl_list link;
+struct motion_filter {
+ struct motion_filter_interface *interface;
};
-WL_EXPORT struct weston_motion_filter *
+struct motion_filter *
create_linear_acceleration_filter(double speed);
-typedef double (*accel_profile_func_t)(struct weston_motion_filter *filter,
+typedef double (*accel_profile_func_t)(struct motion_filter *filter,
void *data,
double velocity,
- uint32_t time);
+ uint64_t time);
-WL_EXPORT struct weston_motion_filter *
+struct motion_filter *
create_pointer_accelator_filter(accel_profile_func_t filter);
-#endif // _FILTER_H_
+
+/*
+ * Pointer acceleration profiles.
+ */
+
+/*
+ * Profile similar which is similar to nonaccelerated but with a smooth
+ * transition between accelerated and non-accelerated.
+ */
+double
+pointer_accel_profile_smooth_simple(struct motion_filter *filter,
+ void *data,
+ double velocity,
+ uint64_t time);
+
+#endif /* FILTER_H */