mirror of
https://github.com/X11Libre/xf86-input-libinput.git
synced 2026-03-24 17:44:05 +00:00
Compare commits
48 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f14fdf12 | ||
|
|
92047e5d99 | ||
|
|
b8d3c29f59 | ||
|
|
2bbc4727a1 | ||
|
|
39be944991 | ||
|
|
bd2aaa246d | ||
|
|
99773d7bda | ||
|
|
3afb6244e3 | ||
|
|
f279108ffd | ||
|
|
583ed5acdc | ||
|
|
e8e5d1a6b5 | ||
|
|
639b21d78a | ||
|
|
e52daf203b | ||
|
|
400bf493d1 | ||
|
|
27a88897be | ||
|
|
d5867e5db6 | ||
|
|
1ef2ed874e | ||
|
|
3c9052d886 | ||
|
|
39b0bb4585 | ||
|
|
8923d18d25 | ||
|
|
055481187d | ||
|
|
5a925eaa84 | ||
|
|
e7eafa199e | ||
|
|
d13ab268bd | ||
|
|
347c78387e | ||
|
|
b63f7994dc | ||
|
|
04f42d6e0f | ||
|
|
5d341d1d6c | ||
|
|
4985de5ef3 | ||
|
|
e26fc3c66c | ||
|
|
a759610292 | ||
|
|
21ff2ca7d1 | ||
|
|
c67f191d5b | ||
|
|
1978a2555b | ||
|
|
0909a1a765 | ||
|
|
20bb8d6b9f | ||
|
|
1e88664d95 | ||
|
|
d84e0035d1 | ||
|
|
6c75acfcdf | ||
|
|
eaf847be16 | ||
|
|
d319092d55 | ||
|
|
18cc042e68 | ||
|
|
0db82219bb | ||
|
|
f93bc148d4 | ||
|
|
0d4b50fd6e | ||
|
|
9d9f59fd4c | ||
|
|
7353481490 | ||
|
|
6d3bd4544a |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -71,11 +71,11 @@ core
|
||||
*.tar.bz2
|
||||
*.tar.gz
|
||||
#
|
||||
# Add & Override patterns for xf86-input-libinput
|
||||
# Add & Override patterns for xf86-input-libinput
|
||||
#
|
||||
# Edit the following section as needed
|
||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
||||
#
|
||||
#
|
||||
*.log
|
||||
*.trs
|
||||
*.swp
|
||||
|
||||
55
.gitlab-ci.yml
Normal file
55
.gitlab-ci.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
|
||||
|
||||
include:
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: 59de540b620c45739871d1a073d76d5521989d11 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
||||
file: '/templates/fedora.yml'
|
||||
|
||||
|
||||
variables:
|
||||
FDO_UPSTREAM_REPO: xorg/drivers/xf86-input-libinput
|
||||
|
||||
|
||||
stages:
|
||||
- containers
|
||||
- build
|
||||
|
||||
|
||||
.fedora:
|
||||
variables:
|
||||
FDO_DISTRIBUTION_VERSION: 33
|
||||
FDO_DISTRIBUTION_PACKAGES: 'git autoconf automake libtool make xorg-x11-server-devel libudev-devel libevdev-devel libinput-devel xorg-x11-util-macros'
|
||||
FDO_DISTRIBUTION_TAG: '2021-04-06.0'
|
||||
|
||||
|
||||
fedora@container_build:
|
||||
extends:
|
||||
- .fedora
|
||||
- .fdo.container-build@fedora
|
||||
stage: containers
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
|
||||
|
||||
.default_build:
|
||||
stage: build
|
||||
script:
|
||||
- mkdir _builddir _inst
|
||||
- pushd _builddir > /dev/null
|
||||
- ../autogen.sh --prefix=$(realpath ../_inst) --disable-silent-rules
|
||||
- make && make check
|
||||
- make install
|
||||
- popd > /dev/null
|
||||
artifacts:
|
||||
name: "automake-logs-$CI_JOB_NAME"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- _builddir/config.log
|
||||
|
||||
|
||||
fedora:33@default-build:
|
||||
extends:
|
||||
- .fedora
|
||||
- .fdo.distribution-image@fedora
|
||||
- .default_build
|
||||
36
COPYING
36
COPYING
@@ -1,20 +1,20 @@
|
||||
Copyright © 2014 Red Hat, Inc.
|
||||
SPDX-License-Identifier: MIT
|
||||
|
||||
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 authors
|
||||
not be used in advertising or publicity pertaining to distribution of the
|
||||
software without specific, written prior permission. The authors make no
|
||||
representations about the suitability of this software for any
|
||||
purpose. It is provided "as is" without express or implied
|
||||
warranty.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
NO EVENT SHALL THE AUTHORS 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.
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
14
README.md
14
README.md
@@ -2,7 +2,7 @@ xf86-input-libinput - a libinput-based X driver
|
||||
===============================================
|
||||
|
||||
The official repository for this driver is
|
||||
http://cgit.freedesktop.org/xorg/driver/xf86-input-libinput/
|
||||
https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput
|
||||
|
||||
This is an X driver based on libinput. It is a thin wrapper around libinput,
|
||||
so while it does provide all features that libinput supports it does little
|
||||
@@ -20,10 +20,10 @@ xorg-x11-server-devel package or similar) and libinput (check your
|
||||
distribution for libinput-devel or similar).
|
||||
|
||||
To get libinput from source, see:
|
||||
http://www.freedesktop.org/wiki/Software/libinput/
|
||||
https://www.freedesktop.org/wiki/Software/libinput/
|
||||
|
||||
To build the X server from source:
|
||||
http://www.x.org/wiki/Building_the_X_Window_System/
|
||||
https://www.x.org/wiki/Building_the_X_Window_System/
|
||||
|
||||
Building
|
||||
--------
|
||||
@@ -48,8 +48,8 @@ This will assign this driver to *all* devices. Use with caution.
|
||||
Bugs
|
||||
----
|
||||
|
||||
Bugs in libinput go to the "libinput" component of wayland:
|
||||
https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland
|
||||
Bugs in libinput go to the Issues section of the libinput gitlab project:
|
||||
https://gitlab.freedesktop.org/libinput/libinput/issues
|
||||
|
||||
Bugs in this driver go to the "Input/libinput" component of xorg:
|
||||
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
||||
Bugs in this driver go to the Issues section of its gitlab project:
|
||||
https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
# Match on all types of devices but joysticks
|
||||
#
|
||||
# If you want to configure your devices, do not copy this file.
|
||||
# Instead, use a config snippet that contains something like this:
|
||||
#
|
||||
# Section "InputClass"
|
||||
# Identifier "something or other"
|
||||
# MatchDriver "libinput"
|
||||
#
|
||||
# MatchIsTouchpad "on"
|
||||
# ... other Match directives ...
|
||||
# Option "someoption" "value"
|
||||
# EndSection
|
||||
#
|
||||
# This applies the option any libinput device also matched by the other
|
||||
# directives. See the xorg.conf(5) man page for more info on
|
||||
# matching devices.
|
||||
|
||||
Section "InputClass"
|
||||
Identifier "libinput pointer catchall"
|
||||
MatchIsPointer "on"
|
||||
|
||||
28
configure.ac
28
configure.ac
@@ -23,8 +23,8 @@
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([xf86-input-libinput],
|
||||
[0.26.0],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
[1.0.0],
|
||||
[https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/issues],
|
||||
[xf86-input-libinput])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
@@ -38,14 +38,32 @@ AC_DISABLE_STATIC
|
||||
LT_INIT
|
||||
|
||||
# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
|
||||
m4_ifndef([XORG_MACROS_VERSION],
|
||||
m4_ifndef([XORG_MACROS_VERSION],
|
||||
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.8)
|
||||
XORG_DEFAULT_OPTIONS
|
||||
|
||||
# Obtain compiler/linker options from server and required extensions
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto [inputproto >= 2.2])
|
||||
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.4.901])
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.19] xproto [inputproto >= 2.2])
|
||||
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.11.0])
|
||||
|
||||
OLD_LIBS=$LIBS
|
||||
OLD_CFLAGS=$CFLAGS
|
||||
LIBS="$LIBS $LIBINPUT_LIBS"
|
||||
CFLAGS="$CFLAGS $LIBINPUT_CFLAGS"
|
||||
|
||||
AC_MSG_CHECKING([if libinput_device_config_scroll_get_button_lock is available])
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <libinput.h>]],
|
||||
[[libinput_device_config_scroll_get_button_lock(NULL)]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE(HAVE_LIBINPUT_SCROLL_BUTTON_LOCK, [1],
|
||||
[libinput_device_config_scroll_get_button_lock() is available])
|
||||
[libinput_have_scroll_button_lock=yes]],
|
||||
[AC_MSG_RESULT([no])
|
||||
[libinput_have_scroll_button_lock=no]])
|
||||
LIBS=$OLD_LIBS
|
||||
CFLAGS=$OLD_CFLAGS
|
||||
|
||||
# Define a configure option for an alternate input module directory
|
||||
AC_ARG_WITH(xorg-module-dir,
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2015 Red Hat, Inc.
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _LIBINPUT_PROPERTIES_H_
|
||||
@@ -115,6 +117,12 @@
|
||||
/* Scroll button for button scrolling: 32-bit int, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT "libinput Button Scrolling Button Default"
|
||||
|
||||
/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise */
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK "libinput Button Scrolling Button Lock Enabled"
|
||||
|
||||
/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise, read-only*/
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK_DEFAULT "libinput Button Scrolling Button Lock Enabled Default"
|
||||
|
||||
/* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
|
||||
shows available click methods */
|
||||
#define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE "libinput Click Methods Available"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
#
|
||||
|
||||
drivermandir = $(DRIVER_MAN_DIR)
|
||||
|
||||
|
||||
@@ -15,11 +15,11 @@ libinput \- libinput-based X.Org input driver
|
||||
|
||||
.SH NOTE
|
||||
This is the man page for the X input driver. If you are looking for the
|
||||
library documentation, go to
|
||||
library documentation, go to
|
||||
.BI http://wayland.freedesktop.org/libinput/doc/
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B libinput
|
||||
.B libinput
|
||||
is an __xservername__ input driver based on libinput. It
|
||||
therefore supports all input devices that libinput can handle, including
|
||||
most mice, keyboards, tablets and touchscreens.
|
||||
@@ -37,7 +37,7 @@ Please refer to __xconfigfile__(__filemansuffix__) for general configuration
|
||||
details and for options that can be used with all input drivers. This
|
||||
section only covers configuration details specific to this driver.
|
||||
.PP
|
||||
The following driver
|
||||
The following driver
|
||||
.B Options
|
||||
are supported:
|
||||
.TP 7
|
||||
@@ -139,9 +139,18 @@ Designates a button as scroll button. If the
|
||||
.BI ScrollMethod
|
||||
is
|
||||
.BI button
|
||||
and the button is logically held down, x/y axis movement is converted into
|
||||
and the button is logically down, x/y axis movement is converted into
|
||||
scroll events.
|
||||
.TP 7
|
||||
.BI "Option \*qScrollButtonLock\*q \*q" bool \*q
|
||||
Enables or disables the scroll button lock. If enabled, the
|
||||
.BI ScrollButton
|
||||
is considered logically down after the first click and remains down until
|
||||
the second click of that button. If disabled (the default), the
|
||||
.BI ScrollButton
|
||||
button is considered logically down while held down and up once physically
|
||||
released.
|
||||
.TP 7
|
||||
.BI "Option \*qScrollMethod\*q \*q" string \*q
|
||||
Enables a scroll method. Permitted values are
|
||||
.BI none,
|
||||
@@ -219,6 +228,12 @@ Indicates which acceleration profile is currently enabled on this device.
|
||||
setting is independent of the scroll method, to enable button scrolling the
|
||||
method must be set to button-scrolling and a valid button must be set.
|
||||
.TP 7
|
||||
.BI "libinput Button Scrolling Button Lock Enabled"
|
||||
1 boolean value. If true, the scroll button lock is enabled. This
|
||||
setting is independent of the scroll method or the scroll button, to enable
|
||||
button scrolling the method must be set to button-scrolling and a valid
|
||||
button must be set.
|
||||
.TP 7
|
||||
.BI "libinput Calibration Matrix"
|
||||
9 32-bit float values, representing a 3x3 calibration matrix, order is row
|
||||
1, row 2, row 3
|
||||
@@ -277,7 +292,7 @@ enabled on this device.
|
||||
.BI "libinput Tablet Tool Pressurecurve"
|
||||
4 32-bit float values [0.0 to 1.0]. See section
|
||||
.B TABLET TOOL PRESSURE CURVE
|
||||
.TP7
|
||||
.TP 7
|
||||
.BI "libinput Tablet Tool Area Ratio"
|
||||
2 32-bit values, corresponding to width and height. Special value 0, 0
|
||||
resets to the default ratio. See section
|
||||
@@ -381,6 +396,12 @@ it takes left-handed-ness into account.
|
||||
.TP
|
||||
This feature is provided by this driver, not by libinput.
|
||||
|
||||
.SH BUGS
|
||||
This driver does not work with \fBOption \*qDevice\*q\fR set to an event
|
||||
node in \fI/dev/input/by-id\fR and \fI/dev/input/by-path\fR. This can be
|
||||
usually be worked by using \fBSection \*qInputClass\*q\fR with an
|
||||
appropriate \fBMatch*\fR statement in the __xconfigfile__(__filemansuffix__).
|
||||
|
||||
.SH AUTHORS
|
||||
Peter Hutterer
|
||||
.SH "SEE ALSO"
|
||||
|
||||
36
src/bezier.c
36
src/bezier.c
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2016 Red Hat, Inc.
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
36
src/bezier.h
36
src/bezier.h
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2016 Red Hat, Inc.
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2015 Red Hat, Inc.
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -116,7 +118,7 @@ draglock_get_meta(const struct draglock *dl)
|
||||
}
|
||||
|
||||
size_t
|
||||
draglock_get_pairs(const struct draglock *dl, int *array, size_t sz)
|
||||
draglock_get_pairs(const struct draglock *dl, int *array, size_t nelem)
|
||||
{
|
||||
unsigned int i;
|
||||
size_t last = 0;
|
||||
@@ -131,8 +133,8 @@ draglock_get_pairs(const struct draglock *dl, int *array, size_t sz)
|
||||
}
|
||||
|
||||
/* size N array with a[0] == 0, the rest ordered by button number */
|
||||
memset(array, 0, sz * sizeof(array[0]));
|
||||
for (i = 0; i < sz && i < ARRAY_SIZE(dl->lock_pair); i++) {
|
||||
memset(array, 0, nelem * sizeof(array[0]));
|
||||
for (i = 0; i < nelem && i < ARRAY_SIZE(dl->lock_pair); i++) {
|
||||
array[i] = dl->lock_pair[i];
|
||||
if (array[i] != 0 && i > last)
|
||||
last = i;
|
||||
@@ -153,20 +155,20 @@ draglock_set_meta(struct draglock *dl, int meta_button)
|
||||
}
|
||||
|
||||
int
|
||||
draglock_set_pairs(struct draglock *dl, const int *array, size_t sz)
|
||||
draglock_set_pairs(struct draglock *dl, const int *array, size_t nelem)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (sz == 0 || array[0] != 0)
|
||||
if (nelem == 0 || array[0] != 0)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < sz; i++) {
|
||||
for (i = 0; i < nelem; i++) {
|
||||
if (array[i] < 0 || array[i] >= DRAGLOCK_MAX_BUTTONS)
|
||||
return 1;
|
||||
}
|
||||
|
||||
dl->mode = DRAGLOCK_DISABLED;
|
||||
for (i = 0; i < sz; i++) {
|
||||
for (i = 0; i < nelem; i++) {
|
||||
dl->lock_pair[i] = array[i];
|
||||
if (dl->lock_pair[i])
|
||||
dl->mode = DRAGLOCK_PAIRS;
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2015 Red Hat, Inc.
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -107,13 +109,13 @@ draglock_get_meta(const struct draglock *dl);
|
||||
* @note Button numbers start at 1, array[0] is always 0.
|
||||
*
|
||||
* @param[in|out] array Caller-allocated array to hold the button mappings.
|
||||
* @param[in] sz Maximum number of elements in array
|
||||
* @param[in] nelem Maximum number of elements in array
|
||||
*
|
||||
* @return The number of valid elements in array or 0 if the current mode is
|
||||
* not DRAGLOCK_PAIRS
|
||||
*/
|
||||
size_t
|
||||
draglock_get_pairs(const struct draglock *dl, int *array, size_t sz);
|
||||
draglock_get_pairs(const struct draglock *dl, int *array, size_t nelem);
|
||||
|
||||
/**
|
||||
* Set the drag lock config to the DRAGLOCK_META mode, with the given
|
||||
@@ -140,7 +142,7 @@ draglock_set_meta(struct draglock *dl, int meta_button);
|
||||
* @return 0 on successor nonzero otherwise
|
||||
*/
|
||||
int
|
||||
draglock_set_pairs(struct draglock *dl, const int *array, size_t sz);
|
||||
draglock_set_pairs(struct draglock *dl, const int *array, size_t nelem);
|
||||
|
||||
/**
|
||||
* Process the given button event through the drag lock state machine.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2016 Red Hat, Inc.
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "bezier.h"
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2013-2015 Red Hat, Inc.
|
||||
*
|
||||
* 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 Red Hat
|
||||
* not be used in advertising or publicity pertaining to distribution
|
||||
* of the software without specific, written prior permission. Red
|
||||
* Hat makes no representations about the suitability of this software
|
||||
* for any purpose. It is provided "as is" without express or implied
|
||||
* warranty.
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL THE AUTHORS 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.
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "draglock.h"
|
||||
|
||||
Reference in New Issue
Block a user