diff options
165 files changed, 7584 insertions, 7433 deletions
diff --git a/libX11/configure.ac b/libX11/configure.ac index 80e38a931..a9ee5a2aa 100644 --- a/libX11/configure.ac +++ b/libX11/configure.ac @@ -246,8 +246,8 @@ dnl AC_PATH_XTRA # arch specific things
WCHAR32="1"
-case $target_alias in
- *os2*) os2="true" ; WCHAR32="0" ;;
+case $host_os in
+ os2*) os2="true" ; WCHAR32="0" ;;
*) ;;
esac
AC_SUBST(WCHAR32)
diff --git a/libX11/specs/xmlrules.in b/libX11/specs/xmlrules.in index c34fba41b..b58ff5f08 100644 --- a/libX11/specs/xmlrules.in +++ b/libX11/specs/xmlrules.in @@ -37,11 +37,10 @@ spec_DATA += $(doc_sources:.xml=.txt) endif
if HAVE_STYLESHEETS
-XMLTO_FLAGS += -m $(XSL_STYLESHEET) --stringparam img.src.path=$(abs_builddir)/
-
-spec_DATA += xorg.css
-xorg.css: $(STYLESHEET_SRCDIR)/xorg.css
- $(AM_V_GEN)cp -pf $(STYLESHEET_SRCDIR)/xorg.css $@
+XMLTO_FLAGS += \
+ -m $(XSL_STYLESHEET) \
+ --stringparam img.src.path=$(abs_builddir)/ \
+ --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
endif
CLEANFILES += $(spec_DATA)
diff --git a/libXdmcp/doc/Makefile.am b/libXdmcp/doc/Makefile.am index ca5f7c9f3..c95f6cc7c 100644 --- a/libXdmcp/doc/Makefile.am +++ b/libXdmcp/doc/Makefile.am @@ -37,11 +37,8 @@ doc_DATA += $(doc_sources:.xml=.txt) endif
if HAVE_STYLESHEETS
-XMLTO_FLAGS = -m $(XSL_STYLESHEET)
-
-doc_DATA += xorg.css
-xorg.css: $(STYLESHEET_SRCDIR)/xorg.css
- $(AM_V_GEN)cp -pf $(STYLESHEET_SRCDIR)/xorg.css $@
+XMLTO_FLAGS = -m $(XSL_STYLESHEET) \
+ --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
endif
CLEANFILES = $(doc_DATA)
diff --git a/libXext/specs/Makefile.am b/libXext/specs/Makefile.am index 700969074..0d6379223 100644 --- a/libXext/specs/Makefile.am +++ b/libXext/specs/Makefile.am @@ -37,11 +37,8 @@ doc_DATA += $(doc_sources:.xml=.txt) endif
if HAVE_STYLESHEETS
-XMLTO_FLAGS = -m $(XSL_STYLESHEET)
-
-doc_DATA += xorg.css
-xorg.css: $(STYLESHEET_SRCDIR)/xorg.css
- $(AM_V_GEN)cp -pf $(STYLESHEET_SRCDIR)/xorg.css $@
+XMLTO_FLAGS = -m $(XSL_STYLESHEET) \
+ --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
endif
CLEANFILES = $(doc_DATA)
diff --git a/pixman/configure.ac b/pixman/configure.ac index ad975f494..d1265ab11 100644 --- a/pixman/configure.ac +++ b/pixman/configure.ac @@ -740,6 +740,33 @@ AC_SUBST(HAVE_PTHREAD_SETSPECIFIC) AC_SUBST(PTHREAD_LDFLAGS)
AC_SUBST(PTHREAD_LIBS)
+dnl =====================================
+dnl __attribute__((constructor))
+
+support_for_attribute_constructor=no
+
+AC_MSG_CHECKING(for __attribute__((constructor)))
+AC_LINK_IFELSE([
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
+/* attribute 'constructor' is supported since gcc 2.7, but some compilers
+ * may only pretend to be gcc, so let's try to actually use it
+ */
+static int x = 1;
+static void __attribute__((constructor)) constructor_function () { x = 0; }
+int main (void) { return x; }
+#else
+#error not gcc or gcc version is older than 2.7
+#endif
+], support_for_attribute_constructor=yes)
+
+if test x$support_for_attribute_constructor = xyes; then
+ AC_DEFINE([TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR],
+ [],[Whether the tool chain supports __attribute__((constructor))])
+fi
+
+AC_MSG_RESULT($support_for_attribute_constructor)
+AC_SUBST(TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR)
+
AC_OUTPUT([pixman-1.pc
pixman-1-uninstalled.pc
Makefile
diff --git a/pixman/pixman/pixman-arm-common.h b/pixman/pixman/pixman-arm-common.h index 8d432b1de..08f34cc20 100644 --- a/pixman/pixman/pixman-arm-common.h +++ b/pixman/pixman/pixman-arm-common.h @@ -1,273 +1,313 @@ -/* - * Copyright © 2010 Nokia Corporation - * - * 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 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. - * - * Author: Siarhei Siamashka (siarhei.siamashka@nokia.com) - */ - -#ifndef PIXMAN_ARM_COMMON_H -#define PIXMAN_ARM_COMMON_H - -/* Define some macros which can expand into proxy functions between - * ARM assembly optimized functions and the rest of pixman fast path API. - * - * All the low level ARM assembly functions have to use ARM EABI - * calling convention and take up to 8 arguments: - * width, height, dst, dst_stride, src, src_stride, mask, mask_stride - * - * The arguments are ordered with the most important coming first (the - * first 4 arguments are passed to function in registers, the rest are - * on stack). The last arguments are optional, for example if the - * function is not using mask, then 'mask' and 'mask_stride' can be - * omitted when doing a function call. - * - * Arguments 'src' and 'mask' contain either a pointer to the top left - * pixel of the composited rectangle or a pixel color value depending - * on the function type. In the case of just a color value (solid source - * or mask), the corresponding stride argument is unused. - */ - -#define PIXMAN_ARM_BIND_FAST_PATH_SRC_DST(cputype, name, \ - src_type, src_cnt, \ - dst_type, dst_cnt) \ -void \ -pixman_composite_##name##_asm_##cputype (int32_t w, \ - int32_t h, \ - dst_type *dst, \ - int32_t dst_stride, \ - src_type *src, \ - int32_t src_stride); \ - \ -static void \ -cputype##_composite_##name (pixman_implementation_t *imp, \ - pixman_op_t op, \ - pixman_image_t * src_image, \ - pixman_image_t * mask_image, \ - pixman_image_t * dst_image, \ - int32_t src_x, \ - int32_t src_y, \ - int32_t mask_x, \ - int32_t mask_y, \ - int32_t dest_x, \ - int32_t dest_y, \ - int32_t width, \ - int32_t height) \ -{ \ - dst_type *dst_line; \ - src_type *src_line; \ - int32_t dst_stride, src_stride; \ - \ - PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type, \ - src_stride, src_line, src_cnt); \ - PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \ - dst_stride, dst_line, dst_cnt); \ - \ - pixman_composite_##name##_asm_##cputype (width, height, \ - dst_line, dst_stride, \ - src_line, src_stride); \ -} - -#define PIXMAN_ARM_BIND_FAST_PATH_N_DST(cputype, name, \ - dst_type, dst_cnt) \ -void \ -pixman_composite_##name##_asm_##cputype (int32_t w, \ - int32_t h, \ - dst_type *dst, \ - int32_t dst_stride, \ - uint32_t src); \ - \ -static void \ -cputype##_composite_##name (pixman_implementation_t *imp, \ - pixman_op_t op, \ - pixman_image_t * src_image, \ - pixman_image_t * mask_image, \ - pixman_image_t * dst_image, \ - int32_t src_x, \ - int32_t src_y, \ - int32_t mask_x, \ - int32_t mask_y, \ - int32_t dest_x, \ - int32_t dest_y, \ - int32_t width, \ - int32_t height) \ -{ \ - dst_type *dst_line; \ - int32_t dst_stride; \ - uint32_t src; \ - \ - src = _pixman_image_get_solid (src_image, dst_image->bits.format); \ - \ - if (src == 0) \ - return; \ - \ - PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \ - dst_stride, dst_line, dst_cnt); \ - \ - pixman_composite_##name##_asm_##cputype (width, height, \ - dst_line, dst_stride, \ - src); \ -} - -#define PIXMAN_ARM_BIND_FAST_PATH_N_MASK_DST(cputype, name, \ - mask_type, mask_cnt, \ - dst_type, dst_cnt) \ -void \ -pixman_composite_##name##_asm_##cputype (int32_t w, \ - int32_t h, \ - dst_type *dst, \ - int32_t dst_stride, \ - uint32_t src, \ - int32_t unused, \ - mask_type *mask, \ - int32_t mask_stride); \ - \ -static void \ -cputype##_composite_##name (pixman_implementation_t *imp, \ - pixman_op_t op, \ - pixman_image_t * src_image, \ - pixman_image_t * mask_image, \ - pixman_image_t * dst_image, \ - int32_t src_x, \ - int32_t src_y, \ - int32_t mask_x, \ - int32_t mask_y, \ - int32_t dest_x, \ - int32_t dest_y, \ - int32_t width, \ - int32_t height) \ -{ \ - dst_type *dst_line; \ - mask_type *mask_line; \ - int32_t dst_stride, mask_stride; \ - uint32_t src; \ - \ - src = _pixman_image_get_solid (src_image, dst_image->bits.format); \ - \ - if (src == 0) \ - return; \ - \ - PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \ - dst_stride, dst_line, dst_cnt); \ - PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, mask_type, \ - mask_stride, mask_line, mask_cnt); \ - \ - pixman_composite_##name##_asm_##cputype (width, height, \ - dst_line, dst_stride, \ - src, 0, \ - mask_line, mask_stride); \ -} - -#define PIXMAN_ARM_BIND_FAST_PATH_SRC_N_DST(cputype, name, \ - src_type, src_cnt, \ - dst_type, dst_cnt) \ -void \ -pixman_composite_##name##_asm_##cputype (int32_t w, \ - int32_t h, \ - dst_type *dst, \ - int32_t dst_stride, \ - src_type *src, \ - int32_t src_stride, \ - uint32_t mask); \ - \ -static void \ -cputype##_composite_##name (pixman_implementation_t *imp, \ - pixman_op_t op, \ - pixman_image_t * src_image, \ - pixman_image_t * mask_image, \ - pixman_image_t * dst_image, \ - int32_t src_x, \ - int32_t src_y, \ - int32_t mask_x, \ - int32_t mask_y, \ - int32_t dest_x, \ - int32_t dest_y, \ - int32_t width, \ - int32_t height) \ -{ \ - dst_type *dst_line; \ - src_type *src_line; \ - int32_t dst_stride, src_stride; \ - uint32_t mask; \ - \ - mask = _pixman_image_get_solid (mask_image, dst_image->bits.format);\ - \ - if (mask == 0) \ - return; \ - \ - PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \ - dst_stride, dst_line, dst_cnt); \ - PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type, \ - src_stride, src_line, src_cnt); \ - \ - pixman_composite_##name##_asm_##cputype (width, height, \ - dst_line, dst_stride, \ - src_line, src_stride, \ - mask); \ -} - -#define PIXMAN_ARM_BIND_FAST_PATH_SRC_MASK_DST(cputype, name, \ - src_type, src_cnt, \ - mask_type, mask_cnt, \ - dst_type, dst_cnt) \ -void \ -pixman_composite_##name##_asm_##cputype (int32_t w, \ - int32_t h, \ - dst_type *dst, \ - int32_t dst_stride, \ - src_type *src, \ - int32_t src_stride, \ - mask_type *mask, \ - int32_t mask_stride); \ - \ -static void \ -cputype##_composite_##name (pixman_implementation_t *imp, \ - pixman_op_t op, \ - pixman_image_t * src_image, \ - pixman_image_t * mask_image, \ - pixman_image_t * dst_image, \ - int32_t src_x, \ - int32_t src_y, \ - int32_t mask_x, \ - int32_t mask_y, \ - int32_t dest_x, \ - int32_t dest_y, \ - int32_t width, \ - int32_t height) \ -{ \ - dst_type *dst_line; \ - src_type *src_line; \ - mask_type *mask_line; \ - int32_t dst_stride, src_stride, mask_stride; \ - \ - PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \ - dst_stride, dst_line, dst_cnt); \ - PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type, \ - src_stride, src_line, src_cnt); \ - PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, mask_type, \ - mask_stride, mask_line, mask_cnt); \ - \ - pixman_composite_##name##_asm_##cputype (width, height, \ - dst_line, dst_stride, \ - src_line, src_stride, \ - mask_line, mask_stride); \ -} - -#endif +/*
+ * Copyright © 2010 Nokia Corporation
+ *
+ * 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 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.
+ *
+ * Author: Siarhei Siamashka (siarhei.siamashka@nokia.com)
+ */
+
+#ifndef PIXMAN_ARM_COMMON_H
+#define PIXMAN_ARM_COMMON_H
+
+#include "pixman-fast-path.h"
+
+/* Define some macros which can expand into proxy functions between
+ * ARM assembly optimized functions and the rest of pixman fast path API.
+ *
+ * All the low level ARM assembly functions have to use ARM EABI
+ * calling convention and take up to 8 arguments:
+ * width, height, dst, dst_stride, src, src_stride, mask, mask_stride
+ *
+ * The arguments are ordered with the most important coming first (the
+ * first 4 arguments are passed to function in registers, the rest are
+ * on stack). The last arguments are optional, for example if the
+ * function is not using mask, then 'mask' and 'mask_stride' can be
+ * omitted when doing a function call.
+ *
+ * Arguments 'src' and 'mask' contain either a pointer to the top left
+ * pixel of the composited rectangle or a pixel color value depending
+ * on the function type. In the case of just a color value (solid source
+ * or mask), the corresponding stride argument is unused.
+ */
+
+#define PIXMAN_ARM_BIND_FAST_PATH_SRC_DST(cputype, name, \
+ src_type, src_cnt, \
+ dst_type, dst_cnt) \
+void \
+pixman_composite_##name##_asm_##cputype (int32_t w, \
+ int32_t h, \
+ dst_type *dst, \
+ int32_t dst_stride, \
+ src_type *src, \
+ int32_t src_stride); \
+ \
+static void \
+cputype##_composite_##name (pixman_implementation_t *imp, \
+ pixman_op_t op, \
+ pixman_image_t * src_image, \
+ pixman_image_t * mask_image, \
+ pixman_image_t * dst_image, \
+ int32_t src_x, \
+ int32_t src_y, \
+ int32_t mask_x, \
+ int32_t mask_y, \
+ int32_t dest_x, \
+ int32_t dest_y, \
+ int32_t width, \
+ int32_t height) \
+{ \
+ dst_type *dst_line; \
+ src_type *src_line; \
+ int32_t dst_stride, src_stride; \
+ \
+ PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type, \
+ src_stride, src_line, src_cnt); \
+ PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \
+ dst_stride, dst_line, dst_cnt); \
+ \
+ pixman_composite_##name##_asm_##cputype (width, height, \
+ dst_line, dst_stride, \
+ src_line, src_stride); \
+}
+
+#define PIXMAN_ARM_BIND_FAST_PATH_N_DST(cputype, name, \
+ dst_type, dst_cnt) \
+void \
+pixman_composite_##name##_asm_##cputype (int32_t w, \
+ int32_t h, \
+ dst_type *dst, \
+ int32_t dst_stride, \
+ uint32_t src); \
+ \
+static void \
+cputype##_composite_##name (pixman_implementation_t *imp, \
+ pixman_op_t op, \
+ pixman_image_t * src_image, \
+ pixman_image_t * mask_image, \
+ pixman_image_t * dst_image, \
+ int32_t src_x, \
+ int32_t src_y, \
+ int32_t mask_x, \
+ int32_t mask_y, \
+ int32_t dest_x, \
+ int32_t dest_y, \
+ int32_t width, \
+ int32_t height) \
+{ \
+ dst_type *dst_line; \
+ int32_t dst_stride; \
+ uint32_t src; \
+ \
+ src = _pixman_image_get_solid (src_image, dst_image->bits.format); \
+ \
+ if (src == 0) \
+ return; \
+ \
+ PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \
+ dst_stride, dst_line, dst_cnt); \
+ \
+ pixman_composite_##name##_asm_##cputype (width, height, \
+ dst_line, dst_stride, \
+ src); \
+}
+
+#define PIXMAN_ARM_BIND_FAST_PATH_N_MASK_DST(cputype, name, \
+ mask_type, mask_cnt, \
+ dst_type, dst_cnt) \
+void \
+pixman_composite_##name##_asm_##cputype (int32_t w, \
+ int32_t h, \
+ dst_type *dst, \
+ int32_t dst_stride, \
+ uint32_t src, \
+ int32_t unused, \
+ mask_type *mask, \
+ int32_t mask_stride); \
+ \
+static void \
+cputype##_composite_##name (pixman_implementation_t *imp, \
+ pixman_op_t op, \
+ pixman_image_t * src_image, \
+ pixman_image_t * mask_image, \
+ pixman_image_t * dst_image, \
+ int32_t src_x, \
+ int32_t src_y, \
+ int32_t mask_x, \
+ int32_t mask_y, \
+ int32_t dest_x, \
+ int32_t dest_y, \
+ int32_t width, \
+ int32_t height) \
+{ \
+ dst_type *dst_line; \
+ mask_type *mask_line; \
+ int32_t dst_stride, mask_stride; \
+ uint32_t src; \
+ \
+ src = _pixman_image_get_solid (src_image, dst_image->bits.format); \
+ \
+ if (src == 0) \
+ return; \
+ \
+ PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \
+ dst_stride, dst_line, dst_cnt); \
+ PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, mask_type, \
+ mask_stride, mask_line, mask_cnt); \
+ \
+ pixman_composite_##name##_asm_##cputype (width, height, \
+ dst_line, dst_stride, \
+ src, 0, \
+ mask_line, mask_stride); \
+}
+
+#define PIXMAN_ARM_BIND_FAST_PATH_SRC_N_DST(cputype, name, \
+ src_type, src_cnt, \
+ dst_type, dst_cnt) \
+void \
+pixman_composite_##name##_asm_##cputype (int32_t w, \
+ int32_t h, \
+ dst_type *dst, \
+ int32_t dst_stride, \
+ src_type *src, \
+ int32_t src_stride, \
+ uint32_t mask); \
+ \
+static void \
+cputype##_composite_##name (pixman_implementation_t *imp, \
+ pixman_op_t op, \
+ pixman_image_t * src_image, \
+ pixman_image_t * mask_image, \
+ pixman_image_t * dst_image, \
+ int32_t src_x, \
+ int32_t src_y, \
+ int32_t mask_x, \
+ int32_t mask_y, \
+ int32_t dest_x, \
+ int32_t dest_y, \
+ int32_t width, \
+ int32_t height) \
+{ \
+ dst_type *dst_line; \
+ src_type *src_line; \
+ int32_t dst_stride, src_stride; \
+ uint32_t mask; \
+ \
+ mask = _pixman_image_get_solid (mask_image, dst_image->bits.format);\
+ \
+ if (mask == 0) \
+ return; \
+ \
+ PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \
+ dst_stride, dst_line, dst_cnt); \
+ PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type, \
+ src_stride, src_line, src_cnt); \
+ \
+ pixman_composite_##name##_asm_##cputype (width, height, \
+ dst_line, dst_stride, \
+ src_line, src_stride, \
+ mask); \
+}
+
+#define PIXMAN_ARM_BIND_FAST_PATH_SRC_MASK_DST(cputype, name, \
+ src_type, src_cnt, \
+ mask_type, mask_cnt, \
+ dst_type, dst_cnt) \
+void \
+pixman_composite_##name##_asm_##cputype (int32_t w, \
+ int32_t h, \
+ dst_type *dst, \
+ int32_t dst_stride, \
+ src_type *src, \
+ int32_t src_stride, \
+ mask_type *mask, \
+ int32_t mask_stride); \
+ \
+static void \
+cputype##_composite_##name (pixman_implementation_t *imp, \
+ pixman_op_t op, \
+ pixman_image_t * src_image, \
+ pixman_image_t * mask_image, \
+ pixman_image_t * dst_image, \
+ int32_t src_x, \
+ int32_t src_y, \
+ int32_t mask_x, \
+ int32_t mask_y, \
+ int32_t dest_x, \
+ int32_t dest_y, \
+ int32_t width, \
+ int32_t height) \
+{ \
+ dst_type *dst_line; \
+ src_type *src_line; \
+ mask_type *mask_line; \
+ int32_t dst_stride, src_stride, mask_stride; \
+ \
+ PIXMAN_IMAGE_GET_LINE (dst_image, dest_x, dest_y, dst_type, \
+ dst_stride, dst_line, dst_cnt); \
+ PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type, \
+ src_stride, src_line, src_cnt); \
+ PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, mask_type, \
+ mask_stride, mask_line, mask_cnt); \
+ \
+ pixman_composite_##name##_asm_##cputype (width, height, \
+ dst_line, dst_stride, \
+ src_line, src_stride, \
+ mask_line, mask_stride); \
+}
+
+#define PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST(cputype, name, op, \
+ src_type, dst_type) \
+void \
+pixman_scaled_nearest_scanline_##name##_##op##_asm_##cputype ( \
+ int32_t w, \
+ dst_type * dst, \
+ src_type * src, \
+ pixman_fixed_t vx, \
+ pixman_fixed_t unit_x);\
+ \
+static force_inline void \
+scaled_nearest_scanline_##cputype##_##name##_##op (dst_type * pd, \
+ src_type * ps, \
+ int32_t w, \
+ pixman_fixed_t vx, \
+ pixman_fixed_t unit_x, \
+ pixman_fixed_t max_vx) \
+{ \
+ pixman_scaled_nearest_scanline_##name##_##op##_asm_##cputype (w, pd, ps, \
+ vx, unit_x);\
+} \
+ \
+FAST_NEAREST_MAINLOOP (cputype##_##name##_cover_##op, \
+ scaled_nearest_scanline_##cputype##_##name##_##op, \
+ src_type, dst_type, COVER) \
+FAST_NEAREST_MAINLOOP (cputype##_##name##_none_##op, \
+ scaled_nearest_scanline_##cputype##_##name##_##op, \
+ src_type, dst_type, NONE) \
+FAST_NEAREST_MAINLOOP (cputype##_##name##_pad_##op, \
+ scaled_nearest_scanline_##cputype##_##name##_##op, \
+ src_type, dst_type, PAD)
+
+/* Provide entries for the fast path table */
+#define PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH(op,s,d,func) \
+ SIMPLE_NEAREST_FAST_PATH_COVER (op,s,d,func), \
+ SIMPLE_NEAREST_FAST_PATH_NONE (op,s,d,func), \
+ SIMPLE_NEAREST_FAST_PATH_PAD (op,s,d,func)
+
+#endif
diff --git a/pixman/pixman/pixman-arm-neon-asm.S b/pixman/pixman/pixman-arm-neon-asm.S index 8ddbefc87..0229bedfa 100644 --- a/pixman/pixman/pixman-arm-neon-asm.S +++ b/pixman/pixman/pixman-arm-neon-asm.S @@ -253,7 +253,7 @@ vld1.16 {d4, d5}, [DST_R, :128]!
vqadd.u8 q9, q0, q11
vshrn.u16 d6, q2, #8
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
vshrn.u16 d7, q2, #3
vsli.u16 q2, q2, #5
vshll.u8 q14, d16, #8
@@ -295,7 +295,7 @@ pixman_composite_over_8888_0565_process_pixblock_tail
vst1.16 {d28, d29}, [DST_W, :128]!
vld1.16 {d4, d5}, [DST_R, :128]!
- vld4.32 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
pixman_composite_over_8888_0565_process_pixblock_head
cache_preload 8, 8
.endm
@@ -433,7 +433,7 @@ generate_composite_function \ vsri.u16 q14, q8, #5
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
vsri.u16 q14, q9, #11
@@ -478,7 +478,7 @@ generate_composite_function \ .macro pixman_composite_src_0565_8888_process_pixblock_tail_head
pixman_composite_src_0565_8888_process_pixblock_tail
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
- vld1.16 {d0, d1}, [SRC]!
+ fetch_src_pixblock
pixman_composite_src_0565_8888_process_pixblock_head
cache_preload 8, 8
.endm
@@ -505,7 +505,7 @@ generate_composite_function \ .endm
.macro pixman_composite_add_8_8_process_pixblock_tail_head
- vld1.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
PF add PF_X, PF_X, #32
PF tst PF_CTL, #0xF
vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
@@ -537,13 +537,13 @@ generate_composite_function \ /******************************************************************************/
.macro pixman_composite_add_8888_8888_process_pixblock_tail_head
- vld1.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
- vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
+ vld1.32 {d4, d5, d6, d7}, [DST_R, :128]!
PF addne PF_X, PF_X, #8
PF subne PF_CTL, PF_CTL, #1
- vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
+ vst1.32 {d28, d29, d30, d31}, [DST_W, :128]!
PF cmp PF_X, ORIG_W
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
@@ -613,7 +613,7 @@ generate_composite_function_single_scanline \ PF cmp PF_X, ORIG_W
vraddhn.u16 d30, q12, q10
vraddhn.u16 d31, q13, q11
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
vmvn.8 d22, d3
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
@@ -667,7 +667,7 @@ generate_composite_function_single_scanline \ vraddhn.u16 d31, q13, q11
vqadd.u8 q14, q0, q14
vqadd.u8 q15, q1, q15
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift]
vmvn.8 d22, d3
PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift]
@@ -887,7 +887,7 @@ generate_composite_function \ .macro pixman_composite_over_8888_8_0565_process_pixblock_tail_head
vld1.16 {d4, d5}, [DST_R, :128]!
pixman_composite_over_n_8_0565_process_pixblock_tail
- vld4.8 {d8, d9, d10, d11}, [SRC]!
+ fetch_src_pixblock
cache_preload 8, 8
vld1.8 {d24}, [MASK]!
pixman_composite_over_n_8_0565_process_pixblock_head
@@ -919,7 +919,7 @@ generate_composite_function \ .macro pixman_composite_src_0565_0565_process_pixblock_tail_head
vst1.16 {d0, d1, d2, d3}, [DST_W, :128]!
- vld1.16 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
cache_preload 16, 16
.endm
@@ -1065,7 +1065,7 @@ generate_composite_function \ .macro pixman_composite_src_8888_8888_process_pixblock_tail_head
vst1.32 {d0, d1, d2, d3}, [DST_W, :128]!
- vld1.32 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
cache_preload 8, 8
.endm
@@ -1096,7 +1096,7 @@ generate_composite_function \ .macro pixman_composite_src_x888_8888_process_pixblock_tail_head
vst1.32 {d0, d1, d2, d3}, [DST_W, :128]!
- vld1.32 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
vorr q0, q0, q2
vorr q1, q1, q2
cache_preload 8, 8
@@ -1395,7 +1395,7 @@ generate_composite_function \ vst1.8 {d28, d29, d30, d31}, [DST_W, :128]!
vld1.8 {d4, d5, d6, d7}, [DST_R, :128]!
vld1.8 {d24, d25, d26, d27}, [MASK]!
- vld1.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
cache_preload 32, 32
pixman_composite_add_8_8_8_process_pixblock_head
.endm
@@ -1448,7 +1448,7 @@ generate_composite_function \ vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
vld4.8 {d24, d25, d26, d27}, [MASK]!
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
cache_preload 8, 8
pixman_composite_add_8888_8888_8888_process_pixblock_head
.endm
@@ -1517,7 +1517,7 @@ generate_composite_function_single_scanline \ .macro pixman_composite_out_reverse_8888_8888_8888_process_pixblock_tail_head
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
pixman_composite_out_reverse_8888_n_8888_process_pixblock_tail
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
cache_preload 8, 8
vld4.8 {d12, d13, d14, d15}, [MASK]!
pixman_composite_out_reverse_8888_n_8888_process_pixblock_head
@@ -1554,7 +1554,7 @@ generate_composite_function_single_scanline \ .macro pixman_composite_over_8888_n_8888_process_pixblock_tail_head
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
pixman_composite_over_8888_n_8888_process_pixblock_tail
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
cache_preload 8, 8
pixman_composite_over_8888_n_8888_process_pixblock_head
vst4.8 {d28, d29, d30, d31}, [DST_W, :128]!
@@ -1588,7 +1588,7 @@ generate_composite_function \ .macro pixman_composite_over_8888_8888_8888_process_pixblock_tail_head
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
pixman_composite_over_8888_n_8888_process_pixblock_tail
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
cache_preload 8, 8
vld4.8 {d12, d13, d14, d15}, [MASK]!
pixman_composite_over_8888_n_8888_process_pixblock_head
@@ -1630,7 +1630,7 @@ generate_composite_function_single_scanline \ .macro pixman_composite_over_8888_8_8888_process_pixblock_tail_head
vld4.8 {d4, d5, d6, d7}, [DST_R, :128]!
pixman_composite_over_8888_n_8888_process_pixblock_tail
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
cache_preload 8, 8
vld1.8 {d15}, [MASK]!
pixman_composite_over_8888_n_8888_process_pixblock_head
@@ -1662,7 +1662,7 @@ generate_composite_function \ .macro pixman_composite_src_0888_0888_process_pixblock_tail_head
vst3.8 {d0, d1, d2}, [DST_W]!
- vld3.8 {d0, d1, d2}, [SRC]!
+ fetch_src_pixblock
cache_preload 8, 8
.endm
@@ -1692,7 +1692,7 @@ generate_composite_function \ .macro pixman_composite_src_0888_8888_rev_process_pixblock_tail_head
vst4.8 {d0, d1, d2, d3}, [DST_W]!
- vld3.8 {d0, d1, d2}, [SRC]!
+ fetch_src_pixblock
vswp d0, d2
cache_preload 8, 8
.endm
@@ -1731,7 +1731,7 @@ generate_composite_function \ .macro pixman_composite_src_0888_0565_rev_process_pixblock_tail_head
vshll.u8 q14, d0, #8
- vld3.8 {d0, d1, d2}, [SRC]!
+ fetch_src_pixblock
vsri.u16 q14, q8, #5
vsri.u16 q14, q9, #11
vshll.u8 q8, d1, #8
@@ -1777,7 +1777,7 @@ generate_composite_function \ vswp d3, d31
vrshr.u16 q12, q9, #8
vrshr.u16 q13, q10, #8
- vld4.8 {d0, d1, d2, d3}, [SRC]!
+ fetch_src_pixblock
vraddhn.u16 d30, q11, q8
PF add PF_X, PF_X, #8
PF tst PF_CTL, #0xF
@@ -1851,7 +1851,7 @@ generate_composite_function \ .macro pixman_composite_over_0565_8_0565_process_pixblock_tail_head
vld1.8 {d15}, [MASK]!
pixman_composite_over_0565_8_0565_process_pixblock_tail
- vld1.16 {d8, d9}, [SRC]!
+ fetch_src_pixblock
vld1.16 {d10, d11}, [DST_R, :128]!
cache_preload 8, 8
pixman_composite_over_0565_8_0565_process_pixblock_head
@@ -1903,7 +1903,7 @@ generate_composite_function \ .macro pixman_composite_add_0565_8_0565_process_pixblock_tail_head
vld1.8 {d15}, [MASK]!
pixman_composite_add_0565_8_0565_process_pixblock_tail
- vld1.16 {d8, d9}, [SRC]!
+ fetch_src_pixblock
vld1.16 {d10, d11}, [DST_R, :128]!
cache_preload 8, 8
pixman_composite_add_0565_8_0565_process_pixblock_head
@@ -1951,7 +1951,7 @@ generate_composite_function \ /* TODO: expand macros and do better instructions scheduling */
.macro pixman_composite_out_reverse_8_0565_process_pixblock_tail_head
- vld1.8 {d15}, [SRC]!
+ fetch_src_pixblock
pixman_composite_out_reverse_8_0565_process_pixblock_tail
vld1.16 {d10, d11}, [DST_R, :128]!
cache_preload 8, 8
@@ -1973,3 +1973,49 @@ generate_composite_function \ 10, /* dst_r_basereg */ \
15, /* src_basereg */ \
0 /* mask_basereg */
+
+/******************************************************************************/
+
+generate_composite_function_nearest_scanline \
+ pixman_scaled_nearest_scanline_8888_8888_OVER_asm_neon, 32, 0, 32, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_over_8888_8888_process_pixblock_head, \
+ pixman_composite_over_8888_8888_process_pixblock_tail, \
+ pixman_composite_over_8888_8888_process_pixblock_tail_head
+
+generate_composite_function_nearest_scanline \
+ pixman_scaled_nearest_scanline_8888_0565_OVER_asm_neon, 32, 0, 16, \
+ FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_over_8888_0565_process_pixblock_head, \
+ pixman_composite_over_8888_0565_process_pixblock_tail, \
+ pixman_composite_over_8888_0565_process_pixblock_tail_head, \
+ 28, /* dst_w_basereg */ \
+ 4, /* dst_r_basereg */ \
+ 0, /* src_basereg */ \
+ 24 /* mask_basereg */
+
+generate_composite_function_nearest_scanline \
+ pixman_scaled_nearest_scanline_8888_0565_SRC_asm_neon, 32, 0, 16, \
+ FLAG_DST_WRITEONLY | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_8888_0565_process_pixblock_head, \
+ pixman_composite_src_8888_0565_process_pixblock_tail, \
+ pixman_composite_src_8888_0565_process_pixblock_tail_head
+
+generate_composite_function_nearest_scanline \
+ pixman_scaled_nearest_scanline_0565_8888_SRC_asm_neon, 16, 0, 32, \
+ FLAG_DST_WRITEONLY | FLAG_DEINTERLEAVE_32BPP, \
+ 8, /* number of pixels, processed in a single block */ \
+ default_init, \
+ default_cleanup, \
+ pixman_composite_src_0565_8888_process_pixblock_head, \
+ pixman_composite_src_0565_8888_process_pixblock_tail, \
+ pixman_composite_src_0565_8888_process_pixblock_tail_head
diff --git a/pixman/pixman/pixman-arm-neon-asm.h b/pixman/pixman/pixman-arm-neon-asm.h index 84706d7fe..1d8a31c1e 100644 --- a/pixman/pixman/pixman-arm-neon-asm.h +++ b/pixman/pixman/pixman-arm-neon-asm.h @@ -205,6 +205,121 @@ .endif
.endm
+/*
+ * Pixel fetcher for nearest scaling (needs TMP1, TMP2, VX, UNIT_X register
+ * aliases to be defined)
+ */
+.macro pixld1_s elem_size, reg1, mem_operand
+.if elem_size == 16
+ mov TMP1, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP1, mem_operand, TMP1, asl #1
+ mov TMP2, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP2, mem_operand, TMP2, asl #1
+ vld1.16 {d®1&[0]}, [TMP1, :16]
+ mov TMP1, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP1, mem_operand, TMP1, asl #1
+ vld1.16 {d®1&[1]}, [TMP2, :16]
+ mov TMP2, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP2, mem_operand, TMP2, asl #1
+ vld1.16 {d®1&[2]}, [TMP1, :16]
+ vld1.16 {d®1&[3]}, [TMP2, :16]
+.elseif elem_size == 32
+ mov TMP1, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP1, mem_operand, TMP1, asl #2
+ mov TMP2, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP2, mem_operand, TMP2, asl #2
+ vld1.32 {d®1&[0]}, [TMP1, :32]
+ vld1.32 {d®1&[1]}, [TMP2, :32]
+.else
+ .error "unsupported"
+.endif
+.endm
+
+.macro pixld2_s elem_size, reg1, reg2, mem_operand
+.if elem_size == 32
+ mov TMP1, VX, asr #16
+ add VX, VX, UNIT_X, asl #1
+ add TMP1, mem_operand, TMP1, asl #2
+ mov TMP2, VX, asr #16
+ sub VX, VX, UNIT_X
+ add TMP2, mem_operand, TMP2, asl #2
+ vld1.32 {d®1&[0]}, [TMP1, :32]
+ mov TMP1, VX, asr #16
+ add VX, VX, UNIT_X, asl #1
+ add TMP1, mem_operand, TMP1, asl #2
+ vld1.32 {d®2&[0]}, [TMP2, :32]
+ mov TMP2, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP2, mem_operand, TMP2, asl #2
+ vld1.32 {d®1&[1]}, [TMP1, :32]
+ vld1.32 {d®2&[1]}, [TMP2, :32]
+.else
+ pixld1_s elem_size, reg1, mem_operand
+ pixld1_s elem_size, reg2, mem_operand
+.endif
+.endm
+
+.macro pixld0_s elem_size, reg1, idx, mem_operand
+.if elem_size == 16
+ mov TMP1, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP1, mem_operand, TMP1, asl #1
+ vld1.16 {d®1&[idx]}, [TMP1, :16]
+.elseif elem_size == 32
+ mov TMP1, VX, asr #16
+ add VX, VX, UNIT_X
+ add TMP1, mem_operand, TMP1, asl #2
+ vld1.32 {d®1&[idx]}, [TMP1, :32]
+.endif
+.endm
+
+.macro pixld_s_internal numbytes, elem_size, basereg, mem_operand
+.if numbytes == 32
+ pixld2_s elem_size, %(basereg+4), %(basereg+5), mem_operand
+ pixld2_s elem_size, %(basereg+6), %(basereg+7), mem_operand
+ pixdeinterleave elem_size, %(basereg+4)
+.elseif numbytes == 16
+ pixld2_s elem_size, %(basereg+2), %(basereg+3), mem_operand
+.elseif numbytes == 8
+ pixld1_s elem_size, %(basereg+1), mem_operand
+.elseif numbytes == 4
+ .if elem_size == 32
+ pixld0_s elem_size, %(basereg+0), 1, mem_operand
+ .elseif elem_size == 16
+ pixld0_s elem_size, %(basereg+0), 2, mem_operand
+ pixld0_s elem_size, %(basereg+0), 3, mem_operand
+ .else
+ pixld0_s elem_size, %(basereg+0), 4, mem_operand
+ pixld0_s elem_size, %(basereg+0), 5, mem_operand
+ pixld0_s elem_size, %(basereg+0), 6, mem_operand
+ pixld0_s elem_size, %(basereg+0), 7, mem_operand
+ .endif
+.elseif numbytes == 2
+ .if elem_size == 16
+ pixld0_s elem_size, %(basereg+0), 1, mem_operand
+ .else
+ pixld0_s elem_size, %(basereg+0), 2, mem_operand
+ pixld0_s elem_size, %(basereg+0), 3, mem_operand
+ .endif
+.elseif numbytes == 1
+ pixld0_s elem_size, %(basereg+0), 1, mem_operand
+.else
+ .error "unsupported size: numbytes"
+.endif
+.endm
+
+.macro pixld_s numpix, bpp, basereg, mem_operand
+.if bpp > 0
+ pixld_s_internal %(numpix * bpp / 8), %(bpp), basereg, mem_operand
+.endif
+.endm
+
.macro vuzp8 reg1, reg2
vuzp.8 d®1, d®2
.endm
@@ -335,7 +450,7 @@ local skip1 tst DST_R, #lowbit
beq 1f
.endif
- pixld (lowbit * 8 / dst_w_bpp), src_bpp, src_basereg, SRC
+ pixld_src (lowbit * 8 / dst_w_bpp), src_bpp, src_basereg, SRC
pixld (lowbit * 8 / dst_w_bpp), mask_bpp, mask_basereg, MASK
.if dst_r_bpp > 0
pixld_a (lowbit * 8 / dst_r_bpp), dst_r_bpp, dst_r_basereg, DST_R
@@ -397,7 +512,7 @@ local skip1 .if pixblock_size > chunk_size
tst W, #chunk_size
beq 1f
- pixld chunk_size, src_bpp, src_basereg, SRC
+ pixld_src chunk_size, src_bpp, src_basereg, SRC
pixld chunk_size, mask_bpp, mask_basereg, MASK
.if dst_aligned_flag != 0
pixld_a chunk_size, dst_r_bpp, dst_r_basereg, DST_R
@@ -531,6 +646,13 @@ fname: .set src_basereg, src_basereg_
.set mask_basereg, mask_basereg_
+ .macro pixld_src x:vararg
+ pixld x
+ .endm
+ .macro fetch_src_pixblock
+ pixld_src pixblock_size, src_bpp, \
+ (src_basereg - pixblock_size * src_bpp / 64), SRC
+ .endm
/*
* Assign symbolic names to registers
*/
@@ -696,8 +818,7 @@ fname: /* Implement "head (tail_head) ... (tail_head) tail" loop pattern */
pixld_a pixblock_size, dst_r_bpp, \
(dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R
- pixld pixblock_size, src_bpp, \
- (src_basereg - pixblock_size * src_bpp / 64), SRC
+ fetch_src_pixblock
pixld pixblock_size, mask_bpp, \
(mask_basereg - pixblock_size * mask_bpp / 64), MASK
PF add PF_X, PF_X, #pixblock_size
@@ -739,8 +860,7 @@ fname: beq 1f
pixld pixblock_size, dst_r_bpp, \
(dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R
- pixld pixblock_size, src_bpp, \
- (src_basereg - pixblock_size * src_bpp / 64), SRC
+ fetch_src_pixblock
pixld pixblock_size, mask_bpp, \
(mask_basereg - pixblock_size * mask_bpp / 64), MASK
process_pixblock_head
@@ -761,6 +881,9 @@ fname: cleanup
pop {r4-r12, pc} /* exit */
+ .purgem fetch_src_pixblock
+ .purgem pixld_src
+
.unreq SRC
.unreq MASK
.unreq DST_R
@@ -784,7 +907,8 @@ fname: * A simplified variant of function generation template for a single
* scanline processing (for implementing pixman combine functions)
*/
-.macro generate_composite_function_single_scanline fname, \
+.macro generate_composite_function_scanline use_nearest_scaling, \
+ fname, \
src_bpp_, \
mask_bpp_, \
dst_w_bpp_, \
@@ -821,15 +945,45 @@ fname: .set dst_r_basereg, dst_r_basereg_
.set src_basereg, src_basereg_
.set mask_basereg, mask_basereg_
-/*
- * Assign symbolic names to registers
- */
+
+.if use_nearest_scaling != 0
+ /*
+ * Assign symbolic names to registers for nearest scaling
+ */
+ W .req r0
+ DST_W .req r1
+ SRC .req r2
+ VX .req r3
+ UNIT_X .req ip
+ MASK .req lr
+ TMP1 .req r4
+ TMP2 .req r5
+ DST_R .req r6
+
+ .macro pixld_src x:vararg
+ pixld_s x
+ .endm
+
+ ldr UNIT_X, [sp]
+ push {r4-r6, lr}
+ .if mask_bpp != 0
+ ldr MASK, [sp, #(16 + 4)]
+ .endif
+.else
+ /*
+ * Assign symbolic names to registers
+ */
W .req r0 /* width (is updated during processing) */
DST_W .req r1 /* destination buffer pointer for writes */
SRC .req r2 /* source buffer pointer */
DST_R .req ip /* destination buffer pointer for reads */
MASK .req r3 /* mask pointer */
+ .macro pixld_src x:vararg
+ pixld x
+ .endm
+.endif
+
.if (((flags) & FLAG_DST_READWRITE) != 0)
.set dst_r_bpp, dst_w_bpp
.else
@@ -841,6 +995,11 @@ fname: .set DEINTERLEAVE_32BPP_ENABLED, 0
.endif
+ .macro fetch_src_pixblock
+ pixld_src pixblock_size, src_bpp, \
+ (src_basereg - pixblock_size * src_bpp / 64), SRC
+ .endm
+
init
mov DST_R, DST_W
@@ -857,8 +1016,7 @@ fname: /* Implement "head (tail_head) ... (tail_head) tail" loop pattern */
pixld_a pixblock_size, dst_r_bpp, \
(dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R
- pixld pixblock_size, src_bpp, \
- (src_basereg - pixblock_size * src_bpp / 64), SRC
+ fetch_src_pixblock
pixld pixblock_size, mask_bpp, \
(mask_basereg - pixblock_size * mask_bpp / 64), MASK
process_pixblock_head
@@ -880,7 +1038,11 @@ fname: process_pixblock_tail_head
cleanup
- bx lr /* exit */
+.if use_nearest_scaling != 0
+ pop {r4-r6, pc} /* exit */
+.else
+ bx lr /* exit */
+.endif
8:
/* Process the remaining trailing pixels in the scanline (dst unaligned) */
process_trailing_pixels 0, 0, \
@@ -889,6 +1051,21 @@ fname: process_pixblock_tail_head
cleanup
+
+.if use_nearest_scaling != 0
+ pop {r4-r6, pc} /* exit */
+
+ .unreq DST_R
+ .unreq SRC
+ .unreq W
+ .unreq VX
+ .unreq UNIT_X
+ .unreq TMP1
+ .unreq TMP2
+ .unreq DST_W
+ .unreq MASK
+
+.else
bx lr /* exit */
.unreq SRC
@@ -896,9 +1073,22 @@ fname: .unreq DST_R
.unreq DST_W
.unreq W
+.endif
+
+ .purgem fetch_src_pixblock
+ .purgem pixld_src
+
.endfunc
.endm
+.macro generate_composite_function_single_scanline x:vararg
+ generate_composite_function_scanline 0, x
+.endm
+
+.macro generate_composite_function_nearest_scanline x:vararg
+ generate_composite_function_scanline 1, x
+.endm
+
/* Default prologue/epilogue, nothing special needs to be done */
.macro default_init
diff --git a/pixman/pixman/pixman-arm-neon.c b/pixman/pixman/pixman-arm-neon.c index d22922a4a..858bb071e 100644 --- a/pixman/pixman/pixman-arm-neon.c +++ b/pixman/pixman/pixman-arm-neon.c @@ -97,6 +97,15 @@ PIXMAN_ARM_BIND_FAST_PATH_SRC_MASK_DST (neon, over_8888_8_0565, PIXMAN_ARM_BIND_FAST_PATH_SRC_MASK_DST (neon, over_0565_8_0565,
uint16_t, 1, uint8_t, 1, uint16_t, 1)
+PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST (neon, 8888_8888, OVER,
+ uint32_t, uint32_t)
+PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST (neon, 8888_0565, OVER,
+ uint32_t, uint16_t)
+PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST (neon, 8888_0565, SRC,
+ uint32_t, uint16_t)
+PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST (neon, 0565_8888, SRC,
+ uint16_t, uint32_t)
+
void
pixman_composite_src_n_8_asm_neon (int32_t w,
int32_t h,
@@ -271,6 +280,27 @@ static const pixman_fast_path_t arm_neon_fast_paths[] = PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, r5g6b5, neon_composite_out_reverse_8_0565),
PIXMAN_STD_FAST_PATH (OUT_REVERSE, a8, null, b5g6r5, neon_composite_out_reverse_8_0565),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, neon_8888_8888),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (OVER, a8b8g8r8, a8b8g8r8, neon_8888_8888),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (OVER, a8r8g8b8, x8r8g8b8, neon_8888_8888),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (OVER, a8b8g8r8, x8b8g8r8, neon_8888_8888),
+
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (OVER, a8r8g8b8, r5g6b5, neon_8888_0565),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (OVER, a8b8g8r8, b5g6r5, neon_8888_0565),
+
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, a8r8g8b8, r5g6b5, neon_8888_0565),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, x8r8g8b8, r5g6b5, neon_8888_0565),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, a8b8g8r8, b5g6r5, neon_8888_0565),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, x8b8g8r8, b5g6r5, neon_8888_0565),
+
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, b5g6r5, x8b8g8r8, neon_0565_8888),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, r5g6b5, x8r8g8b8, neon_0565_8888),
+ /* Note: NONE repeat is not supported yet */
+ SIMPLE_NEAREST_FAST_PATH_COVER (SRC, r5g6b5, a8r8g8b8, neon_0565_8888),
+ SIMPLE_NEAREST_FAST_PATH_COVER (SRC, b5g6r5, a8b8g8r8, neon_0565_8888),
+ SIMPLE_NEAREST_FAST_PATH_PAD (SRC, r5g6b5, a8r8g8b8, neon_0565_8888),
+ SIMPLE_NEAREST_FAST_PATH_PAD (SRC, b5g6r5, a8b8g8r8, neon_0565_8888),
+
{ PIXMAN_OP_NONE },
};
diff --git a/pixman/pixman/pixman-arm-simd-asm.S b/pixman/pixman/pixman-arm-simd-asm.S index 76647c6bc..d97545c1b 100644 --- a/pixman/pixman/pixman-arm-simd-asm.S +++ b/pixman/pixman/pixman-arm-simd-asm.S @@ -1,5 +1,6 @@ /*
* Copyright © 2008 Mozilla Corporation
+ * Copyright © 2010 Nokia Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -328,3 +329,72 @@ pixman_asm_function pixman_composite_over_n_8_8888_asm_armv6 pop {r4, r5, r6, r7, r8, r9, r10, r11}
bx lr
.endfunc
+
+/*
+ * Note: This function is only using armv4t instructions (not even armv6),
+ * but is scheduled for ARM Cortex-A8 pipeline. So it might need to
+ * be split into a few variants, tuned for each microarchitecture.
+ *
+ * TODO: In order to get good performance on ARM9/ARM11 cores (which don't
+ * have efficient write combining), it needs to be changed to use 16-byte
+ * aligned writes using STM instruction.
+ */
+pixman_asm_function pixman_scaled_nearest_scanline_0565_0565_SRC_asm_armv6
+ W .req r0
+ DST .req r1
+ SRC .req r2
+ VX .req r3
+ UNIT_X .req ip
+ TMP1 .req r4
+ TMP2 .req r5
+ VXMASK .req r6
+
+ ldr UNIT_X, [sp]
+ push {r4, r5, r6, r7}
+ mvn VXMASK, #1
+
+ /* define helper macro */
+ .macro scale_2_pixels
+ ldrh TMP1, [SRC, TMP1]
+ and TMP2, VXMASK, VX, lsr #15
+ add VX, VX, UNIT_X
+ strh TMP1, [DST], #2
+
+ ldrh TMP2, [SRC, TMP2]
+ and TMP1, VXMASK, VX, lsr #15
+ add VX, VX, UNIT_X
+ strh TMP2, [DST], #2
+ .endm
+
+ /* now do the scaling */
+ and TMP1, VXMASK, VX, lsr #15
+ add VX, VX, UNIT_X
+ subs W, #4
+ blt 2f
+1: /* main loop, process 4 pixels per iteration */
+ scale_2_pixels
+ scale_2_pixels
+ subs W, W, #4
+ bge 1b
+2:
+ tst W, #2
+ beq 2f
+ scale_2_pixels
+2:
+ tst W, #1
+ ldrneh TMP1, [SRC, TMP1]
+ strneh TMP1, [DST], #2
+ /* cleanup helper macro */
+ .purgem scale_2_pixels
+ .unreq DST
+ .unreq SRC
+ .unreq W
+ .unreq VX
+ .unreq UNIT_X
+ .unreq TMP1
+ .unreq TMP2
+ .unreq VXMASK
+ /* return */
+ pop {r4, r5, r6, r7}
+ bx lr
+.endfunc
diff --git a/pixman/pixman/pixman-arm-simd.c b/pixman/pixman/pixman-arm-simd.c index 76a7ffeab..7f789ceab 100644 --- a/pixman/pixman/pixman-arm-simd.c +++ b/pixman/pixman/pixman-arm-simd.c @@ -29,6 +29,7 @@ #include "pixman-private.h"
#include "pixman-arm-common.h"
+#include "pixman-fast-path.h"
#if 0 /* This code was moved to 'pixman-arm-simd-asm.S' */
@@ -386,6 +387,9 @@ PIXMAN_ARM_BIND_FAST_PATH_SRC_N_DST (armv6, over_8888_n_8888, PIXMAN_ARM_BIND_FAST_PATH_N_MASK_DST (armv6, over_n_8_8888,
uint8_t, 1, uint32_t, 1)
+PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST (armv6, 0565_0565, SRC,
+ uint16_t, uint16_t)
+
static const pixman_fast_path_t arm_simd_fast_paths[] =
{
PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, a8r8g8b8, armv6_composite_over_8888_8888),
@@ -404,6 +408,9 @@ static const pixman_fast_path_t arm_simd_fast_paths[] = PIXMAN_STD_FAST_PATH (OVER, solid, a8, a8b8g8r8, armv6_composite_over_n_8_8888),
PIXMAN_STD_FAST_PATH (OVER, solid, a8, x8b8g8r8, armv6_composite_over_n_8_8888),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, r5g6b5, r5g6b5, armv6_0565_0565),
+ PIXMAN_ARM_SIMPLE_NEAREST_FAST_PATH (SRC, b5g6r5, b5g6r5, armv6_0565_0565),
+
{ PIXMAN_OP_NONE },
};
diff --git a/pixman/pixman/pixman-conical-gradient.c b/pixman/pixman/pixman-conical-gradient.c index 648f3569d..769b984d1 100644 --- a/pixman/pixman/pixman-conical-gradient.c +++ b/pixman/pixman/pixman-conical-gradient.c @@ -58,8 +58,7 @@ conical_gradient_get_scanline_32 (pixman_image_t *image, uint32_t * buffer,
const uint32_t *mask)
{
- source_image_t *source = (source_image_t *)image;
- gradient_t *gradient = (gradient_t *)source;
+ gradient_t *gradient = (gradient_t *)image;
conical_gradient_t *conical = (conical_gradient_t *)image;
uint32_t *end = buffer + width;
pixman_gradient_walker_t walker;
@@ -71,9 +70,9 @@ conical_gradient_get_scanline_32 (pixman_image_t *image, double ry = y + 0.5;
double rz = 1.;
- _pixman_gradient_walker_init (&walker, gradient, source->common.repeat);
+ _pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
- if (source->common.transform)
+ if (image->common.transform)
{
pixman_vector_t v;
@@ -82,19 +81,19 @@ conical_gradient_get_scanline_32 (pixman_image_t *image, v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2;
v.vector[2] = pixman_fixed_1;
- if (!pixman_transform_point_3d (source->common.transform, &v))
+ if (!pixman_transform_point_3d (image->common.transform, &v))
return;
- cx = source->common.transform->matrix[0][0] / 65536.;
- cy = source->common.transform->matrix[1][0] / 65536.;
- cz = source->common.transform->matrix[2][0] / 65536.;
+ cx = image->common.transform->matrix[0][0] / 65536.;
+ cy = image->common.transform->matrix[1][0] / 65536.;
+ cz = image->common.transform->matrix[2][0] / 65536.;
rx = v.vector[0] / 65536.;
ry = v.vector[1] / 65536.;
rz = v.vector[2] / 65536.;
affine =
- source->common.transform->matrix[2][0] == 0 &&
+ image->common.transform->matrix[2][0] == 0 &&
v.vector[2] == pixman_fixed_1;
}
diff --git a/pixman/pixman/pixman-image.c b/pixman/pixman/pixman-image.c index ac7bccc5d..48faa3a10 100644 --- a/pixman/pixman/pixman-image.c +++ b/pixman/pixman/pixman-image.c @@ -47,8 +47,6 @@ _pixman_init_gradient (gradient_t * gradient, gradient->n_stops = n_stops;
- gradient->stop_range = 0xffff;
-
return TRUE;
}
@@ -238,54 +236,27 @@ _pixman_image_reset_clip_region (pixman_image_t *image) image->common.have_clip_region = FALSE;
}
-static pixman_bool_t out_of_bounds_workaround = TRUE;
-
-/* Old X servers rely on out-of-bounds accesses when they are asked
- * to composite with a window as the source. They create a pixman image
- * pointing to some bogus position in memory, but then they set a clip
- * region to the position where the actual bits are.
+/* Executive Summary: This function is a no-op that only exists
+ * for historical reasons.
+ *
+ * There used to be a bug in the X server where it would rely on
+ * out-of-bounds accesses when it was asked to composite with a
+ * window as the source. It would create a pixman image pointing
+ * to some bogus position in memory, but then set a clip region
+ * to the position where the actual bits were.
*
* Due to a bug in old versions of pixman, where it would not clip
* against the image bounds when a clip region was set, this would
- * actually work. So by default we allow certain out-of-bound access
- * to happen unless explicitly disabled.
+ * actually work. So when the pixman bug was fixed, a workaround was
+ * added to allow certain out-of-bound accesses. This function disabled
+ * those workarounds.
*
- * Fixed X servers should call this function to disable the workaround.
+ * Since 0.21.2, pixman doesn't do these workarounds anymore, so now
+ * this function is a no-op.
*/
PIXMAN_EXPORT void
pixman_disable_out_of_bounds_workaround (void)
{
- out_of_bounds_workaround = FALSE;
-}
-
-static pixman_bool_t
-source_image_needs_out_of_bounds_workaround (bits_image_t *image)
-{
- if (image->common.clip_sources &&
- image->common.repeat == PIXMAN_REPEAT_NONE &&
- image->common.have_clip_region &&
- out_of_bounds_workaround)
- {
- if (!image->common.client_clip)
- {
- /* There is no client clip, so if the clip region extends beyond the
- * drawable geometry, it must be because the X server generated the
- * bogus clip region.
- */
- const pixman_box32_t *extents =
- pixman_region32_extents (&image->common.clip_region);
-
- if (extents->x1 >= 0 && extents->x2 <= image->width &&
- extents->y1 >= 0 && extents->y2 <= image->height)
- {
- return FALSE;
- }
- }
-
- return TRUE;
- }
-
- return FALSE;
}
static void
@@ -420,9 +391,6 @@ compute_image_info (pixman_image_t *image) flags |= FAST_PATH_IS_OPAQUE;
}
- if (source_image_needs_out_of_bounds_workaround (&image->bits))
- flags |= FAST_PATH_NEEDS_WORKAROUND;
-
if (image->bits.read_func || image->bits.write_func)
flags &= ~FAST_PATH_NO_ACCESSORS;
@@ -430,10 +398,25 @@ compute_image_info (pixman_image_t *image) flags &= ~FAST_PATH_NARROW_FORMAT;
break;
- case LINEAR:
case RADIAL:
code = PIXMAN_unknown;
+ /*
+ * As explained in pixman-radial-gradient.c, every point of
+ * the plane has a valid associated radius (and thus will be
+ * colored) if and only if a is negative (i.e. one of the two
+ * circles contains the other one).
+ */
+
+ if (image->radial.a >= 0)
+ break;
+
+ /* Fall through */
+
+ case CONICAL:
+ case LINEAR:
+ code = PIXMAN_unknown;
+
if (image->common.repeat != PIXMAN_REPEAT_NONE)
{
int i;
diff --git a/pixman/pixman/pixman-linear-gradient.c b/pixman/pixman/pixman-linear-gradient.c index 9ccb688ff..1756b4a0e 100644 --- a/pixman/pixman/pixman-linear-gradient.c +++ b/pixman/pixman/pixman-linear-gradient.c @@ -38,7 +38,6 @@ linear_gradient_classify (pixman_image_t *image, int width,
int height)
{
- source_image_t *source = (source_image_t *)image;
linear_gradient_t *linear = (linear_gradient_t *)image;
pixman_vector_t v;
pixman_fixed_32_32_t l;
@@ -48,19 +47,19 @@ linear_gradient_classify (pixman_image_t *image, class = SOURCE_IMAGE_CLASS_UNKNOWN;
- if (source->common.transform)
+ if (image->common.transform)
{
/* projective transformation */
- if (source->common.transform->matrix[2][0] != 0 ||
- source->common.transform->matrix[2][1] != 0 ||
- source->common.transform->matrix[2][2] == 0)
+ if (image->common.transform->matrix[2][0] != 0 ||
+ image->common.transform->matrix[2][1] != 0 ||
+ image->common.transform->matrix[2][2] == 0)
{
return class;
}
- v.vector[0] = source->common.transform->matrix[0][1];
- v.vector[1] = source->common.transform->matrix[1][1];
- v.vector[2] = source->common.transform->matrix[2][2];
+ v.vector[0] = image->common.transform->matrix[0][1];
+ v.vector[1] = image->common.transform->matrix[1][1];
+ v.vector[2] = image->common.transform->matrix[2][2];
}
else
{
@@ -104,26 +103,25 @@ linear_gradient_get_scanline_32 (pixman_image_t *image, pixman_fixed_32_32_t l;
pixman_fixed_48_16_t dx, dy;
gradient_t *gradient = (gradient_t *)image;
- source_image_t *source = (source_image_t *)image;
linear_gradient_t *linear = (linear_gradient_t *)image;
uint32_t *end = buffer + width;
pixman_gradient_walker_t walker;
- _pixman_gradient_walker_init (&walker, gradient, source->common.repeat);
+ _pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
/* reference point is the center of the pixel */
v.vector[0] = pixman_int_to_fixed (x) + pixman_fixed_1 / 2;
v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2;
v.vector[2] = pixman_fixed_1;
- if (source->common.transform)
+ if (image->common.transform)
{
- if (!pixman_transform_point_3d (source->common.transform, &v))
+ if (!pixman_transform_point_3d (image->common.transform, &v))
return;
-
- unit.vector[0] = source->common.transform->matrix[0][0];
- unit.vector[1] = source->common.transform->matrix[1][0];
- unit.vector[2] = source->common.transform->matrix[2][0];
+
+ unit.vector[0] = image->common.transform->matrix[0][0];
+ unit.vector[1] = image->common.transform->matrix[1][0];
+ unit.vector[2] = image->common.transform->matrix[2][0];
}
else
{
diff --git a/pixman/pixman/pixman-mmx.c b/pixman/pixman/pixman-mmx.c index 0b98282cb..f4d90a6bc 100644 --- a/pixman/pixman/pixman-mmx.c +++ b/pixman/pixman/pixman-mmx.c @@ -1937,8 +1937,8 @@ pixman_fill_mmx (uint32_t *bits, "movq %7, %4\n"
"movq %7, %5\n"
"movq %7, %6\n"
- : "=y" (v1), "=y" (v2), "=y" (v3),
- "=y" (v4), "=y" (v5), "=y" (v6), "=y" (v7)
+ : "=&y" (v1), "=&y" (v2), "=&y" (v3),
+ "=&y" (v4), "=&y" (v5), "=&y" (v6), "=y" (v7)
: "y" (vfill));
#endif
diff --git a/pixman/pixman/pixman-private.h b/pixman/pixman/pixman-private.h index b0faf2c08..b6eb24835 100644 --- a/pixman/pixman/pixman-private.h +++ b/pixman/pixman/pixman-private.h @@ -20,7 +20,6 @@ * Images
*/
typedef struct image_common image_common_t;
-typedef struct source_image source_image_t;
typedef struct solid_fill solid_fill_t;
typedef struct gradient gradient_t;
typedef struct linear_gradient linear_gradient_t;
@@ -108,14 +107,9 @@ struct image_common pixman_format_code_t extended_format_code;
};
-struct source_image
-{
- image_common_t common;
-};
-
struct solid_fill
{
- source_image_t common;
+ image_common_t common;
pixman_color_t color;
uint32_t color_32;
@@ -124,10 +118,9 @@ struct solid_fill struct gradient
{
- source_image_t common;
+ image_common_t common;
int n_stops;
pixman_gradient_stop_t *stops;
- int stop_range;
};
struct linear_gradient
@@ -193,7 +186,6 @@ union pixman_image image_type_t type;
image_common_t common;
bits_image_t bits;
- source_image_t source;
gradient_t gradient;
linear_gradient_t linear;
conical_gradient_t conical;
@@ -561,14 +553,13 @@ _pixman_choose_implementation (void); #define FAST_PATH_NEAREST_FILTER (1 << 11)
#define FAST_PATH_HAS_TRANSFORM (1 << 12)
#define FAST_PATH_IS_OPAQUE (1 << 13)
-#define FAST_PATH_NEEDS_WORKAROUND (1 << 14)
+#define FAST_PATH_NO_NORMAL_REPEAT (1 << 14)
#define FAST_PATH_NO_NONE_REPEAT (1 << 15)
#define FAST_PATH_SAMPLES_COVER_CLIP (1 << 16)
#define FAST_PATH_X_UNIT_POSITIVE (1 << 17)
#define FAST_PATH_AFFINE_TRANSFORM (1 << 18)
#define FAST_PATH_Y_UNIT_ZERO (1 << 19)
#define FAST_PATH_BILINEAR_FILTER (1 << 20)
-#define FAST_PATH_NO_NORMAL_REPEAT (1 << 21)
#define FAST_PATH_PAD_REPEAT \
(FAST_PATH_NO_NONE_REPEAT | \
diff --git a/pixman/pixman/pixman-radial-gradient.c b/pixman/pixman/pixman-radial-gradient.c index 2d9e46a39..7dfc1d04e 100644 --- a/pixman/pixman/pixman-radial-gradient.c +++ b/pixman/pixman/pixman-radial-gradient.c @@ -219,7 +219,6 @@ radial_gradient_get_scanline_32 (pixman_image_t *image, */
gradient_t *gradient = (gradient_t *)image;
- source_image_t *source = (source_image_t *)image;
radial_gradient_t *radial = (radial_gradient_t *)image;
uint32_t *end = buffer + width;
pixman_gradient_walker_t walker;
@@ -230,16 +229,16 @@ radial_gradient_get_scanline_32 (pixman_image_t *image, v.vector[1] = pixman_int_to_fixed (y) + pixman_fixed_1 / 2;
v.vector[2] = pixman_fixed_1;
- _pixman_gradient_walker_init (&walker, gradient, source->common.repeat);
+ _pixman_gradient_walker_init (&walker, gradient, image->common.repeat);
- if (source->common.transform)
+ if (image->common.transform)
{
- if (!pixman_transform_point_3d (source->common.transform, &v))
+ if (!pixman_transform_point_3d (image->common.transform, &v))
return;
- unit.vector[0] = source->common.transform->matrix[0][0];
- unit.vector[1] = source->common.transform->matrix[1][0];
- unit.vector[2] = source->common.transform->matrix[2][0];
+ unit.vector[0] = image->common.transform->matrix[0][0];
+ unit.vector[1] = image->common.transform->matrix[1][0];
+ unit.vector[2] = image->common.transform->matrix[2][0];
}
else
{
@@ -309,7 +308,7 @@ radial_gradient_get_scanline_32 (pixman_image_t *image, radial->delta.radius,
radial->mindr,
&walker,
- source->common.repeat);
+ image->common.repeat);
}
b += db;
@@ -354,14 +353,14 @@ radial_gradient_get_scanline_32 (pixman_image_t *image, radial->delta.radius,
radial->mindr,
&walker,
- source->common.repeat);
+ image->common.repeat);
}
else
{
*buffer = 0;
}
}
-
+
++buffer;
v.vector[0] += unit.vector[0];
diff --git a/pixman/pixman/pixman.c b/pixman/pixman/pixman.c index 4857e30ce..d41e7bd26 100644 --- a/pixman/pixman/pixman.c +++ b/pixman/pixman/pixman.c @@ -30,14 +30,23 @@ #include <stdlib.h>
+static pixman_implementation_t *global_implementation;
+
+#ifdef TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR
+static void __attribute__((constructor))
+pixman_constructor (void)
+{
+ global_implementation = _pixman_choose_implementation ();
+}
+#endif
+
static force_inline pixman_implementation_t *
get_implementation (void)
{
- static pixman_implementation_t *global_implementation;
-
+#ifndef TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR
if (!global_implementation)
global_implementation = _pixman_choose_implementation ();
-
+#endif
return global_implementation;
}
@@ -153,57 +162,6 @@ optimize_operator (pixman_op_t op, return operator_table[op].opaque_info[is_dest_opaque | is_source_opaque];
}
-static void
-apply_workaround (pixman_image_t *image,
- int32_t * x,
- int32_t * y,
- uint32_t ** save_bits,
- int * save_dx,
- int * save_dy)
-{
- if (image && (image->common.flags & FAST_PATH_NEEDS_WORKAROUND))
- {
- /* Some X servers generate images that point to the
- * wrong place in memory, but then set the clip region
- * to point to the right place. Because of an old bug
- * in pixman, this would actually work.
- *
- * Here we try and undo the damage
- */
- int bpp = PIXMAN_FORMAT_BPP (image->bits.format) / 8;
- pixman_box32_t *extents;
- uint8_t *t;
- int dx, dy;
-
- extents = pixman_region32_extents (&(image->common.clip_region));
- dx = extents->x1;
- dy = extents->y1;
-
- *save_bits = image->bits.bits;
-
- *x -= dx;
- *y -= dy;
- pixman_region32_translate (&(image->common.clip_region), -dx, -dy);
-
- t = (uint8_t *)image->bits.bits;
- t += dy * image->bits.rowstride * 4 + dx * bpp;
- image->bits.bits = (uint32_t *)t;
-
- *save_dx = dx;
- *save_dy = dy;
- }
-}
-
-static void
-unapply_workaround (pixman_image_t *image, uint32_t *bits, int dx, int dy)
-{
- if (image && (image->common.flags & FAST_PATH_NEEDS_WORKAROUND))
- {
- image->bits.bits = bits;
- pixman_region32_translate (&image->common.clip_region, dx, dy);
- }
-}
-
/*
* Computing composite region
*/
@@ -732,13 +690,6 @@ pixman_image_composite32 (pixman_op_t op, uint32_t src_flags, mask_flags, dest_flags;
pixman_region32_t region;
pixman_box32_t *extents;
- uint32_t *src_bits;
- int src_dx, src_dy;
- uint32_t *mask_bits;
- int mask_dx, mask_dy;
- uint32_t *dest_bits;
- int dest_dx, dest_dy;
- pixman_bool_t need_workaround;
pixman_implementation_t *imp;
pixman_composite_func_t func;
@@ -776,16 +727,6 @@ pixman_image_composite32 (pixman_op_t op, src_format = mask_format = PIXMAN_rpixbuf;
}
- /* Check for workaround */
- need_workaround = (src_flags | mask_flags | dest_flags) & FAST_PATH_NEEDS_WORKAROUND;
-
- if (need_workaround)
- {
- apply_workaround (src, &src_x, &src_y, &src_bits, &src_dx, &src_dy);
- apply_workaround (mask, &mask_x, &mask_y, &mask_bits, &mask_dx, &mask_dy);
- apply_workaround (dest, &dest_x, &dest_y, &dest_bits, &dest_dx, &dest_dy);
- }
-
pixman_region32_init (®ion);
if (!pixman_compute_composite_region32 (
@@ -852,13 +793,6 @@ pixman_image_composite32 (pixman_op_t op, }
out:
- if (need_workaround)
- {
- unapply_workaround (src, src_bits, src_dx, src_dy);
- unapply_workaround (mask, mask_bits, mask_dx, mask_dy);
- unapply_workaround (dest, dest_bits, dest_dx, dest_dy);
- }
-
pixman_region32_fini (®ion);
}
diff --git a/pixman/pixman/pixman.h b/pixman/pixman/pixman.h index 08494c467..27eeeee4e 100644 --- a/pixman/pixman/pixman.h +++ b/pixman/pixman/pixman.h @@ -841,19 +841,25 @@ void pixman_image_composite32 (pixman_op_t op, int32_t width,
int32_t height);
-/* Old X servers rely on out-of-bounds accesses when they are asked
- * to composite with a window as the source. They create a pixman image
- * pointing to some bogus position in memory, but then they set a clip
- * region to the position where the actual bits are.
+/* Executive Summary: This function is a no-op that only exists
+ * for historical reasons.
+ *
+ * There used to be a bug in the X server where it would rely on
+ * out-of-bounds accesses when it was asked to composite with a
+ * window as the source. It would create a pixman image pointing
+ * to some bogus position in memory, but then set a clip region
+ * to the position where the actual bits were.
*
* Due to a bug in old versions of pixman, where it would not clip
* against the image bounds when a clip region was set, this would
- * actually work. So by default we allow certain out-of-bound access
- * to happen unless explicitly disabled.
+ * actually work. So when the pixman bug was fixed, a workaround was
+ * added to allow certain out-of-bound accesses. This function disabled
+ * those workarounds.
*
- * Fixed X servers should call this function to disable the workaround.
+ * Since 0.21.2, pixman doesn't do these workarounds anymore, so now this
+ * function is a no-op.
*/
-void pixman_disable_out_of_bounds_workaround (void);
+void pixman_disable_out_of_bounds_workaround (void);
/*
* Trapezoids
diff --git a/pixman/test/Makefile.am b/pixman/test/Makefile.am index 32b1d6327..98bf94ef0 100644 --- a/pixman/test/Makefile.am +++ b/pixman/test/Makefile.am @@ -10,7 +10,6 @@ TESTPROGRAMS = \ region-translate-test \
fetch-test \
oob-test \
- window-test \
gradient-crash-test \
trap-crasher \
alpha-loop \
@@ -26,7 +25,6 @@ fetch_test_LDADD = $(TEST_LDADD) gradient_crash_test_LDADD = $(TEST_LDADD)
trap_crasher_LDADD = $(TEST_LDADD)
oob_test_LDADD = $(TEST_LDADD)
-window_test_LDADD = $(TEST_LDADD)
scaling_crash_test_LDADD = $(TEST_LDADD)
region_translate_test_LDADD = $(TEST_LDADD)
diff --git a/pixman/test/window-test.c b/pixman/test/window-test.c deleted file mode 100644 index 919fc16ed..000000000 --- a/pixman/test/window-test.c +++ /dev/null @@ -1,173 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <config.h> -#include "pixman-private.h" -#include "pixman.h" - -#define FALSE 0 -#define TRUE 1 - -/* Randomly decide between 32 and 16 bit - * - * Allocate bits with random width, stride and height - * - * Then make up some random offset (dx, dy) - * - * Then make an image with those values. - * - * Do this for both source and destination - * - * Composite them together using OVER. - * - * The bits in the source and the destination should have - * recognizable colors so that the result can be verified. - * - * Ie., walk the bits and verify that they have been composited. - */ - -static int -get_rand (int bound) -{ - return rand () % bound; -} - -static pixman_image_t * -make_image (int width, int height, pixman_bool_t src, int *rx, int *ry) -{ - pixman_format_code_t format; - pixman_image_t *image; - pixman_region32_t region; - uint8_t *bits; - int stride; - int bpp; - int dx, dy; - int i, j; - - if (src) - format = PIXMAN_a8r8g8b8; - else - format = PIXMAN_r5g6b5; - - bpp = PIXMAN_FORMAT_BPP (format) / 8; - - stride = width + get_rand (width); - stride += (stride & 1); /* Make it an even number */ - - bits = malloc (height * stride * bpp); - - for (j = 0; j < height; ++j) - { - for (i = 0; i < width; ++i) - { - uint8_t *pixel = bits + (stride * j + i) * bpp; - - if (src) - *(uint32_t *)pixel = 0x7f00007f; - else - *(uint16_t *)pixel = 0xf100; - } - } - - dx = dy = 0; - - dx = get_rand (500); - dy = get_rand (500); - - if (!src) - { - /* Now simulate the bogus X server translations */ - bits -= (dy * stride + dx) * bpp; - } - - image = pixman_image_create_bits ( - format, width, height, (uint32_t *)bits, stride * bpp); - - if (!src) - { - /* And add the bogus clip region */ - pixman_region32_init_rect (®ion, dx, dy, dx + width, dy + height); - - pixman_image_set_clip_region32 (image, ®ion); - } - - pixman_image_set_source_clipping (image, TRUE); - - if (src) - { - pixman_transform_t trans; - - pixman_transform_init_identity (&trans); - - pixman_transform_translate (&trans, - NULL, - - pixman_int_to_fixed (width / 2), - - pixman_int_to_fixed (height / 2)); - - pixman_transform_scale (&trans, - NULL, - pixman_double_to_fixed (0.5), - pixman_double_to_fixed (0.5)); - - pixman_transform_translate (&trans, - NULL, - pixman_int_to_fixed (width / 2), - pixman_int_to_fixed (height / 2)); - - pixman_image_set_transform (image, &trans); - pixman_image_set_filter (image, PIXMAN_FILTER_BILINEAR, NULL, 0); - pixman_image_set_repeat (image, PIXMAN_REPEAT_PAD); - } - - if (!src) - { - *rx = dx; - *ry = dy; - } - else - { - *rx = *ry = 0; - } - - return image; -} - -int -main () -{ - pixman_image_t *src, *dest; - int src_x, src_y, dest_x, dest_y; - int i, j; - int width = get_rand (499) + 1; - int height = get_rand (499) + 1; - - src = make_image (width, height, TRUE, &src_x, &src_y); - dest = make_image (width, height, FALSE, &dest_x, &dest_y); - - pixman_image_composite ( - PIXMAN_OP_OVER, src, NULL, dest, - src_x, src_y, - -1, -1, - dest_x, dest_y, - width, height); - - for (i = 0; i < height; ++i) - { - for (j = 0; j < width; ++j) - { - uint8_t *bits = (uint8_t *)dest->bits.bits; - int bpp = PIXMAN_FORMAT_BPP (dest->bits.format) / 8; - int stride = dest->bits.rowstride * 4; - - uint8_t *pixel = - bits + (i + dest_y) * stride + (j + dest_x) * bpp; - - if (*(uint16_t *)pixel != 0x788f) - { - printf ("bad pixel %x\n", *(uint16_t *)pixel); - assert (*(uint16_t *)pixel == 0x788f); - } - } - } - - return 0; -} diff --git a/xorg-server/Xext/panoramiXprocs.c b/xorg-server/Xext/panoramiXprocs.c index 067fb6cf7..615246bab 100644 --- a/xorg-server/Xext/panoramiXprocs.c +++ b/xorg-server/Xext/panoramiXprocs.c @@ -634,7 +634,7 @@ int PanoramiXTranslateCoords(ClientPtr client) rep.dstX = x - pDst->drawable.x;
rep.dstY = y - pDst->drawable.y;
if((pDst == screenInfo.screens[0]->root) ||
- (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
+ (pDst->drawable.id == screenInfo.screens[0]->screensaver.wid))
{
rep.dstX += screenInfo.screens[0]->x;
rep.dstY += screenInfo.screens[0]->y;
diff --git a/xorg-server/Xext/xtest.c b/xorg-server/Xext/xtest.c index f1edfaca6..859057e2b 100644 --- a/xorg-server/Xext/xtest.c +++ b/xorg-server/Xext/xtest.c @@ -52,6 +52,7 @@ #include "mipointer.h"
#include "xserver-properties.h"
#include "exevents.h"
+#include "inpututils.h"
#include "modinit.h"
@@ -153,6 +154,7 @@ ProcXTestFakeInput(ClientPtr client) WindowPtr root;
Bool extension = FALSE;
deviceValuator *dv = NULL;
+ ValuatorMask mask;
int valuators[MAX_VALUATORS] = {0};
int numValuators = 0;
int firstValuator = 0;
@@ -413,14 +415,14 @@ ProcXTestFakeInput(ClientPtr client) switch(type) {
case MotionNotify:
- nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags,
- firstValuator, numValuators, valuators);
+ valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
+ nevents = GetPointerEvents(xtest_evlist, dev, type, 0, flags, &mask);
break;
case ButtonPress:
case ButtonRelease:
+ valuator_mask_set_range(&mask, firstValuator, numValuators, valuators);
nevents = GetPointerEvents(xtest_evlist, dev, type, ev->u.u.detail,
- flags, firstValuator,
- numValuators, valuators);
+ flags, &mask);
break;
case KeyPress:
case KeyRelease:
diff --git a/xorg-server/Xi/closedev.c b/xorg-server/Xi/closedev.c index fcd0ed832..60f5aebe5 100644 --- a/xorg-server/Xi/closedev.c +++ b/xorg-server/Xi/closedev.c @@ -162,6 +162,5 @@ ProcXCloseDevice(ClientPtr client) DeleteEventsFromChildren(d, p1, client);
}
- CloseInputDevice(d, client);
return Success;
}
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index 1fc62968c..3acf2b5e8 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -113,13 +113,6 @@ XIShouldNotify(ClientPtr client, DeviceIntPtr dev) return 0;
}
-void
-RegisterOtherDevice(DeviceIntPtr device)
-{
- device->public.processInputProc = ProcessOtherEvent;
- device->public.realInputProc = ProcessOtherEvent;
-}
-
Bool
IsPointerEvent(InternalEvent* event)
{
@@ -565,7 +558,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) v->axisVal = (double*)(v->axes + from->valuator->numAxes);
v->sourceid = from->id;
- v->mode = from->valuator->mode;
} else if (to->valuator && !from->valuator)
{
ClassesPtr classes;
@@ -900,9 +892,9 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) mask = PointerMotionMask | b->state | b->motionMask;
SetMaskForEvent(device->id, mask, MotionNotify);
} else if (event->type == ET_ProximityIn)
- device->valuator->mode &= ~OutOfProximity;
+ device->proximity->in_proximity = TRUE;
else if (event->type == ET_ProximityOut)
- device->valuator->mode |= OutOfProximity;
+ device->proximity->in_proximity = FALSE;
return DEFAULT;
}
@@ -1124,6 +1116,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) if (!proxc)
return FALSE;
proxc->sourceid = dev->id;
+ proxc->in_proximity = TRUE;
dev->proximity = proxc;
return TRUE;
}
@@ -1139,7 +1132,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) */
void
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval,
- int resolution, int min_res, int max_res)
+ int resolution, int min_res, int max_res, int mode)
{
AxisInfoPtr ax;
@@ -1156,6 +1149,10 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int ax->min_resolution = min_res;
ax->max_resolution = max_res;
ax->label = label;
+ ax->mode = mode;
+
+ if (mode & OutOfProximity)
+ dev->proximity->in_proximity = FALSE;
}
static void
@@ -1184,7 +1181,7 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, int nval = v->numAxes - first;
ev->classes_reported |= (1 << ValuatorClass);
- ev->classes_reported |= (dev->valuator->mode << ModeBitsShift);
+ ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift;
ev->num_valuators = nval < 3 ? nval : 3;
switch (ev->num_valuators) {
case 3:
diff --git a/xorg-server/Xi/extinit.c b/xorg-server/Xi/extinit.c index dd72ee2b0..a6408fbb3 100644 --- a/xorg-server/Xi/extinit.c +++ b/xorg-server/Xi/extinit.c @@ -1120,8 +1120,6 @@ RestoreExtensionEvents(void) static void
IResetProc(ExtensionEntry * unused)
{
- XIResetProperties();
-
ReplySwapVector[IReqCode] = ReplyNotSwappd;
EventSwapVector[DeviceValuator] = NotImplemented;
EventSwapVector[DeviceKeyPress] = NotImplemented;
@@ -1301,6 +1299,8 @@ XInputExtensionInit(void) inputInfo.all_devices = &xi_all_devices;
inputInfo.all_master_devices = &xi_all_master_devices;
+
+ XIResetProperties();
} else {
FatalError("IExtensionInit: AddExtensions failed\n");
}
diff --git a/xorg-server/Xi/listdev.c b/xorg-server/Xi/listdev.c index d84dcd8d9..da7529f1e 100644 --- a/xorg-server/Xi/listdev.c +++ b/xorg-server/Xi/listdev.c @@ -230,10 +230,11 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf) */
static int
-CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf)
+CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
{
int i, j, axes, t_axes;
char n;
+ ValuatorClassPtr v = dev->valuator;
xValuatorInfoPtr v2;
AxisInfo *a;
xAxisInfoPtr a2;
@@ -247,7 +248,7 @@ CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf) v2->class = ValuatorClass;
v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
v2->num_axes = t_axes;
- v2->mode = v->mode & DeviceMode;
+ v2->mode = valuator_get_mode(dev, 0);
v2->motion_buffer_size = v->numMotionEvents;
if (client && client->swapped) {
swapl(&v2->motion_buffer_size, n);
@@ -286,7 +287,7 @@ CopySwapClasses(ClientPtr client, DeviceIntPtr dev, CARD8 *num_classes, }
if (dev->valuator != NULL) {
(*num_classes) +=
- CopySwapValuatorClass(client, dev->valuator, classbuf);
+ CopySwapValuatorClass(client, dev, classbuf);
}
}
@@ -356,9 +357,6 @@ ProcXListInputDevices(ClientPtr client) rep.length = 0;
rep.sequenceNumber = client->sequence;
-
- AddOtherInputDevices();
-
/* allocate space for saving skip value */
skip = calloc(sizeof(Bool), inputInfo.numDevices);
if (!skip)
diff --git a/xorg-server/Xi/opendev.c b/xorg-server/Xi/opendev.c index 092b464ee..23a3a1b5b 100644 --- a/xorg-server/Xi/opendev.c +++ b/xorg-server/Xi/opendev.c @@ -115,10 +115,6 @@ ProcXOpenDevice(ClientPtr client) if (IsMaster(dev))
return BadDevice;
- OpenInputDevice(dev, client, &status);
- if (status != Success)
- return status;
-
memset(&rep, 0, sizeof(xOpenDeviceReply));
rep.repType = X_Reply;
rep.RepType = X_OpenDevice;
diff --git a/xorg-server/Xi/queryst.c b/xorg-server/Xi/queryst.c index 15d44592e..4810ed7f1 100644 --- a/xorg-server/Xi/queryst.c +++ b/xorg-server/Xi/queryst.c @@ -151,7 +151,8 @@ ProcXQueryDeviceState(ClientPtr client) tv->class = ValuatorClass;
tv->length = sizeof(xValuatorState) + v->numAxes * 4;
tv->num_valuators = v->numAxes;
- tv->mode = v->mode;
+ tv->mode = valuator_get_mode(dev, 0);
+ tv->mode |= (dev->proximity && !dev->proximity->in_proximity) ? OutOfProximity : 0;
buf += sizeof(xValuatorState);
for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
if (rc != BadAccess)
diff --git a/xorg-server/Xi/setmode.c b/xorg-server/Xi/setmode.c index ce2ad47c7..9f88eacf6 100644 --- a/xorg-server/Xi/setmode.c +++ b/xorg-server/Xi/setmode.c @@ -1,146 +1,146 @@ -/************************************************************ - -Copyright 1989, 1998 The Open Group - -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. - -The above copyright notice and this permission notice 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 -OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Hewlett-Packard not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -HEWLETT-PACKARD 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. - -********************************************************/ - -/*********************************************************************** - * - * Request to change the mode of an extension input device. - * - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include "inputstr.h" /* DeviceIntPtr */ -#include <X11/extensions/XI.h> -#include <X11/extensions/XIproto.h> -#include "XIstubs.h" -#include "exglobals.h" - -#include "setmode.h" - -/*********************************************************************** - * - * Handle a request from a client with a different byte order. - * - */ - -int -SProcXSetDeviceMode(ClientPtr client) -{ - char n; - - REQUEST(xSetDeviceModeReq); - swaps(&stuff->length, n); - return (ProcXSetDeviceMode(client)); -} - -/*********************************************************************** - * - * This procedure sets the mode of a device. - * - */ - -int -ProcXSetDeviceMode(ClientPtr client) -{ - DeviceIntPtr dev; - xSetDeviceModeReply rep; - int rc; - - REQUEST(xSetDeviceModeReq); - REQUEST_SIZE_MATCH(xSetDeviceModeReq); - - rep.repType = X_Reply; - rep.RepType = X_SetDeviceMode; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess); - if (rc != Success) - return rc; - if (dev->valuator == NULL) - return BadMatch; - if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client)) - rep.status = AlreadyGrabbed; - else - rep.status = SetDeviceMode(client, dev, stuff->mode); - - if (rep.status == Success) - dev->valuator->mode = stuff->mode; - else if (rep.status != AlreadyGrabbed) - { - switch(rep.status) { - case BadMatch: - case BadImplementation: - case BadAlloc: - break; - default: - rep.status = BadMode; - } - return rep.status; - } - - WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep); - return Success; -} - -/*********************************************************************** - * - * This procedure writes the reply for the XSetDeviceMode function, - * if the client and server have a different byte ordering. - * - */ - -void -SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep) -{ - char n; - - swaps(&rep->sequenceNumber, n); - swapl(&rep->length, n); - WriteToClient(client, size, (char *)rep); -} +/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+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.
+
+The above copyright notice and this permission notice 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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD 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.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Request to change the mode of an extension input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "exglobals.h"
+
+#include "setmode.h"
+
+/***********************************************************************
+ *
+ * Handle a request from a client with a different byte order.
+ *
+ */
+
+int
+SProcXSetDeviceMode(ClientPtr client)
+{
+ char n;
+
+ REQUEST(xSetDeviceModeReq);
+ swaps(&stuff->length, n);
+ return (ProcXSetDeviceMode(client));
+}
+
+/***********************************************************************
+ *
+ * This procedure sets the mode of a device.
+ *
+ */
+
+int
+ProcXSetDeviceMode(ClientPtr client)
+{
+ DeviceIntPtr dev;
+ xSetDeviceModeReply rep;
+ int rc;
+
+ REQUEST(xSetDeviceModeReq);
+ REQUEST_SIZE_MATCH(xSetDeviceModeReq);
+
+ rep.repType = X_Reply;
+ rep.RepType = X_SetDeviceMode;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ if (dev->valuator == NULL)
+ return BadMatch;
+ if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client))
+ rep.status = AlreadyGrabbed;
+ else
+ rep.status = SetDeviceMode(client, dev, stuff->mode);
+
+ if (rep.status == Success)
+ valuator_set_mode(dev, VALUATOR_MODE_ALL_AXES, stuff->mode);
+ else if (rep.status != AlreadyGrabbed)
+ {
+ switch(rep.status) {
+ case BadMatch:
+ case BadImplementation:
+ case BadAlloc:
+ break;
+ default:
+ rep.status = BadMode;
+ }
+ return rep.status;
+ }
+
+ WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XSetDeviceMode function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
+{
+ char n;
+
+ swaps(&rep->sequenceNumber, n);
+ swapl(&rep->length, n);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/stubs.c b/xorg-server/Xi/stubs.c index 4921b36f9..f69b34b2e 100644 --- a/xorg-server/Xi/stubs.c +++ b/xorg-server/Xi/stubs.c @@ -66,96 +66,6 @@ SOFTWARE. #include "XIstubs.h"
#include "xace.h"
-/***********************************************************************
- *
- * Caller: ProcXCloseDevice
- *
- * Take care of implementation-dependent details of closing a device.
- * Some implementations may actually close the device, others may just
- * remove this clients interest in that device.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- *
- */
-
-void
-CloseInputDevice(DeviceIntPtr d, ClientPtr client)
-{
-}
-
-/***********************************************************************
- *
- * Caller: ProcXListInputDevices
- *
- * This is the implementation-dependent routine to initialize an input
- * device to the point that information about it can be listed.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. If some other process has the device open, the
- * server may not be able to get information about the device to list it.
- *
- * This procedure should be used by implementations that do not initialize
- * all input devices at server startup. It should do device-dependent
- * initialization for any devices not previously initialized, and call
- * AddInputDevice for each of those devices so that a DeviceIntRec will be
- * created for them.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- * The commented-out sample code shows what you might do if you don't want
- * the default.
- *
- */
-
-void
-AddOtherInputDevices(void)
-{
- /**********************************************************************
- for each uninitialized device, do something like:
-
- DeviceIntPtr dev;
- DeviceProc deviceProc;
- pointer private;
-
- dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
- dev->public.devicePrivate = private;
- RegisterOtherDevice(dev);
- dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
- ************************************************************************/
-
-}
-
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- */
-
-void
-OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
-{
- *status = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixUseAccess);
-}
-
/****************************************************************************
*
* Caller: ProcXSetDeviceMode
diff --git a/xorg-server/Xi/xichangehierarchy.c b/xorg-server/Xi/xichangehierarchy.c index 5deb52eac..6b0288c88 100644 --- a/xorg-server/Xi/xichangehierarchy.c +++ b/xorg-server/Xi/xichangehierarchy.c @@ -136,12 +136,286 @@ int SProcXIChangeHierarchy(ClientPtr client) return (ProcXIChangeHierarchy(client));
}
+static int
+add_master(ClientPtr client, xXIAddMasterInfo *c, int flags[MAXDEVICES])
+{
+ DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
+ char* name;
+ int rc;
+
+ name = calloc(c->name_len + 1, sizeof(char));
+ strncpy(name, (char*)&c[1], c->name_len);
+
+ rc = AllocDevicePair(client, name, &ptr, &keybd,
+ CorePointerProc, CoreKeyboardProc, TRUE);
+ if (rc != Success)
+ goto unwind;
+
+ if (!c->send_core)
+ ptr->coreEvents = keybd->coreEvents = FALSE;
+
+ /* Allocate virtual slave devices for xtest events */
+ rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd, ptr, keybd);
+ if (rc != Success)
+ {
+ DeleteInputDeviceRequest(ptr);
+ DeleteInputDeviceRequest(keybd);
+ goto unwind;
+ }
+
+ ActivateDevice(ptr, FALSE);
+ ActivateDevice(keybd, FALSE);
+ flags[ptr->id] |= XIMasterAdded;
+ flags[keybd->id] |= XIMasterAdded;
+
+ ActivateDevice(XTestptr, FALSE);
+ ActivateDevice(XTestkeybd, FALSE);
+ flags[XTestptr->id] |= XISlaveAdded;
+ flags[XTestkeybd->id] |= XISlaveAdded;
+
+ if (c->enable)
+ {
+ EnableDevice(ptr, FALSE);
+ EnableDevice(keybd, FALSE);
+ flags[ptr->id] |= XIDeviceEnabled;
+ flags[keybd->id] |= XIDeviceEnabled;
+
+ EnableDevice(XTestptr, FALSE);
+ EnableDevice(XTestkeybd, FALSE);
+ flags[XTestptr->id] |= XIDeviceEnabled;
+ flags[XTestkeybd->id] |= XIDeviceEnabled;
+ }
+
+ /* Attach the XTest virtual devices to the newly
+ created master device */
+ AttachDevice(NULL, XTestptr, ptr);
+ AttachDevice(NULL, XTestkeybd, keybd);
+ flags[XTestptr->id] |= XISlaveAttached;
+ flags[XTestkeybd->id] |= XISlaveAttached;
+
+unwind:
+ free(name);
+ return rc;
+}
+
+static int
+remove_master(ClientPtr client, xXIRemoveMasterInfo *r,
+ int flags[MAXDEVICES])
+{
+ DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
+ int rc = Success;
+
+ if (r->return_mode != XIAttachToMaster &&
+ r->return_mode != XIFloating)
+ return BadValue;
+
+ rc = dixLookupDevice(&ptr, r->deviceid, client, DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (!IsMaster(ptr))
+ {
+ client->errorValue = r->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ /* XXX: For now, don't allow removal of VCP, VCK */
+ if (ptr == inputInfo.pointer || ptr == inputInfo.keyboard)
+ {
+ rc = BadDevice;
+ goto unwind;
+ }
+
+
+ ptr = GetMaster(ptr, MASTER_POINTER);
+ rc = dixLookupDevice(&ptr, ptr->id, client, DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+ keybd = GetMaster(ptr, MASTER_KEYBOARD);
+ rc = dixLookupDevice(&keybd, keybd->id, client, DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+
+ XTestptr = GetXTestDevice(ptr);
+ rc = dixLookupDevice(&XTestptr, XTestptr->id, client, DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+
+ XTestkeybd = GetXTestDevice(keybd);
+ rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client,
+ DixDestroyAccess);
+ if (rc != Success)
+ goto unwind;
+
+ /* Disabling sends the devices floating, reattach them if
+ * desired. */
+ if (r->return_mode == XIAttachToMaster)
+ {
+ DeviceIntPtr attached,
+ newptr,
+ newkeybd;
+
+ rc = dixLookupDevice(&newptr, r->return_pointer, client, DixAddAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (!IsMaster(newptr))
+ {
+ client->errorValue = r->return_pointer;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ rc = dixLookupDevice(&newkeybd, r->return_keyboard,
+ client, DixAddAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (!IsMaster(newkeybd))
+ {
+ client->errorValue = r->return_keyboard;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ for (attached = inputInfo.devices; attached; attached = attached->next)
+ {
+ if (!IsMaster(attached)) {
+ if (attached->u.master == ptr)
+ {
+ AttachDevice(client, attached, newptr);
+ flags[attached->id] |= XISlaveAttached;
+ }
+ if (attached->u.master == keybd)
+ {
+ AttachDevice(client, attached, newkeybd);
+ flags[attached->id] |= XISlaveAttached;
+ }
+ }
+ }
+ }
+
+ /* can't disable until we removed pairing */
+ keybd->spriteInfo->paired = NULL;
+ ptr->spriteInfo->paired = NULL;
+ XTestptr->spriteInfo->paired = NULL;
+ XTestkeybd->spriteInfo->paired = NULL;
+
+ /* disable the remove the devices, XTest devices must be done first
+ else the sprites they rely on will be destroyed */
+ DisableDevice(XTestptr, FALSE);
+ DisableDevice(XTestkeybd, FALSE);
+ DisableDevice(keybd, FALSE);
+ DisableDevice(ptr, FALSE);
+ flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached;
+ flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached;
+ flags[keybd->id] |= XIDeviceDisabled;
+ flags[ptr->id] |= XIDeviceDisabled;
+
+ RemoveDevice(XTestptr, FALSE);
+ RemoveDevice(XTestkeybd, FALSE);
+ RemoveDevice(keybd, FALSE);
+ RemoveDevice(ptr, FALSE);
+ flags[XTestptr->id] |= XISlaveRemoved;
+ flags[XTestkeybd->id] |= XISlaveRemoved;
+ flags[keybd->id] |= XIMasterRemoved;
+ flags[ptr->id] |= XIMasterRemoved;
+
+unwind:
+ return rc;
+}
+
+static int
+detach_slave(ClientPtr client, xXIDetachSlaveInfo *c, int flags[MAXDEVICES])
+{
+ DeviceIntPtr dev;
+ int rc;
+
+ rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (IsMaster(dev))
+ {
+ client->errorValue = c->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ /* Don't allow changes to XTest Devices, these are fixed */
+ if (IsXTestDevice(dev, NULL))
+ {
+ client->errorValue = c->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ AttachDevice(client, dev, NULL);
+ flags[dev->id] |= XISlaveDetached;
+
+unwind:
+ return rc;
+}
+
+static int
+attach_slave(ClientPtr client, xXIAttachSlaveInfo *c,
+ int flags[MAXDEVICES])
+{
+ DeviceIntPtr dev;
+ DeviceIntPtr newmaster;
+ int rc;
+
+ rc = dixLookupDevice(&dev, c->deviceid, client, DixManageAccess);
+ if (rc != Success)
+ goto unwind;
+
+ if (IsMaster(dev))
+ {
+ client->errorValue = c->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ /* Don't allow changes to XTest Devices, these are fixed */
+ if (IsXTestDevice(dev, NULL))
+ {
+ client->errorValue = c->deviceid;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ rc = dixLookupDevice(&newmaster, c->new_master, client, DixAddAccess);
+ if (rc != Success)
+ goto unwind;
+ if (!IsMaster(newmaster))
+ {
+ client->errorValue = c->new_master;
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ if (!((IsPointerDevice(newmaster) && IsPointerDevice(dev)) ||
+ (IsKeyboardDevice(newmaster) && IsKeyboardDevice(dev))))
+ {
+ rc = BadDevice;
+ goto unwind;
+ }
+
+ AttachDevice(client, dev, newmaster);
+ flags[dev->id] |= XISlaveAttached;
+
+unwind:
+ return rc;
+}
+
+
+
#define SWAPIF(cmd) if (client->swapped) { cmd; }
int
ProcXIChangeHierarchy(ClientPtr client)
{
- DeviceIntPtr ptr, keybd, XTestptr, XTestkeybd;
xXIAnyHierarchyChangeInfo *any;
int required_len = sizeof(xXIChangeHierarchyReq);
char n;
@@ -169,276 +443,38 @@ ProcXIChangeHierarchy(ClientPtr client) case XIAddMaster:
{
xXIAddMasterInfo* c = (xXIAddMasterInfo*)any;
- char* name;
-
SWAPIF(swaps(&c->name_len, n));
- name = calloc(c->name_len + 1, sizeof(char));
- strncpy(name, (char*)&c[1], c->name_len);
-
-
- rc = AllocDevicePair(client, name, &ptr, &keybd,
- CorePointerProc, CoreKeyboardProc,
- TRUE);
- if (rc != Success)
- {
- free(name);
- goto unwind;
- }
-
- if (!c->send_core)
- ptr->coreEvents = keybd->coreEvents = FALSE;
- /* Allocate virtual slave devices for xtest events */
- rc = AllocXTestDevice(client, name, &XTestptr, &XTestkeybd,
- ptr, keybd);
+ rc = add_master(client, c, flags);
if (rc != Success)
- {
-
- free(name);
goto unwind;
- }
-
- ActivateDevice(ptr, FALSE);
- ActivateDevice(keybd, FALSE);
- flags[ptr->id] |= XIMasterAdded;
- flags[keybd->id] |= XIMasterAdded;
-
- ActivateDevice(XTestptr, FALSE);
- ActivateDevice(XTestkeybd, FALSE);
- flags[XTestptr->id] |= XISlaveAdded;
- flags[XTestkeybd->id] |= XISlaveAdded;
-
- if (c->enable)
- {
- EnableDevice(ptr, FALSE);
- EnableDevice(keybd, FALSE);
- flags[ptr->id] |= XIDeviceEnabled;
- flags[keybd->id] |= XIDeviceEnabled;
-
- EnableDevice(XTestptr, FALSE);
- EnableDevice(XTestkeybd, FALSE);
- flags[XTestptr->id] |= XIDeviceEnabled;
- flags[XTestkeybd->id] |= XIDeviceEnabled;
- }
-
- /* Attach the XTest virtual devices to the newly
- created master device */
- AttachDevice(NULL, XTestptr, ptr);
- AttachDevice(NULL, XTestkeybd, keybd);
- flags[XTestptr->id] |= XISlaveAttached;
- flags[XTestkeybd->id] |= XISlaveAttached;
-
- free(name);
}
break;
case XIRemoveMaster:
{
xXIRemoveMasterInfo* r = (xXIRemoveMasterInfo*)any;
- if (r->return_mode != XIAttachToMaster &&
- r->return_mode != XIFloating)
- return BadValue;
-
- rc = dixLookupDevice(&ptr, r->deviceid, client,
- DixDestroyAccess);
+ rc = remove_master(client, r, flags);
if (rc != Success)
goto unwind;
-
- if (!IsMaster(ptr))
- {
- client->errorValue = r->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- /* XXX: For now, don't allow removal of VCP, VCK */
- if (ptr == inputInfo.pointer ||
- ptr == inputInfo.keyboard)
- {
- rc = BadDevice;
- goto unwind;
- }
-
-
- ptr = GetMaster(ptr, MASTER_POINTER);
- rc = dixLookupDevice(&ptr,
- ptr->id,
- client,
- DixDestroyAccess);
- if (rc != Success)
- goto unwind;
- keybd = GetMaster(ptr, MASTER_KEYBOARD);
- rc = dixLookupDevice(&keybd,
- keybd->id,
- client,
- DixDestroyAccess);
- if (rc != Success)
- goto unwind;
-
- XTestptr = GetXTestDevice(ptr);
- rc = dixLookupDevice(&XTestptr, XTestptr->id, client,
- DixDestroyAccess);
- if (rc != Success)
- goto unwind;
-
- XTestkeybd = GetXTestDevice(keybd);
- rc = dixLookupDevice(&XTestkeybd, XTestkeybd->id, client,
- DixDestroyAccess);
- if (rc != Success)
- goto unwind;
-
- /* Disabling sends the devices floating, reattach them if
- * desired. */
- if (r->return_mode == XIAttachToMaster)
- {
- DeviceIntPtr attached,
- newptr,
- newkeybd;
-
- rc = dixLookupDevice(&newptr, r->return_pointer,
- client, DixAddAccess);
- if (rc != Success)
- goto unwind;
-
- if (!IsMaster(newptr))
- {
- client->errorValue = r->return_pointer;
- rc = BadDevice;
- goto unwind;
- }
-
- rc = dixLookupDevice(&newkeybd, r->return_keyboard,
- client, DixAddAccess);
- if (rc != Success)
- goto unwind;
-
- if (!IsMaster(newkeybd))
- {
- client->errorValue = r->return_keyboard;
- rc = BadDevice;
- goto unwind;
- }
-
- for (attached = inputInfo.devices;
- attached;
- attached = attached->next)
- {
- if (!IsMaster(attached)) {
- if (attached->u.master == ptr)
- {
- AttachDevice(client, attached, newptr);
- flags[attached->id] |= XISlaveAttached;
- }
- if (attached->u.master == keybd)
- {
- AttachDevice(client, attached, newkeybd);
- flags[attached->id] |= XISlaveAttached;
- }
- }
- }
- }
-
- /* can't disable until we removed pairing */
- keybd->spriteInfo->paired = NULL;
- ptr->spriteInfo->paired = NULL;
- XTestptr->spriteInfo->paired = NULL;
- XTestkeybd->spriteInfo->paired = NULL;
-
- /* disable the remove the devices, XTest devices must be done first
- else the sprites they rely on will be destroyed */
- DisableDevice(XTestptr, FALSE);
- DisableDevice(XTestkeybd, FALSE);
- DisableDevice(keybd, FALSE);
- DisableDevice(ptr, FALSE);
- flags[XTestptr->id] |= XIDeviceDisabled | XISlaveDetached;
- flags[XTestkeybd->id] |= XIDeviceDisabled | XISlaveDetached;
- flags[keybd->id] |= XIDeviceDisabled;
- flags[ptr->id] |= XIDeviceDisabled;
-
- RemoveDevice(XTestptr, FALSE);
- RemoveDevice(XTestkeybd, FALSE);
- RemoveDevice(keybd, FALSE);
- RemoveDevice(ptr, FALSE);
- flags[XTestptr->id] |= XISlaveRemoved;
- flags[XTestkeybd->id] |= XISlaveRemoved;
- flags[keybd->id] |= XIMasterRemoved;
- flags[ptr->id] |= XIMasterRemoved;
}
break;
case XIDetachSlave:
{
xXIDetachSlaveInfo* c = (xXIDetachSlaveInfo*)any;
- rc = dixLookupDevice(&ptr, c->deviceid, client,
- DixManageAccess);
+ rc = detach_slave(client, c, flags);
if (rc != Success)
goto unwind;
-
- if (IsMaster(ptr))
- {
- client->errorValue = c->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- /* Don't allow changes to XTest Devices, these are fixed */
- if (IsXTestDevice(ptr, NULL))
- {
- client->errorValue = c->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- AttachDevice(client, ptr, NULL);
- flags[ptr->id] |= XISlaveDetached;
}
break;
case XIAttachSlave:
{
xXIAttachSlaveInfo* c = (xXIAttachSlaveInfo*)any;
- DeviceIntPtr newmaster;
- rc = dixLookupDevice(&ptr, c->deviceid, client,
- DixManageAccess);
+ rc = attach_slave(client, c, flags);
if (rc != Success)
goto unwind;
-
- if (IsMaster(ptr))
- {
- client->errorValue = c->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- /* Don't allow changes to XTest Devices, these are fixed */
- if (IsXTestDevice(ptr, NULL))
- {
- client->errorValue = c->deviceid;
- rc = BadDevice;
- goto unwind;
- }
-
- rc = dixLookupDevice(&newmaster, c->new_master,
- client, DixAddAccess);
- if (rc != Success)
- goto unwind;
- if (!IsMaster(newmaster))
- {
- client->errorValue = c->new_master;
- rc = BadDevice;
- goto unwind;
- }
-
- if (!((IsPointerDevice(newmaster) &&
- IsPointerDevice(ptr)) ||
- (IsKeyboardDevice(newmaster) &&
- IsKeyboardDevice(ptr))))
- {
- rc = BadDevice;
- goto unwind;
- }
- AttachDevice(client, ptr, newmaster);
- flags[ptr->id] |= XISlaveAttached;
}
break;
}
diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c index c24f8a894..4e1cae406 100644 --- a/xorg-server/Xi/xiquerydevice.c +++ b/xorg-server/Xi/xiquerydevice.c @@ -349,7 +349,7 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber, info->value.frac = (int)(v->axisVal[axisnumber] * (1 << 16) * (1 << 16));
info->resolution = v->axes[axisnumber].resolution;
info->number = axisnumber;
- info->mode = v->mode; /* Server doesn't have per-axis mode yet */
+ info->mode = valuator_get_mode(dev, axisnumber);
info->sourceid = v->sourceid;
if (!reportState)
diff --git a/xorg-server/composite/compalloc.c b/xorg-server/composite/compalloc.c index d5fe30315..d7d28ea98 100644 --- a/xorg-server/composite/compalloc.c +++ b/xorg-server/composite/compalloc.c @@ -238,7 +238,7 @@ compFreeClientWindow (WindowPtr pWin, XID id) DamageRegister (&pWin->drawable, cw->damage);
cw->damageRegistered = TRUE;
pWin->redirectDraw = RedirectDrawAutomatic;
- DamageRegionAppend(&pWin->drawable, &pWin->borderSize);
+ DamageDamageRegion(&pWin->drawable, &pWin->borderSize);
}
if (wasMapped && !pWin->mapped)
{
diff --git a/xorg-server/composite/compwindow.c b/xorg-server/composite/compwindow.c index e897c13f9..b0afc3f9a 100644 --- a/xorg-server/composite/compwindow.c +++ b/xorg-server/composite/compwindow.c @@ -519,7 +519,7 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) RegionTranslate(prgnSrc,
pWin->drawable.x - ptOldOrg.x,
pWin->drawable.y - ptOldOrg.y);
- DamageRegionAppend(&pWin->drawable, prgnSrc);
+ DamageDamageRegion(&pWin->drawable, prgnSrc);
}
cs->CopyWindow = pScreen->CopyWindow;
pScreen->CopyWindow = compCopyWindow;
@@ -598,7 +598,7 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion) /*
* Report that as damaged so it will be redrawn
*/
- DamageRegionAppend(&pWin->drawable, &damage);
+ DamageDamageRegion(&pWin->drawable, &damage);
RegionUninit(&damage);
/*
* Save the new border clip region
diff --git a/xorg-server/config/hal.c b/xorg-server/config/hal.c index 5ce7d7d48..dab35ddf7 100644 --- a/xorg-server/config/hal.c +++ b/xorg-server/config/hal.c @@ -376,6 +376,7 @@ device_added(LibHalContext *hal_ctx, const char *udi) add_option(&options, "xkb_model", xkb_opts.model);
if (xkb_opts.options)
add_option(&options, "xkb_options", xkb_opts.options);
+ add_option(&options, "config_info", config_info);
/* this isn't an error, but how else do you output something that the user can see? */
LogMessage(X_INFO, "config/hal: Adding input device %s\n", name);
@@ -385,11 +386,6 @@ device_added(LibHalContext *hal_ctx, const char *udi) goto unwind;
}
- for (; dev; dev = dev->next){
- free(dev->config_info);
- dev->config_info = strdup(config_info);
- }
-
unwind:
if (set)
libhal_free_property_set(set);
diff --git a/xorg-server/config/udev.c b/xorg-server/config/udev.c index 32f414137..88222bb01 100644 --- a/xorg-server/config/udev.c +++ b/xorg-server/config/udev.c @@ -181,17 +181,14 @@ device_added(struct udev_device *udev_device) }
}
+ add_option(&options, "config_info", config_info);
+
LogMessage(X_INFO, "config/udev: Adding input device %s (%s)\n",
name, path);
rc = NewInputDeviceRequest(options, &attrs, &dev);
if (rc != Success)
goto unwind;
- for (; dev; dev = dev->next) {
- free(dev->config_info);
- dev->config_info = strdup(config_info);
- }
-
unwind:
free(config_info);
while (!dev && (tmpo = options)) {
diff --git a/xorg-server/config/x11-input.fdi b/xorg-server/config/x11-input.fdi index 9e629cbd0..42489821d 100644 --- a/xorg-server/config/x11-input.fdi +++ b/xorg-server/config/x11-input.fdi @@ -1,98 +1,93 @@ -<?xml version="1.0" encoding="UTF-8"?> -<deviceinfo version="0.2"> - <device> - - <!-- The way this works: - - Match against some input device (see the HAL specification for more - information), and then merge in keys, which you can use to specify - the configuration similar to the way you would in xorg.conf. You will - need to restart HAL after making changes. If you are having issues, - starting X with the -logverbose 7 flag may yield useful information. - - Keys Supported: - - Key "input.x11_driver" (string) - This specifies the driver to use. You MUST specify this option, - or a driver will not be loaded and the rest will be ignored by - Xorg - - Key "input.x11_options.<option name>" (string) - This allows you to specify arbitrary options to pass to the driver. - Anything you would normally specify in xorg.conf goes here. So, for - option "Mode" in xorg.conf, you would specify the key name of - "input.x11_options.Mode". - - Do not specify "input.x11_options.Device" since "input.device" - will be used automatically. - - You MUST specify all options as strings, otherwise the server will - ignore them. - - Legacy Keys - "input.xkb.rules" - "input.xkb.model" - "input.xkb.layout" - "input.xkb.variant" - "input.xkb.options" - - These keys are deprecated. Use these instead: - "input.x11_options.XkbRules" - "input.x11_options.XkbModel" - "input.x11_options.XkbLayout" - "input.x11_options.XkbVariant" - "input.x11_options.XkbOptions" - - See the evdev documentation for more information. - - You will probably want to add the following option to the ServerFlags of - your xorg.conf: - - Option "AllowEmptyInput" "True" - - FIXME: Support tablets too. - TODO: I think its fixed, can't test - - --> - - <match key="info.capabilities" contains="input.mouse"> - <merge key="input.x11_driver" type="string">mouse</merge> - <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" - string="Linux"> - <merge key="input.x11_driver" type="string">evdev</merge> - </match> - <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" - string="SunOS"> - <match key="input.device" contains="usb"> - <merge key="input.x11_options.StreamsModule" type="string">usbms</merge> - <merge key="input.x11_options.Protocol" type="string">VUID</merge> - </match> - </match> - </match> - - <match key="info.capabilities" contains="input.keys"> - <merge key="input.x11_options.XkbRules" type="string">base</merge> - - <!-- If we're using Linux, we use evdev by default (falling back to - kbd otherwise). --> - <merge key="input.x11_driver" type="string">kbd</merge> - <merge key="input.x11_options.XkbModel" type="string">pc105</merge> - <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" - string="Linux"> - <merge key="input.x11_driver" type="string">evdev</merge> - <merge key="input.x11_options.XkbModel" type="string">evdev</merge> - </match> - <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" - string="SunOS"> - <match key="input.device" contains="usb"> - <merge key="input.x11_options.StreamsModule" type="string">usbkbm</merge> - <merge key="input.x11_options.Protocol" type="string">VUID</merge> - </match> - </match> - - <merge key="input.x11_options.XkbLayout" type="string">us</merge> - - <merge key="input.x11_options.XkbVariant" type="string" /> - </match> - </device> -</deviceinfo> +<?xml version="1.0" encoding="UTF-8"?>
+<deviceinfo version="0.2">
+ <device>
+
+ <!-- The way this works:
+
+ Match against some input device (see the HAL specification for more
+ information), and then merge in keys, which you can use to specify
+ the configuration similar to the way you would in xorg.conf. You will
+ need to restart HAL after making changes. If you are having issues,
+ starting X with the -logverbose 7 flag may yield useful information.
+
+ Keys Supported:
+
+ Key "input.x11_driver" (string)
+ This specifies the driver to use. You MUST specify this option,
+ or a driver will not be loaded and the rest will be ignored by
+ Xorg
+
+ Key "input.x11_options.<option name>" (string)
+ This allows you to specify arbitrary options to pass to the driver.
+ Anything you would normally specify in xorg.conf goes here. So, for
+ option "Mode" in xorg.conf, you would specify the key name of
+ "input.x11_options.Mode".
+
+ Do not specify "input.x11_options.Device" since "input.device"
+ will be used automatically.
+
+ You MUST specify all options as strings, otherwise the server will
+ ignore them.
+
+ Legacy Keys
+ "input.xkb.rules"
+ "input.xkb.model"
+ "input.xkb.layout"
+ "input.xkb.variant"
+ "input.xkb.options"
+
+ These keys are deprecated. Use these instead:
+ "input.x11_options.XkbRules"
+ "input.x11_options.XkbModel"
+ "input.x11_options.XkbLayout"
+ "input.x11_options.XkbVariant"
+ "input.x11_options.XkbOptions"
+
+ See the evdev documentation for more information.
+
+ FIXME: Support tablets too.
+ TODO: I think its fixed, can't test
+
+ -->
+
+ <match key="info.capabilities" contains="input.mouse">
+ <merge key="input.x11_driver" type="string">mouse</merge>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+ string="Linux">
+ <merge key="input.x11_driver" type="string">evdev</merge>
+ </match>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+ string="SunOS">
+ <match key="input.device" contains="usb">
+ <merge key="input.x11_options.StreamsModule" type="string">usbms</merge>
+ <merge key="input.x11_options.Protocol" type="string">VUID</merge>
+ </match>
+ </match>
+ </match>
+
+ <match key="info.capabilities" contains="input.keys">
+ <merge key="input.x11_options.XkbRules" type="string">base</merge>
+
+ <!-- If we're using Linux, we use evdev by default (falling back to
+ kbd otherwise). -->
+ <merge key="input.x11_driver" type="string">kbd</merge>
+ <merge key="input.x11_options.XkbModel" type="string">pc105</merge>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+ string="Linux">
+ <merge key="input.x11_driver" type="string">evdev</merge>
+ <merge key="input.x11_options.XkbModel" type="string">evdev</merge>
+ </match>
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
+ string="SunOS">
+ <match key="input.device" contains="usb">
+ <merge key="input.x11_options.StreamsModule" type="string">usbkbm</merge>
+ <merge key="input.x11_options.Protocol" type="string">VUID</merge>
+ </match>
+ </match>
+
+ <merge key="input.x11_options.XkbLayout" type="string">us</merge>
+
+ <merge key="input.x11_options.XkbVariant" type="string" />
+ </match>
+ </device>
+</deviceinfo>
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index b53b3aaa8..8ab086211 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -714,6 +714,7 @@ fi dnl Handle building documentation
AM_CONDITIONAL(BUILDDOCS, test "x$BUILDDOCS" = xyes)
+XORG_ENABLE_DOCS
XORG_ENABLE_DEVEL_DOCS
XORG_WITH_XMLTO(0.0.20)
XORG_WITH_FOP
diff --git a/xorg-server/damageext/damageext.c b/xorg-server/damageext/damageext.c index fb60e7f72..2b1514872 100644 --- a/xorg-server/damageext/damageext.c +++ b/xorg-server/damageext/damageext.c @@ -217,12 +217,13 @@ ProcDamageCreate (ClientPtr client) if (!AddResource (stuff->damage, DamageExtType, (pointer) pDamageExt))
return BadAlloc;
+ DamageSetReportAfterOp (pDamageExt->pDamage, TRUE);
DamageRegister (pDamageExt->pDrawable, pDamageExt->pDamage);
if (pDrawable->type == DRAWABLE_WINDOW)
{
pRegion = &((WindowPtr) pDrawable)->borderClip;
- DamageRegionAppend(pDrawable, pRegion);
+ DamageDamageRegion(pDrawable, pRegion);
}
return Success;
@@ -292,7 +293,7 @@ ProcDamageAdd (ClientPtr client) * screen coordinates like damage expects.
*/
RegionTranslate(pRegion, pDrawable->x, pDrawable->y);
- DamageRegionAppend(pDrawable, pRegion);
+ DamageDamageRegion(pDrawable, pRegion);
RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y);
return Success;
diff --git a/xorg-server/dix/Makefile.am b/xorg-server/dix/Makefile.am index 8e6f7dd6a..5ff75c0ba 100644 --- a/xorg-server/dix/Makefile.am +++ b/xorg-server/dix/Makefile.am @@ -1,5 +1,6 @@ noinst_LTLIBRARIES = libdix.la libmain.la
+AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CFLAGS = $(DIX_CFLAGS)
libmain_la_SOURCES = \
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c index 338819e8d..6ef24feb1 100644 --- a/xorg-server/dix/devices.c +++ b/xorg-server/dix/devices.c @@ -265,8 +265,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) if (!dev)
return (DeviceIntPtr)NULL;
dev->id = devid;
- dev->public.processInputProc = (ProcessInputProc)NoopDDA;
- dev->public.realInputProc = (ProcessInputProc)NoopDDA;
+ dev->public.processInputProc = ProcessOtherEvent;
+ dev->public.realInputProc = ProcessOtherEvent;
dev->public.enqueueInputProc = EnqueueEvent;
dev->deviceProc = deviceProc;
dev->startup = autoStart;
@@ -276,6 +276,8 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
+ XkbSetExtension(dev, ProcessKeyboardEvent);
+
dev->coreEvents = TRUE;
/* sprite defaults */
@@ -1114,18 +1116,6 @@ NumMotionEvents(void) return inputInfo.pointer->valuator->numMotionEvents;
}
-void
-RegisterPointerDevice(DeviceIntPtr device)
-{
- RegisterOtherDevice(device);
-}
-
-void
-RegisterKeyboardDevice(DeviceIntPtr device)
-{
- RegisterOtherDevice(device);
-}
-
int
dixLookupDevice(DeviceIntPtr *pDev, int id, ClientPtr client, Mask access_mode)
{
@@ -1269,16 +1259,19 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, valc->numMotionEvents = numMotionEvents;
valc->motionHintWindow = NullWindow;
valc->numAxes = numAxes;
- valc->mode = mode;
valc->axes = (AxisInfoPtr)(valc + 1);
valc->axisVal = (double *)(valc->axes + numAxes);
+
+ if (mode & OutOfProximity)
+ InitProximityClassDeviceStruct(dev);
+
dev->valuator = valc;
AllocateMotionHistory(dev);
for (i=0; i<numAxes; i++) {
InitValuatorAxisStruct(dev, i, labels[i], NO_AXIS_LIMITS, NO_AXIS_LIMITS,
- 0, 0, 0);
+ 0, 0, 0, mode);
valc->axisVal[i]=0;
}
@@ -2375,8 +2368,7 @@ RecalculateMasterButtons(DeviceIntPtr slave) event.valuators[i].min = master->valuator->axes[i].min_value;
event.valuators[i].max = master->valuator->axes[i].max_value;
event.valuators[i].resolution = master->valuator->axes[i].resolution;
- /* This should, eventually, be a per-axis mode */
- event.valuators[i].mode = master->valuator->mode;
+ event.valuators[i].mode = master->valuator->axes[i].mode;
event.valuators[i].name = master->valuator->axes[i].label;
}
}
@@ -2589,3 +2581,25 @@ AllocDevicePair (ClientPtr client, char* name, return Success;
}
+/**
+ * Return Relative or Absolute for the device.
+ */
+int valuator_get_mode(DeviceIntPtr dev, int axis)
+{
+ return (dev->valuator->axes[axis].mode & DeviceMode);
+}
+
+/**
+ * Set the given mode for the axis. If axis is VALUATOR_MODE_ALL_AXES, then
+ * set the mode for all axes.
+ */
+void valuator_set_mode(DeviceIntPtr dev, int axis, int mode)
+{
+ if (axis != VALUATOR_MODE_ALL_AXES)
+ dev->valuator->axes[axis].mode = mode;
+ else {
+ int i;
+ for (i = 0; i < dev->valuator->numAxes; i++)
+ dev->valuator->axes[i].mode = mode;
+ }
+}
diff --git a/xorg-server/dix/eventconvert.c b/xorg-server/dix/eventconvert.c index e891f0698..e45878a90 100644 --- a/xorg-server/dix/eventconvert.c +++ b/xorg-server/dix/eventconvert.c @@ -261,6 +261,12 @@ eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count) }
num_events = (countValuators(ev, &first) + 5)/6; /* valuator ev */
+ if (num_events <= 0)
+ {
+ *count = 0;
+ return BadMatch;
+ }
+
num_events++; /* the actual event event */
*xi = calloc(num_events, sizeof(xEvent));
@@ -318,6 +324,12 @@ countValuators(DeviceEvent *ev, int *first) for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++)
{
+ /* Assume mode of 0th valuator matches XI1 device mode. Stop when the
+ * event mode changes since XI1 can't handle mixed mode devices.
+ */
+ if (ev->valuators.mode[i] != ev->valuators.mode[0])
+ break;
+
if (BitIsOn(ev->valuators.mask, i))
{
if (first_valuator == -1)
@@ -440,7 +452,7 @@ appendValuatorInfo(DeviceChangedEvent *dce, xXIValuatorInfo *info, int axisnumbe info->value.frac = 0;
info->resolution = dce->valuators[axisnumber].resolution;
info->number = axisnumber;
- info->mode = dce->valuators[axisnumber].mode; /* Server doesn't have per-axis mode yet */
+ info->mode = dce->valuators[axisnumber].mode;
info->sourceid = dce->sourceid;
return info->length * 4;
diff --git a/xorg-server/dix/getevents.c b/xorg-server/dix/getevents.c index c13ff9808..3dceeb7ae 100644 --- a/xorg-server/dix/getevents.c +++ b/xorg-server/dix/getevents.c @@ -46,6 +46,7 @@ #include "mipointer.h"
#include "eventstr.h"
#include "eventconvert.h"
+#include "inpututils.h"
#include <X11/extensions/XKBproto.h>
#include "xkbsrv.h"
@@ -199,34 +200,38 @@ init_raw(DeviceIntPtr dev, RawDeviceEvent *event, Time ms, int type, int detail) }
static void
-set_raw_valuators(RawDeviceEvent *event, int first, int num, int *valuators, int32_t* data)
+set_raw_valuators(RawDeviceEvent *event, ValuatorMask *mask, int32_t* data)
{
int i;
- for (i = first; i < first + num; i++)
- SetBit(event->valuators.mask, i);
- memcpy(&data[first], valuators, num * sizeof(uint32_t));
+ for (i = 0; i < valuator_mask_size(mask); i++)
+ {
+ if (valuator_mask_isset(mask, i))
+ {
+ SetBit(event->valuators.mask, i);
+ data[i] = valuator_mask_get(mask, i);
+ }
+ }
}
static void
-set_valuators(DeviceIntPtr dev, DeviceEvent* event, int first_valuator,
- int num_valuators, int *valuators)
+set_valuators(DeviceIntPtr dev, DeviceEvent* event, ValuatorMask *mask)
{
int i;
- for (i = first_valuator; i < first_valuator + num_valuators; i++)
+ for (i = 0; i < valuator_mask_size(mask); i++)
{
- SetBit(event->valuators.mask, i);
- if (dev->valuator->mode == Absolute)
- SetBit(event->valuators.mode, i);
- event->valuators.data_frac[i] =
- dev->last.remainder[i] * (1 << 16) * (1 << 16);
+ if (valuator_mask_isset(mask, i))
+ {
+ SetBit(event->valuators.mask, i);
+ if (dev->valuator->axes[i].mode == Absolute)
+ SetBit(event->valuators.mode, i);
+ event->valuators.data[i] = valuator_mask_get(mask, i);
+ event->valuators.data_frac[i] =
+ dev->last.remainder[i] * (1 << 16) * (1 << 16);
+ }
}
-
- memcpy(&event->valuators.data[first_valuator],
- valuators, num_valuators * sizeof(int32_t));
-
}
void
@@ -265,8 +270,7 @@ CreateClassesChangedEvent(EventList* event, dce->valuators[i].min = slave->valuator->axes[i].min_value;
dce->valuators[i].max = slave->valuator->axes[i].max_value;
dce->valuators[i].resolution = slave->valuator->axes[i].resolution;
- /* This should, eventually, be a per-axis mode */
- dce->valuators[i].mode = slave->valuator->mode;
+ dce->valuators[i].mode = slave->valuator->axes[i].mode;
dce->valuators[i].name = slave->valuator->axes[i].label;
}
}
@@ -384,8 +388,15 @@ AllocateMotionHistory(DeviceIntPtr pDev) */
if (IsMaster(pDev))
size = sizeof(INT32) * 3 * MAX_VALUATORS;
- else
- size = sizeof(INT32) * pDev->valuator->numAxes;
+ else {
+ ValuatorClassPtr v = pDev->valuator;
+ int numAxes;
+ /* XI1 doesn't understand mixed mode devices */
+ for (numAxes = 0; numAxes < v->numAxes; numAxes++)
+ if (valuator_get_mode(pDev, numAxes) != valuator_get_mode(pDev, 0))
+ break;
+ size = sizeof(INT32) * numAxes;
+ }
size += sizeof(Time);
@@ -539,12 +550,12 @@ GetMotionHistory(DeviceIntPtr pDev, xTimecoord **buff, unsigned long start, * for SDs: [time] [val0] [val1] ... [valn]
* for MDs: [time] [min_val0] [max_val0] [val0] [min_val1] ... [valn]
*
- * For events that have some valuators unset (first_valuator > 0):
+ * For events that have some valuators unset:
* min_val == max_val == val == 0.
*/
static void
-updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
- int num_valuators, int *valuators)
+updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, ValuatorMask *mask,
+ int *valuators)
{
char *buff = (char *) pDev->valuator->motion;
ValuatorClassPtr v;
@@ -563,17 +574,22 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, buff += sizeof(Time);
memset(buff, 0, sizeof(INT32) * 3 * MAX_VALUATORS);
- buff += 3 * sizeof(INT32) * first_valuator;
- for (i = first_valuator; i < first_valuator + num_valuators; i++)
+ for (i = 0; i < v->numAxes; i++)
{
- if (i >= v->numAxes)
+ /* XI1 doesn't support mixed mode devices */
+ if (valuator_get_mode(pDev, i) != valuator_get_mode(pDev, 0))
break;
+ if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i))
+ {
+ buff += 3 * sizeof(INT32);
+ continue;
+ }
memcpy(buff, &v->axes[i].min_value, sizeof(INT32));
buff += sizeof(INT32);
memcpy(buff, &v->axes[i].max_value, sizeof(INT32));
buff += sizeof(INT32);
- memcpy(buff, &valuators[i - first_valuator], sizeof(INT32));
+ memcpy(buff, &valuators[i], sizeof(INT32));
buff += sizeof(INT32);
}
} else
@@ -586,9 +602,17 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator, buff += sizeof(Time);
memset(buff, 0, sizeof(INT32) * pDev->valuator->numAxes);
- buff += sizeof(INT32) * first_valuator;
- memcpy(buff, valuators, sizeof(INT32) * num_valuators);
+ for (i = 0; i < MAX_VALUATORS; i++)
+ {
+ if (valuator_mask_size(mask) <= i || !valuator_mask_isset(mask, i))
+ {
+ buff += sizeof(INT32);
+ continue;
+ }
+ memcpy(buff, &valuators[i], sizeof(INT32));
+ buff += sizeof(INT32);
+ }
}
pDev->valuator->last_motion = (pDev->valuator->last_motion + 1) %
@@ -646,13 +670,17 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val) * Clip every axis in the list of valuators to its bounds.
*/
static void
-clipValuators(DeviceIntPtr pDev, int first_valuator, int num_valuators,
- int *valuators)
+clipValuators(DeviceIntPtr pDev, ValuatorMask *mask)
{
int i;
- for (i = 0; i < num_valuators; i++)
- clipAxis(pDev, i + first_valuator, &(valuators[i]));
+ for (i = 0; i < valuator_mask_size(mask); i++)
+ if (valuator_mask_isset(mask, i))
+ {
+ int val = valuator_mask_get(mask, i);
+ clipAxis(pDev, i, &val);
+ valuator_mask_set(mask, i, val);
+ }
}
/**
@@ -695,36 +723,35 @@ UpdateFromMaster(EventListPtr events, DeviceIntPtr dev, int type, int *num_event * @param dev The device which's pointer is to be moved.
* @param x Returns the x position of the pointer after the move.
* @param y Returns the y position of the pointer after the move.
- * @param first The first valuator in @valuators
- * @param num Total number of valuators in @valuators.
+ * @param mask Bit mask of valid valuators.
* @param valuators Valuator data for each axis between @first and
* @first+@num.
*/
static void
-moveAbsolute(DeviceIntPtr dev, int *x, int *y,
- int first, int num, int *valuators)
+moveAbsolute(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
{
int i;
-
- if (num >= 1 && first == 0)
- *x = *(valuators + 0);
+ if (valuator_mask_isset(mask, 0))
+ *x = valuator_mask_get(mask, 0);
else
*x = dev->last.valuators[0];
- if (first <= 1 && num >= (2 - first))
- *y = *(valuators + 1 - first);
+ if (valuator_mask_isset(mask, 1))
+ *y = valuator_mask_get(mask, 1);
else
*y = dev->last.valuators[1];
clipAxis(dev, 0, x);
clipAxis(dev, 1, y);
- i = (first > 2) ? 0 : 2;
- for (; i < num; i++)
+ for (i = 2; i < valuator_mask_size(mask); i++)
{
- dev->last.valuators[i + first] = valuators[i];
- clipAxis(dev, i, &dev->last.valuators[i + first]);
+ if (valuator_mask_isset(mask, i))
+ {
+ dev->last.valuators[i] = valuator_mask_get(mask, i);
+ clipAxis(dev, i, &dev->last.valuators[i]);
+ }
}
}
@@ -734,42 +761,44 @@ moveAbsolute(DeviceIntPtr dev, int *x, int *y, * @param dev The device which's pointer is to be moved.
* @param x Returns the x position of the pointer after the move.
* @param y Returns the y position of the pointer after the move.
- * @param first The first valuator in @valuators
- * @param num Total number of valuators in @valuators.
+ * @param mask Bit mask of valid valuators.
* @param valuators Valuator data for each axis between @first and
* @first+@num.
*/
static void
-moveRelative(DeviceIntPtr dev, int *x, int *y,
- int first, int num, int *valuators)
+moveRelative(DeviceIntPtr dev, int *x, int *y, ValuatorMask *mask)
{
int i;
*x = dev->last.valuators[0];
*y = dev->last.valuators[1];
- if (num >= 1 && first == 0)
- *x += *(valuators +0);
+ if (valuator_mask_isset(mask, 0))
+ *x += valuator_mask_get(mask, 0);
- if (first <= 1 && num >= (2 - first))
- *y += *(valuators + 1 - first);
+ if (valuator_mask_isset(mask, 1))
+ *y += valuator_mask_get(mask, 1);
/* if attached, clip both x and y to the defined limits (usually
* co-ord space limit). If it is attached, we need x/y to go over the
* limits to be able to change screens. */
- if(dev->u.master && dev->valuator->mode == Absolute) {
- clipAxis(dev, 0, x);
- clipAxis(dev, 1, y);
+ if(dev->u.master) {
+ if (valuator_get_mode(dev, 0) == Absolute)
+ clipAxis(dev, 0, x);
+ if (valuator_get_mode(dev, 1) == Absolute)
+ clipAxis(dev, 1, y);
}
/* calc other axes, clip, drop back into valuators */
- i = (first > 2) ? 0 : 2;
- for (; i < num; i++)
+ for (i = 2; i < valuator_mask_size(mask); i++)
{
- dev->last.valuators[i + first] += valuators[i];
- if (dev->valuator->mode == Absolute)
- clipAxis(dev, i, &dev->last.valuators[i + first]);
- valuators[i] = dev->last.valuators[i + first];
+ if (valuator_mask_isset(mask, i))
+ {
+ dev->last.valuators[i] += valuator_mask_get(mask, i);
+ if (valuator_get_mode(dev, i) == Absolute)
+ clipAxis(dev, i, &dev->last.valuators[i]);
+ valuator_mask_set(mask, i, dev->last.valuators[i]);
+ }
}
}
@@ -883,18 +912,18 @@ positionSprite(DeviceIntPtr dev, int *x, int *y, float x_frac, float y_frac, * Update the motion history for the device and (if appropriate) for its
* master device.
* @param dev Slave device to update.
- * @param first First valuator to append to history.
+ * @param mask Bit mask of valid valuators to append to history.
* @param num Total number of valuators to append to history.
* @param ms Current time
*/
static void
-updateHistory(DeviceIntPtr dev, int first, int num, CARD32 ms)
+updateHistory(DeviceIntPtr dev, ValuatorMask *mask, CARD32 ms)
{
- updateMotionHistory(dev, ms, first, num, &dev->last.valuators[first]);
+ updateMotionHistory(dev, ms, mask, dev->last.valuators);
if (dev->u.master)
{
DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
- updateMotionHistory(master, ms, first, num, &dev->last.valuators[first]);
+ updateMotionHistory(master, ms, mask, dev->last.valuators);
}
}
@@ -904,7 +933,10 @@ updateHistory(DeviceIntPtr dev, int first, int num, CARD32 ms) */
int
GetKeyboardEvents(EventList *events, DeviceIntPtr pDev, int type, int key_code) {
- return GetKeyboardValuatorEvents(events, pDev, type, key_code, 0, 0, NULL);
+ ValuatorMask mask;
+
+ valuator_mask_zero(&mask);
+ return GetKeyboardValuatorEvents(events, pDev, type, key_code, &mask);
}
@@ -918,20 +950,18 @@ GetKeyboardEvents(EventList *events, DeviceIntPtr pDev, int type, int key_code) */
int
GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type,
- int key_code, int first_valuator,
- int num_valuators, int *valuators_in) {
+ int key_code, const ValuatorMask *mask_in) {
int num_events = 0;
CARD32 ms = 0;
DeviceEvent *event;
RawDeviceEvent *raw;
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
/* refuse events from disabled devices */
if (!pDev || !pDev->enabled)
return 0;
if (!events ||!pDev->key || !pDev->focus || !pDev->kbdfeed ||
- num_valuators > MAX_VALUATORS ||
(type != KeyPress && type != KeyRelease) ||
(key_code < 8 || key_code > 255))
return 0;
@@ -956,17 +986,14 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, events++;
num_events++;
- memcpy(valuators, valuators_in, num_valuators * sizeof(int));
+ valuator_mask_copy(&mask, mask_in);
init_raw(pDev, raw, ms, type, key_code);
- set_raw_valuators(raw, first_valuator, num_valuators, valuators,
- raw->valuators.data_raw);
+ set_raw_valuators(raw, &mask, raw->valuators.data_raw);
- if (num_valuators)
- clipValuators(pDev, first_valuator, num_valuators, valuators);
+ clipValuators(pDev, &mask);
- set_raw_valuators(raw, first_valuator, num_valuators, valuators,
- raw->valuators.data);
+ set_raw_valuators(raw, &mask, raw->valuators.data);
event = (DeviceEvent*) events->event;
init_event(pDev, event, ms);
@@ -981,10 +1008,9 @@ GetKeyboardValuatorEvents(EventList *events, DeviceIntPtr pDev, int type, set_key_up(pDev, key_code, KEY_POSTED);
}
- if (num_valuators)
- clipValuators(pDev, first_valuator, num_valuators, valuators);
+ clipValuators(pDev, &mask);
- set_valuators(pDev, event, first_valuator, num_valuators, valuators);
+ set_valuators(pDev, event, &mask);
return num_events;
}
@@ -1041,19 +1067,19 @@ FreeEventList(EventListPtr list, int num_events) }
static void
-transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS])
+transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
{
struct pixman_f_vector p;
/* p' = M * p in homogeneous coordinates */
- p.v[0] = v[0];
- p.v[1] = v[1];
+ p.v[0] = valuator_mask_get(mask, 0);
+ p.v[1] = valuator_mask_get(mask, 1);
p.v[2] = 1.0;
pixman_f_transform_point(&dev->transform, &p);
- v[0] = lround(p.v[0]);
- v[1] = lround(p.v[1]);
+ valuator_mask_set(mask, 0, lround(p.v[0]));
+ valuator_mask_set(mask, 1, lround(p.v[1]));
}
/**
@@ -1074,8 +1100,7 @@ transformAbsolute(DeviceIntPtr dev, int v[MAX_VALUATORS]) */
int
GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
- int flags, int first_valuator, int num_valuators,
- int *valuators_in) {
+ int flags, const ValuatorMask *mask_in) {
int num_events = 1;
CARD32 ms;
DeviceEvent *event;
@@ -1084,7 +1109,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, cx, cy; /* only screen coordinates */
float x_frac = 0.0, y_frac = 0.0, cx_frac, cy_frac;
ScreenPtr scr = miPointerGetScreen(pDev);
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
/* refuse events from disabled devices */
if (!pDev->enabled)
@@ -1092,13 +1117,14 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, ms = GetTimeInMillis(); /* before pointer update to help precision */
- if (!scr || !pDev->valuator || first_valuator < 0 ||
- num_valuators > MAX_VALUATORS ||
- ((num_valuators + first_valuator) > pDev->valuator->numAxes) ||
+ if (!scr || !pDev->valuator ||
(type != MotionNotify && type != ButtonPress && type != ButtonRelease) ||
(type != MotionNotify && !pDev->button) ||
- ((type == ButtonPress || type == ButtonRelease) && !buttons) ||
- (type == MotionNotify && num_valuators <= 0))
+ ((type == ButtonPress || type == ButtonRelease) && !buttons))
+ return 0;
+
+ if (type == MotionNotify &&
+ (!mask_in || valuator_mask_num_valuators(mask_in) <= 0))
return 0;
events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
@@ -1107,54 +1133,68 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, events++;
num_events++;
- memcpy(valuators, valuators_in, num_valuators * sizeof(int));
+ valuator_mask_copy(&mask, mask_in);
init_raw(pDev, raw, ms, type, buttons);
- set_raw_valuators(raw, first_valuator, num_valuators, valuators,
- raw->valuators.data_raw);
+ set_raw_valuators(raw, &mask, raw->valuators.data_raw);
if (flags & POINTER_ABSOLUTE)
{
if (flags & POINTER_SCREEN) /* valuators are in screen coords */
{
+ int scaled;
- if (num_valuators >= 1 && first_valuator == 0)
- valuators[0] = rescaleValuatorAxis(valuators[0], 0.0, &x_frac, NULL,
- pDev->valuator->axes + 0,
- scr->width);
- if (first_valuator <= 1 && num_valuators >= (2 - first_valuator))
- valuators[1 - first_valuator] = rescaleValuatorAxis(valuators[1 - first_valuator], 0.0, &y_frac, NULL,
- pDev->valuator->axes + 1,
- scr->height);
+ if (valuator_mask_isset(&mask, 0))
+ {
+ scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 0),
+ 0.0, &x_frac, NULL,
+ pDev->valuator->axes + 0,
+ scr->width);
+ valuator_mask_set(&mask, 0, scaled);
+ }
+ if (valuator_mask_isset(&mask, 1))
+ {
+ scaled = rescaleValuatorAxis(valuator_mask_get(&mask, 1),
+ 0.0, &y_frac, NULL,
+ pDev->valuator->axes + 1,
+ scr->height);
+ valuator_mask_set(&mask, 1, scaled);
+ }
}
- transformAbsolute(pDev, valuators);
- moveAbsolute(pDev, &x, &y, first_valuator, num_valuators, valuators);
+ transformAbsolute(pDev, &mask);
+ moveAbsolute(pDev, &x, &y, &mask);
} else {
if (flags & POINTER_ACCELERATE) {
- accelPointer(pDev, first_valuator, num_valuators, valuators, ms);
+ /* FIXME: Pointer acceleration only requires X and Y values. This
+ * should be converted to masked valuators. */
+ int vals[2];
+ vals[0] = valuator_mask_isset(&mask, 0) ?
+ valuator_mask_get(&mask, 0) : pDev->last.valuators[0];
+ vals[1] = valuator_mask_isset(&mask, 1) ?
+ valuator_mask_get(&mask, 1) : pDev->last.valuators[1];
+ accelPointer(pDev, 0, 2, vals, ms);
+
/* The pointer acceleration code modifies the fractional part
* in-place, so we need to extract this information first */
x_frac = pDev->last.remainder[0];
y_frac = pDev->last.remainder[1];
}
- moveRelative(pDev, &x, &y, first_valuator, num_valuators, valuators);
+ moveRelative(pDev, &x, &y, &mask);
}
- set_raw_valuators(raw, first_valuator, num_valuators, valuators,
- raw->valuators.data);
+ set_raw_valuators(raw, &mask, raw->valuators.data);
positionSprite(pDev, &x, &y, x_frac, y_frac, scr, &cx, &cy, &cx_frac, &cy_frac);
- updateHistory(pDev, first_valuator, num_valuators, ms);
+ updateHistory(pDev, &mask, ms);
/* Update the valuators with the true value sent to the client*/
- if (num_valuators >= 1 && first_valuator == 0)
- valuators[0] = x;
- if (first_valuator <= 1 && num_valuators >= (2 - first_valuator))
- valuators[1 - first_valuator] = y;
+ if (valuator_mask_isset(&mask, 0))
+ valuator_mask_set(&mask, 0, x);
+ if (valuator_mask_isset(&mask, 1))
+ valuator_mask_set(&mask, 0, y);
- if (num_valuators)
- clipValuators(pDev, first_valuator, num_valuators, valuators);
+ clipValuators(pDev, &mask);
event = (DeviceEvent*) events->event;
init_event(pDev, event, ms);
@@ -1180,7 +1220,7 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, event->root_x_frac = cx_frac;
event->root_y_frac = cy_frac;
- set_valuators(pDev, event, first_valuator, num_valuators, valuators);
+ set_valuators(pDev, event, &mask);
return num_events;
}
@@ -1195,30 +1235,31 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, * place via GetMaximumEventsNum(), and for freeing it.
*/
int
-GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type,
- int first_valuator, int num_valuators, int *valuators_in)
+GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, const ValuatorMask *mask_in)
{
- int num_events = 1;
+ int num_events = 1, i;
DeviceEvent *event;
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
/* refuse events from disabled devices */
if (!pDev->enabled)
return 0;
/* Sanity checks. */
- if (type != ProximityIn && type != ProximityOut)
+ if ((type != ProximityIn && type != ProximityOut) || !mask_in)
return 0;
if (!pDev->valuator)
return 0;
- /* Do we need to send a DeviceValuator event? */
- if ((pDev->valuator->mode & 1) == Relative)
- num_valuators = 0;
- /* You fail. */
- if (first_valuator < 0 || num_valuators > MAX_VALUATORS ||
- (num_valuators + first_valuator) > pDev->valuator->numAxes)
- return 0;
+ valuator_mask_copy(&mask, mask_in);
+
+ /* ignore relative axes for proximity. */
+ for (i = 0; i < valuator_mask_num_valuators(&mask); i++)
+ {
+ if (valuator_mask_isset(&mask, i) &&
+ valuator_get_mode(pDev, i) == Relative)
+ valuator_mask_unset(&mask, i);
+ }
events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, &num_events);
@@ -1226,12 +1267,9 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type, init_event(pDev, event, GetTimeInMillis());
event->type = (type == ProximityIn) ? ET_ProximityIn : ET_ProximityOut;
- if (num_valuators) {
- memcpy(valuators, valuators_in, num_valuators * sizeof(int));
- clipValuators(pDev, first_valuator, num_valuators, valuators);
- }
+ clipValuators(pDev, &mask);
- set_valuators(pDev, event, first_valuator, num_valuators, valuators);
+ set_valuators(pDev, event, &mask);
return num_events;
}
diff --git a/xorg-server/dix/globals.c b/xorg-server/dix/globals.c index 622e50f81..d7e919e50 100644 --- a/xorg-server/dix/globals.c +++ b/xorg-server/dix/globals.c @@ -106,10 +106,6 @@ CARD32 defaultScreenSaverTime = DEFAULT_SCREEN_SAVER_TIME; CARD32 defaultScreenSaverInterval = DEFAULT_SCREEN_SAVER_INTERVAL;
int defaultScreenSaverBlanking = DEFAULT_SCREEN_SAVER_BLANKING;
int defaultScreenSaverAllowExposures = DEFAULT_SCREEN_SAVER_EXPOSURES;
-#ifndef NOLOGOHACK
-int logoScreenSaver = DEFAULT_LOGO_SCREEN_SAVER;
-#endif
-
#ifdef SCREENSAVER
Bool screenSaverSuspended = FALSE;
#endif
diff --git a/xorg-server/dix/grabs.c b/xorg-server/dix/grabs.c index c588afc7c..a14181108 100644 --- a/xorg-server/dix/grabs.c +++ b/xorg-server/dix/grabs.c @@ -117,11 +117,8 @@ CreateGrab( static void
FreeGrab(GrabPtr pGrab)
{
- if (pGrab->modifiersDetail.pMask != NULL)
- free(pGrab->modifiersDetail.pMask);
-
- if (pGrab->detail.pMask != NULL)
- free(pGrab->detail.pMask);
+ free(pGrab->modifiersDetail.pMask);
+ free(pGrab->detail.pMask);
if (pGrab->cursor)
FreeCursor(pGrab->cursor, (Cursor)0);
diff --git a/xorg-server/dix/inpututils.c b/xorg-server/dix/inpututils.c index 39e65064a..80275bd40 100644 --- a/xorg-server/dix/inpututils.c +++ b/xorg-server/dix/inpututils.c @@ -35,6 +35,7 @@ #include "xace.h"
#include "xkbsrv.h"
#include "xkbstr.h"
+#include "inpututils.h"
/* Check if a button map change is okay with the device.
* Returns -1 for BadValue, as it collides with MappingBusy. */
@@ -418,3 +419,132 @@ FreeInputAttributes(InputAttributes *attrs) free(attrs);
}
+/**
+ * Alloc a valuator mask large enough for num_valuators.
+ */
+ValuatorMask*
+valuator_mask_new(int num_valuators)
+{
+ /* alloc a fixed size mask for now and ignore num_valuators. in the
+ * flying-car future, when we can dynamically alloc the masks and are
+ * not constrained by signals, we can start using num_valuators */
+ ValuatorMask *mask = calloc(1, sizeof(ValuatorMask));
+ mask->last_bit = -1;
+ return mask;
+}
+
+/**
+ * Sets a range of valuators between first_valuator and num_valuators with
+ * the data in the valuators array. All other values are set to 0.
+ */
+void
+valuator_mask_set_range(ValuatorMask *mask, int first_valuator, int num_valuators,
+ const int* valuators)
+{
+ int i;
+
+ valuator_mask_zero(mask);
+
+ for (i = first_valuator; i < min(first_valuator + num_valuators, MAX_VALUATORS); i++)
+ valuator_mask_set(mask, i, valuators[i - first_valuator]);
+}
+
+/**
+ * Reset mask to zero.
+ */
+void
+valuator_mask_zero(ValuatorMask *mask)
+{
+ memset(mask, 0, sizeof(*mask));
+ mask->last_bit = -1;
+}
+
+/**
+ * Returns the current size of the mask (i.e. the highest number of
+ * valuators currently set + 1).
+ */
+int
+valuator_mask_size(const ValuatorMask *mask)
+{
+ return mask->last_bit + 1;
+}
+
+/**
+ * Returns the number of valuators set in the given mask.
+ */
+int
+valuator_mask_num_valuators(const ValuatorMask *mask)
+{
+ return CountBits(mask->mask, min(mask->last_bit + 1, MAX_VALUATORS));
+}
+
+/**
+ * Return true if the valuator is set in the mask, or false otherwise.
+ */
+int
+valuator_mask_isset(const ValuatorMask *mask, int valuator)
+{
+ return mask->last_bit >= valuator && BitIsOn(mask->mask, valuator);
+}
+
+/**
+ * Set the valuator to the given data.
+ */
+void
+valuator_mask_set(ValuatorMask *mask, int valuator, int data)
+{
+ mask->last_bit = max(valuator, mask->last_bit);
+ SetBit(mask->mask, valuator);
+ mask->valuators[valuator] = data;
+}
+
+/**
+ * Return the requested valuator value. If the mask bit is not set for the
+ * given valuator, the returned value is undefined.
+ */
+int
+valuator_mask_get(const ValuatorMask *mask, int valuator)
+{
+ return mask->valuators[valuator];
+}
+
+/**
+ * Remove the valuator from the mask.
+ */
+void
+valuator_mask_unset(ValuatorMask *mask, int valuator)
+{
+ if (mask->last_bit >= valuator) {
+ int i, lastbit = -1;
+
+ ClearBit(mask->mask, valuator);
+ mask->valuators[valuator] = 0;
+
+ for (i = 0; i <= mask->last_bit; i++)
+ if (valuator_mask_isset(mask, i))
+ lastbit = max(lastbit, i);
+ mask->last_bit = lastbit;
+ }
+}
+
+void
+valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src)
+{
+ if (src)
+ memcpy(dest, src, sizeof(*dest));
+ else
+ valuator_mask_zero(dest);
+}
+
+int
+CountBits(const uint8_t *mask, int len)
+{
+ int i;
+ int ret = 0;
+
+ for (i = 0; i < len; i++)
+ if (BitIsOn(mask, i))
+ ret++;
+
+ return ret;
+}
diff --git a/xorg-server/dix/ptrveloc.c b/xorg-server/dix/ptrveloc.c index 27cb766f4..74a3d3a90 100644 --- a/xorg-server/dix/ptrveloc.c +++ b/xorg-server/dix/ptrveloc.c @@ -961,11 +961,9 @@ SetAccelerationProfile( if(profile == NULL && profile_num != PROFILE_UNINITIALIZE)
return FALSE;
- if(vel->profile_private != NULL){
- /* Here one could free old profile-private data */
- free(vel->profile_private);
- vel->profile_private = NULL;
- }
+ /* Here one could free old profile-private data */
+ free(vel->profile_private);
+ vel->profile_private = NULL;
/* Here one could init profile-private data */
vel->Profile = profile;
vel->statistics.profile_number = profile_num;
diff --git a/xorg-server/dix/window.c b/xorg-server/dix/window.c index 485c3caea..399e08635 100644 --- a/xorg-server/dix/window.c +++ b/xorg-server/dix/window.c @@ -137,6 +137,8 @@ Equipment Corporation. * ChangeWindowDeviceCursor
******/
+Bool bgNoneRoot = FALSE;
+
static unsigned char _back_lsb[4] = {0x88, 0x22, 0x44, 0x11};
static unsigned char _back_msb[4] = {0x11, 0x44, 0x22, 0x88};
@@ -463,6 +465,10 @@ InitRootWindow(WindowPtr pWin) if (party_like_its_1989) {
MakeRootTile(pWin);
backFlag |= CWBackPixmap;
+ } else if (pScreen->canDoBGNoneRoot && bgNoneRoot) {
+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
+ pWin->background.pixel = pScreen->whitePixel;
+ backFlag |= CWBackPixmap;
} else {
if (whiteRoot)
pWin->background.pixel = pScreen->whitePixel;
@@ -950,6 +956,26 @@ DestroySubwindows(WindowPtr pWin, ClientPtr client) return Success;
}
+static void
+SetRootWindowBackground(WindowPtr pWin, ScreenPtr pScreen, Mask *index2)
+{
+ /* following the protocol: "Changing the background of a root window to
+ * None or ParentRelative restores the default background pixmap" */
+ if (bgNoneRoot) {
+ pWin->backgroundState = XaceBackgroundNoneState(pWin);
+ pWin->background.pixel = pScreen->whitePixel;
+ }
+ else if (party_like_its_1989)
+ MakeRootTile(pWin);
+ else {
+ if (whiteRoot)
+ pWin->background.pixel = pScreen->whitePixel;
+ else
+ pWin->background.pixel = pScreen->blackPixel;
+ *index2 = CWBackPixel;
+ }
+}
+
/*****
* ChangeWindowAttributes
*
@@ -999,7 +1025,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
if (!pWin->parent)
- MakeRootTile(pWin);
+ SetRootWindowBackground(pWin, pScreen, &index2);
else {
pWin->backgroundState = XaceBackgroundNoneState(pWin);
pWin->background.pixel = pScreen->whitePixel;
@@ -1016,7 +1042,7 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) if (pWin->backgroundState == BackgroundPixmap)
(*pScreen->DestroyPixmap)(pWin->background.pixmap);
if (!pWin->parent)
- MakeRootTile(pWin);
+ SetRootWindowBackground(pWin, pScreen, &index2);
else
pWin->backgroundState = ParentRelative;
borderRelative = TRUE;
@@ -3087,13 +3113,6 @@ SendVisibilityNotify(WindowPtr pWin) }
#define RANDOM_WIDTH 32
-
-#ifndef NOLOGOHACK
-static void DrawLogo(
- WindowPtr pWin
-);
-#endif
-
int
dixSaveScreens(ClientPtr client, int on, int mode)
{
@@ -3155,18 +3174,10 @@ dixSaveScreens(ClientPtr client, int on, int mode) * for the root window, so miPaintWindow works
*/
screenIsSaved = SCREEN_SAVER_OFF;
-#ifndef NOLOGOHACK
- if (logoScreenSaver)
- (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, FALSE);
-#endif
(*pWin->drawable.pScreen->MoveWindow)(pWin,
(short)(-(rand() % RANDOM_WIDTH)),
(short)(-(rand() % RANDOM_WIDTH)),
pWin->nextSib, VTMove);
-#ifndef NOLOGOHACK
- if (logoScreenSaver)
- DrawLogo(pWin);
-#endif
screenIsSaved = SCREEN_SAVER_ON;
}
/*
@@ -3324,10 +3335,6 @@ TileScreenSaver(ScreenPtr pScreen, int kind) (*pWin->drawable.pScreen->ChangeWindowAttributes)(pWin, CWBackPixmap);
}
MapWindow(pWin, serverClient);
-#ifndef NOLOGOHACK
- if (kind == SCREEN_IS_TILED && logoScreenSaver)
- DrawLogo(pWin);
-#endif
return TRUE;
}
@@ -3673,184 +3680,3 @@ WindowParentHasDeviceCursor(WindowPtr pWin, }
return FALSE;
}
-
-#ifndef NOLOGOHACK
-static void
-DrawLogo(WindowPtr pWin)
-{
- DrawablePtr pDraw;
- ScreenPtr pScreen;
- int x, y;
- unsigned int width, height, size;
- GC *pGC;
- int rc, thin, gap, d31;
- DDXPointRec poly[4];
- ChangeGCVal fore[2], back[2];
- xrgb rgb[2];
- BITS32 fmask, bmask;
- ColormapPtr cmap;
-
- pDraw = (DrawablePtr)pWin;
- pScreen = pDraw->pScreen;
- x = -pWin->origin.x;
- y = -pWin->origin.y;
- width = pScreen->width;
- height = pScreen->height;
- pGC = GetScratchGC(pScreen->rootDepth, pScreen);
- if (!pGC)
- return;
-
- if ((rand() % 100) <= 17) /* make the probability for white fairly low */
- fore[0].val = pScreen->whitePixel;
- else
- fore[0].val = pScreen->blackPixel;
- if (pWin->backgroundState == BackgroundPixel) {
- rc = dixLookupResourceByType((pointer *)&cmap, wColormap(pWin),
- RT_COLORMAP, serverClient, DixReadAccess);
- if (rc == Success) {
- Pixel querypixels[2];
-
- querypixels[0] = fore[0].val;
- querypixels[1] = pWin->background.pixel;
- QueryColors(cmap, 2, querypixels, rgb, serverClient);
- if ((rgb[0].red == rgb[1].red) &&
- (rgb[0].green == rgb[1].green) &&
- (rgb[0].blue == rgb[1].blue)) {
- if (fore[0].val == pScreen->blackPixel)
- fore[0].val = pScreen->whitePixel;
- else
- fore[0].val = pScreen->blackPixel;
- }
- }
- }
- fore[1].val = FillSolid;
- fmask = GCForeground|GCFillStyle;
- if (pWin->backgroundState == BackgroundPixel) {
- back[0].val = pWin->background.pixel;
- back[1].val = FillSolid;
- bmask = GCForeground|GCFillStyle;
- } else {
- back[0].val = 0;
- back[1].val = 0;
- ChangeGC(NullClient, pGC, GCTileStipXOrigin|GCTileStipYOrigin, back);
- back[0].val = FillTiled;
- back[1].ptr = pWin->background.pixmap;
- bmask = GCFillStyle|GCTile;
- }
-
- /* should be the same as the reference function XmuDrawLogo() */
-
- size = width;
- if (height < width)
- size = height;
- size = RANDOM_WIDTH + rand() % (size - RANDOM_WIDTH);
- size &= ~1;
- x += rand() % (width - size);
- y += rand() % (height - size);
-
-/*
- * Draw what will be the thin strokes.
- *
- * -----
- * / /
- * / /
- * / /
- * / /
- * /____/
- * d
- *
- * Point d is 9/44 (~1/5) of the way across.
- */
-
- thin = (size / 11);
- if (thin < 1) thin = 1;
- gap = (thin+3) / 4;
- d31 = thin + thin + gap;
- poly[0].x = x + size; poly[0].y = y;
- poly[1].x = x + size-d31; poly[1].y = y;
- poly[2].x = x + 0; poly[2].y = y + size;
- poly[3].x = x + d31; poly[3].y = y + size;
- ChangeGC(NullClient, pGC, fmask, fore);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase area not needed for lower thin stroke.
- *
- * ------
- * / /
- * / __ /
- * / / /
- * / / /
- * /__/__/
- */
-
- poly[0].x = x + d31/2; poly[0].y = y + size;
- poly[1].x = x + size / 2; poly[1].y = y + size/2;
- poly[2].x = x + (size/2)+(d31-(d31/2)); poly[2].y = y + size/2;
- poly[3].x = x + d31; poly[3].y = y + size;
- ChangeGC(NullClient, pGC, bmask, back);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase area not needed for upper thin stroke.
- *
- * ------
- * / / /
- * /--/ /
- * / /
- * / /
- * /_____/
- */
-
- poly[0].x = x + size - d31/2; poly[0].y = y;
- poly[1].x = x + size / 2; poly[1].y = y + size/2;
- poly[2].x = x + (size/2)-(d31-(d31/2)); poly[2].y = y + size/2;
- poly[3].x = x + size - d31; poly[3].y = y;
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Draw thick stroke.
- * Point b is 1/4 of the way across.
- *
- * b
- * -----
- * \ \
- * \ \
- * \ \
- * \ \
- * \____\
- */
-
- poly[0].x = x; poly[0].y = y;
- poly[1].x = x + size/4; poly[1].y = y;
- poly[2].x = x + size; poly[2].y = y + size;
- poly[3].x = x + size - size/4; poly[3].y = y + size;
- ChangeGC(NullClient, pGC, fmask, fore);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
-/*
- * Erase to create gap.
- *
- * /
- * /
- * /
- * /
- * /
- */
-
- poly[0].x = x + size- thin; poly[0].y = y;
- poly[1].x = x + size-( thin+gap); poly[1].y = y;
- poly[2].x = x + thin; poly[2].y = y + size;
- poly[3].x = x + thin + gap; poly[3].y = y + size;
- ChangeGC(NullClient, pGC, bmask, back);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->FillPolygon)(pDraw, pGC, Convex, CoordModeOrigin, 4, poly);
-
- FreeScratchGC(pGC);
-}
-
-#endif
diff --git a/xorg-server/doc/Xserver.man.pre b/xorg-server/doc/Xserver.man.pre index 4926960c2..2fc5541fc 100644 --- a/xorg-server/doc/Xserver.man.pre +++ b/xorg-server/doc/Xserver.man.pre @@ -285,14 +285,6 @@ sets the stack space limit of the server to the specified number of kilobytes. A value of zero makes the stack size as large as possible. The default value
of \-1 leaves the stack space limit unchanged.
.TP 8
-.B \-logo
-turns on the X Window System logo display in the screen-saver.
-There is currently no way to change this from a client.
-.TP 8
-.B nologo
-turns off the X Window System logo display in the screen-saver.
-There is currently no way to change this from a client.
-.TP 8
.B \-render
.BR default | mono | gray | color
sets the color allocation policy that will be used by the render extension.
diff --git a/xorg-server/doc/xml/Xserver-spec.xml b/xorg-server/doc/xml/Xserver-spec.xml index 3bea5e968..1b216ce8d 100644 --- a/xorg-server/doc/xml/Xserver-spec.xml +++ b/xorg-server/doc/xml/Xserver-spec.xml @@ -1710,8 +1710,6 @@ Input initialization is a bit complicated. It all starts with InitInput(), a routine that you write to call
AddInputDevice() twice
(once for pointing device and once for keyboard.)
-You also want to call RegisterKeyboardDevice() and RegisterPointerDevice()
-on them.
</para>
<para>
When you Add the devices, a routine you supply for each device
@@ -1731,8 +1729,6 @@ the pointer is the pointer. InitInput is a DDX routine you must write to initialize the
input subsystem in DDX.
It must call AddInputDevice() for each device that might generate events.
-In addition, you must register the main keyboard and pointing devices by
-calling RegisterPointerDevice() and RegisterKeyboardDevice().
</para>
<para>
<blockquote><programlisting>
@@ -1755,25 +1751,6 @@ Note also that except for the main keyboard and pointing device, an extension is needed to provide for a client interface to a device.
</para>
<para>
-<blockquote><programlisting>
-
- void RegisterPointerDevice(device)
- DevicePtr device;
-</programlisting></blockquote>
-RegisterPointerDevice is a DIX routine that your DDX code calls that
-makes that device the main pointing device.
-This routine is called once upon initialization and cannot be called again.
-</para>
-<para>
-<blockquote><programlisting>
-
- void RegisterKeyboardDevice(device)
- DevicePtr device;
-</programlisting></blockquote>
-RegisterKeyboardDevice makes the given device the main keyboard.
-This routine is called once upon initialization and cannot be called again.
-</para>
-<para>
The following DIX
procedures return the specified DevicePtr. They may or may not be useful
to DDX implementors.
@@ -5163,8 +5140,6 @@ mi and fb implementations.</para> </row>
</thead>
<tbody>
-<row><entry><function>RegisterKeyboardDevice</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
-<row><entry><function>RegisterPointerDevice</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
<row><entry><function>RemoveEnabledDevice</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>ResetCurrentRequest</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
<row><entry><function>SaveScreen</function></entry><entry><literal>ddx</literal></entry><entry><para>Screen</para></entry></row>
diff --git a/xorg-server/doc/xml/dtrace/Makefile.am b/xorg-server/doc/xml/dtrace/Makefile.am index 946fba7d8..dc6127416 100644 --- a/xorg-server/doc/xml/dtrace/Makefile.am +++ b/xorg-server/doc/xml/dtrace/Makefile.am @@ -25,11 +25,13 @@ XML_FILES = Xserver-DTrace.xml include ../xmlrules.in
+if ENABLE_DOCS
if XSERVER_DTRACE
doc_DATA = $(BUILT_DOC_FILES)
else
noinst_DATA = $(BUILT_DOC_FILES)
endif
+endif
CLEANFILES = $(CLEAN_DOC_FILES)
diff --git a/xorg-server/exa/exa.c b/xorg-server/exa/exa.c index eda9ad7a7..9dbcf4d10 100644 --- a/xorg-server/exa/exa.c +++ b/xorg-server/exa/exa.c @@ -159,8 +159,7 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2) return;
RegionInit(®ion, &box, 1);
- DamageRegionAppend(&pPix->drawable, ®ion);
- DamageRegionProcessPending(&pPix->drawable);
+ DamageDamageRegion(&pPix->drawable, ®ion);
RegionUninit(®ion);
}
diff --git a/xorg-server/fb/Makefile.am b/xorg-server/fb/Makefile.am index 21ed7b624..0863d7c07 100644 --- a/xorg-server/fb/Makefile.am +++ b/xorg-server/fb/Makefile.am @@ -55,4 +55,4 @@ libfb_la_SOURCES = \ libwfb_la_SOURCES = $(libfb_la_SOURCES)
-EXTRA_DIST = fbcmap.c fbcmap_mi.c
+EXTRA_DIST = fbcmap_mi.c
diff --git a/xorg-server/fb/fb.h b/xorg-server/fb/fb.h index 14c5ed137..cefd410dd 100644 --- a/xorg-server/fb/fb.h +++ b/xorg-server/fb/fb.h @@ -1262,7 +1262,7 @@ fbBltPlane (FbBits *src, Pixel planeMask);
/*
- * fbcmap.c
+ * fbcmap_mi.c
*/
extern _X_EXPORT int
fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
diff --git a/xorg-server/fb/fbcmap.c b/xorg-server/fb/fbcmap.c deleted file mode 100644 index 123b7f41d..000000000 --- a/xorg-server/fb/fbcmap.c +++ /dev/null @@ -1,586 +0,0 @@ -/*
- * Copyright © 1987 Sun Microsystems, Inc. All rights reserved.
- *
- * 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 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_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "scrnintstr.h"
-#include "colormapst.h"
-#include "resource.h"
-#include "fb.h"
-
-#ifdef XFree86Server
-#error "You should be compiling fbcmap_mi.c instead of fbcmap.c!"
-#endif
-
-static DevPrivateKeyRec cmapScrPrivateKeyRec;
-#define cmapScrPrivateKey (&cmapScrPrivateKeyRec)
-
-#define GetInstalledColormap(s) ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, cmapScrPrivateKey))
-#define SetInstalledColormap(s,c) (dixSetPrivate(&(s)->devPrivates, cmapScrPrivateKey, c))
-
-int
-fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
-{
- /* By the time we are processing requests, we can guarantee that there
- * is always a colormap installed */
- *pmaps = GetInstalledColormap(pScreen)->mid;
- return 1;
-}
-
-
-void
-fbInstallColormap(ColormapPtr pmap)
-{
- ColormapPtr oldpmap = GetInstalledColormap(pmap->pScreen);
-
- if(pmap != oldpmap)
- {
- /* Uninstall pInstalledMap. No hardware changes required, just
- * notify all interested parties. */
- if(oldpmap != (ColormapPtr)None)
- WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
- /* Install pmap */
- SetInstalledColormap(pmap->pScreen, pmap);
- WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
- }
-}
-
-void
-fbUninstallColormap(ColormapPtr pmap)
-{
- ColormapPtr curpmap = GetInstalledColormap(pmap->pScreen);
-
- if(pmap == curpmap)
- {
- if (pmap->mid != pmap->pScreen->defColormap)
- {
- dixLookupResourceByType((pointer *)&curpmap,
- pmap->pScreen->defColormap,
- RT_COLORMAP,
- serverClient, DixInstallAccess);
- (*pmap->pScreen->InstallColormap)(curpmap);
- }
- }
-}
-
-void
-fbResolveColor(unsigned short *pred,
- unsigned short *pgreen,
- unsigned short *pblue,
- VisualPtr pVisual)
-{
- int shift = 16 - pVisual->bitsPerRGBValue;
- unsigned lim = (1 << pVisual->bitsPerRGBValue) - 1;
-
- if ((pVisual->class | DynamicClass) == GrayScale)
- {
- /* rescale to gray then rgb bits */
- *pred = (30L * *pred + 59L * *pgreen + 11L * *pblue) / 100;
- *pblue = *pgreen = *pred = ((*pred >> shift) * 65535) / lim;
- }
- else
- {
- /* rescale to rgb bits */
- *pred = ((*pred >> shift) * 65535) / lim;
- *pgreen = ((*pgreen >> shift) * 65535) / lim;
- *pblue = ((*pblue >> shift) * 65535) / lim;
- }
-}
-
-Bool
-fbInitializeColormap(ColormapPtr pmap)
-{
- register unsigned i;
- register VisualPtr pVisual;
- unsigned lim, maxent, shift;
-
- pVisual = pmap->pVisual;
- lim = (1 << pVisual->bitsPerRGBValue) - 1;
- shift = 16 - pVisual->bitsPerRGBValue;
- maxent = pVisual->ColormapEntries - 1;
- if (pVisual->class == TrueColor)
- {
- unsigned limr, limg, limb;
-
- limr = pVisual->redMask >> pVisual->offsetRed;
- limg = pVisual->greenMask >> pVisual->offsetGreen;
- limb = pVisual->blueMask >> pVisual->offsetBlue;
- for(i = 0; i <= maxent; i++)
- {
- /* rescale to [0..65535] then rgb bits */
- pmap->red[i].co.local.red =
- ((((i * 65535) / limr) >> shift) * 65535) / lim;
- pmap->green[i].co.local.green =
- ((((i * 65535) / limg) >> shift) * 65535) / lim;
- pmap->blue[i].co.local.blue =
- ((((i * 65535) / limb) >> shift) * 65535) / lim;
- }
- }
- else if (pVisual->class == StaticColor)
- {
- unsigned n;
- unsigned r, g, b;
- unsigned red, green, blue;
-
- for (n = 0; n*n*n < pVisual->ColormapEntries; n++)
- ;
- n--;
- i = 0;
- for (r = 0; r < n; r++)
- {
- red = (((r * 65535 / (n - 1)) >> shift) * 65535) / lim;
- for (g = 0; g < n; g++)
- {
- green = (((g * 65535 / (n - 1)) >> shift) * 65535) / lim;
- for (b = 0; b < n; b++)
- {
- blue = (((b * 65535 / (n - 1)) >> shift) * 65535) / lim;
- pmap->red[i].co.local.red = red;
- pmap->red[i].co.local.green = green;
- pmap->red[i].co.local.blue = blue;
- i++;
- }
- }
- }
- n = pVisual->ColormapEntries - i;
- for (r = 0; r < n; r++)
- {
- red = (((r * 65535 / (n - 1)) >> shift) * 65535) / lim;
- pmap->red[i].co.local.red = red;
- pmap->red[i].co.local.green = red;
- pmap->red[i].co.local.blue = red;
- i++;
- }
- }
- else if (pVisual->class == StaticGray)
- {
- for(i = 0; i <= maxent; i++)
- {
- /* rescale to [0..65535] then rgb bits */
- pmap->red[i].co.local.red = ((((i * 65535) / maxent) >> shift)
- * 65535) / lim;
- pmap->red[i].co.local.green = pmap->red[i].co.local.red;
- pmap->red[i].co.local.blue = pmap->red[i].co.local.red;
- }
- }
- return TRUE;
-}
-
-/* When simulating DirectColor on PseudoColor hardware, multiple
- entries of the colormap must be updated
- */
-
-#define AddElement(mask) { \
- pixel = red | green | blue; \
- for (i = 0; i < nresult; i++) \
- if (outdefs[i].pixel == pixel) \
- break; \
- if (i == nresult) \
- { \
- nresult++; \
- outdefs[i].pixel = pixel; \
- outdefs[i].flags = 0; \
- } \
- outdefs[i].flags |= (mask); \
- outdefs[i].red = pmap->red[red >> pVisual->offsetRed].co.local.red; \
- outdefs[i].green = pmap->green[green >> pVisual->offsetGreen].co.local.green; \
- outdefs[i].blue = pmap->blue[blue >> pVisual->offsetBlue].co.local.blue; \
-}
-
-int
-fbExpandDirectColors (ColormapPtr pmap,
- int ndef,
- xColorItem *indefs,
- xColorItem *outdefs)
-{
- register int red, green, blue;
- int maxred, maxgreen, maxblue;
- int stepred, stepgreen, stepblue;
- VisualPtr pVisual;
- register int pixel;
- register int nresult;
- register int i;
-
- pVisual = pmap->pVisual;
-
- stepred = 1 << pVisual->offsetRed;
- stepgreen = 1 << pVisual->offsetGreen;
- stepblue = 1 << pVisual->offsetBlue;
- maxred = pVisual->redMask;
- maxgreen = pVisual->greenMask;
- maxblue = pVisual->blueMask;
- nresult = 0;
- for (;ndef--; indefs++)
- {
- if (indefs->flags & DoRed)
- {
- red = indefs->pixel & pVisual->redMask;
- for (green = 0; green <= maxgreen; green += stepgreen)
- {
- for (blue = 0; blue <= maxblue; blue += stepblue)
- {
- AddElement (DoRed)
- }
- }
- }
- if (indefs->flags & DoGreen)
- {
- green = indefs->pixel & pVisual->greenMask;
- for (red = 0; red <= maxred; red += stepred)
- {
- for (blue = 0; blue <= maxblue; blue += stepblue)
- {
- AddElement (DoGreen)
- }
- }
- }
- if (indefs->flags & DoBlue)
- {
- blue = indefs->pixel & pVisual->blueMask;
- for (red = 0; red <= maxred; red += stepred)
- {
- for (green = 0; green <= maxgreen; green += stepgreen)
- {
- AddElement (DoBlue)
- }
- }
- }
- }
- return nresult;
-}
-
-Bool
-fbCreateDefColormap(ScreenPtr pScreen)
-{
- unsigned short zero = 0, ones = 0xFFFF;
- VisualPtr pVisual;
- ColormapPtr cmap;
- Pixel wp, bp;
-
- for (pVisual = pScreen->visuals;
- pVisual->vid != pScreen->rootVisual;
- pVisual++)
- ;
-
- if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap,
- (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
- 0)
- != Success)
- return FALSE;
- wp = pScreen->whitePixel;
- bp = pScreen->blackPixel;
- if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) !=
- Success) ||
- (AllocColor(cmap, &zero, &zero, &zero, &bp, 0) !=
- Success))
- return FALSE;
- pScreen->whitePixel = wp;
- pScreen->blackPixel = bp;
- (*pScreen->InstallColormap)(cmap);
- return TRUE;
-}
-
-extern int defaultColorVisualClass;
-
-#define _RZ(d) ((d + 2) / 3)
-#define _RS(d) 0
-#define _RM(d) ((1 << _RZ(d)) - 1)
-#define _GZ(d) ((d - _RZ(d) + 1) / 2)
-#define _GS(d) _RZ(d)
-#define _GM(d) (((1 << _GZ(d)) - 1) << _GS(d))
-#define _BZ(d) (d - _RZ(d) - _GZ(d))
-#define _BS(d) (_RZ(d) + _GZ(d))
-#define _BM(d) (((1 << _BZ(d)) - 1) << _BS(d))
-#define _CE(d) (1 << _RZ(d))
-
-#define MAX_PSEUDO_DEPTH 10 /* largest DAC size I know */
-
-#define StaticGrayMask (1 << StaticGray)
-#define GrayScaleMask (1 << GrayScale)
-#define StaticColorMask (1 << StaticColor)
-#define PseudoColorMask (1 << PseudoColor)
-#define TrueColorMask (1 << TrueColor)
-#define DirectColorMask (1 << DirectColor)
-
-#define ALL_VISUALS (StaticGrayMask|\
- GrayScaleMask|\
- StaticColorMask|\
- PseudoColorMask|\
- TrueColorMask|\
- DirectColorMask)
-
-#define LARGE_VISUALS (TrueColorMask|\
- DirectColorMask)
-
-typedef struct _fbVisuals {
- struct _fbVisuals *next;
- int depth;
- int bitsPerRGB;
- int visuals;
- int count;
- Pixel redMask, greenMask, blueMask;
-} fbVisualsRec, *fbVisualsPtr;
-
-static const int fbVisualPriority[] = {
- PseudoColor, DirectColor, GrayScale, StaticColor, TrueColor, StaticGray
-};
-
-#define NUM_PRIORITY 6
-
-static fbVisualsPtr fbVisuals;
-
-static int
-popCount (int i)
-{
- int count;
-
- count = (i >> 1) & 033333333333;
- count = i - count - ((count >> 1) & 033333333333);
- count = (((count + (count >> 3)) & 030707070707) % 077); /* HAKMEM 169 */
- return count;
-}
-
-/*
- * Distance to least significant one bit
- */
-static int
-maskShift (Pixel p)
-{
- int s;
-
- if (!p) return 0;
- s = 0;
- while (!(p & 1))
- {
- s++;
- p >>= 1;
- }
- return s;
-}
-
-Bool
-fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
- Pixel redMask, Pixel greenMask, Pixel blueMask)
-{
- fbVisualsPtr new, *prev, v;
-
- new = (fbVisualsPtr) malloc(sizeof *new);
- if (!new)
- return FALSE;
- if (!redMask || !greenMask || !blueMask)
- {
- redMask = _RM(depth);
- greenMask = _GM(depth);
- blueMask = _BM(depth);
- }
- new->next = 0;
- new->depth = depth;
- new->visuals = visuals;
- new->bitsPerRGB = bitsPerRGB;
- new->redMask = redMask;
- new->greenMask = greenMask;
- new->blueMask = blueMask;
- new->count = popCount (visuals);
- for (prev = &fbVisuals; (v = *prev); prev = &v->next);
- *prev = new;
- return TRUE;
-}
-
-Bool
-fbHasVisualTypes (int depth)
-{
- fbVisualsPtr v;
-
- for (v = fbVisuals; v; v = v->next)
- if (v->depth == depth)
- return TRUE;
- return FALSE;
-}
-
-Bool
-fbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
-{
- return fbSetVisualTypesAndMasks (depth, visuals, bitsPerRGB,
- _RM(depth), _GM(depth), _BM(depth));
-}
-
-/*
- * Given a list of formats for a screen, create a list
- * of visuals and depths for the screen which coorespond to
- * the set which can be used with this version of fb.
- */
-
-Bool
-fbInitVisuals (VisualPtr *visualp,
- DepthPtr *depthp,
- int *nvisualp,
- int *ndepthp,
- int *rootDepthp,
- VisualID *defaultVisp,
- unsigned long sizes,
- int bitsPerRGB)
-{
- int i, j = 0, k;
- VisualPtr visual;
- DepthPtr depth;
- VisualID *vid;
- int d, b;
- int f;
- int ndepth, nvisual;
- int nvtype;
- int vtype;
- fbVisualsPtr visuals, nextVisuals;
-
- /* none specified, we'll guess from pixmap formats */
- if (!fbVisuals)
- {
- for (f = 0; f < screenInfo.numPixmapFormats; f++)
- {
- d = screenInfo.formats[f].depth;
- b = screenInfo.formats[f].bitsPerPixel;
- if (sizes & (1 << (b - 1)))
- {
- if (d > MAX_PSEUDO_DEPTH)
- vtype = LARGE_VISUALS;
- else if (d == 1)
- vtype = StaticGrayMask;
- else
- vtype = ALL_VISUALS;
- }
- else
- vtype = 0;
- if (!fbSetVisualTypes (d, vtype, bitsPerRGB))
- return FALSE;
- }
- }
- nvisual = 0;
- ndepth = 0;
- for (visuals = fbVisuals; visuals; visuals = nextVisuals)
- {
- nextVisuals = visuals->next;
- ndepth++;
- nvisual += visuals->count;
- }
- depth = (DepthPtr) malloc(ndepth * sizeof (DepthRec));
- visual = (VisualPtr) malloc(nvisual * sizeof (VisualRec));
- if (!depth || !visual)
- {
- free(depth);
- free(visual);
- return FALSE;
- }
- *depthp = depth;
- *visualp = visual;
- *ndepthp = ndepth;
- *nvisualp = nvisual;
- for (visuals = fbVisuals; visuals; visuals = nextVisuals)
- {
- nextVisuals = visuals->next;
- d = visuals->depth;
- vtype = visuals->visuals;
- nvtype = visuals->count;
- vid = NULL;
- if (nvtype)
- {
- vid = (VisualID *) malloc(nvtype * sizeof (VisualID));
- if (!vid)
- return FALSE;
- }
- depth->depth = d;
- depth->numVids = nvtype;
- depth->vids = vid;
- depth++;
- for (i = 0; i < NUM_PRIORITY; i++) {
- if (! (vtype & (1 << fbVisualPriority[i])))
- continue;
- visual->class = fbVisualPriority[i];
- visual->bitsPerRGBValue = visuals->bitsPerRGB;
- visual->ColormapEntries = 1 << d;
- visual->nplanes = d;
- visual->vid = *vid = FakeClientID (0);
- switch (visual->class) {
- case PseudoColor:
- case GrayScale:
- case StaticGray:
- case StaticColor:
- visual->redMask = 0;
- visual->greenMask = 0;
- visual->blueMask = 0;
- visual->offsetRed = 0;
- visual->offsetGreen = 0;
- visual->offsetBlue = 0;
- break;
- case DirectColor:
- case TrueColor:
- visual->ColormapEntries = _CE(d);
- visual->redMask = visuals->redMask;
- visual->greenMask = visuals->greenMask;
- visual->blueMask = visuals->blueMask;
- visual->offsetRed = maskShift (visuals->redMask);
- visual->offsetGreen = maskShift (visuals->greenMask);
- visual->offsetBlue = maskShift (visuals->blueMask);
- }
- vid++;
- visual++;
- }
- free(visuals);
- }
- fbVisuals = NULL;
- visual = *visualp;
- depth = *depthp;
- for (i = 0; i < ndepth; i++)
- {
- if (*rootDepthp && *rootDepthp != depth[i].depth)
- continue;
- for (j = 0; j < depth[i].numVids; j++)
- {
- for (k = 0; k < nvisual; k++)
- if (visual[k].vid == depth[i].vids[j])
- break;
- if (k == nvisual)
- continue;
- if (defaultColorVisualClass < 0 ||
- visual[k].class == defaultColorVisualClass)
- break;
- }
- if (j != depth[i].numVids)
- break;
- }
- if (i == ndepth) {
- for (i = 0; i < ndepth; i++)
- {
- if (depth[i].numVids)
- break;
- }
- if (i == ndepth)
- return FALSE;
- j = 0;
- }
- *rootDepthp = depth[i].depth;
- *defaultVisp = depth[i].vids[j];
- return TRUE;
-}
diff --git a/xorg-server/fb/fbpict.c b/xorg-server/fb/fbpict.c index 9e2c35c4b..c27fb4e20 100644 --- a/xorg-server/fb/fbpict.c +++ b/xorg-server/fb/fbpict.c @@ -35,112 +35,6 @@ #include "mipict.h"
#include "fbpict.h"
-#define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
-
-void
-fbWalkCompositeRegion (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height,
- Bool srcRepeat,
- Bool maskRepeat,
- CompositeFunc compositeRect)
-{
- RegionRec region;
- int n;
- BoxPtr pbox;
- int w, h, w_this, h_this;
- int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
-
- xDst += pDst->pDrawable->x;
- yDst += pDst->pDrawable->y;
- if (pSrc->pDrawable)
- {
- xSrc += pSrc->pDrawable->x;
- ySrc += pSrc->pDrawable->y;
- }
- if (pMask && pMask->pDrawable)
- {
- xMask += pMask->pDrawable->x;
- yMask += pMask->pDrawable->y;
- }
-
- if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst, width, height))
- return;
-
- n = RegionNumRects (®ion);
- pbox = RegionRects (®ion);
- while (n--)
- {
- h = pbox->y2 - pbox->y1;
- y_src = pbox->y1 - yDst + ySrc;
- y_msk = pbox->y1 - yDst + yMask;
- y_dst = pbox->y1;
- while (h)
- {
- h_this = h;
- w = pbox->x2 - pbox->x1;
- x_src = pbox->x1 - xDst + xSrc;
- x_msk = pbox->x1 - xDst + xMask;
- x_dst = pbox->x1;
- if (maskRepeat)
- {
- y_msk = mod (y_msk - pMask->pDrawable->y, pMask->pDrawable->height);
- if (h_this > pMask->pDrawable->height - y_msk)
- h_this = pMask->pDrawable->height - y_msk;
- y_msk += pMask->pDrawable->y;
- }
- if (srcRepeat)
- {
- y_src = mod (y_src - pSrc->pDrawable->y, pSrc->pDrawable->height);
- if (h_this > pSrc->pDrawable->height - y_src)
- h_this = pSrc->pDrawable->height - y_src;
- y_src += pSrc->pDrawable->y;
- }
- while (w)
- {
- w_this = w;
- if (maskRepeat)
- {
- x_msk = mod (x_msk - pMask->pDrawable->x, pMask->pDrawable->width);
- if (w_this > pMask->pDrawable->width - x_msk)
- w_this = pMask->pDrawable->width - x_msk;
- x_msk += pMask->pDrawable->x;
- }
- if (srcRepeat)
- {
- x_src = mod (x_src - pSrc->pDrawable->x, pSrc->pDrawable->width);
- if (w_this > pSrc->pDrawable->width - x_src)
- w_this = pSrc->pDrawable->width - x_src;
- x_src += pSrc->pDrawable->x;
- }
- (*compositeRect) (op, pSrc, pMask, pDst,
- x_src, y_src, x_msk, y_msk, x_dst, y_dst,
- w_this, h_this);
- w -= w_this;
- x_src += w_this;
- x_msk += w_this;
- x_dst += w_this;
- }
- h -= h_this;
- y_src += h_this;
- y_msk += h_this;
- y_dst += h_this;
- }
- pbox++;
- }
- RegionUninit(®ion);
-}
-
void
fbComposite (CARD8 op,
PicturePtr pSrc,
@@ -182,25 +76,6 @@ fbComposite (CARD8 op, free_pixman_pict (pDst, dest);
}
-void
-fbCompositeGeneral (CARD8 op,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
- fbComposite (op, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height);
-}
-
static pixman_image_t *
create_solid_fill_image (PicturePtr pict)
{
diff --git a/xorg-server/fb/fbpict.h b/xorg-server/fb/fbpict.h index b89f90ff1..e7daaa245 100644 --- a/xorg-server/fb/fbpict.h +++ b/xorg-server/fb/fbpict.h @@ -1,484 +1,68 @@ -/* - * - * Copyright © 2000 Keith Packard, member of The XFree86 Project, 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#ifndef _FBPICT_H_ -#define _FBPICT_H_ - -#include "renderedge.h" - - -#if defined(__GNUC__) -#define INLINE __inline__ -#else -#define INLINE -#endif - -#define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) ) -#define FbIntDiv(a,b) (((CARD16) (a) * 255) / (b)) - -#define FbGet8(v,i) ((CARD16) (CARD8) ((v) >> i)) - -/* - * There are two ways of handling alpha -- either as a single unified value or - * a separate value for each component, hence each macro must have two - * versions. The unified alpha version has a 'U' at the end of the name, - * the component version has a 'C'. Similarly, functions which deal with - * this difference will have two versions using the same convention. - */ - -#define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - -#define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i),\ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - -#define FbInU(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),(a),(t)) << (i)) - -#define FbInC(x,i,a,t) ((CARD32) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i)) - -#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (FbIntMult(FbGet8(y,i),ay,(u)) + \ - FbIntMult(FbGet8(x,i),ax,(v))),\ - (CARD32) ((CARD8) ((t) | \ - (0 - ((t) >> 8)))) << (i)) - -#define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \ - (CARD32) ((CARD8) ((t) | (0 - ((t) >> 8)))) << (i)) - - -#define Alpha(x) ((x) >> 24) -#define Red(x) (((x) >> 16) & 0xff) -#define Green(x) (((x) >> 8) & 0xff) -#define Blue(x) ((x) & 0xff) - -/** - * Returns TRUE if the fbComposeGetSolid can be used to get a single solid - * color representing every source sampling location of the picture. - */ -static INLINE Bool -fbCanGetSolid(PicturePtr pict) -{ - if (pict->pDrawable == NULL || - pict->pDrawable->width != 1 || - pict->pDrawable->height != 1) - { - return FALSE; - } - if (pict->repeat != RepeatNormal) - return FALSE; - - switch (pict->format) { - case PICT_a8r8g8b8: - case PICT_x8r8g8b8: - case PICT_a8b8g8r8: - case PICT_x8b8g8r8: - case PICT_b8g8r8a8: - case PICT_b8g8r8x8: - case PICT_r8g8b8: - case PICT_b8g8r8: - case PICT_r5g6b5: - case PICT_b5g6r5: - return TRUE; - default: - return FALSE; - } -} - -#define fbComposeGetSolid(pict, bits, fmt) { \ - FbBits *__bits__; \ - FbStride __stride__; \ - int __bpp__; \ - int __xoff__,__yoff__; \ -\ - fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ - switch (__bpp__) { \ - case 32: \ - (bits) = READ((CARD32 *) __bits__); \ - break; \ - case 24: \ - (bits) = Fetch24 ((CARD8 *) __bits__); \ - break; \ - case 16: \ - (bits) = READ((CARD16 *) __bits__); \ - (bits) = cvt0565to0888(bits); \ - break; \ - case 8: \ - (bits) = READ((CARD8 *) __bits__); \ - (bits) = (bits) << 24; \ - break; \ - case 1: \ - (bits) = READ((CARD32 *) __bits__); \ - (bits) = FbLeftStipBits((bits),1) ? 0xff000000 : 0x00000000;\ - break; \ - default: \ - return; \ - } \ - /* If necessary, convert RGB <--> BGR. */ \ - if (PICT_FORMAT_TYPE((pict)->format) != PICT_FORMAT_TYPE(fmt)) \ - { \ - (bits) = (((bits) & 0xff000000) | \ - (((bits) & 0x00ff0000) >> 16) | \ - (((bits) & 0x0000ff00) >> 0) | \ - (((bits) & 0x000000ff) << 16)); \ - } \ - /* manage missing src alpha */ \ - if ((pict)->pFormat->direct.alphaMask == 0) \ - (bits) |= 0xff000000; \ - fbFinishAccess ((pict)->pDrawable); \ -} - -#define fbComposeGetStart(pict,x,y,type,stride,line,mul) {\ - FbBits *__bits__; \ - FbStride __stride__; \ - int __bpp__; \ - int __xoff__,__yoff__; \ -\ - fbGetDrawable((pict)->pDrawable,__bits__,__stride__,__bpp__,__xoff__,__yoff__); \ - (stride) = __stride__ * sizeof (FbBits) / sizeof (type); \ - (line) = ((type *) __bits__) + (stride) * ((y) + __yoff__) + (mul) * ((x) + __xoff__); \ -} -#define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \ - (((s) >> 5) & 0x07e0) | \ - (((s) >> 8) & 0xf800)) -#define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \ - ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \ - ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000))) - -#if IMAGE_BYTE_ORDER == MSBFirst -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - ((READ(a) << 16) | READ((CARD16 *) ((a)+1))) : \ - ((READ((CARD16 *) (a)) << 8) | READ((a)+2))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (CARD8) ((v) >> 16)), \ - WRITE((CARD16 *) ((a)+1), (CARD16) (v))) : \ - (WRITE((CARD16 *) (a), (CARD16) ((v) >> 8)), \ - WRITE((a)+2, (CARD8) (v)))) -#else -#define Fetch24(a) ((unsigned long) (a) & 1 ? \ - (READ(a) | (READ((CARD16 *) ((a)+1)) << 8)) : \ - (READ((CARD16 *) (a)) | (READ((a)+2) << 16))) -#define Store24(a,v) ((unsigned long) (a) & 1 ? \ - (WRITE(a, (CARD8) (v)), \ - WRITE((CARD16 *) ((a)+1), (CARD16) ((v) >> 8))) : \ - (WRITE((CARD16 *) (a), (CARD16) (v)),\ - WRITE((a)+2, (CARD8) ((v) >> 16)))) -#endif - -/* - The methods below use some tricks to be able to do two color - components at the same time. -*/ - -/* - x_c = (x_c * a) / 255 -*/ -#define FbByteMul(x, a) do { \ - CARD32 t = ((x & 0xff00ff) * a) + 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - \ - x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \ - x = (x + ((x >> 8) & 0xff00ff)); \ - x &= 0xff00ff00; \ - x += t; \ - } while (0) - -/* - x_c = (x_c * a) / 255 + y -*/ -#define FbByteMulAdd(x, a, y) do { \ - CARD32 t = ((x & 0xff00ff) * a) + 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - t += y & 0xff00ff; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - \ - x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \ - x = (x + ((x >> 8) & 0xff00ff)) >> 8; \ - x &= 0xff00ff; \ - x += (y >> 8) & 0xff00ff; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x <<= 8; \ - x += t; \ - } while (0) - -/* - x_c = (x_c * a + y_c * b) / 255 -*/ -#define FbByteAddMul(x, a, y, b) do { \ - CARD32 t; \ - CARD32 r = (x >> 24) * a + (y >> 24) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - t = (x & 0xff00) * a + (y & 0xff00) * b; \ - t += (t >> 8) + 0x8000; \ - t >>= 16; \ - \ - t |= r << 16; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - t <<= 8; \ - \ - r = ((x >> 16) & 0xff) * a + ((y >> 16) & 0xff) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - x = (x & 0xff) * a + (y & 0xff) * b + 0x80; \ - x += (x >> 8); \ - x >>= 8; \ - x |= r << 16; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x |= t; \ -} while (0) - -/* - x_c = (x_c * a + y_c *b) / 256 -*/ -#define FbByteAddMul_256(x, a, y, b) do { \ - CARD32 t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; \ - t >>= 8; \ - t &= 0xff00ff; \ - \ - x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; \ - x &= 0xff00ff00; \ - x += t; \ -} while (0) -/* - x_c = (x_c * a_c) / 255 -*/ -#define FbByteMulC(x, a) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff) * (a & 0xff); \ - r |= (x & 0xff0000) * ((a >> 16) & 0xff); \ - r += 0x800080; \ - r = (r + ((r >> 8) & 0xff00ff)) >> 8; \ - r &= 0xff00ff; \ - \ - x >>= 8; \ - t = (x & 0xff) * ((a >> 8) & 0xff); \ - t |= (x & 0xff0000) * (a >> 24); \ - t += 0x800080; \ - t = t + ((t >> 8) & 0xff00ff); \ - x = r | (t & 0xff00ff00); \ - \ - } while (0) - -/* - x_c = (x_c * a) / 255 + y -*/ -#define FbByteMulAddC(x, a, y) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff) * (a & 0xff); \ - r |= (x & 0xff0000) * ((a >> 16) & 0xff); \ - r += 0x800080; \ - r = (r + ((r >> 8) & 0xff00ff)) >> 8; \ - r &= 0xff00ff; \ - r += y & 0xff00ff; \ - r |= 0x1000100 - ((r >> 8) & 0xff00ff); \ - r &= 0xff00ff; \ - \ - x >>= 8; \ - t = (x & 0xff) * ((a >> 8) & 0xff); \ - t |= (x & 0xff0000) * (a >> 24); \ - t += 0x800080; \ - t = (t + ((t >> 8) & 0xff00ff)) >> 8; \ - t &= 0xff00ff; \ - t += (y >> 8) & 0xff00ff; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - x = r | (t << 8); \ - } while (0) - -/* - x_c = (x_c * a_c + y_c * b) / 255 -*/ -#define FbByteAddMulC(x, a, y, b) do { \ - CARD32 t; \ - CARD32 r = (x >> 24) * (a >> 24) + (y >> 24) * b; \ - r += (r >> 8) + 0x80; \ - r >>= 8; \ - \ - t = (x & 0xff00) * ((a >> 8) & 0xff) + (y & 0xff00) * b; \ - t += (t >> 8) + 0x8000; \ - t >>= 16; \ - \ - t |= r << 16; \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - t &= 0xff00ff; \ - t <<= 8; \ - \ - r = ((x >> 16) & 0xff) * ((a >> 16) & 0xff) + ((y >> 16) & 0xff) * b + 0x80; \ - r += (r >> 8); \ - r >>= 8; \ - \ - x = (x & 0xff) * (a & 0xff) + (y & 0xff) * b + 0x80; \ - x += (x >> 8); \ - x >>= 8; \ - x |= r << 16; \ - x |= 0x1000100 - ((x >> 8) & 0xff00ff); \ - x &= 0xff00ff; \ - x |= t; \ - } while (0) - -/* - x_c = min(x_c + y_c, 255) -*/ -#define FbByteAdd(x, y) do { \ - CARD32 t; \ - CARD32 r = (x & 0xff00ff) + (y & 0xff00ff); \ - r |= 0x1000100 - ((r >> 8) & 0xff00ff); \ - r &= 0xff00ff; \ - \ - t = ((x >> 8) & 0xff00ff) + ((y >> 8) & 0xff00ff); \ - t |= 0x1000100 - ((t >> 8) & 0xff00ff); \ - r |= (t & 0xff00ff) << 8; \ - x = r; \ - } while (0) - -#define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8) - -#if defined(__i386__) && defined(__GNUC__) -#define FASTCALL __attribute__((regparm(3))) -#else -#define FASTCALL -#endif - -typedef struct _FbComposeData { - CARD8 op; - PicturePtr src; - PicturePtr mask; - PicturePtr dest; - INT16 xSrc; - INT16 ySrc; - INT16 xMask; - INT16 yMask; - INT16 xDest; - INT16 yDest; - CARD16 width; - CARD16 height; -} FbComposeData; - -extern _X_EXPORT void -fbCompositeRect (const FbComposeData *data, CARD32 *scanline_buffer); - -typedef FASTCALL void (*CombineMaskU) (CARD32 *src, const CARD32 *mask, int width); -typedef FASTCALL void (*CombineFuncU) (CARD32 *dest, const CARD32 *src, int width); -typedef FASTCALL void (*CombineFuncC) (CARD32 *dest, CARD32 *src, CARD32 *mask, int width); - -typedef struct _FbComposeFunctions { - CombineFuncU *combineU; - CombineFuncC *combineC; - CombineMaskU combineMaskU; -} FbComposeFunctions; - -/* fbcompose.c */ - -extern _X_EXPORT void -fbCompositeGeneral (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -/* fbpict.c */ -extern _X_EXPORT void -fbComposite (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -typedef void (*CompositeFunc) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height); - -extern _X_EXPORT void -fbWalkCompositeRegion (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, - INT16 yDst, - CARD16 width, - CARD16 height, - Bool srcRepeat, - Bool maskRepeat, - CompositeFunc compositeRect); - -/* fbtrap.c */ - -extern _X_EXPORT void -fbAddTraps (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntrap, - xTrap *traps); - -extern _X_EXPORT void -fbRasterizeTrapezoid (PicturePtr alpha, - xTrapezoid *trap, - int x_off, - int y_off); - -extern _X_EXPORT void -fbAddTriangles (PicturePtr pPicture, - INT16 xOff, - INT16 yOff, - int ntri, - xTriangle *tris); - -#endif /* _FBPICT_H_ */ +/*
+ *
+ * Copyright © 2000 Keith Packard, member of The XFree86 Project, 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _FBPICT_H_
+#define _FBPICT_H_
+
+/* fbpict.c */
+extern _X_EXPORT void
+fbComposite (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+/* fbtrap.c */
+
+extern _X_EXPORT void
+fbAddTraps (PicturePtr pPicture,
+ INT16 xOff,
+ INT16 yOff,
+ int ntrap,
+ xTrap *traps);
+
+extern _X_EXPORT void
+fbRasterizeTrapezoid (PicturePtr alpha,
+ xTrapezoid *trap,
+ int x_off,
+ int y_off);
+
+extern _X_EXPORT void
+fbAddTriangles (PicturePtr pPicture,
+ INT16 xOff,
+ INT16 yOff,
+ int ntri,
+ xTriangle *tris);
+
+#endif /* _FBPICT_H_ */
diff --git a/xorg-server/fb/fbtrap.c b/xorg-server/fb/fbtrap.c index 9f5c39f65..e52f84cd7 100644 --- a/xorg-server/fb/fbtrap.c +++ b/xorg-server/fb/fbtrap.c @@ -1,160 +1,159 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include "fb.h" - -#include "picturestr.h" -#include "mipict.h" -#include "renderedge.h" -#include "fbpict.h" - -void -fbAddTraps (PicturePtr pPicture, - INT16 x_off, - INT16 y_off, - int ntrap, - xTrap *traps) -{ - int image_xoff, image_yoff; - pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff); - - if (!image) - return; - - pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps); - - free_pixman_pict (pPicture, image); -} - -void -fbRasterizeTrapezoid (PicturePtr pPicture, - xTrapezoid *trap, - int x_off, - int y_off) -{ - int mask_xoff, mask_yoff; - pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff); - - if (!image) - return; - - pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off); - - free_pixman_pict (pPicture, image); -} - -static int -_GreaterY (xPointFixed *a, xPointFixed *b) -{ - if (a->y == b->y) - return a->x > b->x; - return a->y > b->y; -} - -/* - * Note that the definition of this function is a bit odd because - * of the X coordinate space (y increasing downwards). - */ -static int -_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b) -{ - xPointFixed ad, bd; - - ad.x = a->x - ref->x; - ad.y = a->y - ref->y; - bd.x = b->x - ref->x; - bd.y = b->y - ref->y; - - return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0; -} - -/* FIXME -- this could be made more efficient */ -void -fbAddTriangles (PicturePtr pPicture, - INT16 x_off, - INT16 y_off, - int ntri, - xTriangle *tris) -{ - xPointFixed *top, *left, *right, *tmp; - xTrapezoid trap; - - for (; ntri; ntri--, tris++) - { - top = &tris->p1; - left = &tris->p2; - right = &tris->p3; - if (_GreaterY (top, left)) { - tmp = left; left = top; top = tmp; - } - if (_GreaterY (top, right)) { - tmp = right; right = top; top = tmp; - } - if (_Clockwise (top, right, left)) { - tmp = right; right = left; left = tmp; - } - - /* - * Two cases: - * - * + + - * / \ / \ - * / \ / \ - * / + + \ - * / -- -- \ - * / -- -- \ - * / --- --- \ - * +-- --+ - */ - - trap.top = top->y; - trap.left.p1 = *top; - trap.left.p2 = *left; - trap.right.p1 = *top; - trap.right.p2 = *right; - if (right->y < left->y) - trap.bottom = right->y; - else - trap.bottom = left->y; - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - if (right->y < left->y) - { - trap.top = right->y; - trap.bottom = left->y; - trap.right.p1 = *right; - trap.right.p2 = *left; - } - else - { - trap.top = left->y; - trap.bottom = right->y; - trap.left.p1 = *left; - trap.left.p2 = *right; - } - fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off); - } -} - +/*
+ * Copyright © 2004 Keith Packard
+ *
+ * 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 Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD 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.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "fb.h"
+
+#include "picturestr.h"
+#include "mipict.h"
+#include "fbpict.h"
+
+void
+fbAddTraps (PicturePtr pPicture,
+ INT16 x_off,
+ INT16 y_off,
+ int ntrap,
+ xTrap *traps)
+{
+ int image_xoff, image_yoff;
+ pixman_image_t *image = image_from_pict (pPicture, FALSE, &image_xoff, &image_yoff);
+
+ if (!image)
+ return;
+
+ pixman_add_traps (image, x_off, y_off, ntrap, (pixman_trap_t *)traps);
+
+ free_pixman_pict (pPicture, image);
+}
+
+void
+fbRasterizeTrapezoid (PicturePtr pPicture,
+ xTrapezoid *trap,
+ int x_off,
+ int y_off)
+{
+ int mask_xoff, mask_yoff;
+ pixman_image_t *image = image_from_pict (pPicture, FALSE, &mask_xoff, &mask_yoff);
+
+ if (!image)
+ return;
+
+ pixman_rasterize_trapezoid (image, (pixman_trapezoid_t *)trap, x_off, y_off);
+
+ free_pixman_pict (pPicture, image);
+}
+
+static int
+_GreaterY (xPointFixed *a, xPointFixed *b)
+{
+ if (a->y == b->y)
+ return a->x > b->x;
+ return a->y > b->y;
+}
+
+/*
+ * Note that the definition of this function is a bit odd because
+ * of the X coordinate space (y increasing downwards).
+ */
+static int
+_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b)
+{
+ xPointFixed ad, bd;
+
+ ad.x = a->x - ref->x;
+ ad.y = a->y - ref->y;
+ bd.x = b->x - ref->x;
+ bd.y = b->y - ref->y;
+
+ return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0;
+}
+
+/* FIXME -- this could be made more efficient */
+void
+fbAddTriangles (PicturePtr pPicture,
+ INT16 x_off,
+ INT16 y_off,
+ int ntri,
+ xTriangle *tris)
+{
+ xPointFixed *top, *left, *right, *tmp;
+ xTrapezoid trap;
+
+ for (; ntri; ntri--, tris++)
+ {
+ top = &tris->p1;
+ left = &tris->p2;
+ right = &tris->p3;
+ if (_GreaterY (top, left)) {
+ tmp = left; left = top; top = tmp;
+ }
+ if (_GreaterY (top, right)) {
+ tmp = right; right = top; top = tmp;
+ }
+ if (_Clockwise (top, right, left)) {
+ tmp = right; right = left; left = tmp;
+ }
+
+ /*
+ * Two cases:
+ *
+ * + +
+ * / \ / \
+ * / \ / \
+ * / + + \
+ * / -- -- \
+ * / -- -- \
+ * / --- --- \
+ * +-- --+
+ */
+
+ trap.top = top->y;
+ trap.left.p1 = *top;
+ trap.left.p2 = *left;
+ trap.right.p1 = *top;
+ trap.right.p2 = *right;
+ if (right->y < left->y)
+ trap.bottom = right->y;
+ else
+ trap.bottom = left->y;
+ fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
+ if (right->y < left->y)
+ {
+ trap.top = right->y;
+ trap.bottom = left->y;
+ trap.right.p1 = *right;
+ trap.right.p2 = *left;
+ }
+ else
+ {
+ trap.top = left->y;
+ trap.bottom = right->y;
+ trap.left.p1 = *left;
+ trap.left.p2 = *right;
+ }
+ fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
+ }
+}
+
diff --git a/xorg-server/fb/wfbrename.h b/xorg-server/fb/wfbrename.h index 0d59811e1..d9aba7fb6 100644 --- a/xorg-server/fb/wfbrename.h +++ b/xorg-server/fb/wfbrename.h @@ -39,20 +39,6 @@ #define fbClearVisualTypes wfbClearVisualTypes
#define fbCloseScreen wfbCloseScreen
#define fbComposite wfbComposite
-#define fbCompositeGeneral wfbCompositeGeneral
-#define fbCompositeSolidMask_nx1xn wfbCompositeSolidMask_nx1xn
-#define fbCompositeSolidMask_nx8888x0565C wfbCompositeSolidMask_nx8888x0565C
-#define fbCompositeSolidMask_nx8888x8888C wfbCompositeSolidMask_nx8888x8888C
-#define fbCompositeSolidMask_nx8x0565 wfbCompositeSolidMask_nx8x0565
-#define fbCompositeSolidMask_nx8x0888 wfbCompositeSolidMask_nx8x0888
-#define fbCompositeSolidMask_nx8x8888 wfbCompositeSolidMask_nx8x8888
-#define fbCompositeSrc_0565x0565 wfbCompositeSrc_0565x0565
-#define fbCompositeSrc_8888x0565 wfbCompositeSrc_8888x0565
-#define fbCompositeSrc_8888x0888 wfbCompositeSrc_8888x0888
-#define fbCompositeSrc_8888x8888 wfbCompositeSrc_8888x8888
-#define fbCompositeSrcAdd_1000x1000 wfbCompositeSrcAdd_1000x1000
-#define fbCompositeSrcAdd_8000x8000 wfbCompositeSrcAdd_8000x8000
-#define fbCompositeSrcAdd_8888x8888 wfbCompositeSrcAdd_8888x8888
#define fbCopy1toN wfbCopy1toN
#define fbCopyArea wfbCopyArea
#define fbCopyNto1 wfbCopyNto1
@@ -149,7 +135,6 @@ #define fbPutXYImage wfbPutXYImage
#define fbPutZImage wfbPutZImage
#define fbQueryBestSize wfbQueryBestSize
-#define fbRasterizeEdges wfbRasterizeEdges
#define fbRasterizeTrapezoid wfbRasterizeTrapezoid
#define fbRealizeFont wfbRealizeFont
#define fbReduceRasterOp wfbReduceRasterOp
@@ -179,10 +164,8 @@ #define fbUnmapWindow wfbUnmapWindow
#define fbUnrealizeFont wfbUnrealizeFont
#define fbValidateGC wfbValidateGC
-#define fbWalkCompositeRegion wfbWalkCompositeRegion
#define fbWinPrivateKeyRec wfbWinPrivateKeyRec
#define fbZeroLine wfbZeroLine
#define fbZeroSegment wfbZeroSegment
#define free_pixman_pict wfb_free_pixman_pict
#define image_from_pict wfb_image_from_pict
-#define composeFunctions wfbComposeFunctions
diff --git a/xorg-server/glx/glxdri.c b/xorg-server/glx/glxdri.c index 2733cb856..99602bf66 100644 --- a/xorg-server/glx/glxdri.c +++ b/xorg-server/glx/glxdri.c @@ -837,9 +837,7 @@ static void __glXReportDamage(__DRIdrawable *driDraw, RegionInit(®ion, (BoxPtr) rects, num_rects);
RegionTranslate(®ion, pDraw->x, pDraw->y);
- DamageRegionAppend(pDraw, ®ion);
- /* This is wrong, this needs a seperate function. */
- DamageRegionProcessPending(pDraw);
+ DamageDamageRegion(pDraw, ®ion);
RegionUninit(®ion);
__glXleaveServer(GL_FALSE);
@@ -1163,9 +1161,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0) {
- if (screen->base.GLXextensions != NULL) {
- free(screen->base.GLXextensions);
- }
+ free(screen->base.GLXextensions);
screen->base.GLXextensions = xnfalloc(buffer_size);
(void) __glXGetExtensionString(screen->glx_enable_bits,
diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c index 45a1903e4..23a29cc55 100644 --- a/xorg-server/glx/glxdri2.c +++ b/xorg-server/glx/glxdri2.c @@ -792,9 +792,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) */
buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0) {
- if (screen->base.GLXextensions != NULL) {
- free(screen->base.GLXextensions);
- }
+ free(screen->base.GLXextensions);
screen->base.GLXextensions = xnfalloc(buffer_size);
(void) __glXGetExtensionString(screen->glx_enable_bits,
diff --git a/xorg-server/glx/single2.c b/xorg-server/glx/single2.c index d0f0c83bb..63a2a9d0e 100644 --- a/xorg-server/glx/single2.c +++ b/xorg-server/glx/single2.c @@ -350,9 +350,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) cl->GLClientextensions);
buf = __glXcombine_strings(buf1,
cx->pGlxScreen->GLextensions);
- if (buf1 != NULL) {
- free(buf1);
- }
+ free(buf1);
string = buf;
}
else if ( name == GL_VERSION ) {
@@ -381,8 +379,7 @@ int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap) __GLX_SEND_HEADER();
WriteToClient(client, length, (char *) string);
- if (buf != NULL)
- free(buf);
+ free(buf);
return Success;
}
diff --git a/xorg-server/hw/dmx/doc/dmx.xml b/xorg-server/hw/dmx/doc/dmx.xml index c7eaf1333..c998485bc 100644 --- a/xorg-server/hw/dmx/doc/dmx.xml +++ b/xorg-server/hw/dmx/doc/dmx.xml @@ -817,22 +817,10 @@ is called once for each input device. </para>
<para>Once input handles for core keyboard and core pointer devices have
-been obtained from AddInputDevice(), they are registered as core devices
-by calling RegisterPointerDevice() and RegisterKeyboardDevice(). Each
-of these should be called once. If both core devices are not
+been obtained from AddInputDevice(). If both core devices are not
registered, then the X server will exit with a fatal error when it
attempts to start the input devices in InitAndStartDevices(), which is
called directly after InitInput() (see below).
-
-<variablelist>
-<varlistentry>
-<term>Register{Pointer,Keyboard}Device()</term>
-<listitem><para>These DIX functions take a
-handle returned from AddInputDevice() and initialize the core input
-device fields in inputInfo, and initialize the input processing and grab
-functions for each core input device.
-</para></listitem></varlistentry>
-</variablelist>
</para>
<para>The core pointer device is then registered with the miPointer code
diff --git a/xorg-server/hw/dmx/glxProxy/glxcmds.c b/xorg-server/hw/dmx/glxProxy/glxcmds.c index f1893656f..26ffad825 100644 --- a/xorg-server/hw/dmx/glxProxy/glxcmds.c +++ b/xorg-server/hw/dmx/glxProxy/glxcmds.c @@ -2565,7 +2565,7 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc) cl->GLClientmajorVersion = req->major;
cl->GLClientminorVersion = req->minor;
- if (cl->GLClientextensions) free(cl->GLClientextensions);
+ free(cl->GLClientextensions);
buf = (const char *)(req+1);
cl->GLClientextensions = strdup(buf);
diff --git a/xorg-server/hw/dmx/glxProxy/glxext.c b/xorg-server/hw/dmx/glxProxy/glxext.c index 01cbd6e08..a90c14906 100644 --- a/xorg-server/hw/dmx/glxProxy/glxext.c +++ b/xorg-server/hw/dmx/glxProxy/glxext.c @@ -77,10 +77,10 @@ static void ResetClientState(int clientIndex) Display **keep_be_displays;
int i;
- if (cl->returnBuf) free(cl->returnBuf);
- if (cl->currentContexts) free(cl->currentContexts);
- if (cl->currentDrawables) free(cl->currentDrawables);
- if (cl->largeCmdBuf) free(cl->largeCmdBuf);
+ free(cl->returnBuf);
+ free(cl->currentContexts);
+ free(cl->currentDrawables);
+ free(cl->largeCmdBuf);
for (i=0; i< screenInfo.numScreens; i++) {
if (cl->be_displays[i])
@@ -97,7 +97,7 @@ static void ResetClientState(int clientIndex) */
cl->GLClientmajorVersion = 1;
cl->GLClientminorVersion = 0;
- if (cl->GLClientextensions) free(cl->GLClientextensions);
+ free(cl->GLClientextensions);
memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));
}
@@ -222,10 +222,10 @@ GLboolean __glXFreeContext(__GLXcontext *cx) {
if (cx->idExists || cx->isCurrent) return GL_FALSE;
- if (cx->feedbackBuf) free(cx->feedbackBuf);
- if (cx->selectBuf) free(cx->selectBuf);
- if (cx->real_ids) free(cx->real_ids);
- if (cx->real_vids) free(cx->real_vids);
+ free(cx->feedbackBuf);
+ free(cx->selectBuf);
+ free(cx->real_ids);
+ free(cx->real_vids);
if (cx->pGlxPixmap) {
/*
diff --git a/xorg-server/hw/dmx/input/dmxevents.c b/xorg-server/hw/dmx/input/dmxevents.c index dfa6bdad5..efcd07da3 100644 --- a/xorg-server/hw/dmx/input/dmxevents.c +++ b/xorg-server/hw/dmx/input/dmxevents.c @@ -1,795 +1,800 @@ -/* - * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina. - * - * All Rights Reserved. - * - * 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 on 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 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 - * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS - * 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. - */ - -/* - * Authors: - * Rickard E. (Rik) Faith <faith@redhat.com> - * - */ - -/** \file - * Provide support and helper functions for enqueing events received by - * the low-level input drivers. */ - -#ifdef HAVE_DMX_CONFIG_H -#include <dmx-config.h> -#endif - -#define DMX_EVENTS_DEBUG 0 - -#include "dmxinputinit.h" -#include "dmxevents.h" -#include "dmxcb.h" -#include "dmxcommon.h" -#include "dmxcursor.h" -#include "dmxmotion.h" -#include "dmxsigio.h" -#include "dmxmap.h" - -#include <X11/keysym.h> -#include "opaque.h" -#include "inputstr.h" -#include "mipointer.h" -#include "mi.h" -#include "exglobals.h" - -#include "xkbsrv.h" -#include "XIstubs.h" - -static int dmxGlobalX, dmxGlobalY; /* Global cursor position */ -static int dmxGlobalInvalid; /* Flag indicating dmxCoreMotion - * should move the mouse anyway. */ - -#if DMX_EVENTS_DEBUG -#define DMXDBG0(f) dmxLog(dmxDebug,f) -#define DMXDBG1(f,a) dmxLog(dmxDebug,f,a) -#define DMXDBG2(f,a,b) dmxLog(dmxDebug,f,a,b) -#define DMXDBG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c) -#define DMXDBG4(f,a,b,c,d) dmxLog(dmxDebug,f,a,b,c,d) -#define DMXDBG5(f,a,b,c,d,e) dmxLog(dmxDebug,f,a,b,c,d,e) -#define DMXDBG6(f,a,b,c,d,e,g) dmxLog(dmxDebug,f,a,b,c,d,e,g) -#define DMXDBG7(f,a,b,c,d,e,g,h) dmxLog(dmxDebug,f,a,b,c,d,e,g,h) -#else -#define DMXDBG0(f) -#define DMXDBG1(f,a) -#define DMXDBG2(f,a,b) -#define DMXDBG3(f,a,b,c) -#define DMXDBG4(f,a,b,c,d) -#define DMXDBG5(f,a,b,c,d,e) -#define DMXDBG6(f,a,b,c,d,e,g) -#define DMXDBG7(f,a,b,c,d,e,g,h) -#endif - -static int dmxApplyFunctions(DMXInputInfo *dmxInput, DMXFunctionType f) -{ - int i; - int rc = 0; - - for (i = 0; i < dmxInput->numDevs; i+= dmxInput->devs[i]->binding) - if (dmxInput->devs[i]->functions) - rc += dmxInput->devs[i]->functions(dmxInput->devs[i]->private, f); - return rc; -} - -static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal, - int type, - KeySym keySym) -{ - DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]; - -#if 1 /* hack to detect ctrl-alt-q, etc */ - static int ctrl = 0, alt = 0; - /* keep track of ctrl/alt key status */ - if (type == KeyPress && keySym == 0xffe3) { - ctrl = 1; - } - else if (type == KeyRelease && keySym == 0xffe3) { - ctrl = 0; - } - else if (type == KeyPress && keySym == 0xffe9) { - alt = 1; - } - else if (type == KeyRelease && keySym == 0xffe9) { - alt = 0; - } - if (!ctrl || !alt) - return 0; -#else - unsigned short state = 0; - - if (dmxLocal->sendsCore) - state = dmxLocalCoreKeyboard->pDevice->key->state; - else if (dmxLocal->pDevice->key) - state = dmxLocal->pDevice->key->state; - - DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n", - keySym, type == KeyPress ? "press" : "release", state); - - if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) - return 0; -#endif - - switch (keySym) { - case XK_g: - if (type == KeyPress) - dmxApplyFunctions(dmxInput, DMX_FUNCTION_GRAB); - return 1; - case XK_f: - if (type == KeyPress) - dmxApplyFunctions(dmxInput, DMX_FUNCTION_FINE); - return 1; - case XK_q: - if (type == KeyPress && dmxLocal->sendsCore) - if (dmxApplyFunctions(dmxInput, DMX_FUNCTION_TERMINATE)) { - dmxLog(dmxInfo, "User request for termination\n"); - dispatchException |= DE_TERMINATE; - } - return 1; - } - - return 0; -} - - -DMXScreenInfo *dmxFindFirstScreen(int x, int y) -{ - int i; - - for (i = 0; i < dmxNumScreens; i++) { - DMXScreenInfo *dmxScreen = &dmxScreens[i]; - if (dmxOnScreen(x, y, dmxScreen)) - return dmxScreen; - } - return NULL; -} - - -/** - * Enqueue a motion event. - */ -static void enqueueMotion(DevicePtr pDev, int x, int y) -{ - GETDMXLOCALFROMPDEV; - DeviceIntPtr p = dmxLocal->pDevice; - int i, nevents, valuators[3]; - EventListPtr events; - int detail = 0; /* XXX should this be mask of pressed buttons? */ - valuators[0] = x; - valuators[1] = y; - - GetEventList(&events); - nevents = GetPointerEvents(events, p, MotionNotify, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); - return; -} - - -void -dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block) -{ - DMXScreenInfo *dmxScreen; - DMXInputInfo *dmxInput; - ScreenPtr pScreen; - int localX; - int localY; - int i; - - if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y) - return; - - DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n", - x, y, delta, dmxGlobalX, dmxGlobalY); - - dmxGlobalInvalid = 0; - dmxGlobalX = x; - dmxGlobalY = y; - - if (dmxGlobalX < 0) - dmxGlobalX = 0; - if (dmxGlobalY < 0) - dmxGlobalY = 0; - if (dmxGlobalX >= dmxGlobalWidth) - dmxGlobalX = dmxGlobalWidth + delta -1; - if (dmxGlobalY >= dmxGlobalHeight) - dmxGlobalY = dmxGlobalHeight + delta -1; - - if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) { - localX = dmxGlobalX - dmxScreen->rootXOrigin; - localY = dmxGlobalY - dmxScreen->rootYOrigin; - if ((pScreen = miPointerGetScreen(inputInfo.pointer)) - && pScreen->myNum == dmxScreen->index) { - /* Screen is old screen */ - if (block) - dmxSigioBlock(); - if (pDev) - enqueueMotion(pDev, localX, localY); - if (block) - dmxSigioUnblock(); - } else { - /* Screen is new */ - DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n", - pScreen->myNum, dmxScreen->index, localX, localY); - if (block) - dmxSigioBlock(); - mieqProcessInputEvents(); - miPointerSetScreen(inputInfo.pointer, dmxScreen->index, - localX, localY); - if (pDev) - enqueueMotion(pDev, localX, localY); - if (block) - dmxSigioUnblock(); - } -#if 00 - miPointerGetPosition(inputInfo.pointer, &localX, &localY); - - if ((pScreen = miPointerGetScreen(inputInfo.pointer))) { - dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin; - dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin; - ErrorF("Global is now %d, %d %d, %d\n", dmxGlobalX, dmxGlobalY, - localX, localY); - DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d" - " on screen index=%d/%d localX=%d localY=%d\n", - dmxGlobalX, dmxGlobalY, - dmxScreen ? dmxScreen->index : -1, pScreen->myNum, - localX, localY); - } -#endif - } - /* Send updates down to all core input - * drivers */ - for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) { - int j; - for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding) - if (!dmxInput->detached - && dmxInput->devs[j]->sendsCore - && dmxInput->devs[j]->update_position) - dmxInput->devs[j]->update_position(dmxInput->devs[j]->private, - dmxGlobalX, dmxGlobalY); - } - if (!dmxScreen) ProcessInputEvents(); -} - - - -#define DMX_MAX_AXES 32 /* Max axes reported by this routine */ -static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, - int *v, int firstAxis, int axesCount, - DMXMotionType type, DMXBlockType block) -{ - DeviceIntPtr pDevice = dmxLocal->pDevice; - xEvent xE[2 * DMX_MAX_AXES/6]; - deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *)xE; - deviceValuator *xv = (deviceValuator *)xev+1; - int thisX = 0; - int thisY = 0; - int i; - int count; - EventListPtr events; - int nevents; - - memset(xE, 0, sizeof(xE)); - - if (axesCount > DMX_MAX_AXES) axesCount = DMX_MAX_AXES; - - if (!pDevice->valuator->mode && axesCount == 2) { - /* The dmx console is a relative mode - * device that sometimes reports - * absolute motion. It only has two - * axes. */ - if (type == DMX_RELATIVE) { - thisX = -v[0]; - thisY = -v[1]; - dmxLocal->lastX += thisX; - dmxLocal->lastY += thisY; - if (dmxLocal->update_position) - dmxLocal->update_position(dmxLocal->private, - dmxLocal->lastX, dmxLocal->lastY); - } else { /* Convert to relative */ - if (dmxLocal->lastX || dmxLocal->lastY) { - thisX = v[0] - dmxLocal->lastX; - thisY = v[1] - dmxLocal->lastY; - } - dmxLocal->lastX = v[0]; - dmxLocal->lastY = v[1]; - } - v[0] = thisX; - v[1] = thisY; - } - - if (axesCount <= 6) { - /* Optimize for the common case when - * only 1 or 2 axes change. */ - xev->time = GetTimeInMillis(); - xev->type = DeviceMotionNotify; - xev->detail = 0; - xev->deviceid = pDevice->id | MORE_EVENTS; - - xv->type = DeviceValuator; - xv->deviceid = pDevice->id; - xv->num_valuators = axesCount; - xv->first_valuator = firstAxis; - switch (xv->num_valuators) { - case 6: xv->valuator5 = v[5]; - case 5: xv->valuator4 = v[4]; - case 4: xv->valuator3 = v[3]; - case 3: xv->valuator2 = v[2]; - case 2: xv->valuator1 = v[1]; - case 1: xv->valuator0 = v[0]; - } - count = 2; - } else { - for (i = 0, count = 0; i < axesCount; i += 6) { - xev->time = GetTimeInMillis(); - xev->type = DeviceMotionNotify; - xev->detail = 0; - xev->deviceid = pDevice->id | MORE_EVENTS; - xev += 2; - - xv->type = DeviceValuator; - xv->deviceid = pDevice->id; - xv->num_valuators = (i+6 >= axesCount ? axesCount - i : 6); - xv->first_valuator = firstAxis + i; - switch (xv->num_valuators) { - case 6: xv->valuator5 = v[i+5]; - case 5: xv->valuator4 = v[i+4]; - case 4: xv->valuator3 = v[i+3]; - case 3: xv->valuator2 = v[i+2]; - case 2: xv->valuator1 = v[i+1]; - case 1: xv->valuator0 = v[i+0]; - } - xv += 2; - count += 2; - } - } - - if (block) - dmxSigioBlock(); - GetEventList(&events); - nevents = GetPointerEvents(events, pDevice, MotionNotify, 0, POINTER_ABSOLUTE, - firstAxis, axesCount, v); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - - if (block) - dmxSigioUnblock(); -} - -static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, - XEvent *e, DMXBlockType block) -{ - int type; - int event = -1; - XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e; - XDeviceMotionEvent *me = (XDeviceMotionEvent *)e; - DeviceIntPtr pDevice = dmxLocal->pDevice; - int valuators[6]; - EventListPtr events; - int nevents, i; - - if (!e) - return -1; /* No extended event passed, cannot handle */ - - if ((XID)dmxLocal->deviceId != ke->deviceid) { - /* Search for the correct dmxLocal, - * since backend and console events are - * picked up for the first device on - * that X server. */ - int i; - DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx]; - for (i = 0; i < dmxInput->numDevs; i++) { - dmxLocal = dmxInput->devs[i]; - if ((XID)dmxLocal->deviceId == ke->deviceid) - break; - } - } - - if ((XID)dmxLocal->deviceId != ke->deviceid - || (type = dmxMapLookup(dmxLocal, e->type)) < 0) - return -1; /* No mapping, so this event is unhandled */ - - switch (type) { - case XI_DeviceValuator: event = DeviceValuator; break; - case XI_DeviceKeyPress: event = KeyPress; break; - case XI_DeviceKeyRelease: event = KeyRelease; break; - case XI_DeviceButtonPress: event = ButtonPress; break; - case XI_DeviceButtonRelease: event = ButtonRelease; break; - case XI_DeviceMotionNotify: event = MotionNotify; break; - case XI_DeviceFocusIn: event = DeviceFocusIn; break; - case XI_DeviceFocusOut: event = DeviceFocusOut; break; - case XI_ProximityIn: event = ProximityIn; break; - case XI_ProximityOut: event = ProximityOut; break; - case XI_DeviceStateNotify: event = DeviceStateNotify; break; - case XI_DeviceMappingNotify: event = DeviceMappingNotify; break; - case XI_ChangeDeviceNotify: event = ChangeDeviceNotify; break; - case XI_DeviceKeystateNotify: event = DeviceStateNotify; break; - case XI_DeviceButtonstateNotify: event = DeviceStateNotify; break; - } - -#define EXTRACT_VALUATORS(ke, valuators) \ - valuators[0] = ke->axis_data[0]; \ - valuators[1] = ke->axis_data[1]; \ - valuators[2] = ke->axis_data[2]; \ - valuators[3] = ke->axis_data[3]; \ - valuators[4] = ke->axis_data[4]; \ - valuators[5] = ke->axis_data[5]; \ - - switch (type) { - case XI_DeviceKeyPress: - case XI_DeviceKeyRelease: - EXTRACT_VALUATORS(ke, valuators); - if (block) - dmxSigioBlock(); - GetEventList(&events); - nevents = GetKeyboardValuatorEvents(events, pDevice, event, - ke->keycode, ke->first_axis, - ke->axes_count, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - - if (block) - dmxSigioUnblock(); - break; - case XI_DeviceButtonPress: - case XI_DeviceButtonRelease: - EXTRACT_VALUATORS(ke, valuators); - if (block) - dmxSigioBlock(); - GetEventList(&events); - nevents = GetPointerEvents(events, pDevice, event, ke->keycode, - POINTER_ABSOLUTE, ke->first_axis, - ke->axes_count, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - - if (block) - dmxSigioUnblock(); - break; - case XI_ProximityIn: - case XI_ProximityOut: - EXTRACT_VALUATORS(ke, valuators); - if (block) - dmxSigioBlock(); - GetEventList(&events); - nevents = GetProximityEvents(events, pDevice, event, - ke->first_axis, ke->axes_count, - valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event); - - if (block) - dmxSigioUnblock(); - break; - - break; - - case XI_DeviceMotionNotify: - dmxExtMotion(dmxLocal, me->axis_data, me->first_axis, me->axes_count, - DMX_ABSOLUTE, block); - break; - case XI_DeviceFocusIn: - case XI_DeviceFocusOut: - case XI_DeviceStateNotify: - case XI_DeviceMappingNotify: - case XI_ChangeDeviceNotify: - case XI_DeviceKeystateNotify: - case XI_DeviceButtonstateNotify: - /* These are ignored, since DMX will - * generate its own events of these - * types, as necessary. - - * Perhaps ChangeDeviceNotify should - * generate an error, because it is - * unexpected? */ - break; - case XI_DeviceValuator: - default: - dmxLog(dmxWarning, - "XInput extension event (remote=%d -> zero-based=%d)" - " not supported yet\n", e->type, type); - return -1; - } - return 0; -} - -static int dmxGetButtonMapping(DMXLocalInputInfoPtr dmxLocal, int button) -{ - ButtonClassPtr b = dmxLocal->pDevice->button; - - if (button > b->numButtons) { /* This shouldn't happen. */ - dmxLog(dmxWarning, "Button %d pressed, but only %d buttons?!?\n", - button, b->numButtons); - return button; - } - return b->map[button]; -} - -/** Return DMX's notion of the pointer position in the global coordinate - * space. */ -void dmxGetGlobalPosition(int *x, int *y) -{ - *x = dmxGlobalX; - *y = dmxGlobalY; -} - -/** Invalidate the global position for #dmxCoreMotion. */ -void dmxInvalidateGlobalPosition(void) -{ - dmxGlobalInvalid = 1; -} - -/** Enqueue a motion event for \a pDev. The \a v vector has length \a - * axesCount, and contains values for each of the axes, starting at \a - * firstAxes. - * - * The \a type of the motion may be \a DMX_RELATIVE, \a DMX_ABSOLUTE, or - * \a DMX_ABSOLUTE_CONFINED (in the latter case, the pointer will not be - * allowed to move outside the global boundaires). - * - * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be - * blocked around calls to \a enqueueMotion(). */ -void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount, - DMXMotionType type, DMXBlockType block) -{ - GETDMXLOCALFROMPDEV; - - if (!dmxLocal->sendsCore) { - dmxExtMotion(dmxLocal, v, firstAxes, axesCount, type, block); - return; - } - if (axesCount == 2) { - switch (type) { - case DMX_RELATIVE: - dmxCoreMotion(pDev, dmxGlobalX - v[0], dmxGlobalY - v[1], 0, block); - break; - case DMX_ABSOLUTE: - dmxCoreMotion(pDev, v[0], v[1], 0, block); - break; - case DMX_ABSOLUTE_CONFINED: - dmxCoreMotion(pDev, v[0], v[1], -1, block); - break; - } - } -} - -static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal, - KeyCode keyCode) -{ - KeySym keysym = NoSymbol; - int effectiveGroup; - XkbSrvInfoPtr xkbi; - - if (!dmxLocal || !dmxLocal->pDevice || !dmxLocal->pDevice->key) - goto out; - - xkbi = dmxLocal->pDevice->key->xkbInfo; - effectiveGroup = XkbGetEffectiveGroup(xkbi, &xkbi->state, keyCode); - - if (effectiveGroup == -1) - goto out; - - keysym = XkbKeySym(xkbi->desc, keyCode, effectiveGroup); - DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n", - keyCode, keysym); - -out: - return keysym; -} - -static KeyCode dmxKeySymToKeyCode(DMXLocalInputInfoPtr dmxLocal, KeySym keySym, - int tryFirst) -{ - /* FIXME: this is quite ineffective, converting to a core map first and - * then extracting the info from there. It'd be better to run the actual - * xkb map */ - XkbSrvInfoPtr xkbi = dmxLocal->pDevice->key->xkbInfo; - KeySymsPtr pKeySyms = XkbGetCoreMap(dmxLocal->pDevice); - int i; - - /* Optimize for similar maps */ - if (XkbKeycodeInRange(xkbi->desc, tryFirst) - && pKeySyms->map[(tryFirst - xkbi->desc->min_key_code) - * pKeySyms->mapWidth] == keySym) - return tryFirst; - - for (i = pKeySyms->minKeyCode; i <= pKeySyms->maxKeyCode; i++) { - if (pKeySyms->map[(i - pKeySyms->minKeyCode) - * pKeySyms->mapWidth] == keySym) { - DMXDBG3("dmxKeySymToKeyCode: Translated keySym=0x%04x to" - " keyCode=%d (reverses to core keySym=0x%04x)\n", - keySym, i, dmxKeyCodeToKeySym(dmxLocalCoreKeyboard,i)); - return i; - } - } - return 0; -} - -static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym) -{ - GETDMXLOCALFROMPDEV; - int keyCode; - - if (!dmxLocal->pDevice->key) { - dmxLog(dmxWarning, "dmxFixup: not a keyboard device (%s)\n", - dmxLocal->pDevice->name); - return NoSymbol; - } - if (!keySym) - keySym = dmxKeyCodeToKeySym(dmxLocal, detail); - if (keySym == NoSymbol) - return detail; - keyCode = dmxKeySymToKeyCode(dmxLocalCoreKeyboard, keySym, detail); - - return keyCode ? keyCode : detail; -} - -/** Enqueue an event from the \a pDev device with the - * specified \a type and \a detail. If the event is a KeyPress or - * KeyRelease event, then the \a keySym is also specified. - * - * FIXME: make the code do what the comment says, or remove this comment. - * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be - * blocked around calls to dmxeqEnqueue(). */ - -void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, - XEvent *e, DMXBlockType block) -{ - GETDMXINPUTFROMPDEV; - xEvent xE; - DeviceIntPtr p = dmxLocal->pDevice; - int i, nevents, valuators[3]; - EventListPtr events; - - DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail); - - switch (type) { - case KeyPress: - case KeyRelease: - if (!keySym) - keySym = dmxKeyCodeToKeySym(dmxLocal, detail); - if (dmxCheckFunctionKeys(dmxLocal, type, keySym)) - return; - if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard) - xE.u.u.detail = dmxFixup(pDev, detail, keySym); - - GetEventList(&events); - /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/ - nevents = GetKeyboardEvents(events, p, type, detail); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); - return; - - case ButtonPress: - case ButtonRelease: - detail = dmxGetButtonMapping(dmxLocal, detail); - GetEventList(&events); - nevents = GetPointerEvents(events, p, type, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, - 0, /* first_valuator = 0 */ - 0, /* num_valuators = 0 */ - valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); - return; - - case MotionNotify: - GetEventList(&events); - valuators[0] = e->xmotion.x; - valuators[1] = e->xmotion.y; - valuators[2] = e->xmotion.state; /* FIXME: WTF?? */ - nevents = GetPointerEvents(events, p, type, detail, - POINTER_ABSOLUTE | POINTER_SCREEN, 0, 3, valuators); - for (i = 0; i < nevents; i++) - mieqEnqueue(p, (InternalEvent*)(events + i)->event); - return; - - case EnterNotify: - case LeaveNotify: - case KeymapNotify: - case MappingNotify: /* This is sent because we change the - * modifier map on the backend/console - * input device so that we have complete - * control of the input device LEDs. */ - return; - default: - if (type == ProximityIn || type == ProximityOut) { - if (dmxLocal->sendsCore) - return; /* Not a core event */ - break; - } - if (type >= LASTEvent) { - if (dmxTranslateAndEnqueueExtEvent(dmxLocal, e, block)) - dmxLogInput(dmxInput, "Unhandled extension event: %d\n", type); - } else { - dmxLogInput(dmxInput, "Unhandled event: %d (%s)\n", - type, dmxEventName(type)); - } - return; - } - -} - -/** A pointer to this routine is passed to low-level input drivers so - * that all special keychecking is unified to this file. This function - * returns 0 if no special keys have been pressed. If the user has - * requested termination of the DMX server, -1 is returned. If the user - * has requested a switch to a VT, then the (1-based) number of that VT - * is returned. */ -int dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym) -{ - GETDMXINPUTFROMPDEV; - int vt = 0; - unsigned short state = 0; - - if (dmxLocal->sendsCore) - state = XkbStateFieldFromRec(&dmxLocalCoreKeyboard->pDevice->key->xkbInfo->state); - else if (dmxLocal->pDevice->key) - state = XkbStateFieldFromRec(&dmxLocal->pDevice->key->xkbInfo->state); - - if (!dmxLocal->sendsCore) return 0; /* Only for core devices */ - - DMXDBG2("dmxCheckSpecialKeys: keySym=0x%04x state=0x%04x\n", keySym,state); - - if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) return 0; - - switch (keySym) { - case XK_F1: - case XK_F2: - case XK_F3: - case XK_F4: - case XK_F5: - case XK_F6: - case XK_F7: - case XK_F8: - case XK_F9: - case XK_F10: - vt = keySym - XK_F1 + 1; - break; - - case XK_F11: - case XK_F12: - vt = keySym - XK_F11 + 11; - break; - - case XK_q: /* To avoid confusion */ - case XK_BackSpace: - case XK_Delete: - case XK_KP_Delete: - dmxLog(dmxInfo, "User request for termination\n"); - dispatchException |= DE_TERMINATE; - return -1; /* Terminate */ - } - - if (vt) { - dmxLog(dmxInfo, "Request to switch to VT %d\n", vt); - dmxInput->vt_switch_pending = vt; - return vt; - } - - return 0; /* Do nothing */ -} +/*
+ * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * 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 on 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 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
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * 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.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ * Provide support and helper functions for enqueing events received by
+ * the low-level input drivers. */
+
+#ifdef HAVE_DMX_CONFIG_H
+#include <dmx-config.h>
+#endif
+
+#define DMX_EVENTS_DEBUG 0
+
+#include "dmxinputinit.h"
+#include "dmxevents.h"
+#include "dmxcb.h"
+#include "dmxcommon.h"
+#include "dmxcursor.h"
+#include "dmxmotion.h"
+#include "dmxsigio.h"
+#include "dmxmap.h"
+
+#include <X11/keysym.h>
+#include "opaque.h"
+#include "inputstr.h"
+#include "inpututils.h"
+#include "mipointer.h"
+#include "mi.h"
+#include "exglobals.h"
+
+#include "xkbsrv.h"
+#include "XIstubs.h"
+
+static int dmxGlobalX, dmxGlobalY; /* Global cursor position */
+static int dmxGlobalInvalid; /* Flag indicating dmxCoreMotion
+ * should move the mouse anyway. */
+
+#if DMX_EVENTS_DEBUG
+#define DMXDBG0(f) dmxLog(dmxDebug,f)
+#define DMXDBG1(f,a) dmxLog(dmxDebug,f,a)
+#define DMXDBG2(f,a,b) dmxLog(dmxDebug,f,a,b)
+#define DMXDBG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c)
+#define DMXDBG4(f,a,b,c,d) dmxLog(dmxDebug,f,a,b,c,d)
+#define DMXDBG5(f,a,b,c,d,e) dmxLog(dmxDebug,f,a,b,c,d,e)
+#define DMXDBG6(f,a,b,c,d,e,g) dmxLog(dmxDebug,f,a,b,c,d,e,g)
+#define DMXDBG7(f,a,b,c,d,e,g,h) dmxLog(dmxDebug,f,a,b,c,d,e,g,h)
+#else
+#define DMXDBG0(f)
+#define DMXDBG1(f,a)
+#define DMXDBG2(f,a,b)
+#define DMXDBG3(f,a,b,c)
+#define DMXDBG4(f,a,b,c,d)
+#define DMXDBG5(f,a,b,c,d,e)
+#define DMXDBG6(f,a,b,c,d,e,g)
+#define DMXDBG7(f,a,b,c,d,e,g,h)
+#endif
+
+static int dmxApplyFunctions(DMXInputInfo *dmxInput, DMXFunctionType f)
+{
+ int i;
+ int rc = 0;
+
+ for (i = 0; i < dmxInput->numDevs; i+= dmxInput->devs[i]->binding)
+ if (dmxInput->devs[i]->functions)
+ rc += dmxInput->devs[i]->functions(dmxInput->devs[i]->private, f);
+ return rc;
+}
+
+static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
+ int type,
+ KeySym keySym)
+{
+ DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
+
+#if 1 /* hack to detect ctrl-alt-q, etc */
+ static int ctrl = 0, alt = 0;
+ /* keep track of ctrl/alt key status */
+ if (type == KeyPress && keySym == 0xffe3) {
+ ctrl = 1;
+ }
+ else if (type == KeyRelease && keySym == 0xffe3) {
+ ctrl = 0;
+ }
+ else if (type == KeyPress && keySym == 0xffe9) {
+ alt = 1;
+ }
+ else if (type == KeyRelease && keySym == 0xffe9) {
+ alt = 0;
+ }
+ if (!ctrl || !alt)
+ return 0;
+#else
+ unsigned short state = 0;
+
+ if (dmxLocal->sendsCore)
+ state = dmxLocalCoreKeyboard->pDevice->key->state;
+ else if (dmxLocal->pDevice->key)
+ state = dmxLocal->pDevice->key->state;
+
+ DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n",
+ keySym, type == KeyPress ? "press" : "release", state);
+
+ if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask))
+ return 0;
+#endif
+
+ switch (keySym) {
+ case XK_g:
+ if (type == KeyPress)
+ dmxApplyFunctions(dmxInput, DMX_FUNCTION_GRAB);
+ return 1;
+ case XK_f:
+ if (type == KeyPress)
+ dmxApplyFunctions(dmxInput, DMX_FUNCTION_FINE);
+ return 1;
+ case XK_q:
+ if (type == KeyPress && dmxLocal->sendsCore)
+ if (dmxApplyFunctions(dmxInput, DMX_FUNCTION_TERMINATE)) {
+ dmxLog(dmxInfo, "User request for termination\n");
+ dispatchException |= DE_TERMINATE;
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+
+DMXScreenInfo *dmxFindFirstScreen(int x, int y)
+{
+ int i;
+
+ for (i = 0; i < dmxNumScreens; i++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+ if (dmxOnScreen(x, y, dmxScreen))
+ return dmxScreen;
+ }
+ return NULL;
+}
+
+
+/**
+ * Enqueue a motion event.
+ */
+static void enqueueMotion(DevicePtr pDev, int x, int y)
+{
+ GETDMXLOCALFROMPDEV;
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ EventListPtr events;
+ int detail = 0; /* XXX should this be mask of pressed buttons? */
+ ValuatorMask mask;
+ valuators[0] = x;
+ valuators[1] = y;
+
+ valuator_mask_set_range(&mask, 0, 2, valuators);
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, p, MotionNotify, detail,
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, (InternalEvent*)(events + i)->event);
+ return;
+}
+
+
+void
+dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
+{
+ DMXScreenInfo *dmxScreen;
+ DMXInputInfo *dmxInput;
+ ScreenPtr pScreen;
+ int localX;
+ int localY;
+ int i;
+
+ if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y)
+ return;
+
+ DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
+ x, y, delta, dmxGlobalX, dmxGlobalY);
+
+ dmxGlobalInvalid = 0;
+ dmxGlobalX = x;
+ dmxGlobalY = y;
+
+ if (dmxGlobalX < 0)
+ dmxGlobalX = 0;
+ if (dmxGlobalY < 0)
+ dmxGlobalY = 0;
+ if (dmxGlobalX >= dmxGlobalWidth)
+ dmxGlobalX = dmxGlobalWidth + delta -1;
+ if (dmxGlobalY >= dmxGlobalHeight)
+ dmxGlobalY = dmxGlobalHeight + delta -1;
+
+ if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
+ localX = dmxGlobalX - dmxScreen->rootXOrigin;
+ localY = dmxGlobalY - dmxScreen->rootYOrigin;
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))
+ && pScreen->myNum == dmxScreen->index) {
+ /* Screen is old screen */
+ if (block)
+ dmxSigioBlock();
+ if (pDev)
+ enqueueMotion(pDev, localX, localY);
+ if (block)
+ dmxSigioUnblock();
+ } else {
+ /* Screen is new */
+ DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n",
+ pScreen->myNum, dmxScreen->index, localX, localY);
+ if (block)
+ dmxSigioBlock();
+ mieqProcessInputEvents();
+ miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
+ localX, localY);
+ if (pDev)
+ enqueueMotion(pDev, localX, localY);
+ if (block)
+ dmxSigioUnblock();
+ }
+#if 00
+ miPointerGetPosition(inputInfo.pointer, &localX, &localY);
+
+ if ((pScreen = miPointerGetScreen(inputInfo.pointer))) {
+ dmxGlobalX = localX + dmxScreens[pScreen->myNum].rootXOrigin;
+ dmxGlobalY = localY + dmxScreens[pScreen->myNum].rootYOrigin;
+ ErrorF("Global is now %d, %d %d, %d\n", dmxGlobalX, dmxGlobalY,
+ localX, localY);
+ DMXDBG6(" Moved to dmxGlobalX=%d dmxGlobalY=%d"
+ " on screen index=%d/%d localX=%d localY=%d\n",
+ dmxGlobalX, dmxGlobalY,
+ dmxScreen ? dmxScreen->index : -1, pScreen->myNum,
+ localX, localY);
+ }
+#endif
+ }
+ /* Send updates down to all core input
+ * drivers */
+ for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
+ int j;
+ for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding)
+ if (!dmxInput->detached
+ && dmxInput->devs[j]->sendsCore
+ && dmxInput->devs[j]->update_position)
+ dmxInput->devs[j]->update_position(dmxInput->devs[j]->private,
+ dmxGlobalX, dmxGlobalY);
+ }
+ if (!dmxScreen) ProcessInputEvents();
+}
+
+
+
+#define DMX_MAX_AXES 32 /* Max axes reported by this routine */
+static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
+ int *v, int firstAxis, int axesCount,
+ DMXMotionType type, DMXBlockType block)
+{
+ DeviceIntPtr pDevice = dmxLocal->pDevice;
+ xEvent xE[2 * DMX_MAX_AXES/6];
+ deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *)xE;
+ deviceValuator *xv = (deviceValuator *)xev+1;
+ int thisX = 0;
+ int thisY = 0;
+ int i;
+ int count;
+ EventListPtr events;
+ int nevents;
+ ValuatorMask mask;
+
+ memset(xE, 0, sizeof(xE));
+
+ if (axesCount > DMX_MAX_AXES) axesCount = DMX_MAX_AXES;
+
+ if ((valuator_get_mode(pDevice,0) == Relative) && axesCount == 2) {
+ /* The dmx console is a relative mode
+ * device that sometimes reports
+ * absolute motion. It only has two
+ * axes. */
+ if (type == DMX_RELATIVE) {
+ thisX = -v[0];
+ thisY = -v[1];
+ dmxLocal->lastX += thisX;
+ dmxLocal->lastY += thisY;
+ if (dmxLocal->update_position)
+ dmxLocal->update_position(dmxLocal->private,
+ dmxLocal->lastX, dmxLocal->lastY);
+ } else { /* Convert to relative */
+ if (dmxLocal->lastX || dmxLocal->lastY) {
+ thisX = v[0] - dmxLocal->lastX;
+ thisY = v[1] - dmxLocal->lastY;
+ }
+ dmxLocal->lastX = v[0];
+ dmxLocal->lastY = v[1];
+ }
+ v[0] = thisX;
+ v[1] = thisY;
+ }
+
+ if (axesCount <= 6) {
+ /* Optimize for the common case when
+ * only 1 or 2 axes change. */
+ xev->time = GetTimeInMillis();
+ xev->type = DeviceMotionNotify;
+ xev->detail = 0;
+ xev->deviceid = pDevice->id | MORE_EVENTS;
+
+ xv->type = DeviceValuator;
+ xv->deviceid = pDevice->id;
+ xv->num_valuators = axesCount;
+ xv->first_valuator = firstAxis;
+ switch (xv->num_valuators) {
+ case 6: xv->valuator5 = v[5];
+ case 5: xv->valuator4 = v[4];
+ case 4: xv->valuator3 = v[3];
+ case 3: xv->valuator2 = v[2];
+ case 2: xv->valuator1 = v[1];
+ case 1: xv->valuator0 = v[0];
+ }
+ count = 2;
+ } else {
+ for (i = 0, count = 0; i < axesCount; i += 6) {
+ xev->time = GetTimeInMillis();
+ xev->type = DeviceMotionNotify;
+ xev->detail = 0;
+ xev->deviceid = pDevice->id | MORE_EVENTS;
+ xev += 2;
+
+ xv->type = DeviceValuator;
+ xv->deviceid = pDevice->id;
+ xv->num_valuators = (i+6 >= axesCount ? axesCount - i : 6);
+ xv->first_valuator = firstAxis + i;
+ switch (xv->num_valuators) {
+ case 6: xv->valuator5 = v[i+5];
+ case 5: xv->valuator4 = v[i+4];
+ case 4: xv->valuator3 = v[i+3];
+ case 3: xv->valuator2 = v[i+2];
+ case 2: xv->valuator1 = v[i+1];
+ case 1: xv->valuator0 = v[i+0];
+ }
+ xv += 2;
+ count += 2;
+ }
+ }
+
+ if (block)
+ dmxSigioBlock();
+ valuator_mask_set_range(&mask, firstAxis, axesCount, v);
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, pDevice, MotionNotify, 0,
+ POINTER_ABSOLUTE, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event);
+
+ if (block)
+ dmxSigioUnblock();
+}
+
+static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
+ XEvent *e, DMXBlockType block)
+{
+ int type;
+ int event = -1;
+ XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
+ XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
+ DeviceIntPtr pDevice = dmxLocal->pDevice;
+ int valuators[MAX_VALUATORS];
+ EventListPtr events;
+ int nevents, i;
+ ValuatorMask mask;
+
+ if (!e)
+ return -1; /* No extended event passed, cannot handle */
+
+ if ((XID)dmxLocal->deviceId != ke->deviceid) {
+ /* Search for the correct dmxLocal,
+ * since backend and console events are
+ * picked up for the first device on
+ * that X server. */
+ int i;
+ DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
+ for (i = 0; i < dmxInput->numDevs; i++) {
+ dmxLocal = dmxInput->devs[i];
+ if ((XID)dmxLocal->deviceId == ke->deviceid)
+ break;
+ }
+ }
+
+ if ((XID)dmxLocal->deviceId != ke->deviceid
+ || (type = dmxMapLookup(dmxLocal, e->type)) < 0)
+ return -1; /* No mapping, so this event is unhandled */
+
+ switch (type) {
+ case XI_DeviceValuator: event = DeviceValuator; break;
+ case XI_DeviceKeyPress: event = KeyPress; break;
+ case XI_DeviceKeyRelease: event = KeyRelease; break;
+ case XI_DeviceButtonPress: event = ButtonPress; break;
+ case XI_DeviceButtonRelease: event = ButtonRelease; break;
+ case XI_DeviceMotionNotify: event = MotionNotify; break;
+ case XI_DeviceFocusIn: event = DeviceFocusIn; break;
+ case XI_DeviceFocusOut: event = DeviceFocusOut; break;
+ case XI_ProximityIn: event = ProximityIn; break;
+ case XI_ProximityOut: event = ProximityOut; break;
+ case XI_DeviceStateNotify: event = DeviceStateNotify; break;
+ case XI_DeviceMappingNotify: event = DeviceMappingNotify; break;
+ case XI_ChangeDeviceNotify: event = ChangeDeviceNotify; break;
+ case XI_DeviceKeystateNotify: event = DeviceStateNotify; break;
+ case XI_DeviceButtonstateNotify: event = DeviceStateNotify; break;
+ }
+
+#define EXTRACT_VALUATORS(ke, valuators) \
+ valuators[0] = ke->axis_data[0]; \
+ valuators[1] = ke->axis_data[1]; \
+ valuators[2] = ke->axis_data[2]; \
+ valuators[3] = ke->axis_data[3]; \
+ valuators[4] = ke->axis_data[4]; \
+ valuators[5] = ke->axis_data[5]; \
+
+ switch (type) {
+ case XI_DeviceKeyPress:
+ case XI_DeviceKeyRelease:
+ EXTRACT_VALUATORS(ke, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ if (block)
+ dmxSigioBlock();
+ GetEventList(&events);
+ nevents = GetKeyboardValuatorEvents(events, pDevice, event,
+ ke->keycode, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event);
+
+ if (block)
+ dmxSigioUnblock();
+ break;
+ case XI_DeviceButtonPress:
+ case XI_DeviceButtonRelease:
+ EXTRACT_VALUATORS(ke, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ if (block)
+ dmxSigioBlock();
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, pDevice, event, ke->keycode,
+ POINTER_ABSOLUTE, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event);
+
+ if (block)
+ dmxSigioUnblock();
+ break;
+ case XI_ProximityIn:
+ case XI_ProximityOut:
+ EXTRACT_VALUATORS(ke, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ if (block)
+ dmxSigioBlock();
+ GetEventList(&events);
+ nevents = GetProximityEvents(events, pDevice, event, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(pDevice, (InternalEvent*)(events + i)->event);
+
+ if (block)
+ dmxSigioUnblock();
+ break;
+
+ break;
+
+ case XI_DeviceMotionNotify:
+ dmxExtMotion(dmxLocal, me->axis_data, me->first_axis, me->axes_count,
+ DMX_ABSOLUTE, block);
+ break;
+ case XI_DeviceFocusIn:
+ case XI_DeviceFocusOut:
+ case XI_DeviceStateNotify:
+ case XI_DeviceMappingNotify:
+ case XI_ChangeDeviceNotify:
+ case XI_DeviceKeystateNotify:
+ case XI_DeviceButtonstateNotify:
+ /* These are ignored, since DMX will
+ * generate its own events of these
+ * types, as necessary.
+
+ * Perhaps ChangeDeviceNotify should
+ * generate an error, because it is
+ * unexpected? */
+ break;
+ case XI_DeviceValuator:
+ default:
+ dmxLog(dmxWarning,
+ "XInput extension event (remote=%d -> zero-based=%d)"
+ " not supported yet\n", e->type, type);
+ return -1;
+ }
+ return 0;
+}
+
+static int dmxGetButtonMapping(DMXLocalInputInfoPtr dmxLocal, int button)
+{
+ ButtonClassPtr b = dmxLocal->pDevice->button;
+
+ if (button > b->numButtons) { /* This shouldn't happen. */
+ dmxLog(dmxWarning, "Button %d pressed, but only %d buttons?!?\n",
+ button, b->numButtons);
+ return button;
+ }
+ return b->map[button];
+}
+
+/** Return DMX's notion of the pointer position in the global coordinate
+ * space. */
+void dmxGetGlobalPosition(int *x, int *y)
+{
+ *x = dmxGlobalX;
+ *y = dmxGlobalY;
+}
+
+/** Invalidate the global position for #dmxCoreMotion. */
+void dmxInvalidateGlobalPosition(void)
+{
+ dmxGlobalInvalid = 1;
+}
+
+/** Enqueue a motion event for \a pDev. The \a v vector has length \a
+ * axesCount, and contains values for each of the axes, starting at \a
+ * firstAxes.
+ *
+ * The \a type of the motion may be \a DMX_RELATIVE, \a DMX_ABSOLUTE, or
+ * \a DMX_ABSOLUTE_CONFINED (in the latter case, the pointer will not be
+ * allowed to move outside the global boundaires).
+ *
+ * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be
+ * blocked around calls to \a enqueueMotion(). */
+void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
+ DMXMotionType type, DMXBlockType block)
+{
+ GETDMXLOCALFROMPDEV;
+
+ if (!dmxLocal->sendsCore) {
+ dmxExtMotion(dmxLocal, v, firstAxes, axesCount, type, block);
+ return;
+ }
+ if (axesCount == 2) {
+ switch (type) {
+ case DMX_RELATIVE:
+ dmxCoreMotion(pDev, dmxGlobalX - v[0], dmxGlobalY - v[1], 0, block);
+ break;
+ case DMX_ABSOLUTE:
+ dmxCoreMotion(pDev, v[0], v[1], 0, block);
+ break;
+ case DMX_ABSOLUTE_CONFINED:
+ dmxCoreMotion(pDev, v[0], v[1], -1, block);
+ break;
+ }
+ }
+}
+
+static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal,
+ KeyCode keyCode)
+{
+ KeySym keysym = NoSymbol;
+ int effectiveGroup;
+ XkbSrvInfoPtr xkbi;
+
+ if (!dmxLocal || !dmxLocal->pDevice || !dmxLocal->pDevice->key)
+ goto out;
+
+ xkbi = dmxLocal->pDevice->key->xkbInfo;
+ effectiveGroup = XkbGetEffectiveGroup(xkbi, &xkbi->state, keyCode);
+
+ if (effectiveGroup == -1)
+ goto out;
+
+ keysym = XkbKeySym(xkbi->desc, keyCode, effectiveGroup);
+ DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n",
+ keyCode, keysym);
+
+out:
+ return keysym;
+}
+
+static KeyCode dmxKeySymToKeyCode(DMXLocalInputInfoPtr dmxLocal, KeySym keySym,
+ int tryFirst)
+{
+ /* FIXME: this is quite ineffective, converting to a core map first and
+ * then extracting the info from there. It'd be better to run the actual
+ * xkb map */
+ XkbSrvInfoPtr xkbi = dmxLocal->pDevice->key->xkbInfo;
+ KeySymsPtr pKeySyms = XkbGetCoreMap(dmxLocal->pDevice);
+ int i;
+
+ /* Optimize for similar maps */
+ if (XkbKeycodeInRange(xkbi->desc, tryFirst)
+ && pKeySyms->map[(tryFirst - xkbi->desc->min_key_code)
+ * pKeySyms->mapWidth] == keySym)
+ return tryFirst;
+
+ for (i = pKeySyms->minKeyCode; i <= pKeySyms->maxKeyCode; i++) {
+ if (pKeySyms->map[(i - pKeySyms->minKeyCode)
+ * pKeySyms->mapWidth] == keySym) {
+ DMXDBG3("dmxKeySymToKeyCode: Translated keySym=0x%04x to"
+ " keyCode=%d (reverses to core keySym=0x%04x)\n",
+ keySym, i, dmxKeyCodeToKeySym(dmxLocalCoreKeyboard,i));
+ return i;
+ }
+ }
+ return 0;
+}
+
+static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
+{
+ GETDMXLOCALFROMPDEV;
+ int keyCode;
+
+ if (!dmxLocal->pDevice->key) {
+ dmxLog(dmxWarning, "dmxFixup: not a keyboard device (%s)\n",
+ dmxLocal->pDevice->name);
+ return NoSymbol;
+ }
+ if (!keySym)
+ keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
+ if (keySym == NoSymbol)
+ return detail;
+ keyCode = dmxKeySymToKeyCode(dmxLocalCoreKeyboard, keySym, detail);
+
+ return keyCode ? keyCode : detail;
+}
+
+/** Enqueue an event from the \a pDev device with the
+ * specified \a type and \a detail. If the event is a KeyPress or
+ * KeyRelease event, then the \a keySym is also specified.
+ *
+ * FIXME: make the code do what the comment says, or remove this comment.
+ * If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be
+ * blocked around calls to dmxeqEnqueue(). */
+
+void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
+ XEvent *e, DMXBlockType block)
+{
+ GETDMXINPUTFROMPDEV;
+ xEvent xE;
+ DeviceIntPtr p = dmxLocal->pDevice;
+ int i, nevents, valuators[3];
+ EventListPtr events;
+ ValuatorMask mask;
+
+ DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail);
+
+ switch (type) {
+ case KeyPress:
+ case KeyRelease:
+ if (!keySym)
+ keySym = dmxKeyCodeToKeySym(dmxLocal, detail);
+ if (dmxCheckFunctionKeys(dmxLocal, type, keySym))
+ return;
+ if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
+ xE.u.u.detail = dmxFixup(pDev, detail, keySym);
+
+ GetEventList(&events);
+ /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
+ nevents = GetKeyboardEvents(events, p, type, detail);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, (InternalEvent*)(events + i)->event);
+ return;
+
+ case ButtonPress:
+ case ButtonRelease:
+ detail = dmxGetButtonMapping(dmxLocal, detail);
+ valuator_mask_zero(&mask);
+ GetEventList(&events);
+ nevents = GetPointerEvents(events, p, type, detail,
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, (InternalEvent*)(events + i)->event);
+ return;
+
+ case MotionNotify:
+ GetEventList(&events);
+ valuators[0] = e->xmotion.x;
+ valuators[1] = e->xmotion.y;
+ valuators[2] = e->xmotion.state; /* FIXME: WTF?? */
+ valuator_mask_set_range(&mask, 0, 3, valuators);
+ nevents = GetPointerEvents(events, p, type, detail,
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
+ for (i = 0; i < nevents; i++)
+ mieqEnqueue(p, (InternalEvent*)(events + i)->event);
+ return;
+
+ case EnterNotify:
+ case LeaveNotify:
+ case KeymapNotify:
+ case MappingNotify: /* This is sent because we change the
+ * modifier map on the backend/console
+ * input device so that we have complete
+ * control of the input device LEDs. */
+ return;
+ default:
+ if (type == ProximityIn || type == ProximityOut) {
+ if (dmxLocal->sendsCore)
+ return; /* Not a core event */
+ break;
+ }
+ if (type >= LASTEvent) {
+ if (dmxTranslateAndEnqueueExtEvent(dmxLocal, e, block))
+ dmxLogInput(dmxInput, "Unhandled extension event: %d\n", type);
+ } else {
+ dmxLogInput(dmxInput, "Unhandled event: %d (%s)\n",
+ type, dmxEventName(type));
+ }
+ return;
+ }
+
+}
+
+/** A pointer to this routine is passed to low-level input drivers so
+ * that all special keychecking is unified to this file. This function
+ * returns 0 if no special keys have been pressed. If the user has
+ * requested termination of the DMX server, -1 is returned. If the user
+ * has requested a switch to a VT, then the (1-based) number of that VT
+ * is returned. */
+int dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym)
+{
+ GETDMXINPUTFROMPDEV;
+ int vt = 0;
+ unsigned short state = 0;
+
+ if (dmxLocal->sendsCore)
+ state = XkbStateFieldFromRec(&dmxLocalCoreKeyboard->pDevice->key->xkbInfo->state);
+ else if (dmxLocal->pDevice->key)
+ state = XkbStateFieldFromRec(&dmxLocal->pDevice->key->xkbInfo->state);
+
+ if (!dmxLocal->sendsCore) return 0; /* Only for core devices */
+
+ DMXDBG2("dmxCheckSpecialKeys: keySym=0x%04x state=0x%04x\n", keySym,state);
+
+ if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) return 0;
+
+ switch (keySym) {
+ case XK_F1:
+ case XK_F2:
+ case XK_F3:
+ case XK_F4:
+ case XK_F5:
+ case XK_F6:
+ case XK_F7:
+ case XK_F8:
+ case XK_F9:
+ case XK_F10:
+ vt = keySym - XK_F1 + 1;
+ break;
+
+ case XK_F11:
+ case XK_F12:
+ vt = keySym - XK_F11 + 11;
+ break;
+
+ case XK_q: /* To avoid confusion */
+ case XK_BackSpace:
+ case XK_Delete:
+ case XK_KP_Delete:
+ dmxLog(dmxInfo, "User request for termination\n");
+ dispatchException |= DE_TERMINATE;
+ return -1; /* Terminate */
+ }
+
+ if (vt) {
+ dmxLog(dmxInfo, "Request to switch to VT %d\n", vt);
+ dmxInput->vt_switch_pending = vt;
+ return vt;
+ }
+
+ return 0; /* Do nothing */
+}
diff --git a/xorg-server/hw/dmx/input/dmxinputinit.c b/xorg-server/hw/dmx/input/dmxinputinit.c index 0ea3e0953..4b10ecb17 100644 --- a/xorg-server/hw/dmx/input/dmxinputinit.c +++ b/xorg-server/hw/dmx/input/dmxinputinit.c @@ -476,7 +476,8 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) InitValuatorAxisStruct(pDevice, i, axis_labels[i],
info.minval[i], info.maxval[i],
info.res[i],
- info.minres[i], info.maxres[i]);
+ info.minres[i], info.maxres[i],
+ Relative);
} else if (info.numRelAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
axis_labels,
@@ -486,7 +487,8 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) InitValuatorAxisStruct(pDevice, i, axis_labels[i],
info.minval[i],
info.maxval[i], info.res[i],
- info.minres[i], info.maxres[i]);
+ info.minres[i], info.maxres[i],
+ Relative);
} else if (info.numAbsAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numAbsAxes,
axis_labels,
@@ -497,7 +499,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what) axis_labels[i],
info.minval[i], info.maxval[i],
info.res[i], info.minres[i],
- info.maxres[i]);
+ info.maxres[i], Absolute);
}
}
if (info.focusClass) InitFocusClassDeviceStruct(pDevice);
@@ -693,7 +695,6 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) DeviceIntPtr pDevice;
Atom atom;
const char *name = NULL;
- void (*registerProcPtr)(DeviceIntPtr) = NULL;
char *devname;
DMXInputInfo *dmxInput;
@@ -706,22 +707,19 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) dmxLocal->isCore = 1;
dmxLocalCoreKeyboard = dmxLocal;
name = "keyboard";
- registerProcPtr = RegisterKeyboardDevice;
}
if (dmxLocal->type == DMX_LOCAL_MOUSE && !dmxLocalCorePointer) {
dmxLocal->isCore = 1;
dmxLocalCorePointer = dmxLocal;
name = "pointer";
- registerProcPtr = RegisterPointerDevice;
}
}
if (!name) {
name = "extension";
- registerProcPtr = RegisterOtherDevice;
}
- if (!name || !registerProcPtr)
+ if (!name)
dmxLog(dmxFatal, "Cannot add device %s\n", dmxLocal->name);
pDevice = AddInputDevice(serverClient, dmxDeviceOnOff, TRUE);
@@ -738,8 +736,6 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal) pDevice->type = atom;
pDevice->name = devname;
- registerProcPtr(pDevice);
-
if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE) {
#if 00 /*BP*/
miRegisterPointerDevice(screenInfo.screens[0], pDevice);
diff --git a/xorg-server/hw/dmx/input/dmxmotion.c b/xorg-server/hw/dmx/input/dmxmotion.c index d1c79f126..7a4b8a0dc 100644 --- a/xorg-server/hw/dmx/input/dmxmotion.c +++ b/xorg-server/hw/dmx/input/dmxmotion.c @@ -125,12 +125,11 @@ void dmxPointerPutMotionEvent(DeviceIntPtr pDevice, /* Initialize the data from the known
* values (if Absolute) or to zero (if
* Relative) */
- if (pDevice->valuator->mode == Absolute) {
- for (i = 0; i < numAxes; i++)
+ for (i = 0; i < numAxes; i++) {
+ if (pDevice->valuator->axes[i].mode == Absolute)
dmxLocal->history[OFFSET(dmxLocal->tail,i+1)]
= dmxLocal->valuators[i];
- } else {
- for (i = 0; i < numAxes; i++)
+ else
dmxLocal->history[OFFSET(dmxLocal->tail,i+1)] = 0;
}
diff --git a/xorg-server/hw/dmx/input/dmxxinput.c b/xorg-server/hw/dmx/input/dmxxinput.c index 3d5f32775..b28a80d4d 100644 --- a/xorg-server/hw/dmx/input/dmxxinput.c +++ b/xorg-server/hw/dmx/input/dmxxinput.c @@ -51,23 +51,6 @@ #include "dmxinputinit.h"
#include "exevents.h"
-/** Close the input device. This is not required by the XINPUT model
- * that DMX uses. */
-void CloseInputDevice (DeviceIntPtr d, ClientPtr client)
-{
-}
-
-/** This is not required by the XINPUT model that DMX uses. */
-void AddOtherInputDevices(void)
-{
-}
-
-/** Open an input device. This is not required by the XINPUT model that
- * DMX uses. */
-void OpenInputDevice (DeviceIntPtr dev, ClientPtr client, int *status)
-{
-}
-
/** Set device mode to \a mode. This is not implemented. */
int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
{
diff --git a/xorg-server/hw/kdrive/fake/fake.c b/xorg-server/hw/kdrive/fake/fake.c index 626b2d25a..21360b16d 100644 --- a/xorg-server/hw/kdrive/fake/fake.c +++ b/xorg-server/hw/kdrive/fake/fake.c @@ -215,11 +215,8 @@ fakeUnmapFramebuffer (KdScreenInfo *screen) {
FakePriv *priv = screen->card->driver;
KdShadowFbFree (screen);
- if (priv->base)
- {
- free (priv->base);
- priv->base = 0;
- }
+ free(priv->base);
+ priv->base = NULL;
return TRUE;
}
diff --git a/xorg-server/hw/kdrive/src/kinput.c b/xorg-server/hw/kdrive/src/kinput.c index 5b17163da..ee8fba65a 100644 --- a/xorg-server/hw/kdrive/src/kinput.c +++ b/xorg-server/hw/kdrive/src/kinput.c @@ -48,6 +48,7 @@ #include "exglobals.h"
#include "eventstr.h"
#include "xserver-properties.h"
+#include "inpututils.h"
#define AtomFromName(x) MakeAtom(x, strlen(x), 1)
@@ -966,10 +967,6 @@ KdAddKeyboard (KdKeyboardInfo *ki) return !Success;
}
- ki->dixdev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
- ki->dixdev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
- RegisterOtherDevice(ki->dixdev);
-
#ifdef DEBUG
ErrorF("added keyboard %s with dix id %d\n", ki->name, ki->dixdev->id);
#endif
@@ -1037,10 +1034,6 @@ KdAddPointer (KdPointerInfo *pi) return BadDevice;
}
- pi->dixdev->deviceGrab.ActivateGrab = ActivatePointerGrab;
- pi->dixdev->deviceGrab.DeactivateGrab = DeactivatePointerGrab;
- RegisterOtherDevice(pi->dixdev);
-
for (prev = &kdPointers; *prev; prev = &(*prev)->next);
*prev = pi;
@@ -1998,14 +1991,16 @@ _KdEnqueuePointerEvent (KdPointerInfo *pi, int type, int x, int y, int z, {
int nEvents = 0, i = 0;
int valuators[3] = { x, y, z };
+ ValuatorMask mask;
/* TRUE from KdHandlePointerEvent, means 'we swallowed the event'. */
if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel))
return;
+ valuator_mask_set_range(&mask, 0, 3, valuators);
+
GetEventList(&kdEvents);
- nEvents = GetPointerEvents(kdEvents, pi->dixdev, type, b, absrel,
- 0, 3, valuators);
+ nEvents = GetPointerEvents(kdEvents, pi->dixdev, type, b, absrel, &mask);
for (i = 0; i < nEvents; i++)
KdQueueEvent(pi->dixdev, (InternalEvent *)((kdEvents + i)->event));
}
@@ -2209,30 +2204,6 @@ ProcessInputEvents (void) }
#endif
-/* FIXME use XSECURITY to work out whether the client should be allowed to
- * open and close. */
-void
-OpenInputDevice(DeviceIntPtr pDev, ClientPtr client, int *status)
-{
- if (!pDev)
- *status = BadDevice;
- else
- *status = Success;
-}
-
-void
-CloseInputDevice(DeviceIntPtr pDev, ClientPtr client)
-{
- return;
-}
-
-/* We initialise all input devices at startup. */
-void
-AddOtherInputDevices(void)
-{
- return;
-}
-
/* At the moment, absolute/relative is up to the client. */
int
SetDeviceMode(register ClientPtr client, DeviceIntPtr pDev, int mode)
diff --git a/xorg-server/hw/vfb/InitInput.c b/xorg-server/hw/vfb/InitInput.c index 64040c865..aba1a95fb 100644 --- a/xorg-server/hw/vfb/InitInput.c +++ b/xorg-server/hw/vfb/InitInput.c @@ -138,10 +138,8 @@ InitInput(int argc, char *argv[]) Atom xiclass;
p = AddInputDevice(serverClient, vfbMouseProc, TRUE);
k = AddInputDevice(serverClient, vfbKeybdProc, TRUE);
- RegisterPointerDevice(p);
xiclass = MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE);
AssignTypeAndName(p, xiclass, "Xvfb mouse");
- RegisterKeyboardDevice(k);
xiclass = MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE);
AssignTypeAndName(k, xiclass, "Xvfb keyboard");
(void)mieqInit();
diff --git a/xorg-server/hw/xfree86/common/Makefile.am b/xorg-server/hw/xfree86/common/Makefile.am index 821a2b500..c4067aa62 100644 --- a/xorg-server/hw/xfree86/common/Makefile.am +++ b/xorg-server/hw/xfree86/common/Makefile.am @@ -1,95 +1,93 @@ -noinst_LTLIBRARIES = libcommon.la - -if XORG_BUS_SPARC -SBUS_SOURCES = xf86sbusBus.c -endif - -if XV -XVSOURCES = xf86xv.c xf86xvmc.c -XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h -endif - -if XF86VIDMODE -XF86VMODE_SDK = vidmodeproc.h -endif - -if DGA -DGASOURCES = xf86DGA.c -endif - -XISOURCES = xf86Xinput.c xisb.c -XISDKINCS = xf86Xinput.h xisb.h -RANDRSOURCES = xf86RandR.c - -BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES) - -MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes - -xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES) - cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@ - echo >> $@ - -BUILT_SOURCES = xf86DefModeSet.c - -AM_LDFLAGS = -r -libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \ - xf86Cursor.c $(DGASOURCES) xf86DPMS.c \ - xf86Events.c xf86Globals.c xf86AutoConfig.c \ - xf86Option.c xf86Init.c xf86VGAarbiter.c \ - xf86VidMode.c xf86fbman.c xf86cmap.c \ - xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \ - xf86Mode.c xorgHelper.c \ - $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) -nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h -libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la - -INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ - -I$(srcdir)/../loader -I$(srcdir)/../parser \ - -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ - -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \ - -I$(srcdir)/../modes -I$(srcdir)/../ramdac - -sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ - xf86PciInfo.h xf86Priv.h xf86Privstr.h \ - xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \ - $(XVSDKINCS) $(XF86VMODE_SDK) xorgVersion.h \ - xf86sbusBus.h xf86VGAarbiter.h - -DISTCLEANFILES = xf86Build.h -CLEANFILES = $(BUILT_SOURCES) - -EXTRA_DIST = \ - compiler.h \ - fourcc.h \ - scoasm.h \ - vidmodeproc.h \ - xf86.h \ - xf86Bus.h \ - xf86Config.h \ - xf86InPriv.h \ - xf86Module.h \ - xf86Opt.h \ - xf86PciInfo.h \ - xf86Priv.h \ - xf86Privstr.h \ - xf86Xinput.h \ - xf86cmap.h \ - xf86fbman.h \ - xf86pciBus.h \ - xf86str.h \ - xf86xv.h \ - xf86xvmc.h \ - xf86xvpriv.h \ - xisb.h \ - xorgVersion.h \ - $(MODEDEFSOURCES) \ - modeline2c.awk \ - xf86VGAarbiter.h \ - xf86VGAarbiterPriv.h \ - $(DISTKBDSOURCES) - -if LNXACPI -XORG_CFLAGS += -DHAVE_ACPI -endif - -AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) +noinst_LTLIBRARIES = libcommon.la
+
+if XORG_BUS_SPARC
+SBUS_SOURCES = xf86sbusBus.c
+endif
+
+if XV
+XVSOURCES = xf86xv.c xf86xvmc.c
+XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h
+endif
+
+if XF86VIDMODE
+XF86VMODE_SDK = vidmodeproc.h
+endif
+
+if DGA
+DGASOURCES = xf86DGA.c
+endif
+
+RANDRSOURCES = xf86RandR.c
+
+BUSSOURCES = xf86pciBus.c xf86fbBus.c xf86noBus.c $(SBUS_SOURCES)
+
+MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes
+
+xf86DefModeSet.c: $(srcdir)/modeline2c.awk $(MODEDEFSOURCES)
+ cat $(MODEDEFSOURCES) | LC_ALL=C $(AWK) -f $(srcdir)/modeline2c.awk > $@
+ echo >> $@
+
+BUILT_SOURCES = xf86DefModeSet.c
+
+AM_LDFLAGS = -r
+libcommon_la_SOURCES = xf86Configure.c xf86ShowOpts.c xf86Bus.c xf86Config.c \
+ xf86Cursor.c $(DGASOURCES) xf86DPMS.c \
+ xf86Events.c xf86Globals.c xf86AutoConfig.c \
+ xf86Option.c xf86Init.c xf86VGAarbiter.c \
+ xf86VidMode.c xf86fbman.c xf86cmap.c \
+ xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \
+ xf86Mode.c xorgHelper.c \
+ $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES)
+nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h
+libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la
+
+INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \
+ -I$(srcdir)/../loader -I$(srcdir)/../parser \
+ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \
+ -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \
+ -I$(srcdir)/../modes -I$(srcdir)/../ramdac
+
+sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \
+ xf86PciInfo.h xf86Priv.h xf86Privstr.h \
+ xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \
+ $(XVSDKINCS) $(XF86VMODE_SDK) xorgVersion.h \
+ xf86sbusBus.h xf86VGAarbiter.h
+
+DISTCLEANFILES = xf86Build.h
+CLEANFILES = $(BUILT_SOURCES)
+
+EXTRA_DIST = \
+ compiler.h \
+ fourcc.h \
+ scoasm.h \
+ vidmodeproc.h \
+ xf86.h \
+ xf86Bus.h \
+ xf86Config.h \
+ xf86InPriv.h \
+ xf86Module.h \
+ xf86Opt.h \
+ xf86PciInfo.h \
+ xf86Priv.h \
+ xf86Privstr.h \
+ xf86Xinput.h \
+ xf86cmap.h \
+ xf86fbman.h \
+ xf86pciBus.h \
+ xf86str.h \
+ xf86xv.h \
+ xf86xvmc.h \
+ xf86xvpriv.h \
+ xisb.h \
+ xorgVersion.h \
+ $(MODEDEFSOURCES) \
+ modeline2c.awk \
+ xf86VGAarbiter.h \
+ xf86VGAarbiterPriv.h \
+ $(DISTKBDSOURCES)
+
+if LNXACPI
+XORG_CFLAGS += -DHAVE_ACPI
+endif
+
+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
diff --git a/xorg-server/hw/xfree86/common/xf86.h b/xorg-server/hw/xfree86/common/xf86.h index b21bcdf47..68653395b 100644 --- a/xorg-server/hw/xfree86/common/xf86.h +++ b/xorg-server/hw/xfree86/common/xf86.h @@ -203,6 +203,7 @@ extern _X_EXPORT pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc, po extern _X_EXPORT int xf86RemoveGeneralHandler(pointer handler);
extern _X_EXPORT void xf86DisableGeneralHandler(pointer handler);
extern _X_EXPORT void xf86EnableGeneralHandler(pointer handler);
+extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc handler, pointer data);
extern _X_EXPORT void xf86InterceptSignals(int *signo);
extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler)(void));
extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c index faeda92ee..c0cba2994 100644 --- a/xorg-server/hw/xfree86/common/xf86Config.c +++ b/xorg-server/hw/xfree86/common/xf86Config.c @@ -63,7 +63,6 @@ #include "xf86pciBus.h"
#include "xf86Xinput.h"
-extern DeviceAssocRec mouse_assoc;
#include "xkbsrv.h"
@@ -136,7 +135,7 @@ static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, static Bool configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor);
static Bool configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device,
Bool active);
-static Bool configInput(IDevPtr inputp, XF86ConfInputPtr conf_input,
+static Bool configInput(InputInfoPtr pInfo, XF86ConfInputPtr conf_input,
MessageType from);
static Bool configDisplay(DispPtr displayp, XF86ConfDisplayPtr conf_display);
static Bool addDefaultModes(MonPtr monitorp);
@@ -445,8 +444,8 @@ xf86InputDriverlistFromConfig(void) {
int count = 0;
char **modulearray;
- IDevPtr* idp;
-
+ InputInfoPtr *idp;
+
/*
* make sure the config file has been parsed and that we have a
* ModulePath set; if no ModulePath was given, use the default
@@ -504,7 +503,6 @@ fixup_video_driver_list(char **drivers) static const char *fallback[4] = { "vesa", "fbdev", "wsfb", NULL };
char **end, **drv;
char *x;
- char **ati, **atimisc;
int i;
/* walk to the end of the list */
@@ -743,8 +741,6 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE },
{ FLAG_AIGLX, "AIGLX", OPTV_BOOLEAN,
{0}, FALSE },
- { FLAG_ALLOW_EMPTY_INPUT, "AllowEmptyInput", OPTV_BOOLEAN,
- {0}, FALSE },
{ FLAG_IGNORE_ABI, "IgnoreABI", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN,
@@ -955,13 +951,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) }
#endif
- /* AllowEmptyInput is automatically true if we're hotplugging */
- xf86Info.allowEmptyInput = (xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
- xf86GetOptValBool(FlagOptions, FLAG_ALLOW_EMPTY_INPUT, &xf86Info.allowEmptyInput);
+ /* if we're not hotplugging, force some input devices to exist */
+ xf86Info.forceInputDevices = !(xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
- /* AEI on? Then we're not using kbd, so use the evdev rules set. */
+ /* when forcing input devices, we use kbd. otherwise evdev, so use the
+ * evdev rules set. */
#if defined(linux)
- if (xf86Info.allowEmptyInput)
+ if (!xf86Info.forceInputDevices)
set.rules = "evdev";
#endif
XkbSetRulesDflts(&set);
@@ -1093,12 +1089,12 @@ Bool xf86DRI2Enabled(void) static Bool
checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
{
- IDevPtr corePointer = NULL, coreKeyboard = NULL;
+ InputInfoPtr corePointer = NULL, coreKeyboard = NULL;
Bool foundPointer = FALSE, foundKeyboard = FALSE;
const char *pointerMsg = NULL, *keyboardMsg = NULL;
- IDevPtr *devs, /* iterator */
+ InputInfoPtr *devs, /* iterator */
indp;
- IDevRec Pointer, Keyboard;
+ InputInfoRec Pointer = {}, Keyboard = {};
XF86ConfInputPtr confInput;
XF86ConfInputRec defPtr, defKbd;
int count = 0;
@@ -1113,49 +1109,27 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * remove the core attribute from the later ones.
*/
for (devs = servlayoutp->inputs; devs && *devs; devs++) {
- pointer opt1 = NULL, opt2 = NULL;
indp = *devs;
- if (indp->commonOptions &&
- xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) {
- opt1 = indp->commonOptions;
- }
- if (indp->extraOptions &&
- xf86CheckBoolOption(indp->extraOptions, "CorePointer", FALSE)) {
- opt2 = indp->extraOptions;
- }
- if (opt1 || opt2) {
+ if (indp->options &&
+ xf86CheckBoolOption(indp->options, "CorePointer", FALSE)) {
if (!corePointer) {
corePointer = indp;
} else {
- if (opt1)
- xf86ReplaceBoolOption(opt1, "CorePointer", FALSE);
- if (opt2)
- xf86ReplaceBoolOption(opt2, "CorePointer", FALSE);
+ xf86ReplaceBoolOption(indp->options, "CorePointer", FALSE);
xf86Msg(X_WARNING, "Duplicate core pointer devices. "
"Removing core pointer attribute from \"%s\"\n",
- indp->identifier);
+ indp->name);
}
}
- opt1 = opt2 = NULL;
- if (indp->commonOptions &&
- xf86CheckBoolOption(indp->commonOptions, "CoreKeyboard", FALSE)) {
- opt1 = indp->commonOptions;
- }
- if (indp->extraOptions &&
- xf86CheckBoolOption(indp->extraOptions, "CoreKeyboard", FALSE)) {
- opt2 = indp->extraOptions;
- }
- if (opt1 || opt2) {
+ if (indp->options &&
+ xf86CheckBoolOption(indp->options, "CoreKeyboard", FALSE)) {
if (!coreKeyboard) {
coreKeyboard = indp;
} else {
- if (opt1)
- xf86ReplaceBoolOption(opt1, "CoreKeyboard", FALSE);
- if (opt2)
- xf86ReplaceBoolOption(opt2, "CoreKeyboard", FALSE);
+ xf86ReplaceBoolOption(indp->options, "CoreKeyboard", FALSE);
xf86Msg(X_WARNING, "Duplicate core keyboard devices. "
"Removing core keyboard attribute from \"%s\"\n",
- indp->identifier);
+ indp->name);
}
}
count++;
@@ -1182,7 +1156,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (*devs == corePointer)
{
free(*devs);
- *devs = (IDevPtr)0x1; /* ensure we dont skip next loop*/
+ *devs = (InputInfoPtr)0x1; /* ensure we dont skip next loop*/
break;
}
for (; devs && *devs; devs++)
@@ -1200,7 +1174,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 3. First core pointer device. */
- if (!foundPointer && (!xf86Info.allowEmptyInput || implicitLayout)) {
+ if (!foundPointer && (xf86Info.forceInputDevices || implicitLayout)) {
XF86ConfInputPtr p;
for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
@@ -1216,7 +1190,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 4. First pointer with an allowed mouse driver. */
- if (!foundPointer && !xf86Info.allowEmptyInput) {
+ if (!foundPointer && xf86Info.forceInputDevices) {
const char **driver = mousedrivers;
confInput = xf86findInput(CONF_IMPLICIT_POINTER,
xf86configptr->conf_input_lst);
@@ -1233,7 +1207,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 5. Built-in default. */
- if (!foundPointer && !xf86Info.allowEmptyInput) {
+ if (!foundPointer && xf86Info.forceInputDevices) {
memset(&defPtr, 0, sizeof(defPtr));
defPtr.inp_identifier = strdup("<default pointer>");
defPtr.inp_driver = strdup("mouse");
@@ -1249,17 +1223,17 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundPointer) {
count++;
devs = xnfrealloc(servlayoutp->inputs,
- (count + 1) * sizeof(IDevPtr));
- devs[count - 1] = xnfalloc(sizeof(IDevRec));
+ (count + 1) * sizeof(InputInfoPtr));
+ devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
*devs[count - 1] = Pointer;
- devs[count - 1]->extraOptions =
+ devs[count - 1]->options =
xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL);
devs[count] = NULL;
servlayoutp->inputs = devs;
}
}
- if (!foundPointer && !xf86Info.allowEmptyInput) {
+ if (!foundPointer && xf86Info.forceInputDevices) {
/* This shouldn't happen. */
xf86Msg(X_ERROR, "Cannot locate a core pointer device.\n");
return FALSE;
@@ -1283,7 +1257,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) driver++;
}
}
- if (!found && !xf86Info.allowEmptyInput) {
+ if (!found && xf86Info.forceInputDevices) {
xf86Msg(X_INFO, "No default mouse found, adding one\n");
memset(&defPtr, 0, sizeof(defPtr));
defPtr.inp_identifier = strdup("<default pointer>");
@@ -1293,10 +1267,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundPointer) {
count++;
devs = xnfrealloc(servlayoutp->inputs,
- (count + 1) * sizeof(IDevPtr));
- devs[count - 1] = xnfalloc(sizeof(IDevRec));
+ (count + 1) * sizeof(InputInfoPtr));
+ devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
*devs[count - 1] = Pointer;
- devs[count - 1]->extraOptions =
+ devs[count - 1]->options =
xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL);
devs[count] = NULL;
servlayoutp->inputs = devs;
@@ -1324,7 +1298,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (*devs == coreKeyboard)
{
free(*devs);
- *devs = (IDevPtr)0x1; /* ensure we dont skip next loop */
+ *devs = (InputInfoPtr)0x1; /* ensure we dont skip next loop */
break;
}
for (; devs && *devs; devs++)
@@ -1342,7 +1316,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 3. First core keyboard device. */
- if (!foundKeyboard && (!xf86Info.allowEmptyInput || implicitLayout)) {
+ if (!foundKeyboard && (xf86Info.forceInputDevices || implicitLayout)) {
XF86ConfInputPtr p;
for (p = xf86configptr->conf_input_lst; p; p = p->list.next) {
@@ -1358,7 +1332,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 4. First keyboard with 'keyboard' or 'kbd' as the driver. */
- if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+ if (!foundKeyboard && xf86Info.forceInputDevices) {
confInput = xf86findInput(CONF_IMPLICIT_KEYBOARD,
xf86configptr->conf_input_lst);
if (!confInput) {
@@ -1373,7 +1347,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) }
/* 5. Built-in default. */
- if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+ if (!foundKeyboard && xf86Info.forceInputDevices) {
memset(&defKbd, 0, sizeof(defKbd));
defKbd.inp_identifier = strdup("<default keyboard>");
defKbd.inp_driver = strdup("kbd");
@@ -1389,17 +1363,17 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) if (foundKeyboard) {
count++;
devs = xnfrealloc(servlayoutp->inputs,
- (count + 1) * sizeof(IDevPtr));
- devs[count - 1] = xnfalloc(sizeof(IDevRec));
+ (count + 1) * sizeof(InputInfoPtr));
+ devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
*devs[count - 1] = Keyboard;
- devs[count - 1]->extraOptions =
+ devs[count - 1]->options =
xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL);
devs[count] = NULL;
servlayoutp->inputs = devs;
}
}
- if (!foundKeyboard && !xf86Info.allowEmptyInput) {
+ if (!foundKeyboard && xf86Info.forceInputDevices) {
/* This shouldn't happen. */
xf86Msg(X_ERROR, "Cannot locate a core keyboard device.\n");
return FALSE;
@@ -1425,7 +1399,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) "\tUsing the %s.\n", keyboardMsg);
}
- if (xf86Info.allowEmptyInput && !(foundPointer && foundKeyboard)) {
+ if (!xf86Info.forceInputDevices && !(foundPointer && foundKeyboard)) {
#if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
const char *config_backend;
#if defined(CONFIG_HAL)
@@ -1438,8 +1412,10 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) "reconfigure %s or disable AutoAddDevices.\n",
config_backend, config_backend);
#else
- xf86Msg(X_INFO, "Hotplugging is disabled and no input devices were configured.\n"
- "\tTry disabling AllowEmptyInput.\n");
+ xf86Msg(X_WARNING, "Hotplugging requested but the server was "
+ "compiled without a config backend. "
+ "No input devices were configured, the server "
+ "will start without any input devices.\n");
#endif
}
@@ -1464,7 +1440,7 @@ static Bool configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp)
{
XF86ConfInputrefPtr irp;
- IDevPtr *indp;
+ InputInfoPtr *indp;
int count = 0;
/*
@@ -1477,19 +1453,19 @@ configInputDevices(XF86ConfLayoutPtr layout, serverLayoutPtr servlayoutp) }
DebugF("Found %d input devices in the layout section %s\n",
count, layout->lay_identifier);
- indp = xnfcalloc((count + 1), sizeof(IDevPtr));
+ indp = xnfcalloc((count + 1), sizeof(InputInfoPtr));
indp[count] = NULL;
irp = layout->lay_input_lst;
count = 0;
while (irp) {
- indp[count] = xnfalloc(sizeof(IDevRec));
+ indp[count] = xnfalloc(sizeof(InputInfoRec));
if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) {
while(count--)
free(indp[count]);
free(indp);
return FALSE;
}
- indp[count]->extraOptions = irp->iref_option_lst;
+ indp[count]->options = irp->iref_option_lst;
count++;
irp = (XF86ConfInputrefPtr)irp->list.next;
}
@@ -1712,7 +1688,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, MessageType from;
XF86ConfScreenPtr s;
screenLayoutPtr slp;
- IDevPtr *indp;
+ InputInfoPtr *indp;
XF86ConfLayoutRec layout;
if (!servlayoutp)
@@ -1758,7 +1734,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen, from = X_DEFAULT;
} else {
/* Set up an empty input device list, then look for some core devices. */
- indp = xnfalloc(sizeof(IDevPtr));
+ indp = xnfalloc(sizeof(InputInfoPtr));
*indp = NULL;
servlayoutp->inputs = indp;
}
@@ -2211,7 +2187,6 @@ configDevice(GDevPtr devicep, XF86ConfDevicePtr conf_device, Bool active) static void
configDRI(XF86ConfDRIPtr drip)
{
- int i;
struct group *grp;
xf86ConfigDRI.group = -1;
@@ -2283,13 +2258,12 @@ configExtensions(XF86ConfExtensionsPtr conf_ext) }
static Bool
-configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
+configInput(InputInfoPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
{
xf86Msg(from, "|-->Input Device \"%s\"\n", conf_input->inp_identifier);
- inputp->identifier = conf_input->inp_identifier;
+ inputp->name = conf_input->inp_identifier;
inputp->driver = conf_input->inp_driver;
- inputp->commonOptions = conf_input->inp_option_lst;
- inputp->extraOptions = NULL;
+ inputp->options = conf_input->inp_option_lst;
inputp->attrs = NULL;
return TRUE;
@@ -2338,12 +2312,13 @@ static void checkInput(serverLayoutPtr layout, Bool implicit_layout) {
checkCoreInputDevices(layout, implicit_layout);
- /* AllowEmptyInput and the "kbd" and "mouse" drivers are mutually
- * exclusive. Trawl the list for mouse/kbd devices and disable them.
+ /* Unless we're forcing input devices, disable mouse/kbd devices in the
+ * config. Otherwise the same physical device is added multiple times,
+ * leading to duplicate events.
*/
- if (xf86Info.allowEmptyInput && layout->inputs)
+ if (!xf86Info.forceInputDevices && layout->inputs)
{
- IDevPtr *dev = layout->inputs;
+ InputInfoPtr *dev = layout->inputs;
BOOL warned = FALSE;
while(*dev)
@@ -2352,15 +2327,15 @@ checkInput(serverLayoutPtr layout, Bool implicit_layout) { strcmp((*dev)->driver, "mouse") == 0 ||
strcmp((*dev)->driver, "vmmouse") == 0)
{
- IDevPtr *current;
+ InputInfoPtr *current;
if (!warned)
{
- xf86Msg(X_WARNING, "AllowEmptyInput is on, devices using "
+ xf86Msg(X_WARNING, "Hotplugging is on, devices using "
"drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.\n");
warned = TRUE;
}
- xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->identifier);
+ xf86Msg(X_WARNING, "Disabling %s\n", (*dev)->name);
current = dev;
free(*dev);
diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c index 87555f31f..004807483 100644 --- a/xorg-server/hw/xfree86/common/xf86Events.c +++ b/xorg-server/hw/xfree86/common/xf86Events.c @@ -600,6 +600,26 @@ xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) return ih;
}
+/**
+ * Set the handler for the console's fd. Replaces (and returns) the previous
+ * handler or NULL, whichever appropriate.
+ * proc may be NULL if the server should not handle events on the console.
+ */
+InputHandlerProc
+xf86SetConsoleHandler(InputHandlerProc proc, pointer data)
+{
+ static InputHandlerProc handler = NULL;
+ InputHandlerProc old_handler = handler;
+
+ if (old_handler)
+ xf86RemoveGeneralHandler(old_handler);
+
+ xf86AddGeneralHandler(xf86Info.consoleFd, proc, data);
+ handler = proc;
+
+ return old_handler;
+}
+
static void
removeInputHandler(IHPtr ih)
{
diff --git a/xorg-server/hw/xfree86/common/xf86Globals.c b/xorg-server/hw/xfree86/common/xf86Globals.c index c8534132a..0b0931408 100644 --- a/xorg-server/hw/xfree86/common/xf86Globals.c +++ b/xorg-server/hw/xfree86/common/xf86Globals.c @@ -125,15 +125,14 @@ xf86InfoRec xf86Info = { #endif
.pmFlag = TRUE,
.log = LogNone,
- .kbdCustomKeycodes = FALSE,
.disableRandR = FALSE,
.randRFrom = X_DEFAULT,
#if defined(CONFIG_HAL) || defined(CONFIG_UDEV)
- .allowEmptyInput = TRUE,
+ .forceInputDevices = FALSE,
.autoAddDevices = TRUE,
.autoEnableDevices = TRUE
#else
- .allowEmptyInput = FALSE,
+ .forceInputDevices = TRUE,
.autoAddDevices = FALSE,
.autoEnableDevices = FALSE
#endif
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c index e4d07ec12..abb198690 100644 --- a/xorg-server/hw/xfree86/common/xf86Helper.c +++ b/xorg-server/hw/xfree86/common/xf86Helper.c @@ -273,72 +273,6 @@ xf86AllocateScrnInfoPrivateIndex(void) return idx;
}
-/* Allocate a new InputInfoRec and append it to the tail of xf86InputDevs. */
-InputInfoPtr
-xf86AllocateInput(InputDriverPtr drv, int flags)
-{
- InputInfoPtr new, *prev = NULL;
-
- if (!(new = calloc(sizeof(InputInfoRec), 1)))
- return NULL;
-
- new->drv = drv;
- new->module = DuplicateModule(drv->module, NULL);
-
- for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
- ;
-
- *prev = new;
- new->next = NULL;
-
- return new;
-}
-
-
-/*
- * Remove an entry from xf86InputDevs. Ideally it should free all allocated
- * data. To do this properly may require a driver hook.
- */
-
-void
-xf86DeleteInput(InputInfoPtr pInp, int flags)
-{
- InputInfoPtr p;
-
- /* First check if the inputdev is valid. */
- if (pInp == NULL)
- return;
-
-#if 0
- /* If a free function is defined, call it here. */
- if (pInp->free)
- pInp->free(pInp, 0);
-#endif
-
- if (pInp->module)
- UnloadModule(pInp->module);
-
- /* This should *really* be handled in drv->UnInit(dev) call instead, but
- * if the driver forgets about it make sure we free it or at least crash
- * with flying colors */
- free(pInp->private);
-
- FreeInputAttributes(pInp->attrs);
-
- /* Remove the entry from the list. */
- if (pInp == xf86InputDevs)
- xf86InputDevs = pInp->next;
- else {
- p = xf86InputDevs;
- while (p && p->next != pInp)
- p = p->next;
- if (p)
- p->next = pInp->next;
- /* Else the entry wasn't in the xf86InputDevs list (ignore this). */
- }
- free(pInp);
-}
-
Bool
xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad)
{
@@ -1247,6 +1181,43 @@ xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...) va_end(ap);
}
+/* Print input driver messages in the standard format of
+ <driver>: <device name>: <message> */
+void
+xf86VIDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format,
+ va_list args)
+{
+ char *msg;
+
+ msg = Xprintf("%s: %s: %s", dev->drv->driverName, dev->name, format);
+ LogVMessageVerb(type, verb, "%s", msg);
+ free(msg);
+}
+
+/* Print input driver message, with verbose level specified directly */
+void
+xf86IDrvMsgVerb(InputInfoPtr dev, MessageType type, int verb, const char *format,
+ ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VIDrvMsgVerb(dev, type, verb, format, ap);
+ va_end(ap);
+}
+
+/* Print input driver messages, with verbose level of 1 (default) */
+void
+xf86IDrvMsg(InputInfoPtr dev, MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ xf86VIDrvMsgVerb(dev, type, 1, format, ap);
+ va_end(ap);
+}
+
+
/* Print non-driver messages with verbose level specified directly */
void
xf86MsgVerb(MessageType type, int verb, const char *format, ...)
@@ -2070,7 +2041,7 @@ xf86IsUnblank(int mode) }
void
-xf86MotionHistoryAllocate(LocalDevicePtr local)
+xf86MotionHistoryAllocate(InputInfoPtr pInfo)
{
- AllocateMotionHistory(local->dev);
+ AllocateMotionHistory(pInfo->dev);
}
diff --git a/xorg-server/hw/xfree86/common/xf86InPriv.h b/xorg-server/hw/xfree86/common/xf86InPriv.h index 3838d6940..15fef4320 100644 --- a/xorg-server/hw/xfree86/common/xf86InPriv.h +++ b/xorg-server/hw/xfree86/common/xf86InPriv.h @@ -1,46 +1,43 @@ - -/* - * Copyright (c) 1999 by The XFree86 Project, Inc. - * - * 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 above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#ifndef _xf86InPriv_h -#define _xf86InPriv_h - -/* xf86Globals.c */ -extern InputDriverPtr *xf86InputDriverList; -extern int xf86NumInputDrivers; - -/* xf86Xinput.c */ -int xf86ActivateDevice(InputInfoPtr pInfo); - -/* xf86Helper.c */ -InputDriverPtr xf86LookupInputDriver(const char *name); - -#endif /* _xf86InPriv_h */ +
+/*
+ * Copyright (c) 1999 by The XFree86 Project, Inc.
+ *
+ * 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 above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#ifndef _xf86InPriv_h
+#define _xf86InPriv_h
+
+/* xf86Globals.c */
+extern InputDriverPtr *xf86InputDriverList;
+extern int xf86NumInputDrivers;
+
+/* xf86Helper.c */
+InputDriverPtr xf86LookupInputDriver(const char *name);
+
+#endif /* _xf86InPriv_h */
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c index ab5b5a34d..aee1e8e33 100644 --- a/xorg-server/hw/xfree86/common/xf86Init.c +++ b/xorg-server/hw/xfree86/common/xf86Init.c @@ -814,7 +814,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) void
InitInput(int argc, char **argv)
{
- IDevPtr* pDev;
+ InputInfoPtr* pDev;
DeviceIntPtr dev;
xf86Info.vtRequestsPending = FALSE;
diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h index 266a4dafe..9335e116f 100644 --- a/xorg-server/hw/xfree86/common/xf86Module.h +++ b/xorg-server/hw/xfree86/common/xf86Module.h @@ -83,7 +83,7 @@ typedef enum { */
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(9, 0)
-#define ABI_XINPUT_VERSION SET_ABI_VERSION(11, 0)
+#define ABI_XINPUT_VERSION SET_ABI_VERSION(12, 0)
#define ABI_EXTENSION_VERSION SET_ABI_VERSION(4, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
diff --git a/xorg-server/hw/xfree86/common/xf86Opt.h b/xorg-server/hw/xfree86/common/xf86Opt.h index 3af4b4069..5ce320891 100644 --- a/xorg-server/hw/xfree86/common/xf86Opt.h +++ b/xorg-server/hw/xfree86/common/xf86Opt.h @@ -84,6 +84,7 @@ extern _X_EXPORT pointer xf86NewOption(char *name, char *value ); extern _X_EXPORT pointer xf86NextOption(pointer list );
extern _X_EXPORT pointer xf86OptionListCreate(const char **options, int count, int used);
extern _X_EXPORT pointer xf86OptionListMerge(pointer head, pointer tail);
+extern _X_EXPORT pointer xf86OptionListDuplicate(pointer list);
extern _X_EXPORT void xf86OptionListFree(pointer opt);
extern _X_EXPORT char *xf86OptionName(pointer opt);
extern _X_EXPORT char *xf86OptionValue(pointer opt);
diff --git a/xorg-server/hw/xfree86/common/xf86Option.c b/xorg-server/hw/xfree86/common/xf86Option.c index 8dce3ad0f..97deb1436 100644 --- a/xorg-server/hw/xfree86/common/xf86Option.c +++ b/xorg-server/hw/xfree86/common/xf86Option.c @@ -118,58 +118,43 @@ xf86CollectOptions(ScrnInfoPtr pScrn, pointer extraOpts) }
/*
- * xf86CollectInputOptions collects the options for an InputDevice.
- * This function requires that the following has been initialised:
- *
- * pInfo->conf_idev
- *
- * The extraOpts parameter may optionally contain a list of additional options
- * to include.
- *
- * The order of precedence for options is:
- *
- * extraOpts, pInfo->conf_idev->extraOptions,
- * pInfo->conf_idev->commonOptions, defaultOpts
+ * xf86CollectInputOptions collects extra options for an InputDevice (other
+ * than those added by the config backend).
+ * The options are merged into the existing ones and thus take precedence
+ * over the others.
*/
void
-xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
- pointer extraOpts)
+xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts)
{
- XF86OptionPtr tmp;
- XF86OptionPtr extras = (XF86OptionPtr)extraOpts;
-
- pInfo->options = NULL;
if (defaultOpts) {
- pInfo->options = xf86OptionListCreate(defaultOpts, -1, 0);
- }
- if (pInfo->conf_idev && pInfo->conf_idev->commonOptions) {
- tmp = xf86optionListDup(pInfo->conf_idev->commonOptions);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
- if (pInfo->conf_idev && pInfo->conf_idev->extraOptions) {
- tmp = xf86optionListDup(pInfo->conf_idev->extraOptions);
- if (pInfo->options)
- pInfo->options = xf86optionListMerge(pInfo->options, tmp);
- else
- pInfo->options = tmp;
- }
- if (extras) {
- tmp = xf86optionListDup(extras);
+ XF86OptionPtr tmp =xf86optionListCreate(defaultOpts, -1, 0);
if (pInfo->options)
pInfo->options = xf86optionListMerge(pInfo->options, tmp);
else
pInfo->options = tmp;
}
+}
- if (pInfo->conf_idev && pInfo->conf_idev->attrs) {
- pInfo->attrs = pInfo->conf_idev->attrs;
+/**
+ * Duplicate the option list passed in. The returned pointer will be a newly
+ * allocated option list and must be freed by the caller.
+ */
+pointer
+xf86OptionListDuplicate(pointer options)
+{
+ pointer o = NULL;
+
+ while (options)
+ {
+ o = xf86AddNewOption(o, xf86OptionName(options), xf86OptionValue(options));
+ options = xf86nextOption(options);
}
+
+ return o;
}
+
/* Created for new XInput stuff -- essentially extensions to the parser */
static int
diff --git a/xorg-server/hw/xfree86/common/xf86Privstr.h b/xorg-server/hw/xfree86/common/xf86Privstr.h index 6138b6bec..66a73d32b 100644 --- a/xorg-server/hw/xfree86/common/xf86Privstr.h +++ b/xorg-server/hw/xfree86/common/xf86Privstr.h @@ -96,7 +96,6 @@ typedef struct { #endif
Bool pmFlag;
Log log;
- Bool kbdCustomKeycodes;
Bool disableRandR;
MessageType randRFrom;
Bool aiglx;
@@ -108,8 +107,7 @@ typedef struct { MessageType useDefaultFontPathFrom;
Bool ignoreABI;
- Bool allowEmptyInput; /* Allow the server to start with no input
- * devices. */
+ Bool forceInputDevices; /* force xorg.conf or built-in input devices */
Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */
Bool autoEnableDevices; /* Whether to enable, or let the client
* control. */
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c index 3542abd4a..e90268a06 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.c +++ b/xorg-server/hw/xfree86/common/xf86Xinput.c @@ -59,23 +59,15 @@ #include "xf86Priv.h"
#include "xf86Config.h"
#include "xf86Xinput.h"
-#include "XIstubs.h"
#include "xf86Optrec.h"
-#include "xf86Parser.h"
#include "mipointer.h"
-#include "xf86InPriv.h"
-#include "compiler.h"
#include "extinit.h"
#include "loaderProcs.h"
-#ifdef DPMSExtension
-#include <X11/extensions/dpmsconst.h>
-#include "dpmsproc.h"
-#endif
-
#include "exevents.h" /* AddInputDevice */
#include "exglobals.h"
#include "eventstr.h"
+#include "inpututils.h"
#include <string.h> /* InputClassMatches */
#ifdef HAVE_FNMATCH_H
@@ -85,15 +77,9 @@ #include <sys/utsname.h>
#endif
-#include "extnsionst.h"
-
-#include "windowstr.h" /* screenIsSaved */
-
#include <stdarg.h>
#include <stdint.h> /* for int64_t */
-#include <X11/Xpoll.h>
-
#include "mi.h"
#include <ptrveloc.h> /* dix pointer acceleration */
@@ -105,10 +91,19 @@ #include "xkbsrv.h"
-#include "os.h"
+/* Valuator verification macro */
+#define XI_VERIFY_VALUATORS(num_valuators) \
+ if (num_valuators > MAX_VALUATORS) { \
+ xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \
+ " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \
+ return; \
+ }
EventListPtr xf86Events = NULL;
+static int
+xf86InputDevicePostInit(DeviceIntPtr dev);
+
/**
* Eval config and modify DeviceVelocityRec accordingly
*/
@@ -203,11 +198,11 @@ static void ApplyAccelerationSettings(DeviceIntPtr dev){
int scheme, i;
DeviceVelocityPtr pVel;
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate;
char* schemeStr;
if (dev->valuator && dev->ptrfeed) {
- schemeStr = xf86SetStrOption(local->options, "AccelerationScheme", "");
+ schemeStr = xf86SetStrOption(pInfo->options, "AccelerationScheme", "");
scheme = dev->valuator->accelScheme.number;
@@ -228,15 +223,15 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ if (InitPointerAccelerationScheme(dev, scheme)) {
xf86Msg(X_CONFIG, "%s: (accel) selected scheme %s/%i\n",
- local->name, schemeStr, scheme);
+ pInfo->name, schemeStr, scheme);
} else {
xf86Msg(X_CONFIG, "%s: (accel) could not init scheme %s\n",
- local->name, schemeStr);
+ pInfo->name, schemeStr);
scheme = dev->valuator->accelScheme.number;
}
} else {
xf86Msg(X_CONFIG, "%s: (accel) keeping acceleration scheme %i\n",
- local->name, scheme);
+ pInfo->name, scheme);
}
free(schemeStr);
@@ -245,45 +240,34 @@ ApplyAccelerationSettings(DeviceIntPtr dev){ switch (scheme) {
case PtrAccelPredictable:
pVel = GetDevicePredictableAccelData(dev);
- ProcessVelocityConfiguration (dev, local->name, local->options,
+ ProcessVelocityConfiguration (dev, pInfo->name, pInfo->options,
pVel);
break;
}
- i = xf86SetIntOption(local->options, "AccelerationNumerator",
+ i = xf86SetIntOption(pInfo->options, "AccelerationNumerator",
dev->ptrfeed->ctrl.num);
if (i >= 0)
dev->ptrfeed->ctrl.num = i;
- i = xf86SetIntOption(local->options, "AccelerationDenominator",
+ i = xf86SetIntOption(pInfo->options, "AccelerationDenominator",
dev->ptrfeed->ctrl.den);
if (i > 0)
dev->ptrfeed->ctrl.den = i;
- i = xf86SetIntOption(local->options, "AccelerationThreshold",
+ i = xf86SetIntOption(pInfo->options, "AccelerationThreshold",
dev->ptrfeed->ctrl.threshold);
if (i >= 0)
dev->ptrfeed->ctrl.threshold = i;
xf86Msg(X_CONFIG, "%s: (accel) acceleration factor: %.3f\n",
- local->name, ((float)dev->ptrfeed->ctrl.num)/
+ pInfo->name, ((float)dev->ptrfeed->ctrl.num)/
((float)dev->ptrfeed->ctrl.den));
xf86Msg(X_CONFIG, "%s: (accel) acceleration threshold: %i\n",
- local->name, dev->ptrfeed->ctrl.threshold);
+ pInfo->name, dev->ptrfeed->ctrl.threshold);
}
}
-static Bool
-xf86SendDragEvents(DeviceIntPtr device)
-{
- LocalDevicePtr local = (LocalDevicePtr) device->public.devicePrivate;
-
- if (device->button && device->button->buttonsDown > 0)
- return local->flags & XI86_SEND_DRAG_EVENTS;
- else
- return TRUE;
-}
-
/***********************************************************************
*
* xf86ProcessCommonOptions --
@@ -293,27 +277,18 @@ xf86SendDragEvents(DeviceIntPtr device) ***********************************************************************
*/
void
-xf86ProcessCommonOptions(LocalDevicePtr local,
+xf86ProcessCommonOptions(InputInfoPtr pInfo,
pointer list)
{
if (!xf86SetBoolOption(list, "AlwaysCore", 1) ||
!xf86SetBoolOption(list, "SendCoreEvents", 1) ||
!xf86SetBoolOption(list, "CorePointer", 1) ||
!xf86SetBoolOption(list, "CoreKeyboard", 1)) {
- xf86Msg(X_CONFIG, "%s: doesn't report core events\n", local->name);
- } else {
- local->flags |= XI86_ALWAYS_CORE;
- xf86Msg(X_CONFIG, "%s: always reports core events\n", local->name);
- }
-
- if (xf86SetBoolOption(list, "SendDragEvents", 1)) {
- local->flags |= XI86_SEND_DRAG_EVENTS;
+ xf86Msg(X_CONFIG, "%s: doesn't report core events\n", pInfo->name);
} else {
- xf86Msg(X_CONFIG, "%s: doesn't report drag events\n", local->name);
+ pInfo->flags |= XI86_ALWAYS_CORE;
+ xf86Msg(X_CONFIG, "%s: always reports core events\n", pInfo->name);
}
-
- /* Backwards compatibility. */
- local->history_size = GetMotionHistorySize();
}
/***********************************************************************
@@ -325,86 +300,38 @@ xf86ProcessCommonOptions(LocalDevicePtr local, * Returns TRUE on success, or FALSE otherwise.
***********************************************************************
*/
-int
-xf86ActivateDevice(LocalDevicePtr local)
+static DeviceIntPtr
+xf86ActivateDevice(InputInfoPtr pInfo)
{
DeviceIntPtr dev;
+ Atom atom;
- if (local->flags & XI86_CONFIGURED) {
- dev = AddInputDevice(serverClient, local->device_control, TRUE);
+ dev = AddInputDevice(serverClient, pInfo->device_control, TRUE);
- if (dev == NULL)
- {
- xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
- local->name);
- local->dev = NULL;
- return FALSE;
- }
-
- local->atom = MakeAtom(local->type_name,
- strlen(local->type_name),
- TRUE);
- AssignTypeAndName(dev, local->atom, local->name);
- dev->public.devicePrivate = (pointer) local;
- local->dev = dev;
-
- dev->coreEvents = local->flags & XI86_ALWAYS_CORE;
- dev->type = SLAVE;
- dev->spriteInfo->spriteOwner = FALSE;
-
- dev->deviceGrab.ActivateGrab = ActivateKeyboardGrab;
- dev->deviceGrab.DeactivateGrab = DeactivateKeyboardGrab;
-
- RegisterOtherDevice(dev);
- XkbSetExtension(dev, ProcessKeyboardEvent);
-
- if (serverGeneration == 1)
- xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
- local->name, local->type_name);
+ if (dev == NULL)
+ {
+ xf86Msg(X_ERROR, "Too many input devices. Ignoring %s\n",
+ pInfo->name);
+ pInfo->dev = NULL;
+ return NULL;
}
- return TRUE;
-}
+ atom = MakeAtom(pInfo->type_name, strlen(pInfo->type_name), TRUE);
+ AssignTypeAndName(dev, atom, pInfo->name);
+ dev->public.devicePrivate = pInfo;
+ pInfo->dev = dev;
+ dev->coreEvents = pInfo->flags & XI86_ALWAYS_CORE;
+ dev->type = SLAVE;
+ dev->spriteInfo->spriteOwner = FALSE;
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- ***********************************************************************
- */
+ dev->config_info = xf86SetStrOption(pInfo->options, "config_info", NULL);
-void
-OpenInputDevice(DeviceIntPtr dev,
- ClientPtr client,
- int *status)
-{
- if (!dev->inited)
- ActivateDevice(dev, TRUE);
+ if (serverGeneration == 1)
+ xf86Msg(X_INFO, "XINPUT: Adding extended input device \"%s\" (type: %s)\n",
+ pInfo->name, pInfo->type_name);
- *status = Success;
-}
-
-void
-CloseInputDevice(DeviceIntPtr dev,
- ClientPtr client)
-{
+ return dev;
}
/****************************************************************************
@@ -423,10 +350,10 @@ CloseInputDevice(DeviceIntPtr dev, int
SetDeviceMode (ClientPtr client, DeviceIntPtr dev, int mode)
{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate;
- if (local->switch_mode) {
- return (*local->switch_mode)(client, dev, mode);
+ if (pInfo->switch_mode) {
+ return (*pInfo->switch_mode)(client, dev, mode);
}
else
return BadMatch;
@@ -450,10 +377,10 @@ int SetDeviceValuators (ClientPtr client, DeviceIntPtr dev, int *valuators,
int first_valuator, int num_valuators)
{
- LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate;
- if (local->set_device_valuators)
- return (*local->set_device_valuators)(local, valuators, first_valuator,
+ if (pInfo->set_device_valuators)
+ return (*pInfo->set_device_valuators)(pInfo, valuators, first_valuator,
num_valuators);
return BadMatch;
@@ -472,9 +399,9 @@ SetDeviceValuators (ClientPtr client, DeviceIntPtr dev, int *valuators, int
ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control)
{
- LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr)dev->public.devicePrivate;
- if (!local->control_proc) {
+ if (!pInfo->control_proc) {
switch (control->control) {
case DEVICE_CORE:
return BadMatch;
@@ -488,15 +415,10 @@ ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control) }
}
else {
- return (*local->control_proc)(local, control);
+ return (*pInfo->control_proc)(pInfo, control);
}
}
-void
-AddOtherInputDevices(void)
-{
-}
-
/*
* Get the operating system name from uname and store it statically to avoid
* repeating the system call each time MatchOS is checked.
@@ -592,7 +514,7 @@ MatchAttrToken(const char *attr, struct list *patterns, * statements must match.
*/
static Bool
-InputClassMatches(const XF86ConfInputClassPtr iclass, const IDevPtr idev,
+InputClassMatches(const XF86ConfInputClassPtr iclass, const InputInfoPtr idev,
const InputAttributes *attrs)
{
/* MatchProduct substring */
@@ -672,7 +594,7 @@ InputClassMatches(const XF86ConfInputClassPtr iclass, const IDevPtr idev, * well as any previous InputClass sections.
*/
static int
-MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs)
+MergeInputClasses(const InputInfoPtr idev, const InputAttributes *attrs)
{
XF86ConfInputClassPtr cl;
XF86OptionPtr classopts;
@@ -697,9 +619,8 @@ MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs) /* Apply options to device with InputClass settings preferred. */
xf86Msg(X_CONFIG, "%s: Applying InputClass \"%s\"\n",
- idev->identifier, cl->identifier);
- idev->commonOptions = xf86optionListMerge(idev->commonOptions,
- classopts);
+ idev->name, cl->identifier);
+ idev->options = xf86optionListMerge(idev->options, classopts);
}
return Success;
@@ -710,7 +631,7 @@ MergeInputClasses(const IDevPtr idev, const InputAttributes *attrs) * value of the last matching class and holler when returning TRUE.
*/
static Bool
-IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs)
+IgnoreInputClass(const InputInfoPtr idev, const InputAttributes *attrs)
{
XF86ConfInputClassPtr cl;
Bool ignore = FALSE;
@@ -727,10 +648,95 @@ IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs) if (ignore)
xf86Msg(X_CONFIG, "%s: Ignoring device from InputClass \"%s\"\n",
- idev->identifier, ignore_class);
+ idev->name, ignore_class);
return ignore;
}
+static InputInfoPtr
+xf86AllocateInput(void)
+{
+ InputInfoPtr pInfo;
+
+ pInfo = calloc(sizeof(*pInfo), 1);
+ if (!pInfo)
+ return NULL;
+
+ pInfo->fd = -1;
+ pInfo->type_name = "UNKNOWN";
+
+ return pInfo;
+}
+
+/* Append InputInfoRec to the tail of xf86InputDevs. */
+static void
+xf86AddInput(InputDriverPtr drv, InputInfoPtr pInfo)
+{
+ InputInfoPtr *prev = NULL;
+
+ pInfo->drv = drv;
+ pInfo->module = DuplicateModule(drv->module, NULL);
+
+ for (prev = &xf86InputDevs; *prev; prev = &(*prev)->next)
+ ;
+
+ *prev = pInfo;
+ pInfo->next = NULL;
+
+ xf86CollectInputOptions(pInfo, (const char**)drv->default_options);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+}
+
+/*
+ * Remove an entry from xf86InputDevs and free all the device's information.
+ */
+void
+xf86DeleteInput(InputInfoPtr pInp, int flags)
+{
+ /* First check if the inputdev is valid. */
+ if (pInp == NULL)
+ return;
+
+ if (pInp->module)
+ UnloadModule(pInp->module);
+
+ /* This should *really* be handled in drv->UnInit(dev) call instead, but
+ * if the driver forgets about it make sure we free it or at least crash
+ * with flying colors */
+ free(pInp->private);
+
+ FreeInputAttributes(pInp->attrs);
+
+ /* Remove the entry from the list. */
+ if (pInp == xf86InputDevs)
+ xf86InputDevs = pInp->next;
+ else {
+ InputInfoPtr p = xf86InputDevs;
+ while (p && p->next != pInp)
+ p = p->next;
+ if (p)
+ p->next = pInp->next;
+ /* Else the entry wasn't in the xf86InputDevs list (ignore this). */
+ }
+
+ free(pInp->driver);
+ free(pInp->name);
+ xf86optionListFree(pInp->options);
+ free(pInp);
+}
+
+/*
+ * Apply backend-specific initialization. Invoked after ActiveteDevice(),
+ * i.e. after the driver successfully completed DEVICE_INIT and the device
+ * is advertised.
+ * @param dev the device
+ * @return Success or an error code
+ */
+static int
+xf86InputDevicePostInit(DeviceIntPtr dev) {
+ ApplyAccelerationSettings(dev);
+ return Success;
+}
+
/**
* Create a new input device, activate and enable it.
*
@@ -749,21 +755,20 @@ IgnoreInputClass(const IDevPtr idev, const InputAttributes *attrs) * @return Success or an error code
*/
_X_INTERNAL int
-xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable)
+xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
{
InputDriverPtr drv = NULL;
- InputInfoPtr pInfo = NULL;
DeviceIntPtr dev = NULL;
int rval;
/* Memory leak for every attached device if we don't
* test if the module is already loaded first */
- drv = xf86LookupInputDriver(idev->driver);
+ drv = xf86LookupInputDriver(pInfo->driver);
if (!drv)
- if (xf86LoadOneModule(idev->driver, NULL))
- drv = xf86LookupInputDriver(idev->driver);
+ if (xf86LoadOneModule(pInfo->driver, NULL))
+ drv = xf86LookupInputDriver(pInfo->driver);
if (!drv) {
- xf86Msg(X_ERROR, "No input driver matching `%s'\n", idev->driver);
+ xf86Msg(X_ERROR, "No input driver matching `%s'\n", pInfo->driver);
rval = BadName;
goto unwind;
}
@@ -776,42 +781,44 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) goto unwind;
}
- pInfo = drv->PreInit(drv, idev, 0);
+ xf86AddInput(drv, pInfo);
- if (!pInfo) {
- xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", idev->identifier);
- rval = BadMatch;
- goto unwind;
- }
- else if (!(pInfo->flags & XI86_CONFIGURED)) {
- xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n",
- idev->identifier);
- rval = BadMatch;
+ rval = drv->PreInit(drv, pInfo, 0);
+
+ if (rval != Success) {
+ xf86Msg(X_ERROR, "PreInit returned %d for \"%s\"\n", rval, pInfo->name);
goto unwind;
}
- if (!xf86ActivateDevice(pInfo))
+ if (!(dev = xf86ActivateDevice(pInfo)))
{
rval = BadAlloc;
goto unwind;
}
- dev = pInfo->dev;
rval = ActivateDevice(dev, TRUE);
if (rval != Success)
{
- xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier);
+ xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
RemoveDevice(dev, TRUE);
goto unwind;
}
+ rval = xf86InputDevicePostInit(dev);
+ if (rval != Success)
+ {
+ xf86Msg(X_ERROR, "Couldn't post-init device \"%s\"\n", pInfo->name);
+ RemoveDevice(dev, TRUE);
+ goto unwind;
+ }
+
/* Enable it if it's properly initialised and we're currently in the VT */
if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema)
{
EnableDevice(dev, TRUE);
if (!dev->enabled)
{
- xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier);
+ xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", pInfo->name);
rval = BadMatch;
goto unwind;
}
@@ -824,7 +831,7 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) unwind:
if(pInfo) {
- if(drv->UnInit)
+ if(drv && drv->UnInit)
drv->UnInit(drv, pInfo, 0);
else
xf86DeleteInput(pInfo, 0);
@@ -836,23 +843,23 @@ int NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
DeviceIntPtr *pdev)
{
- IDevRec *idev = NULL;
+ InputInfoPtr pInfo = NULL;
InputOption *option = NULL;
int rval = Success;
int is_auto = 0;
- idev = calloc(sizeof(*idev), 1);
- if (!idev)
+ pInfo = xf86AllocateInput();
+ if (!pInfo)
return BadAlloc;
for (option = options; option; option = option->next) {
if (strcasecmp(option->key, "driver") == 0) {
- if (idev->driver) {
+ if (pInfo->driver) {
rval = BadRequest;
goto unwind;
}
- idev->driver = xstrdup(option->value);
- if (!idev->driver) {
+ pInfo->driver = xstrdup(option->value);
+ if (!pInfo->driver) {
rval = BadAlloc;
goto unwind;
}
@@ -860,12 +867,12 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, if (strcasecmp(option->key, "name") == 0 ||
strcasecmp(option->key, "identifier") == 0) {
- if (idev->identifier) {
+ if (pInfo->name) {
rval = BadRequest;
goto unwind;
}
- idev->identifier = xstrdup(option->value);
- if (!idev->identifier) {
+ pInfo->name = xstrdup(option->value);
+ if (!pInfo->name) {
rval = BadAlloc;
goto unwind;
}
@@ -885,7 +892,7 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, for (option = options; option; option = option->next) {
/* Steal option key/value strings from the provided list.
* We need those strings, the InputOption list doesn't. */
- idev->commonOptions = xf86addNewOption(idev->commonOptions,
+ pInfo->options = xf86addNewOption(pInfo->options,
option->key, option->value);
option->key = NULL;
option->value = NULL;
@@ -893,58 +900,51 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs, /* Apply InputClass settings */
if (attrs) {
- if (IgnoreInputClass(idev, attrs)) {
+ if (IgnoreInputClass(pInfo, attrs)) {
rval = BadIDChoice;
goto unwind;
}
- rval = MergeInputClasses(idev, attrs);
+ rval = MergeInputClasses(pInfo, attrs);
if (rval != Success)
goto unwind;
- idev->attrs = DuplicateInputAttributes(attrs);
+ pInfo->attrs = DuplicateInputAttributes(attrs);
}
- if (!idev->driver || !idev->identifier) {
+ if (!pInfo->driver || !pInfo->name) {
xf86Msg(X_INFO, "No input driver/identifier specified (ignoring)\n");
rval = BadRequest;
goto unwind;
}
- if (!idev->identifier) {
+ if (!pInfo->name) {
xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n");
- return BadMatch;
+ rval = BadMatch;
+ goto unwind;
}
- rval = xf86NewInputDevice(idev, pdev,
+ rval = xf86NewInputDevice(pInfo, pdev,
(!is_auto || (is_auto && xf86Info.autoEnableDevices)));
- if (rval == Success)
- return Success;
+
+ return rval;
unwind:
if (is_auto && !xf86Info.autoAddDevices)
xf86Msg(X_INFO, "AutoAddDevices is off - not adding device.\n");
- free(idev->driver);
- free(idev->identifier);
- xf86optionListFree(idev->commonOptions);
- free(idev);
+ xf86DeleteInput(pInfo, 0);
return rval;
}
void
DeleteInputDeviceRequest(DeviceIntPtr pDev)
{
- LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
+ InputInfoPtr pInfo = (InputInfoPtr) pDev->public.devicePrivate;
InputDriverPtr drv = NULL;
- IDevRec *idev = NULL;
- IDevPtr *it;
Bool isMaster = IsMaster(pDev);
if (pInfo) /* need to get these before RemoveDevice */
- {
drv = pInfo->drv;
- idev = pInfo->conf_idev;
- }
OsBlockSignals();
RemoveDevice(pDev, TRUE);
@@ -955,19 +955,6 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) drv->UnInit(drv, pInfo, 0);
else
xf86DeleteInput(pInfo, 0);
-
- /* devices added through HAL aren't in the config layout */
- it = xf86ConfigLayout.inputs;
- while(*it && *it != idev)
- it++;
-
- if (!(*it)) /* end of list, not in the layout */
- {
- free(idev->driver);
- free(idev->identifier);
- xf86optionListFree(idev->commonOptions);
- free(idev);
- }
}
OsReleaseSignals();
}
@@ -985,16 +972,17 @@ xf86PostMotionEvent(DeviceIntPtr device, {
va_list var;
int i = 0;
- static int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_zero(&mask);
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
- valuators[i] = va_arg(var, int);
+ valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
- xf86PostMotionEventP(device, is_absolute, first_valuator, num_valuators, valuators);
+ xf86PostMotionEventM(device, is_absolute, &mask);
}
void
@@ -1002,10 +990,22 @@ xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
+{
+ ValuatorMask mask;
+
+ XI_VERIFY_VALUATORS(num_valuators);
+
+ valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
+ xf86PostMotionEventM(device, is_absolute, &mask);
+}
+
+void
+xf86PostMotionEventM(DeviceIntPtr device,
+ int is_absolute,
+ const ValuatorMask *mask)
{
int i = 0, nevents = 0;
- Bool drag = xf86SendDragEvents(device);
DeviceEvent *event;
int flags = 0;
@@ -1014,8 +1014,6 @@ xf86PostMotionEventP(DeviceIntPtr device, int dx = 0, dy = 0;
#endif
- XI_VERIFY_VALUATORS(num_valuators);
-
if (is_absolute)
flags = POINTER_ABSOLUTE;
else
@@ -1023,19 +1021,20 @@ xf86PostMotionEventP(DeviceIntPtr device, #if XFreeXDGA
/* The evdev driver may not always send all axes across. */
- if (num_valuators >= 1 && first_valuator <= 1) {
+ if (valuator_mask_isset(mask, 0) ||
+ valuator_mask_isset(mask, 1))
if (miPointerGetScreen(device)) {
index = miPointerGetScreen(device)->myNum;
- if (first_valuator == 0)
+ if (valuator_mask_isset(mask, 0))
{
- dx = valuators[0];
+ dx = valuator_mask_get(mask, 0);
if (is_absolute)
dx -= device->last.valuators[0];
}
- if (first_valuator == 1 || num_valuators >= 2)
+ if (valuator_mask_isset(mask, 1))
{
- dy = valuators[1 - first_valuator];
+ dy = valuator_mask_get(mask, 1);
if (is_absolute)
dy -= device->last.valuators[1];
}
@@ -1043,21 +1042,13 @@ xf86PostMotionEventP(DeviceIntPtr device, if (DGAStealMotionEvent(device, index, dx, dy))
return;
}
- }
#endif
- nevents = GetPointerEvents(xf86Events, device, MotionNotify, 0,
- flags, first_valuator, num_valuators,
- valuators);
+ nevents = GetPointerEvents(xf86Events, device, MotionNotify, 0, flags, mask);
for (i = 0; i < nevents; i++) {
event = (DeviceEvent*)((xf86Events + i)->event);
- /* Don't post core motion events for devices not registered to send
- * drag events. */
- if (event->header == ET_Internal &&
- (event->type != ET_Motion || drag)) {
- mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
- }
+ mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
}
}
@@ -1070,18 +1061,17 @@ xf86PostProximityEvent(DeviceIntPtr device, {
va_list var;
int i;
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_zero(&mask);
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
- valuators[i] = va_arg(var, int);
+ valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
- xf86PostProximityEventP(device, is_in, first_valuator, num_valuators,
- valuators);
-
+ xf86PostProximityEventM(device, is_in, &mask);
}
void
@@ -1089,15 +1079,25 @@ xf86PostProximityEventP(DeviceIntPtr device, int is_in,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
{
- int i, nevents;
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
+ xf86PostProximityEventM(device, is_in, &mask);
+}
+
+void
+xf86PostProximityEventM(DeviceIntPtr device,
+ int is_in,
+ const ValuatorMask *mask)
+{
+ int i, nevents;
+
nevents = GetProximityEvents(xf86Events, device,
- is_in ? ProximityIn : ProximityOut,
- first_valuator, num_valuators, valuators);
+ is_in ? ProximityIn : ProximityOut, mask);
for (i = 0; i < nevents; i++)
mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
@@ -1113,19 +1113,19 @@ xf86PostButtonEvent(DeviceIntPtr device, ...)
{
va_list var;
- int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
int i = 0;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_zero(&mask);
+
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
- valuators[i] = va_arg(var, int);
+ valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
- xf86PostButtonEventP(device, is_absolute, button, is_down, first_valuator,
- num_valuators, valuators);
-
+ xf86PostButtonEventM(device, is_absolute, button, is_down, &mask);
}
void
@@ -1135,7 +1135,22 @@ xf86PostButtonEventP(DeviceIntPtr device, int is_down,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
+{
+ ValuatorMask mask;
+
+ XI_VERIFY_VALUATORS(num_valuators);
+
+ valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
+ xf86PostButtonEventM(device, is_absolute, button, is_down, &mask);
+}
+
+void
+xf86PostButtonEventM(DeviceIntPtr device,
+ int is_absolute,
+ int button,
+ int is_down,
+ const ValuatorMask *mask)
{
int i = 0, nevents = 0;
int flags = 0;
@@ -1144,8 +1159,6 @@ xf86PostButtonEventP(DeviceIntPtr device, int index;
#endif
- XI_VERIFY_VALUATORS(num_valuators);
-
if (is_absolute)
flags = POINTER_ABSOLUTE;
else
@@ -1161,7 +1174,7 @@ xf86PostButtonEventP(DeviceIntPtr device, nevents = GetPointerEvents(xf86Events, device,
is_down ? ButtonPress : ButtonRelease, button,
- flags, first_valuator, num_valuators, valuators);
+ flags, mask);
for (i = 0; i < nevents; i++)
mieqEnqueue(device, (InternalEvent*)((xf86Events + i)->event));
@@ -1179,18 +1192,18 @@ xf86PostKeyEvent(DeviceIntPtr device, {
va_list var;
int i = 0;
- static int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_zero(&mask);
+
va_start(var, num_valuators);
for (i = 0; i < num_valuators; i++)
- valuators[i] = va_arg(var, int);
+ valuator_mask_set(&mask, first_valuator + i, va_arg(var, int));
va_end(var);
- xf86PostKeyEventP(device, key_code, is_down, is_absolute, first_valuator,
- num_valuators, valuators);
-
+ xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask);
}
void
@@ -1200,17 +1213,29 @@ xf86PostKeyEventP(DeviceIntPtr device, int is_absolute,
int first_valuator,
int num_valuators,
- int *valuators)
+ const int *valuators)
{
- int i = 0, nevents = 0;
+ ValuatorMask mask;
XI_VERIFY_VALUATORS(num_valuators);
+ valuator_mask_set_range(&mask, first_valuator, num_valuators, valuators);
+ xf86PostKeyEventM(device, key_code, is_down, is_absolute, &mask);
+}
+
+void
+xf86PostKeyEventM(DeviceIntPtr device,
+ unsigned int key_code,
+ int is_down,
+ int is_absolute,
+ const ValuatorMask *mask)
+{
+ int i = 0, nevents = 0;
+
if (is_absolute) {
nevents = GetKeyboardValuatorEvents(xf86Events, device,
is_down ? KeyPress : KeyRelease,
- key_code, first_valuator,
- num_valuators, valuators);
+ key_code, mask);
}
else {
nevents = GetKeyboardEvents(xf86Events, device,
@@ -1227,10 +1252,13 @@ xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
int is_down)
{
- xf86PostKeyEventP(device, key_code, is_down, 0, 0, 0, NULL);
+ ValuatorMask mask;
+
+ valuator_mask_zero(&mask);
+ xf86PostKeyEventM(device, key_code, is_down, 0, &mask);
}
-LocalDevicePtr
+InputInfoPtr
xf86FirstLocalDevice(void)
{
return xf86InputDevs;
@@ -1286,27 +1314,27 @@ xf86ScaleAxis(int Cx, * specific like a touch screen.
*/
void
-xf86XInputSetScreen(LocalDevicePtr local,
+xf86XInputSetScreen(InputInfoPtr pInfo,
int screen_number,
int x,
int y)
{
- if (miPointerGetScreen(local->dev) !=
+ if (miPointerGetScreen(pInfo->dev) !=
screenInfo.screens[screen_number]) {
- miPointerSetScreen(local->dev, screen_number, x, y);
+ miPointerSetScreen(pInfo->dev, screen_number, x, y);
}
}
void
xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval,
- int resolution, int min_res, int max_res)
+ int resolution, int min_res, int max_res, int mode)
{
if (!dev || !dev->valuator)
return;
InitValuatorAxisStruct(dev, axnum, label, minval, maxval, resolution, min_res,
- max_res);
+ max_res, mode);
}
/*
@@ -1324,9 +1352,6 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2;
dev->last.valuators[1] = dev->valuator->axisVal[1];
}
-
- if(axnum == 0) /* to prevent double invocation */
- ApplyAccelerationSettings(dev);
}
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.h b/xorg-server/hw/xfree86/common/xf86Xinput.h index 727f26107..15ab82421 100644 --- a/xorg-server/hw/xfree86/common/xf86Xinput.h +++ b/xorg-server/hw/xfree86/common/xf86Xinput.h @@ -59,161 +59,123 @@ #include "XIstubs.h"
/* Input device flags */
-#define XI86_OPEN_ON_INIT 0x01 /* open the device at startup time */
-#define XI86_CONFIGURED 0x02 /* the device has been configured */
#define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */
/* the device sends Xinput and core pointer events */
#define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE
-/* if the device is the core pointer or is sending core events, and
- * SEND_DRAG_EVENTS is false, and a buttons is done, then no motion events
- * (mouse drag action) are sent. This is mainly to allow a touch screen to be
- * used with netscape and other browsers which do strange things if the mouse
- * moves between button down and button up. With a touch screen, this motion
- * is common due to the user's finger moving slightly.
- */
-#define XI86_SEND_DRAG_EVENTS 0x08
-#define XI86_CORE_POINTER 0x10 /* device is the core pointer */
-#define XI86_CORE_KEYBOARD 0x20 /* device is the core keyboard */
-#define XI86_POINTER_CAPABLE 0x40 /* capable of being a core pointer */
-#define XI86_KEYBOARD_CAPABLE 0x80 /* capable of being a core keyboard */
-
-#define XI_PRIVATE(dev) \
- (((LocalDevicePtr)((dev)->public.devicePrivate))->private)
-
-/* Valuator verification macro */
-#define XI_VERIFY_VALUATORS(num_valuators) \
- if (num_valuators > MAX_VALUATORS) { \
- xf86Msg(X_ERROR, "%s: num_valuator %d is greater than" \
- " MAX_VALUATORS\n", __FUNCTION__, num_valuators); \
- return; \
- }
-
-/* Stupid API backwards-compatibility. */
-#define TS_Raw 60
-#define TS_Scaled 61
/* This holds the input driver entry and module information. */
typedef struct _InputDriverRec {
int driverVersion;
char * driverName;
void (*Identify)(int flags);
- struct _LocalDeviceRec *(*PreInit)(struct _InputDriverRec *drv,
- IDevPtr dev, int flags);
+ int (*PreInit)(struct _InputDriverRec *drv,
+ struct _InputInfoRec* pInfo, int flags);
void (*UnInit)(struct _InputDriverRec *drv,
- struct _LocalDeviceRec *pInfo,
+ struct _InputInfoRec *pInfo,
int flags);
pointer module;
+ char ** default_options;
} InputDriverRec, *InputDriverPtr;
/* This is to input devices what the ScrnInfoRec is to screens. */
-typedef struct _LocalDeviceRec {
- struct _LocalDeviceRec *next;
+typedef struct _InputInfoRec {
+ struct _InputInfoRec *next;
char * name;
+ char * driver;
+
int flags;
Bool (*device_control)(DeviceIntPtr device, int what);
- void (*read_input)(struct _LocalDeviceRec *local);
- int (*control_proc)(struct _LocalDeviceRec *local,
+ void (*read_input)(struct _InputInfoRec *local);
+ int (*control_proc)(struct _InputInfoRec *local,
xDeviceCtl *control);
- void (*close_proc)(struct _LocalDeviceRec *local);
int (*switch_mode)(ClientPtr client, DeviceIntPtr dev,
int mode);
- Bool (*conversion_proc)(struct _LocalDeviceRec *local,
- int first, int num, int v0,
- int v1, int v2, int v3, int v4,
- int v5, int *x, int *y);
- Bool (*reverse_conversion_proc)(
- struct _LocalDeviceRec *local,
- int x, int y, int *valuators);
int (*set_device_valuators)
- (struct _LocalDeviceRec *local,
+ (struct _InputInfoRec *local,
int *valuators, int first_valuator,
int num_valuators);
int fd;
- Atom atom;
DeviceIntPtr dev;
pointer private;
- int private_flags;
- unsigned int first;
- unsigned int last;
- int old_x;
- int old_y;
char * type_name;
- IntegerFeedbackPtr always_core_feedback;
- IDevPtr conf_idev;
InputDriverPtr drv;
pointer module;
pointer options;
- unsigned int history_size;
InputAttributes *attrs;
-} LocalDeviceRec, *LocalDevicePtr, InputInfoRec, *InputInfoPtr;
-
-typedef struct _DeviceAssocRec
-{
- char * config_section_name;
- LocalDevicePtr (*device_allocate)(void);
-} DeviceAssocRec, *DeviceAssocPtr;
+} *InputInfoPtr;
/* xf86Globals.c */
-extern _X_EXPORT InputInfoPtr xf86InputDevs;
+extern InputInfoPtr xf86InputDevs;
/* xf86Xinput.c */
extern _X_EXPORT void xf86PostMotionEvent(DeviceIntPtr device, int is_absolute,
int first_valuator, int num_valuators, ...);
extern _X_EXPORT void xf86PostMotionEventP(DeviceIntPtr device, int is_absolute,
- int first_valuator, int num_valuators, int *valuators);
+ int first_valuator, int num_valuators, const int *valuators);
+extern _X_EXPORT void xf86PostMotionEventM(DeviceIntPtr device, int is_absolute,
+ const ValuatorMask *mask);
extern _X_EXPORT void xf86PostProximityEvent(DeviceIntPtr device, int is_in,
int first_valuator, int num_valuators, ...);
extern _X_EXPORT void xf86PostProximityEventP(DeviceIntPtr device, int is_in, int first_valuator,
- int num_valuators, int *valuators);
+ int num_valuators, const int *valuators);
+extern _X_EXPORT void xf86PostProximityEventM(DeviceIntPtr device, int is_in,
+ const ValuatorMask *mask);
extern _X_EXPORT void xf86PostButtonEvent(DeviceIntPtr device, int is_absolute, int button,
int is_down, int first_valuator, int num_valuators,
...);
extern _X_EXPORT void xf86PostButtonEventP(DeviceIntPtr device, int is_absolute, int button,
int is_down, int first_valuator, int num_valuators,
- int *valuators);
+ const int *valuators);
+extern _X_EXPORT void xf86PostButtonEventM(DeviceIntPtr device, int is_absolute, int button,
+ int is_down, const ValuatorMask *mask);
extern _X_EXPORT void xf86PostKeyEvent(DeviceIntPtr device, unsigned int key_code, int is_down,
int is_absolute, int first_valuator, int num_valuators,
...);
+extern _X_EXPORT void xf86PostKeyEventM(DeviceIntPtr device, unsigned int key_code, int is_down,
+ int is_absolute, const ValuatorMask *mask);
extern _X_EXPORT void xf86PostKeyEventP(DeviceIntPtr device, unsigned int key_code, int is_down,
int is_absolute, int first_valuator, int num_valuators,
- int *valuators);
+ const int *valuators);
extern _X_EXPORT void xf86PostKeyboardEvent(DeviceIntPtr device, unsigned int key_code,
int is_down);
-extern _X_EXPORT int xf86ActivateDevice(LocalDevicePtr local);
-extern _X_EXPORT LocalDevicePtr xf86FirstLocalDevice(void);
+extern _X_EXPORT InputInfoPtr xf86FirstLocalDevice(void);
extern _X_EXPORT int xf86ScaleAxis(int Cx, int to_max, int to_min, int from_max, int from_min);
-extern _X_EXPORT void xf86XInputSetScreen(LocalDevicePtr local, int screen_number, int x, int y);
+extern _X_EXPORT void xf86XInputSetScreen(InputInfoPtr pInfo, int screen_number, int x, int y);
extern _X_EXPORT void xf86ProcessCommonOptions(InputInfoPtr pInfo, pointer options);
extern _X_EXPORT void xf86InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval,
int maxval, int resolution, int min_res,
- int max_res);
+ int max_res, int mode);
extern _X_EXPORT void xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum);
extern _X_EXPORT void xf86AddEnabledDevice(InputInfoPtr pInfo);
extern _X_EXPORT void xf86RemoveEnabledDevice(InputInfoPtr pInfo);
extern _X_EXPORT void xf86DisableDevice(DeviceIntPtr dev, Bool panic);
extern _X_EXPORT void xf86EnableDevice(DeviceIntPtr dev);
/* not exported */
-int xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL is_auto);
+int xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL is_auto);
/* xf86Helper.c */
extern _X_EXPORT void xf86AddInputDriver(InputDriverPtr driver, pointer module, int flags);
extern _X_EXPORT void xf86DeleteInputDriver(int drvIndex);
-extern _X_EXPORT InputInfoPtr xf86AllocateInput(InputDriverPtr drv, int flags);
extern _X_EXPORT InputDriverPtr xf86LookupInputDriver(const char *name);
extern _X_EXPORT InputInfoPtr xf86LookupInput(const char *name);
extern _X_EXPORT void xf86DeleteInput(InputInfoPtr pInp, int flags);
-extern _X_EXPORT void xf86MotionHistoryAllocate(LocalDevicePtr local);
+extern _X_EXPORT void xf86MotionHistoryAllocate(InputInfoPtr pInfo);
+extern _X_EXPORT void xf86IDrvMsgVerb(InputInfoPtr dev,
+ MessageType type, int verb,
+ const char *format, ...) _X_ATTRIBUTE_PRINTF(4,5);
+extern _X_EXPORT void xf86IDrvMsg(InputInfoPtr dev,
+ MessageType type,
+ const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4);
+extern _X_EXPORT void xf86VIDrvMsgVerb(InputInfoPtr dev,
+ MessageType type,
+ int verb,
+ const char *format,
+ va_list args);
/* xf86Option.c */
-extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts,
- pointer extraOpts);
-
-
-/* Legacy hatred */
-#define SendCoreEvents 59
-#define DontSendCoreEvents 60
+extern _X_EXPORT void xf86CollectInputOptions(InputInfoPtr pInfo, const char **defaultOpts);
#endif /* _xf86Xinput_h */
diff --git a/xorg-server/hw/xfree86/common/xf86str.h b/xorg-server/hw/xfree86/common/xf86str.h index 9d52661a7..0b7685012 100644 --- a/xorg-server/hw/xfree86/common/xf86str.h +++ b/xorg-server/hw/xfree86/common/xf86str.h @@ -402,14 +402,6 @@ typedef struct { } GDevRec, *GDevPtr;
typedef struct {
- char * identifier;
- char * driver;
- pointer commonOptions;
- pointer extraOptions;
- InputAttributes *attrs;
-} IDevRec, *IDevPtr;
-
-typedef struct {
int frameX0;
int frameY0;
int virtualX;
@@ -478,11 +470,13 @@ typedef struct _screenlayoutrec { confScreenPtr refscreen;
} screenLayoutRec, *screenLayoutPtr;
+typedef struct _InputInfoRec InputInfoRec;
+
typedef struct _serverlayoutrec {
char * id;
screenLayoutPtr screens;
GDevPtr inactives;
- IDevPtr* inputs; /* NULL terminated */
+ InputInfoRec** inputs; /* NULL terminated */
pointer options;
} serverLayoutRec, *serverLayoutPtr;
diff --git a/xorg-server/hw/xfree86/doc/devel/Registry b/xorg-server/hw/xfree86/doc/devel/Registry index 1fec230e8..613b50c7b 100644 --- a/xorg-server/hw/xfree86/doc/devel/Registry +++ b/xorg-server/hw/xfree86/doc/devel/Registry @@ -1,409 +1,408 @@ -This is the XFree86 driver/module registry. To avoid name space clashes and -to maintain some consistency between drivers the important name spaces are -maintained here. - -1. Module Names. - -Each module is required to have a unique name. Registered names are: - -GLcore -acecad -afb -apm -ark -ati -atimisc -bitmap -bt8xx -calcomp -cfb -cfb16 -cfb24 -cfb32 -chips -cirrus -citron -cyrix -dbe -ddc -digitaledge -dmc -dri -drm -dynapro -elo2300 -elographics -extmod -fb -fbdev -fbdevhw -fi12x6 -freetype -glide -glint -glx -hyperpen -i128 -i2c -i740 -i810 -imstt -int10 -joystick -keyboard -layer -magellan -magictouch -mfb -mga -microtouch -mouse -msp34xx -mutouch -neomagic -newport -nv -pcidata -penmount -pex5 -r128 -radeon -rac -ramdac -record -rendition -s3 -s3virge -savage -shadow -shadowfb -siliconmotion -sis -spaceorb -speedo -summa -sunbw2 -suncg14 -suncg3 -suncg6 -sunffb -sunleo -suntcx -tdfx -tga -trident -tseng -type1 -v4l -vbe -vesa -vga -vgahw -vmware -void -wacom -xaa -xf1bpp -xf24_32bpp -xf4bpp -xf8_16bpp -xf8_32bpp -xf8_32wid -xie -xtrap -xtt - -2. External Module Object Symbols. - -Each module is required to use a unique prefix or prefixes for all of -its externally visible symbols. They should be unique without regard to -case. Registered prefixes are: - -ati -bt8xx -cfb -chips -fi12x6 -glide -glint -mfb -mga -msp34xx -neo -permedia -tseng -vga -vgahw -vmware -xaa -xf1bpp -xf4bpp - -3. Chipset Names. - -Each video driver is required to use a unique set of chipset names. Case, -white space and underscore characters are ignored when comparing chipset -names. All names listed here are in lower case with all white space and -underscores removed. Registered chipset names are: - -ati -ativga -ct64200 -ct64300 -ct65520 -ct65525 -ct65530 -ct65535 -ct65540 -ct65545 -ct65546 -ct65548 -ct65550 -ct65554 -ct65555 -ct68554 -ct69000 -et4000 -et4000w32 -et4000w32i -et4000w32p -et6000 -et6100 -generic -ibmvga -ibm8514 -mach32 -mach64 -mach8 -mga2064w -mga1064sg -mga2164w -mga2164wagp -neo2070 -neo2090 -neo2093 -neo2097 -neo2160 -neo2200 -tipm2 -vgawonder -voodoo - -4. Option Names. - -Option names and their usage should be consistent between drivers. -Case, white space and underscore characters are ignored when comparing -option names. The prefix "no" may be added or removed from boolean -option names. All names listed here are in their preferred user-visible -form. Some registered option names are: - -Types are: B = boolean, O = set/unset (no value), I = integer, S = string, - A = optional string, F = floating point number Q = frequency - -Scopes are: F = global flags, V = video driver, C = common (per screen), - I = input drivers, X = XAA, Xv = Xv extension, M = misc. - -Names currently in use: - -Name Type Scope Description ----------------------------------------------------------------------------- -AllowMouseOpenFail B F ignore mouse dev open failure -AllowNonLocalModInDev B F allow non-local mod of input devs -AllowNonLocalXvidtune B F allow non-local VidMode connections -BlankTime I F Screen saver timeout (min) -DisableModInDev B F disallow changing input devs -DisableVidModeExtension B F disable VidMode extension -DontVTSwitch B F disable Ctrl-Alt-Fn -DontZap B F disable Ctrl-Alt-BS sequence -DontZoom B F disable Ctrl-Alt-+/- -NoTrapSignals B F don't trap signals -OffTime I F Time before DPMS off mode active (min) -PciProbe1 O F use PCI probe algorithm 1 -PciProbe2 O F use PCI probe algorithm 2 -PciForceConfig1 O F force PCI config type 1 -PciForceConfig2 O F force PCI config type 2 -Pixmap I F depth 24 pixmap size (24 or 32) -StandbyTime I F Time before DPMS standby active (min) -SuspendTime I F Time before DPMS suspend mode active (min) - -BackingStore B C Enable backing store -DDC B C Enable/disable DDC -DDC1 B C Enable/disable DDC1 -DDC2 B C Enable/disable DDC2 -DPMS O C Enable DPMS -MTRR B C Enable/disable setting MTRRs - -BaudRate I I Serial port baud rate -ButtonNumber I I Button number (for touch screen?) -ButtonThreshold I I ?? -ClearDTR O I Clear serial port DTR -ClearRTS O I Clear serial port RTS -DataBits I I Serial port data bits -DemandLoad O I ?? -Device S I Device file name -DeviceName S I Input device name -FlowControl S I Serial flow control ("xon", "none") -HistorySize I I ?? -MaxX I I Maximum X coordinate -MaxY I I Maximum Y coordinate -MinX I I Minimum X coordinate -MinY I I Minimum Y coordinate -Parity S I Serial port parity ("odd", "even", "none") -ReportDelay I I ?? -ReportingMode S I may be "raw" or "scaled" -ScreenNumber I I Screen number (for touch screen) -SendCoreEvents B I Send core events -SendDragEvents B I Send drag events -StopBits I I Serial port stop bits -SwapXY B I Swap the X and Y axes -UntouchDelay I I ?? -Vmin I I Tty VMIN -Vtime I I Tty VTIME - - -18BitBus B V ?? -8Plus16 B V Enable depth 8 + depth 16 with overlay -8Plus24 B V Enable depth 8 + depth 24 with overlay -BlockWrite B V Enable/disable block write -ColorKey I V Set the color key for overlay modes -CompositeSync B V Composite sync -CRTDisplay B V Force display on CRT, not LCD -CRTScreen B V Display on CRT, not LCD (Obsolete) -EarlyRasPrecharge O V Early RAS pre-charge -FastDRAM O V Fast DRAM -FifoAggressive O V Aggressive FIFO setting -FifoConservative O V Conservative FIFO setting -FifoModerate O V Moderate FIFO setting -FireGL3000 B V Card is Diamond FireGL3000 -FixPanelSize B V ?? -FPClock8 Q V Flat panel clock for 8bpp fb (MHz) -FPClock16 Q V Flat panel clock for 16bpp fb (MHz) -FPClock24 Q V Flat panel clock for 24bpp fb (MHz) -FPClock32 Q V Flat panel clock for 32bpp fb (MHz) -FPMVRAM O V Fast page mode VRAM -FramebufferWC B V Enable/disable WC for the framebuffer -GlideDevice I V Selects which Voodoo board to use -HiBitHigh O V High clock bit default to set -HiBitLow O V High clock bit default to cleared -HWClocks B V Enable/disable HW clocks -HWCursor B V Enable/disable HW cursor -LateRasPrecharge O V Late RAS pre-charge -Legend O V Card is Legend ET4000 -LCDCenter B V Enable/disable centering for LCD displays -Linear B V Enable/disable linear framebuffer -MCLK Q V Specify the current MCLK value (MHz) -MedDRAM B V Medium speed DRAM -MemCfg1 I V ?? -MemCfg2 I V ?? -MGASDRAM B V Mga card has SDRAM -MMIO B V Enable/disable memory mapped I/O -MMIOCache B V Enable/Disable MMIO cache -MuxThreshold I V Multiplexing threshold (kHz) -NoAccel B V Disable/enable acceleration -NoClockChip B V ?? -NoStretch B V Disable/enable stretching for LCD displays -OnAtExit B V Leave video signal on when exiting server -OverclockMem B V Enable memory overclocking -Overlay A V Enable multi-depth/overlay. An optional - string "M,N" may be specified, where - M, N are the depths. -PanelDisplay B V Force display on LCD -PciBurst B V Enable/disable PCI burst mode -PciRetry B V Enable/disable PCI retries -ProbeClocks B V Force probe for non-programmable clocks -ReferenceClock Q V Clock generator reference frequency -RGBbits I V Number of significant bits per rgb -Rotate S V Rotate the virtual display (CW or CCW) -SetLCDClk Q V Set LCD clock (MHz) -SetMclk Q V Set Memory Clock (MHz) -ShadowFB B V Enable shadow framebuffer layer -ShowCache B V Enable viewing of offscreen memory -ShowOverscan O V Set the overscan area to a visible colour -SlowDRAM O V Slow DRAM -SlowEDODRAM O V Slow EDO DRAM -STN B V STN screen type (??) -SWCursor B V Enable/disable SW cursor -SuspendHack B V ?? -SyncOnGreen B V Enable/disable sync on green -TurboQueue B V Enable/disable turbo queue -UseFBDev B V Use the fbdev driver interface -UseModeLine B V Use Modeline (??) -W32Interleave B V ?? - -Buffers I Xv Number of buffers -Device S Xv Device file name -Expose B Xv Disable occlusion clipping (see DESIGN) -FramesPerSec I Xv Max. refresh frequency - -XAA options. All are of type "O" and scope "X", and are self-explanatory - -XaaNoColor8x8PatternFillRect -XaaNoColor8x8PatternFillTrap -XaaNoCPUToScreenColorExpandFill -XaaNoDashedBresenhamLine -XaaNoDashedTwoPointLine -XaaNoScreenToScreenCopy -XaaNoImageReadRect -XaaNoImageWriteRect -XaaNoMono8x8PatternFillRect -XaaNoMono8x8PatternFillTrap -XaaNoOffscreenPixmaps -XaaNoPixmapCache -XaaNoScanlineCPUToScreenColorExpandFill -XaaNoScanlineImageWriteRect -XaaNoScreenToScreenColorExpandFill -XaaNoSolidBresenhamLine -XaaNoSolidFillRect -XaaNoSolidFillTrap -XaaNoSolidHorVertLine -XaaNoSolidTwoPointLine - - -Names used in previous versions: - -16Clocks -8Clocks -ClkDiv2 -EDO VRAM -ExternDisp -ExtFramBuf -FastVRAM -FavorBitBlt -InternDisp -NoBitBlt -NoFontCache -NoImageBlt -NoMemAccess -NoPciDisconnect -NoPixmapCache -NoProgramClocks -NoSplitXfer -OverrideBIOS -OverrideValidateMode -ProgLcdModeRegs -ProgLcdModeStretch -SlowDRAMrefresh -SlowVRAM -SwapHiBit - - -5. Ramdac Names. - -Ramdac names should be consistent between drivers. Case, white space -and underscore characters are ignored when comparing ramdac names. All -names listed here are in lower case with all white space and underscores -removed. - - -6. Clock Chip Names. - -Clock chip names should be consistent between drivers. Case, white -space and underscore characters are ignored when comparing clock chip -names. All names listed here are in lower case with all white space -and underscores removed. - - - - - -$XFree86: xc/programs/Xserver/hw/xfree86/Registry,v 1.18 2002/04/06 18:31:09 tsi Exp $ +This is the XFree86 driver/module registry. To avoid name space clashes and
+to maintain some consistency between drivers the important name spaces are
+maintained here.
+
+1. Module Names.
+
+Each module is required to have a unique name. Registered names are:
+
+GLcore
+acecad
+afb
+apm
+ark
+ati
+atimisc
+bitmap
+bt8xx
+calcomp
+cfb
+cfb16
+cfb24
+cfb32
+chips
+cirrus
+citron
+cyrix
+dbe
+ddc
+digitaledge
+dmc
+dri
+drm
+dynapro
+elo2300
+elographics
+extmod
+fb
+fbdev
+fbdevhw
+fi12x6
+freetype
+glide
+glint
+glx
+hyperpen
+i128
+i2c
+i740
+i810
+imstt
+int10
+joystick
+keyboard
+layer
+magellan
+magictouch
+mfb
+mga
+microtouch
+mouse
+msp34xx
+mutouch
+neomagic
+newport
+nv
+pcidata
+penmount
+pex5
+r128
+radeon
+rac
+ramdac
+record
+rendition
+s3
+s3virge
+savage
+shadow
+shadowfb
+siliconmotion
+sis
+spaceorb
+speedo
+summa
+sunbw2
+suncg14
+suncg3
+suncg6
+sunffb
+sunleo
+suntcx
+tdfx
+tga
+trident
+tseng
+type1
+v4l
+vbe
+vesa
+vga
+vgahw
+vmware
+void
+wacom
+xaa
+xf1bpp
+xf24_32bpp
+xf4bpp
+xf8_16bpp
+xf8_32bpp
+xf8_32wid
+xie
+xtrap
+xtt
+
+2. External Module Object Symbols.
+
+Each module is required to use a unique prefix or prefixes for all of
+its externally visible symbols. They should be unique without regard to
+case. Registered prefixes are:
+
+ati
+bt8xx
+cfb
+chips
+fi12x6
+glide
+glint
+mfb
+mga
+msp34xx
+neo
+permedia
+tseng
+vga
+vgahw
+vmware
+xaa
+xf1bpp
+xf4bpp
+
+3. Chipset Names.
+
+Each video driver is required to use a unique set of chipset names. Case,
+white space and underscore characters are ignored when comparing chipset
+names. All names listed here are in lower case with all white space and
+underscores removed. Registered chipset names are:
+
+ati
+ativga
+ct64200
+ct64300
+ct65520
+ct65525
+ct65530
+ct65535
+ct65540
+ct65545
+ct65546
+ct65548
+ct65550
+ct65554
+ct65555
+ct68554
+ct69000
+et4000
+et4000w32
+et4000w32i
+et4000w32p
+et6000
+et6100
+generic
+ibmvga
+ibm8514
+mach32
+mach64
+mach8
+mga2064w
+mga1064sg
+mga2164w
+mga2164wagp
+neo2070
+neo2090
+neo2093
+neo2097
+neo2160
+neo2200
+tipm2
+vgawonder
+voodoo
+
+4. Option Names.
+
+Option names and their usage should be consistent between drivers.
+Case, white space and underscore characters are ignored when comparing
+option names. The prefix "no" may be added or removed from boolean
+option names. All names listed here are in their preferred user-visible
+form. Some registered option names are:
+
+Types are: B = boolean, O = set/unset (no value), I = integer, S = string,
+ A = optional string, F = floating point number Q = frequency
+
+Scopes are: F = global flags, V = video driver, C = common (per screen),
+ I = input drivers, X = XAA, Xv = Xv extension, M = misc.
+
+Names currently in use:
+
+Name Type Scope Description
+----------------------------------------------------------------------------
+AllowMouseOpenFail B F ignore mouse dev open failure
+AllowNonLocalModInDev B F allow non-local mod of input devs
+AllowNonLocalXvidtune B F allow non-local VidMode connections
+BlankTime I F Screen saver timeout (min)
+DisableModInDev B F disallow changing input devs
+DisableVidModeExtension B F disable VidMode extension
+DontVTSwitch B F disable Ctrl-Alt-Fn
+DontZap B F disable Ctrl-Alt-BS sequence
+DontZoom B F disable Ctrl-Alt-+/-
+NoTrapSignals B F don't trap signals
+OffTime I F Time before DPMS off mode active (min)
+PciProbe1 O F use PCI probe algorithm 1
+PciProbe2 O F use PCI probe algorithm 2
+PciForceConfig1 O F force PCI config type 1
+PciForceConfig2 O F force PCI config type 2
+Pixmap I F depth 24 pixmap size (24 or 32)
+StandbyTime I F Time before DPMS standby active (min)
+SuspendTime I F Time before DPMS suspend mode active (min)
+
+BackingStore B C Enable backing store
+DDC B C Enable/disable DDC
+DDC1 B C Enable/disable DDC1
+DDC2 B C Enable/disable DDC2
+DPMS O C Enable DPMS
+MTRR B C Enable/disable setting MTRRs
+
+BaudRate I I Serial port baud rate
+ButtonNumber I I Button number (for touch screen?)
+ButtonThreshold I I ??
+ClearDTR O I Clear serial port DTR
+ClearRTS O I Clear serial port RTS
+DataBits I I Serial port data bits
+DemandLoad O I ??
+Device S I Device file name
+DeviceName S I Input device name
+FlowControl S I Serial flow control ("xon", "none")
+HistorySize I I ??
+MaxX I I Maximum X coordinate
+MaxY I I Maximum Y coordinate
+MinX I I Minimum X coordinate
+MinY I I Minimum Y coordinate
+Parity S I Serial port parity ("odd", "even", "none")
+ReportDelay I I ??
+ReportingMode S I may be "raw" or "scaled"
+ScreenNumber I I Screen number (for touch screen)
+SendCoreEvents B I Send core events
+StopBits I I Serial port stop bits
+SwapXY B I Swap the X and Y axes
+UntouchDelay I I ??
+Vmin I I Tty VMIN
+Vtime I I Tty VTIME
+
+
+18BitBus B V ??
+8Plus16 B V Enable depth 8 + depth 16 with overlay
+8Plus24 B V Enable depth 8 + depth 24 with overlay
+BlockWrite B V Enable/disable block write
+ColorKey I V Set the color key for overlay modes
+CompositeSync B V Composite sync
+CRTDisplay B V Force display on CRT, not LCD
+CRTScreen B V Display on CRT, not LCD (Obsolete)
+EarlyRasPrecharge O V Early RAS pre-charge
+FastDRAM O V Fast DRAM
+FifoAggressive O V Aggressive FIFO setting
+FifoConservative O V Conservative FIFO setting
+FifoModerate O V Moderate FIFO setting
+FireGL3000 B V Card is Diamond FireGL3000
+FixPanelSize B V ??
+FPClock8 Q V Flat panel clock for 8bpp fb (MHz)
+FPClock16 Q V Flat panel clock for 16bpp fb (MHz)
+FPClock24 Q V Flat panel clock for 24bpp fb (MHz)
+FPClock32 Q V Flat panel clock for 32bpp fb (MHz)
+FPMVRAM O V Fast page mode VRAM
+FramebufferWC B V Enable/disable WC for the framebuffer
+GlideDevice I V Selects which Voodoo board to use
+HiBitHigh O V High clock bit default to set
+HiBitLow O V High clock bit default to cleared
+HWClocks B V Enable/disable HW clocks
+HWCursor B V Enable/disable HW cursor
+LateRasPrecharge O V Late RAS pre-charge
+Legend O V Card is Legend ET4000
+LCDCenter B V Enable/disable centering for LCD displays
+Linear B V Enable/disable linear framebuffer
+MCLK Q V Specify the current MCLK value (MHz)
+MedDRAM B V Medium speed DRAM
+MemCfg1 I V ??
+MemCfg2 I V ??
+MGASDRAM B V Mga card has SDRAM
+MMIO B V Enable/disable memory mapped I/O
+MMIOCache B V Enable/Disable MMIO cache
+MuxThreshold I V Multiplexing threshold (kHz)
+NoAccel B V Disable/enable acceleration
+NoClockChip B V ??
+NoStretch B V Disable/enable stretching for LCD displays
+OnAtExit B V Leave video signal on when exiting server
+OverclockMem B V Enable memory overclocking
+Overlay A V Enable multi-depth/overlay. An optional
+ string "M,N" may be specified, where
+ M, N are the depths.
+PanelDisplay B V Force display on LCD
+PciBurst B V Enable/disable PCI burst mode
+PciRetry B V Enable/disable PCI retries
+ProbeClocks B V Force probe for non-programmable clocks
+ReferenceClock Q V Clock generator reference frequency
+RGBbits I V Number of significant bits per rgb
+Rotate S V Rotate the virtual display (CW or CCW)
+SetLCDClk Q V Set LCD clock (MHz)
+SetMclk Q V Set Memory Clock (MHz)
+ShadowFB B V Enable shadow framebuffer layer
+ShowCache B V Enable viewing of offscreen memory
+ShowOverscan O V Set the overscan area to a visible colour
+SlowDRAM O V Slow DRAM
+SlowEDODRAM O V Slow EDO DRAM
+STN B V STN screen type (??)
+SWCursor B V Enable/disable SW cursor
+SuspendHack B V ??
+SyncOnGreen B V Enable/disable sync on green
+TurboQueue B V Enable/disable turbo queue
+UseFBDev B V Use the fbdev driver interface
+UseModeLine B V Use Modeline (??)
+W32Interleave B V ??
+
+Buffers I Xv Number of buffers
+Device S Xv Device file name
+Expose B Xv Disable occlusion clipping (see DESIGN)
+FramesPerSec I Xv Max. refresh frequency
+
+XAA options. All are of type "O" and scope "X", and are self-explanatory
+
+XaaNoColor8x8PatternFillRect
+XaaNoColor8x8PatternFillTrap
+XaaNoCPUToScreenColorExpandFill
+XaaNoDashedBresenhamLine
+XaaNoDashedTwoPointLine
+XaaNoScreenToScreenCopy
+XaaNoImageReadRect
+XaaNoImageWriteRect
+XaaNoMono8x8PatternFillRect
+XaaNoMono8x8PatternFillTrap
+XaaNoOffscreenPixmaps
+XaaNoPixmapCache
+XaaNoScanlineCPUToScreenColorExpandFill
+XaaNoScanlineImageWriteRect
+XaaNoScreenToScreenColorExpandFill
+XaaNoSolidBresenhamLine
+XaaNoSolidFillRect
+XaaNoSolidFillTrap
+XaaNoSolidHorVertLine
+XaaNoSolidTwoPointLine
+
+
+Names used in previous versions:
+
+16Clocks
+8Clocks
+ClkDiv2
+EDO VRAM
+ExternDisp
+ExtFramBuf
+FastVRAM
+FavorBitBlt
+InternDisp
+NoBitBlt
+NoFontCache
+NoImageBlt
+NoMemAccess
+NoPciDisconnect
+NoPixmapCache
+NoProgramClocks
+NoSplitXfer
+OverrideBIOS
+OverrideValidateMode
+ProgLcdModeRegs
+ProgLcdModeStretch
+SlowDRAMrefresh
+SlowVRAM
+SwapHiBit
+
+
+5. Ramdac Names.
+
+Ramdac names should be consistent between drivers. Case, white space
+and underscore characters are ignored when comparing ramdac names. All
+names listed here are in lower case with all white space and underscores
+removed.
+
+
+6. Clock Chip Names.
+
+Clock chip names should be consistent between drivers. Case, white
+space and underscore characters are ignored when comparing clock chip
+names. All names listed here are in lower case with all white space
+and underscores removed.
+
+
+
+
+
+$XFree86: xc/programs/Xserver/hw/xfree86/Registry,v 1.18 2002/04/06 18:31:09 tsi Exp $
diff --git a/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre b/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre index 8d09862b3..6547d38aa 100644 --- a/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre +++ b/xorg-server/hw/xfree86/doc/man/xorg.conf.man.pre @@ -558,9 +558,6 @@ Default: off. This tells the mousedrv(__drivermansuffix__) and vmmouse(__drivermansuffix__)
drivers to not report failure if the mouse device can't be opened/initialised.
It has no effect on the evdev(__drivermansuffix__) or other drivers.
-The previous functionality of allowing the server to start up even if
-the mouse device can't be opened/initialised is now handled by the
-AllowEmptyInput option.
Default: false.
.TP 7
.BI "Option \*qVTSysReq\*q \*q" boolean \*q
@@ -677,12 +674,6 @@ default. Allow modules built for a different, potentially incompatible version of
the X server to load. Disabled by default.
.TP 7
-.BI "Option \*qAllowEmptyInput\*q \*q" boolean \*q
-If enabled, don't add the standard keyboard and mouse drivers, if there are no
-input devices in the config file. Enabled by default if AutoAddDevices and
-AutoEnableDevices is enabled, otherwise disabled.
-If AllowEmptyInput is on, devices using the kbd, mouse or vmmouse driver are ignored.
-.TP 7
.BI "Option \*qAutoAddDevices\*q \*q" boolean \*q
If this option is disabled, then no devices will be added from HAL events.
Enabled by default.
@@ -938,9 +929,6 @@ default. Devices with disabled will be \*qfloating\*q and only accessible by clients employing the
X Input extension. This option controls the startup behavior only, a device
may be reattached or set floating at runtime.
-.TP 7
-.BI "Option \*qSendDragEvents\*q \*q" boolean \*q
-Send core events while dragging. Enabled by default.
.PP
For pointing devices, the following options control how the pointer
is accelerated or decelerated with respect to physical device motion. Most of
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index 9bf838e6c..578773a5a 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -828,11 +828,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, * is moved to a crtc with a lower refresh rate, or a crtc that just
* got enabled.
*/
- if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc))
- pPriv->last_swap_target = 0;
+ if (ds->GetMSC) {
+ if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc))
+ pPriv->last_swap_target = 0;
- if (current_msc < pPriv->last_swap_target)
- pPriv->last_swap_target = current_msc;
+ if (current_msc < pPriv->last_swap_target)
+ pPriv->last_swap_target = current_msc;
+
+ }
/*
* Swap target for this swap is last swap target + swap interval since
diff --git a/xorg-server/hw/xfree86/loader/sdksyms.sh b/xorg-server/hw/xfree86/loader/sdksyms.sh index ca1474371..6c45ec45e 100644 --- a/xorg-server/hw/xfree86/loader/sdksyms.sh +++ b/xorg-server/hw/xfree86/loader/sdksyms.sh @@ -19,7 +19,6 @@ cat > sdksyms.c << EOF #include "mipict.h"
#include "glyphstr.h"
#include "picturestr.h"
-#include "renderedge.h"
/* fb/Makefile.am -- module */
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index beb9be66e..d421a942f 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -2964,8 +2964,7 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) int size;
#endif
- if (output->MonInfo != NULL)
- free(output->MonInfo);
+ free(output->MonInfo);
output->MonInfo = edid_mon;
diff --git a/xorg-server/hw/xfree86/modes/xf86Rotate.c b/xorg-server/hw/xfree86/modes/xf86Rotate.c index f846d60ea..655857597 100644 --- a/xorg-server/hw/xfree86/modes/xf86Rotate.c +++ b/xorg-server/hw/xfree86/modes/xf86Rotate.c @@ -168,7 +168,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc) if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width;
if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height;
RegionInit(&damage_region, &damage_box, 1);
- DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+ DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
&damage_region);
RegionUninit(&damage_region);
crtc->shadowClear = TRUE;
diff --git a/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c b/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c index 029d3a989..a0a3b2758 100644 --- a/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c +++ b/xorg-server/hw/xfree86/os-support/hurd/hurd_video.c @@ -124,8 +124,17 @@ xf86EnableIO() FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
return FALSE;
}
+#if 0
+ /*
+ * Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these
+ * ports, and the int10 wrapper is not emulating them. (Note that it's
+ * effectively what happens in the Linux variant too, as iopl() is used
+ * there, making the ioperm() meaningless.)
+ *
+ * Reenable this when int10 gets fixed. */
ioperm(0x40,4,0); /* trap access to the timer chip */
ioperm(0x60,4,0); /* trap access to the keyboard controller */
+#endif
return TRUE;
}
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_init.c b/xorg-server/hw/xfree86/os-support/linux/lnx_init.c index 687483113..7be65dcf9 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_init.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_init.c @@ -277,9 +277,7 @@ xf86OpenConsole(void) tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty);
/* need to keep the buffer clean, else the kernel gets angry */
- if (xf86Info.allowEmptyInput)
- console_handler = xf86AddGeneralHandler(xf86Info.consoleFd,
- drain_console, NULL);
+ xf86SetConsoleHandler(drain_console, NULL);
/* we really should have a InitOSInputDevices() function instead
* of Init?$#*&Device(). So I just place it here */
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c index 8aa2506a9..0311bdf15 100644 --- a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c +++ b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c @@ -530,6 +530,8 @@ xf86EnableIO(void) return FALSE;
}
# if !defined(__alpha__)
+ /* XXX: this is actually not trapping anything because of iopl(3)
+ * above */
ioperm(0x40,4,0); /* trap access to the timer chip */
ioperm(0x60,4,0); /* trap access to the keyboard controller */
# endif
diff --git a/xorg-server/hw/xfree86/parser/Monitor.c b/xorg-server/hw/xfree86/parser/Monitor.c index 8ad7c2e79..24fe4ba0d 100644 --- a/xorg-server/hw/xfree86/parser/Monitor.c +++ b/xorg-server/hw/xfree86/parser/Monitor.c @@ -105,7 +105,6 @@ static xf86ConfigSymTabRec TimingTab[] = {TT_HSKEW, "hskew"},
{TT_BCAST, "bcast"},
{TT_VSCAN, "vscan"},
- {TT_CUSTOM, "CUSTOM"},
{-1, ""},
};
@@ -247,9 +246,6 @@ xf86parseModeLine (void) ptr->ml_vscan = val.num;
ptr->ml_flags |= XF86CONF_VSCAN;
break;
- case TT_CUSTOM:
- ptr->ml_flags |= XF86CONF_CUSTOM;
- break;
case EOF_TOKEN:
Error (UNEXPECTED_EOF_MSG, NULL);
break;
@@ -370,9 +366,6 @@ xf86parseVerboseMode (void) case TT_DBLSCAN:
ptr->ml_flags |= XF86CONF_DBLSCAN;
break;
- case TT_CUSTOM:
- ptr->ml_flags |= XF86CONF_CUSTOM;
- break;
case EOF_TOKEN:
Error (UNEXPECTED_EOF_MSG, NULL);
break;
diff --git a/xorg-server/hw/xfree86/parser/xf86Parser.h b/xorg-server/hw/xfree86/parser/xf86Parser.h index f8c9c3cde..bb7025dc4 100644 --- a/xorg-server/hw/xfree86/parser/xf86Parser.h +++ b/xorg-server/hw/xfree86/parser/xf86Parser.h @@ -119,7 +119,6 @@ XF86ConfModuleRec, *XF86ConfModulePtr; #define XF86CONF_NCSYNC 0x0100
#define XF86CONF_HSKEW 0x0200 /* hskew provided */
#define XF86CONF_BCAST 0x0400
-#define XF86CONF_CUSTOM 0x0800 /* timing numbers customized by editor */
#define XF86CONF_VSCAN 0x1000
typedef struct
diff --git a/xorg-server/hw/xfree86/parser/xf86tokens.h b/xorg-server/hw/xfree86/parser/xf86tokens.h index 8c7ea1b28..d91755d7e 100644 --- a/xorg-server/hw/xfree86/parser/xf86tokens.h +++ b/xorg-server/hw/xfree86/parser/xf86tokens.h @@ -165,7 +165,6 @@ typedef enum { TT_HSKEW,
TT_BCAST,
TT_VSCAN,
- TT_CUSTOM,
/* Module tokens */
LOAD,
diff --git a/xorg-server/hw/xfree86/x86emu/ops.c b/xorg-server/hw/xfree86/x86emu/ops.c index 740a3a58d..c0cfbd8c1 100644 --- a/xorg-server/hw/xfree86/x86emu/ops.c +++ b/xorg-server/hw/xfree86/x86emu/ops.c @@ -9691,15 +9691,23 @@ Handles opcode 0xe9 ****************************************************************************/
static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
{
- int ip;
+ u32 ip;
START_OF_INSTR();
DECODE_PRINTF("JMP\t");
- ip = (s16)fetch_word_imm();
- ip += (s16)M.x86.R_IP;
- DECODE_PRINTF2("%04x\n", (u16)ip);
- TRACE_AND_STEP();
- M.x86.R_IP = (u16)ip;
+ if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+ ip = (u32)fetch_long_imm();
+ ip += (u32)M.x86.R_EIP;
+ DECODE_PRINTF2("%08x\n", (u32)ip);
+ TRACE_AND_STEP();
+ M.x86.R_EIP = (u32)ip;
+ } else {
+ ip = (s16)fetch_word_imm();
+ ip += (s16)M.x86.R_IP;
+ DECODE_PRINTF2("%04x\n", (u16)ip);
+ TRACE_AND_STEP();
+ M.x86.R_IP = (u16)ip;
+ }
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
}
diff --git a/xorg-server/hw/xnest/Events.c b/xorg-server/hw/xnest/Events.c index 88970bbe0..6b8edf143 100644 --- a/xorg-server/hw/xnest/Events.c +++ b/xorg-server/hw/xnest/Events.c @@ -25,6 +25,7 @@ is" without express or implied warranty. #include "windowstr.h"
#include "servermd.h"
#include "inputstr.h"
+#include "inpututils.h"
#include "mi.h"
@@ -117,6 +118,7 @@ xnestCollectEvents(void) {
XEvent X;
int i, n, valuators[2];
+ ValuatorMask mask;
ScreenPtr pScreen;
GetEventList(&xnestEvents);
@@ -133,19 +135,21 @@ xnestCollectEvents(void) break;
case ButtonPress:
+ valuator_mask_set_range(&mask, 0, 0, NULL);
xnestUpdateModifierState(X.xkey.state);
lastEventTime = GetTimeInMillis();
n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonPress,
- X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL);
+ X.xbutton.button, POINTER_RELATIVE, &mask);
for (i = 0; i < n; i++)
mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event);
break;
case ButtonRelease:
+ valuator_mask_set_range(&mask, 0, 0, NULL);
xnestUpdateModifierState(X.xkey.state);
lastEventTime = GetTimeInMillis();
n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonRelease,
- X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL);
+ X.xbutton.button, POINTER_RELATIVE, &mask);
for (i = 0; i < n; i++)
mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event);
break;
@@ -153,9 +157,10 @@ xnestCollectEvents(void) case MotionNotify:
valuators[0] = X.xmotion.x;
valuators[1] = X.xmotion.y;
+ valuator_mask_set_range(&mask, 0, 2, valuators);
lastEventTime = GetTimeInMillis();
n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify,
- 0, POINTER_ABSOLUTE, 0, 2, valuators);
+ 0, POINTER_ABSOLUTE, &mask);
for (i = 0; i < n; i++)
mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event);
break;
@@ -186,9 +191,10 @@ xnestCollectEvents(void) NewCurrentScreen(inputInfo.pointer, pScreen, X.xcrossing.x, X.xcrossing.y);
valuators[0] = X.xcrossing.x;
valuators[1] = X.xcrossing.y;
+ valuator_mask_set_range(&mask, 0, 2, valuators);
lastEventTime = GetTimeInMillis();
n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify,
- 0, POINTER_ABSOLUTE, 0, 2, valuators);
+ 0, POINTER_ABSOLUTE, &mask);
for (i = 0; i < n; i++)
mieqEnqueue(xnestPointerDevice, (InternalEvent*)(xnestEvents + i)->event);
xnestDirectInstallColormaps(pScreen);
diff --git a/xorg-server/hw/xquartz/bundle/Makefile.am b/xorg-server/hw/xquartz/bundle/Makefile.am index 3a09f7427..34598aa6a 100644 --- a/xorg-server/hw/xquartz/bundle/Makefile.am +++ b/xorg-server/hw/xquartz/bundle/Makefile.am @@ -12,7 +12,9 @@ install-data-hook: $(srcdir)/mk_bundke.sh $(srcdir) $(builddir) $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app install
uninstall-hook:
- $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app
+ $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app/Contents/Resources
+ $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app/Contents/Info.plist
+ $(RM) -rf $(DESTDIR)$(APPLE_APPLICATIONS_DIR)/$(APPLE_APPLICATION_NAME).app/Contents/PkgInfo
noinst_PRE = Info.plist.cpp
noinst_DATA = $(noinst_PRE:plist.cpp=plist)
diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c index 7814967b8..f217f4c33 100644 --- a/xorg-server/hw/xquartz/darwin.c +++ b/xorg-server/hw/xquartz/darwin.c @@ -314,10 +314,9 @@ static int DarwinMouseProc(DeviceIntPtr pPointer, int what) { (PtrCtrlProcPtr)NoopDDA,
GetMotionHistorySize(), NAXES,
axes_labels);
- pPointer->valuator->mode = Absolute; // Relative
InitAbsoluteClassDeviceStruct(pPointer);
-// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
-// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+// InitValuatorAxisStruct(pPointer, 0, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+// InitValuatorAxisStruct(pPointer, 1, 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
break;
case DEVICE_ON:
pPointer->public.on = TRUE;
@@ -362,15 +361,14 @@ static int DarwinTabletProc(DeviceIntPtr pPointer, int what) { (PtrCtrlProcPtr)NoopDDA,
GetMotionHistorySize(), NAXES,
axes_labels);
- pPointer->valuator->mode = Absolute; // Relative
InitProximityClassDeviceStruct(pPointer);
InitAbsoluteClassDeviceStruct(pPointer);
- InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
- InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
- InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
- InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
- InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1);
+ InitValuatorAxisStruct(pPointer, 0, axes_labels[0], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(pPointer, 1, axes_labels[1], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(pPointer, 2, axes_labels[2], 0, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(pPointer, 3, axes_labels[3], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
+ InitValuatorAxisStruct(pPointer, 4, axes_labels[4], -XQUARTZ_VALUATOR_LIMIT, XQUARTZ_VALUATOR_LIMIT, 1, 0, 1, Absolute);
// pPointer->use = IsXExtensionDevice;
break;
case DEVICE_ON:
@@ -468,7 +466,6 @@ void InitInput( int argc, char **argv ) XkbSetRulesDflts(&rmlvo);
darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE);
- RegisterKeyboardDevice( darwinKeyboard );
darwinKeyboard->name = strdup("keyboard");
/* here's the snippet from the current gdk sources:
@@ -486,19 +483,15 @@ void InitInput( int argc, char **argv ) */
darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE);
- RegisterPointerDevice( darwinPointer );
darwinPointer->name = strdup("pointer");
darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
- RegisterPointerDevice( darwinTabletStylus );
darwinTabletStylus->name = strdup("pen");
darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
- RegisterPointerDevice( darwinTabletCursor );
darwinTabletCursor->name = strdup("cursor");
darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE);
- RegisterPointerDevice( darwinTabletEraser );
darwinTabletEraser->name = strdup("eraser");
darwinTabletCurrent = darwinTabletStylus;
diff --git a/xorg-server/hw/xquartz/darwinEvents.c b/xorg-server/hw/xquartz/darwinEvents.c index a00c89ecd..ec320b3a5 100644 --- a/xorg-server/hw/xquartz/darwinEvents.c +++ b/xorg-server/hw/xquartz/darwinEvents.c @@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group. #include "windowstr.h"
#include "pixmapstr.h"
#include "inputstr.h"
+#include "inpututils.h"
#include "eventstr.h"
#include "mi.h"
#include "scrnintstr.h"
@@ -464,8 +465,10 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, pressure, tilt_x, tilt_y);
darwinEvents_lock(); {
+ ValuatorMask mask;
+ valuator_mask_set_range(&mask, 0, (pDev == darwinTabletCurrent) ? 5 : 2, valuators);
num_events = GetPointerEvents(darwinEvents, pDev, ev_type, ev_button,
- POINTER_ABSOLUTE, 0, pDev==darwinTabletCurrent?5:2, valuators);
+ POINTER_ABSOLUTE, &mask);
for(i=0; i<num_events; i++) mieqEnqueue (pDev, (InternalEvent*)darwinEvents[i].event);
if(num_events > 0) DarwinPokeEQ();
} darwinEvents_unlock();
@@ -507,8 +510,9 @@ void DarwinSendProximityEvents(int ev_type, float pointer_x, float pointer_y) { DarwinPrepareValuators(pDev, valuators, screen, pointer_x, pointer_y, 0.0f, 0.0f, 0.0f);
darwinEvents_lock(); {
- num_events = GetProximityEvents(darwinEvents, pDev, ev_type,
- 0, 5, valuators);
+ ValuatorMask mask;
+ valuator_mask_set_range(&mask, 0, 5, valuators);
+ num_events = GetProximityEvents(darwinEvents, pDev, ev_type, &mask);
for(i=0; i<num_events; i++) mieqEnqueue (pDev, (InternalEvent*)darwinEvents[i].event);
if(num_events > 0) DarwinPokeEQ();
} darwinEvents_unlock();
diff --git a/xorg-server/hw/xquartz/darwinXinput.c b/xorg-server/hw/xquartz/darwinXinput.c index 958c7cdd4..85ce9d608 100644 --- a/xorg-server/hw/xquartz/darwinXinput.c +++ b/xorg-server/hw/xquartz/darwinXinput.c @@ -82,78 +82,6 @@ CloseInputDevice(DeviceIntPtr d, ClientPtr client) DEBUG_LOG("CloseInputDevice(%p, %p)\n", d, client);
}
-/***********************************************************************
- *
- * Caller: ProcXListInputDevices
- *
- * This is the implementation-dependent routine to initialize an input
- * device to the point that information about it can be listed.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. If some other process has the device open, the
- * server may not be able to get information about the device to list it.
- *
- * This procedure should be used by implementations that do not initialize
- * all input devices at server startup. It should do device-dependent
- * initialization for any devices not previously initialized, and call
- * AddInputDevice for each of those devices so that a DeviceIntRec will be
- * created for them.
- *
- * The default implementation is to do nothing (assume all input devices
- * are initialized during X server initialization and kept open).
- * The commented-out sample code shows what you might do if you don't want
- * the default.
- *
- */
-
-void
-AddOtherInputDevices(void)
-{
- /**********************************************************************
- for each uninitialized device, do something like:
-
- DeviceIntPtr dev;
- DeviceProc deviceProc;
- pointer private;
-
- dev = (DeviceIntPtr) AddInputDevice(deviceProc, TRUE);
- dev->public.devicePrivate = private;
- RegisterOtherDevice(dev);
- dev->inited = ((*dev->deviceProc)(dev, DEVICE_INIT) == Success);
- ************************************************************************/
- DEBUG_LOG("AddOtherInputDevices\n");
-}
-
-/***********************************************************************
- *
- * Caller: ProcXOpenDevice
- *
- * This is the implementation-dependent routine to open an input device.
- * Some implementations open all input devices when the server is first
- * initialized, and never close them. Other implementations open only
- * the X pointer and keyboard devices during server initialization,
- * and only open other input devices when some client makes an
- * XOpenDevice request. This entry point is for the latter type of
- * implementation.
- *
- * If the physical device is not already open, do it here. In this case,
- * you need to keep track of the fact that one or more clients has the
- * device open, and physically close it when the last client that has
- * it open does an XCloseDevice.
- *
- * The default implementation is to do nothing (assume all input devices
- * are opened during X server initialization and kept open).
- *
- */
-
-void
-OpenInputDevice(DeviceIntPtr dev, ClientPtr client, int *status)
-{
- DEBUG_LOG("OpenInputDevice(%p, %p, %p)\n", dev, client, status);
-}
-
/****************************************************************************
*
* Caller: ProcXSetDeviceMode
diff --git a/xorg-server/hw/xwin/InitInput.c b/xorg-server/hw/xwin/InitInput.c index 0e71e1271..1f0ec477e 100644 --- a/xorg-server/hw/xwin/InitInput.c +++ b/xorg-server/hw/xwin/InitInput.c @@ -105,10 +105,6 @@ InitInput (int argc, char *argv[]) g_pwinPointer = AddInputDevice (serverClient, winMouseProc, TRUE);
g_pwinKeyboard = AddInputDevice (serverClient, winKeybdProc, TRUE);
-
- RegisterPointerDevice (g_pwinPointer);
- RegisterKeyboardDevice (g_pwinKeyboard);
-
g_pwinPointer->name = strdup("Windows mouse");
g_pwinKeyboard->name = strdup("Windows keyboard");
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c index bf863b6c8..42a305f37 100644 --- a/xorg-server/hw/xwin/glx/indirect.c +++ b/xorg-server/hw/xwin/glx/indirect.c @@ -750,10 +750,7 @@ glxWinScreenProbe(ScreenPtr pScreen) unsigned int buffer_size = __glXGetExtensionString(screen->glx_enable_bits, NULL);
if (buffer_size > 0)
{
- if (screen->base.GLXextensions != NULL)
- {
- free(screen->base.GLXextensions);
- }
+ free(screen->base.GLXextensions);
screen->base.GLXextensions = xnfalloc(buffer_size);
__glXGetExtensionString(screen->glx_enable_bits, screen->base.GLXextensions);
diff --git a/xorg-server/hw/xwin/wincmap.c b/xorg-server/hw/xwin/wincmap.c index 370a4c584..83279fd84 100644 --- a/xorg-server/hw/xwin/wincmap.c +++ b/xorg-server/hw/xwin/wincmap.c @@ -494,11 +494,8 @@ winGetPaletteDD (ScreenPtr pScreen, ColormapPtr pcmap) pScreen->blackPixel = 0;
/* Free colormap */
- if (ppeColors != NULL)
- {
- free (ppeColors);
- ppeColors = NULL;
- }
+ free(ppeColors);
+ ppeColors = NULL;
/* Free the DC */
if (hdc != NULL)
diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c index e69edf7c0..c72fbe275 100644 --- a/xorg-server/hw/xwin/winkeybd.c +++ b/xorg-server/hw/xwin/winkeybd.c @@ -182,7 +182,6 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState) winDebug ("winKeybdProc - Error initializing keyboard AutoRepeat\n");
}
- XkbSetExtension(pDeviceInt, ProcessKeyboardEvent);
break;
case DEVICE_ON:
diff --git a/xorg-server/hw/xwin/winmouse.c b/xorg-server/hw/xwin/winmouse.c index b37d5cf67..6dac21520 100644 --- a/xorg-server/hw/xwin/winmouse.c +++ b/xorg-server/hw/xwin/winmouse.c @@ -46,6 +46,7 @@ #include "inputstr.h"
#include "exevents.h" /* for button/axes labels */
#include "xserver-properties.h"
+#include "inpututils.h"
/* Peek the internal button mapping */
static CARD8 const *g_winMouseButtonMap = NULL;
@@ -242,13 +243,15 @@ winMouseButtonsSendEvent (int iEventType, int iButton) {
EventListPtr events;
int i, nevents;
+ ValuatorMask mask;
if (g_winMouseButtonMap)
iButton = g_winMouseButtonMap[iButton];
+ valuator_mask_zero(&mask);
GetEventList(&events);
nevents = GetPointerEvents(events, g_pwinPointer, iEventType, iButton,
- POINTER_RELATIVE, 0, 0, NULL);
+ POINTER_RELATIVE, &mask);
for (i = 0; i < nevents; i++)
mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event);
@@ -371,15 +374,17 @@ void winEnqueueMotion(int x, int y) {
int i, nevents;
int valuators[2];
+ ValuatorMask mask;
EventListPtr events;
miPointerSetPosition(g_pwinPointer, &x, &y);
valuators[0] = x;
valuators[1] = y;
+ valuator_mask_set_range(&mask, 0, 2, valuators);
GetEventList(&events);
nevents = GetPointerEvents(events, g_pwinPointer, MotionNotify, 0,
- POINTER_ABSOLUTE | POINTER_SCREEN, 0, 2, valuators);
+ POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
for (i = 0; i < nevents; i++)
mieqEnqueue(g_pwinPointer, (InternalEvent*)events[i].event);
diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c index 3044eda9c..42b2d6221 100644 --- a/xorg-server/hw/xwin/winmultiwindowwindow.c +++ b/xorg-server/hw/xwin/winmultiwindowwindow.c @@ -482,7 +482,6 @@ winCreateWindowsWindow (WindowPtr pWin) dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
dwExStyle = WS_EX_TOOLWINDOW;
- rc;
rc.top = 0;
rc.left = 0;
rc.bottom = iHeight;
diff --git a/xorg-server/hw/xwin/winpixmap.c b/xorg-server/hw/xwin/winpixmap.c index e5b36a000..2af95f225 100644 --- a/xorg-server/hw/xwin/winpixmap.c +++ b/xorg-server/hw/xwin/winpixmap.c @@ -1,187 +1,184 @@ -/* - *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved. - * - *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 above copyright notice and this permission notice 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 XFREE86 PROJECT 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. - * - *Except as contained in this notice, the name of the XFree86 Project - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from the XFree86 Project. - * - * Authors: drewry, september 1986 - * Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include <xwin-config.h> -#endif -#include "win.h" - - -/* - * Local prototypes - */ - -#if 0 -static void -winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw); - -static void -winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh); - -static void -winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix, - int xrot, int yrot); -#endif - - -/* See Porting Layer Definition - p. 34 */ -/* See mfb/mfbpixmap.c - mfbCreatePixmap() */ -PixmapPtr -winCreatePixmapNativeGDI (ScreenPtr pScreen, - int iWidth, int iHeight, - int iDepth, unsigned usage_hint) -{ - winPrivPixmapPtr pPixmapPriv = NULL; - PixmapPtr pPixmap = NULL; - - /* Allocate pixmap memory */ - pPixmap = AllocatePixmap (pScreen, 0); - if (!pPixmap) - { - ErrorF ("winCreatePixmapNativeGDI () - Couldn't allocate a pixmap\n"); - return NullPixmap; - } - - winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n", - iWidth, iHeight, iDepth, usage_hint, - PixmapBytePad (iWidth, iDepth)); - - /* Setup pixmap values */ - pPixmap->drawable.type = DRAWABLE_PIXMAP; - pPixmap->drawable.class = 0; - pPixmap->drawable.pScreen = pScreen; - pPixmap->drawable.depth = iDepth; - pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth); - pPixmap->drawable.id = 0; - pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - pPixmap->drawable.x = 0; - pPixmap->drawable.y = 0; - pPixmap->drawable.width = iWidth; - pPixmap->drawable.height = iHeight; - pPixmap->devKind = 0; - pPixmap->refcnt = 1; - pPixmap->devPrivate.ptr = NULL; - pPixmap->usage_hint = usage_hint; - - /* Pixmap privates are allocated by AllocatePixmap */ - pPixmapPriv = winGetPixmapPriv (pPixmap); - - /* Initialize pixmap privates */ - pPixmapPriv->hBitmap = NULL; - pPixmapPriv->hdcSelected = NULL; - pPixmapPriv->pbBits = NULL; - pPixmapPriv->dwScanlineBytes = PixmapBytePad (iWidth, iDepth); - - /* Check for zero width or height pixmaps */ - if (iWidth == 0 || iHeight == 0) - { - /* Don't allocate a real pixmap, just set fields and return */ - return pPixmap; - } - - /* Create a DIB for the pixmap */ - pPixmapPriv->hBitmap = winCreateDIBNativeGDI (iWidth, iHeight, iDepth, - &pPixmapPriv->pbBits, - (BITMAPINFO **) &pPixmapPriv->pbmih); - - winDebug ("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " \ - "screen: %08x\n", - pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen); - - return pPixmap; -} - - -/* - * See Porting Layer Definition - p. 35 - * - * See mfb/mfbpixmap.c - mfbDestroyPixmap() - */ - -Bool -winDestroyPixmapNativeGDI (PixmapPtr pPixmap) -{ - winPrivPixmapPtr pPixmapPriv = NULL; - - winDebug ("winDestroyPixmapNativeGDI ()\n"); - - /* Bail early if there is not a pixmap to destroy */ - if (pPixmap == NULL) - { - ErrorF ("winDestroyPixmapNativeGDI () - No pixmap to destroy\n"); - return TRUE; - } - - /* Get a handle to the pixmap privates */ - pPixmapPriv = winGetPixmapPriv (pPixmap); - - winDebug ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n", - pPixmapPriv->hBitmap); - - /* Decrement reference count, return if nonzero */ - --pPixmap->refcnt; - if (pPixmap->refcnt != 0) - return TRUE; - - /* Free GDI bitmap */ - if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap); - - /* Free the bitmap info header memory */ - if (pPixmapPriv->pbmih != NULL) - { - free (pPixmapPriv->pbmih); - pPixmapPriv->pbmih = NULL; - } - - /* Free the pixmap memory */ - free (pPixmap); - pPixmap = NULL; - - return TRUE; -} - - -/* - * Not used yet - */ - -Bool -winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap, - int iWidth, int iHeight, - int iDepth, - int iBitsPerPixel, - int devKind, - pointer pPixData) -{ - FatalError ("winModifyPixmapHeaderNativeGDI ()\n"); - return TRUE; -} - +/*
+ *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+ *
+ *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 above copyright notice and this permission notice 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 XFREE86 PROJECT 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.
+ *
+ *Except as contained in this notice, the name of the XFree86 Project
+ *shall not be used in advertising or otherwise to promote the sale, use
+ *or other dealings in this Software without prior written authorization
+ *from the XFree86 Project.
+ *
+ * Authors: drewry, september 1986
+ * Harold L Hunt II
+ */
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+
+/*
+ * Local prototypes
+ */
+
+#if 0
+static void
+winXRotatePixmapNativeGDI (PixmapPtr pPix, int rw);
+
+static void
+winYRotatePixmapNativeGDI (PixmapPtr pPix, int rh);
+
+static void
+winCopyRotatePixmapNativeGDI (PixmapPtr psrcPix, PixmapPtr *ppdstPix,
+ int xrot, int yrot);
+#endif
+
+
+/* See Porting Layer Definition - p. 34 */
+/* See mfb/mfbpixmap.c - mfbCreatePixmap() */
+PixmapPtr
+winCreatePixmapNativeGDI (ScreenPtr pScreen,
+ int iWidth, int iHeight,
+ int iDepth, unsigned usage_hint)
+{
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ PixmapPtr pPixmap = NULL;
+
+ /* Allocate pixmap memory */
+ pPixmap = AllocatePixmap (pScreen, 0);
+ if (!pPixmap)
+ {
+ ErrorF ("winCreatePixmapNativeGDI () - Couldn't allocate a pixmap\n");
+ return NullPixmap;
+ }
+
+ winDebug ("winCreatePixmap () - w %d h %d d %d uh %d bw %d\n",
+ iWidth, iHeight, iDepth, usage_hint,
+ PixmapBytePad (iWidth, iDepth));
+
+ /* Setup pixmap values */
+ pPixmap->drawable.type = DRAWABLE_PIXMAP;
+ pPixmap->drawable.class = 0;
+ pPixmap->drawable.pScreen = pScreen;
+ pPixmap->drawable.depth = iDepth;
+ pPixmap->drawable.bitsPerPixel = BitsPerPixel (iDepth);
+ pPixmap->drawable.id = 0;
+ pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ pPixmap->drawable.x = 0;
+ pPixmap->drawable.y = 0;
+ pPixmap->drawable.width = iWidth;
+ pPixmap->drawable.height = iHeight;
+ pPixmap->devKind = 0;
+ pPixmap->refcnt = 1;
+ pPixmap->devPrivate.ptr = NULL;
+ pPixmap->usage_hint = usage_hint;
+
+ /* Pixmap privates are allocated by AllocatePixmap */
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ /* Initialize pixmap privates */
+ pPixmapPriv->hBitmap = NULL;
+ pPixmapPriv->hdcSelected = NULL;
+ pPixmapPriv->pbBits = NULL;
+ pPixmapPriv->dwScanlineBytes = PixmapBytePad (iWidth, iDepth);
+
+ /* Check for zero width or height pixmaps */
+ if (iWidth == 0 || iHeight == 0)
+ {
+ /* Don't allocate a real pixmap, just set fields and return */
+ return pPixmap;
+ }
+
+ /* Create a DIB for the pixmap */
+ pPixmapPriv->hBitmap = winCreateDIBNativeGDI (iWidth, iHeight, iDepth,
+ &pPixmapPriv->pbBits,
+ (BITMAPINFO **) &pPixmapPriv->pbmih);
+
+ winDebug ("winCreatePixmap () - Created a pixmap %08x, %dx%dx%d, for " \
+ "screen: %08x\n",
+ pPixmapPriv->hBitmap, iWidth, iHeight, iDepth, pScreen);
+
+ return pPixmap;
+}
+
+
+/*
+ * See Porting Layer Definition - p. 35
+ *
+ * See mfb/mfbpixmap.c - mfbDestroyPixmap()
+ */
+
+Bool
+winDestroyPixmapNativeGDI (PixmapPtr pPixmap)
+{
+ winPrivPixmapPtr pPixmapPriv = NULL;
+
+ winDebug ("winDestroyPixmapNativeGDI ()\n");
+
+ /* Bail early if there is not a pixmap to destroy */
+ if (pPixmap == NULL)
+ {
+ ErrorF ("winDestroyPixmapNativeGDI () - No pixmap to destroy\n");
+ return TRUE;
+ }
+
+ /* Get a handle to the pixmap privates */
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
+
+ winDebug ("winDestroyPixmapNativeGDI - pPixmapPriv->hBitmap: %08x\n",
+ pPixmapPriv->hBitmap);
+
+ /* Decrement reference count, return if nonzero */
+ --pPixmap->refcnt;
+ if (pPixmap->refcnt != 0)
+ return TRUE;
+
+ /* Free GDI bitmap */
+ if (pPixmapPriv->hBitmap) DeleteObject (pPixmapPriv->hBitmap);
+
+ /* Free the bitmap info header memory */
+ free(pPixmapPriv->pbmih);
+ pPixmapPriv->pbmih = NULL;
+
+ /* Free the pixmap memory */
+ free (pPixmap);
+ pPixmap = NULL;
+
+ return TRUE;
+}
+
+
+/*
+ * Not used yet
+ */
+
+Bool
+winModifyPixmapHeaderNativeGDI (PixmapPtr pPixmap,
+ int iWidth, int iHeight,
+ int iDepth,
+ int iBitsPerPixel,
+ int devKind,
+ pointer pPixData)
+{
+ FatalError ("winModifyPixmapHeaderNativeGDI ()\n");
+ return TRUE;
+}
+
diff --git a/xorg-server/include/Makefile.am b/xorg-server/include/Makefile.am index e76de05c3..21f9358d5 100644 --- a/xorg-server/include/Makefile.am +++ b/xorg-server/include/Makefile.am @@ -1,72 +1,72 @@ -if XORG -sdk_HEADERS = \ - XIstubs.h \ - bstore.h \ - bstorestr.h \ - callback.h \ - closestr.h \ - closure.h \ - colormap.h \ - colormapst.h \ - hotplug.h \ - cursor.h \ - cursorstr.h \ - dix.h \ - dixaccess.h \ - dixevents.h \ - dixfont.h \ - dixfontstr.h \ - dixgrabs.h \ - dixstruct.h \ - events.h \ - exevents.h \ - extension.h \ - extinit.h \ - extnsionst.h \ - gc.h \ - gcstruct.h \ - globals.h \ - input.h \ - inputstr.h \ - list.h \ - misc.h \ - miscstruct.h \ - opaque.h \ - os.h \ - pixmap.h \ - pixmapstr.h \ - privates.h \ - property.h \ - propertyst.h \ - ptrveloc.h \ - region.h \ - regionstr.h \ - registry.h \ - resource.h \ - rgb.h \ - screenint.h \ - scrnintstr.h \ - selection.h \ - servermd.h \ - site.h \ - swaprep.h \ - swapreq.h \ - validate.h \ - window.h \ - windowstr.h \ - xkbfile.h \ - xkbsrv.h \ - xkbstr.h \ - xkbrules.h \ - xserver-properties.h - -nodist_sdk_HEADERS = xorg-server.h -endif - -AM_CFLAGS = $(DIX_CFLAGS) - -EXTRA_DIST = \ - dix-config-apple-verbatim.h \ - eventconvert.h eventstr.h \ - protocol-versions.h \ - xsha1.h +if XORG
+sdk_HEADERS = \
+ XIstubs.h \
+ bstore.h \
+ bstorestr.h \
+ callback.h \
+ closestr.h \
+ closure.h \
+ colormap.h \
+ colormapst.h \
+ hotplug.h \
+ cursor.h \
+ cursorstr.h \
+ dix.h \
+ dixaccess.h \
+ dixevents.h \
+ dixfont.h \
+ dixfontstr.h \
+ dixgrabs.h \
+ dixstruct.h \
+ events.h \
+ exevents.h \
+ extension.h \
+ extinit.h \
+ extnsionst.h \
+ gc.h \
+ gcstruct.h \
+ globals.h \
+ input.h \
+ inputstr.h \
+ list.h \
+ misc.h \
+ miscstruct.h \
+ opaque.h \
+ os.h \
+ pixmap.h \
+ pixmapstr.h \
+ privates.h \
+ property.h \
+ propertyst.h \
+ ptrveloc.h \
+ region.h \
+ regionstr.h \
+ registry.h \
+ resource.h \
+ rgb.h \
+ screenint.h \
+ scrnintstr.h \
+ selection.h \
+ servermd.h \
+ site.h \
+ swaprep.h \
+ swapreq.h \
+ validate.h \
+ window.h \
+ windowstr.h \
+ xkbfile.h \
+ xkbsrv.h \
+ xkbstr.h \
+ xkbrules.h \
+ xserver-properties.h
+
+nodist_sdk_HEADERS = xorg-server.h
+endif
+
+AM_CFLAGS = $(DIX_CFLAGS)
+
+EXTRA_DIST = \
+ dix-config-apple-verbatim.h \
+ eventconvert.h eventstr.h inpututils.h \
+ protocol-versions.h \
+ xsha1.h
diff --git a/xorg-server/include/XIstubs.h b/xorg-server/include/XIstubs.h index ba2f861cd..380f8d8f2 100644 --- a/xorg-server/include/XIstubs.h +++ b/xorg-server/include/XIstubs.h @@ -1,63 +1,49 @@ -/************************************************************ - -Copyright 1996 by Thomas E. Dickey <dickey@clark.net> - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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 XI_STUBS_H -#define XI_STUBS_H 1 - -extern _X_EXPORT void -CloseInputDevice ( - DeviceIntPtr /* d */, - ClientPtr /* client */); - -extern _X_EXPORT void -AddOtherInputDevices (void); - -extern _X_EXPORT void -OpenInputDevice ( - DeviceIntPtr /* dev */, - ClientPtr /* client */, - int * /* status */); - -extern _X_EXPORT int -SetDeviceMode ( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - int /* mode */); - -extern _X_EXPORT int -SetDeviceValuators ( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - int * /* valuators */, - int /* first_valuator */, - int /* num_valuators */); - -extern _X_EXPORT int -ChangeDeviceControl ( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - xDeviceCtl * /* control */); - -#endif /* XI_STUBS_H */ +/************************************************************
+
+Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 above listed
+copyright holder(s) not be used in advertising or publicity pertaining
+to distribution of the software without specific, written prior
+permission.
+
+THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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 XI_STUBS_H
+#define XI_STUBS_H 1
+
+extern _X_EXPORT int
+SetDeviceMode (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* mode */);
+
+extern _X_EXPORT int
+SetDeviceValuators (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int * /* valuators */,
+ int /* first_valuator */,
+ int /* num_valuators */);
+
+extern _X_EXPORT int
+ChangeDeviceControl (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ xDeviceCtl * /* control */);
+
+#endif /* XI_STUBS_H */
diff --git a/xorg-server/include/exevents.h b/xorg-server/include/exevents.h index 39e1c70fe..b972cbedf 100644 --- a/xorg-server/include/exevents.h +++ b/xorg-server/include/exevents.h @@ -1,315 +1,312 @@ -/************************************************************ - -Copyright 1996 by Thomas E. Dickey <dickey@clark.net> - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 above listed -copyright holder(s) not be used in advertising or publicity pertaining -to distribution of the software without specific, written prior -permission. - -THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD -TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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. - -********************************************************/ - -/******************************************************************** - * Interface of 'exevents.c' - */ - -#ifndef EXEVENTS_H -#define EXEVENTS_H - -#include <X11/extensions/XIproto.h> -#include "inputstr.h" - -/*************************************************************** - * Interface available to drivers * - ***************************************************************/ - -extern _X_EXPORT int InitProximityClassDeviceStruct( - DeviceIntPtr /* dev */); - -extern _X_EXPORT void InitValuatorAxisStruct( - DeviceIntPtr /* dev */, - int /* axnum */, - Atom /* label */, - int /* minval */, - int /* maxval */, - int /* resolution */, - int /* min_res */, - int /* max_res */); - -/* Input device properties */ -extern _X_EXPORT void XIDeleteAllDeviceProperties( - DeviceIntPtr /* device */ -); - -extern _X_EXPORT int XIDeleteDeviceProperty( - DeviceIntPtr /* device */, - Atom /* property */, - Bool /* fromClient */ -); - -extern _X_EXPORT int XIChangeDeviceProperty( - DeviceIntPtr /* dev */, - Atom /* property */, - Atom /* type */, - int /* format*/, - int /* mode*/, - unsigned long /* len*/, - pointer /* value*/, - Bool /* sendevent*/ - ); - -extern _X_EXPORT int XIGetDeviceProperty( - DeviceIntPtr /* dev */, - Atom /* property */, - XIPropertyValuePtr* /* value */ -); - -extern _X_EXPORT int XISetDevicePropertyDeletable( - DeviceIntPtr /* dev */, - Atom /* property */, - Bool /* deletable */ -); - -extern _X_EXPORT long XIRegisterPropertyHandler( - DeviceIntPtr dev, - int (*SetProperty) (DeviceIntPtr dev, - Atom property, - XIPropertyValuePtr prop, - BOOL checkonly), - int (*GetProperty) (DeviceIntPtr dev, - Atom property), - int (*DeleteProperty) (DeviceIntPtr dev, - Atom property) -); - -extern _X_EXPORT void XIUnregisterPropertyHandler( - DeviceIntPtr dev, - long id -); - -extern _X_EXPORT Atom XIGetKnownProperty( - char* name -); - -extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev); - -extern _X_EXPORT int XIPropToInt( - XIPropertyValuePtr val, - int *nelem_return, - int **buf_return -); - -extern _X_EXPORT int XIPropToFloat( - XIPropertyValuePtr val, - int *nelem_return, - float **buf_return -); - -/**************************************************************************** - * End of driver interface * - ****************************************************************************/ - - -/** - * Attached to the devPrivates of each client. Specifies the version number as - * supported by the client. - */ -typedef struct _XIClientRec { - int major_version; - int minor_version; -} XIClientRec, *XIClientPtr; - - -typedef struct _GrabParameters { - int grabtype; /* GRABTYPE_CORE, etc. */ - unsigned int ownerEvents; - unsigned int this_device_mode; - unsigned int other_devices_mode; - Window grabWindow; - Window confineTo; - Cursor cursor; - unsigned int modifiers; -} GrabParameters; - - -extern void -RegisterOtherDevice ( - DeviceIntPtr /* device */); - -extern int -UpdateDeviceState ( - DeviceIntPtr /* device */, - DeviceEvent* /* xE */); - -extern void -ProcessOtherEvent ( - InternalEvent* /* ev */, - DeviceIntPtr /* other */); - -extern void -DeviceFocusEvent( - DeviceIntPtr /* dev */, - int /* type */, - int /* mode */, - int /* detail */, - WindowPtr /* pWin */); - -extern int -CheckGrabValues( - ClientPtr /* client */, - GrabParameters* /* param */); - -extern int -GrabButton( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - DeviceIntPtr /* modifier_device */, - int /* button */, - GrabParameters* /* param */, - GrabType /* grabtype */, - GrabMask* /* eventMask */); - -extern int -GrabKey( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - DeviceIntPtr /* modifier_device */, - int /* key */, - GrabParameters* /* param */, - GrabType /* grabtype */, - GrabMask* /* eventMask */); - -extern int -GrabWindow( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - int /* type */, - GrabParameters* /* param */, - GrabMask* /* eventMask */); - -extern int -SelectForWindow( - DeviceIntPtr /* dev */, - WindowPtr /* pWin */, - ClientPtr /* client */, - Mask /* mask */, - Mask /* exclusivemasks */); - -extern int -AddExtensionClient ( - WindowPtr /* pWin */, - ClientPtr /* client */, - Mask /* mask */, - int /* mskidx */); - -extern void -RecalculateDeviceDeliverableEvents( - WindowPtr /* pWin */); - -extern int -InputClientGone( - WindowPtr /* pWin */, - XID /* id */); - -extern int -SendEvent ( - ClientPtr /* client */, - DeviceIntPtr /* d */, - Window /* dest */, - Bool /* propagate */, - xEvent * /* ev */, - Mask /* mask */, - int /* count */); - -extern int -SetButtonMapping ( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - int /* nElts */, - BYTE * /* map */); - -extern int -ChangeKeyMapping( - ClientPtr /* client */, - DeviceIntPtr /* dev */, - unsigned /* len */, - int /* type */, - KeyCode /* firstKeyCode */, - CARD8 /* keyCodes */, - CARD8 /* keySymsPerKeyCode */, - KeySym * /* map */); - -extern void -DeleteWindowFromAnyExtEvents( - WindowPtr /* pWin */, - Bool /* freeResources */); - -extern int -MaybeSendDeviceMotionNotifyHint ( - deviceKeyButtonPointer * /* pEvents */, - Mask /* mask */); - -extern void -CheckDeviceGrabAndHintWindow ( - WindowPtr /* pWin */, - int /* type */, - deviceKeyButtonPointer * /* xE */, - GrabPtr /* grab */, - ClientPtr /* client */, - Mask /* deliveryMask */); - -extern void -MaybeStopDeviceHint( - DeviceIntPtr /* dev */, - ClientPtr /* client */); - -extern int -DeviceEventSuppressForWindow( - WindowPtr /* pWin */, - ClientPtr /* client */, - Mask /* mask */, - int /* maskndx */); - -extern void -SendEventToAllWindows( - DeviceIntPtr /* dev */, - Mask /* mask */, - xEvent * /* ev */, - int /* count */); - -extern _X_HIDDEN void XI2EventSwap( - xGenericEvent * /* from */, - xGenericEvent * /* to */); - -/* For an event such as MappingNotify which affects client interpretation - * of input events sent by device dev, should we notify the client, or - * would it merely be irrelevant and confusing? */ -extern int -XIShouldNotify(ClientPtr client, DeviceIntPtr dev); - -extern void -XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master, - DeviceChangedEvent *dce); - -extern int -XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client, - unsigned int len, unsigned char* mask); - -extern int -XICheckInvalidMaskBits(unsigned char *mask, int len); - -#endif /* EXEVENTS_H */ +/************************************************************
+
+Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 above listed
+copyright holder(s) not be used in advertising or publicity pertaining
+to distribution of the software without specific, written prior
+permission.
+
+THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
+TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
+
+********************************************************/
+
+/********************************************************************
+ * Interface of 'exevents.c'
+ */
+
+#ifndef EXEVENTS_H
+#define EXEVENTS_H
+
+#include <X11/extensions/XIproto.h>
+#include "inputstr.h"
+
+/***************************************************************
+ * Interface available to drivers *
+ ***************************************************************/
+
+extern _X_EXPORT int InitProximityClassDeviceStruct(
+ DeviceIntPtr /* dev */);
+
+extern _X_EXPORT void InitValuatorAxisStruct(
+ DeviceIntPtr /* dev */,
+ int /* axnum */,
+ Atom /* label */,
+ int /* minval */,
+ int /* maxval */,
+ int /* resolution */,
+ int /* min_res */,
+ int /* max_res */,
+ int /* mode */);
+
+/* Input device properties */
+extern _X_EXPORT void XIDeleteAllDeviceProperties(
+ DeviceIntPtr /* device */
+);
+
+extern _X_EXPORT int XIDeleteDeviceProperty(
+ DeviceIntPtr /* device */,
+ Atom /* property */,
+ Bool /* fromClient */
+);
+
+extern _X_EXPORT int XIChangeDeviceProperty(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ Atom /* type */,
+ int /* format*/,
+ int /* mode*/,
+ unsigned long /* len*/,
+ pointer /* value*/,
+ Bool /* sendevent*/
+ );
+
+extern _X_EXPORT int XIGetDeviceProperty(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ XIPropertyValuePtr* /* value */
+);
+
+extern _X_EXPORT int XISetDevicePropertyDeletable(
+ DeviceIntPtr /* dev */,
+ Atom /* property */,
+ Bool /* deletable */
+);
+
+extern _X_EXPORT long XIRegisterPropertyHandler(
+ DeviceIntPtr dev,
+ int (*SetProperty) (DeviceIntPtr dev,
+ Atom property,
+ XIPropertyValuePtr prop,
+ BOOL checkonly),
+ int (*GetProperty) (DeviceIntPtr dev,
+ Atom property),
+ int (*DeleteProperty) (DeviceIntPtr dev,
+ Atom property)
+);
+
+extern _X_EXPORT void XIUnregisterPropertyHandler(
+ DeviceIntPtr dev,
+ long id
+);
+
+extern _X_EXPORT Atom XIGetKnownProperty(
+ char* name
+);
+
+extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
+
+extern _X_EXPORT int XIPropToInt(
+ XIPropertyValuePtr val,
+ int *nelem_return,
+ int **buf_return
+);
+
+extern _X_EXPORT int XIPropToFloat(
+ XIPropertyValuePtr val,
+ int *nelem_return,
+ float **buf_return
+);
+
+/****************************************************************************
+ * End of driver interface *
+ ****************************************************************************/
+
+
+/**
+ * Attached to the devPrivates of each client. Specifies the version number as
+ * supported by the client.
+ */
+typedef struct _XIClientRec {
+ int major_version;
+ int minor_version;
+} XIClientRec, *XIClientPtr;
+
+
+typedef struct _GrabParameters {
+ int grabtype; /* GRABTYPE_CORE, etc. */
+ unsigned int ownerEvents;
+ unsigned int this_device_mode;
+ unsigned int other_devices_mode;
+ Window grabWindow;
+ Window confineTo;
+ Cursor cursor;
+ unsigned int modifiers;
+} GrabParameters;
+
+
+extern int
+UpdateDeviceState (
+ DeviceIntPtr /* device */,
+ DeviceEvent* /* xE */);
+
+extern void
+ProcessOtherEvent (
+ InternalEvent* /* ev */,
+ DeviceIntPtr /* other */);
+
+extern void
+DeviceFocusEvent(
+ DeviceIntPtr /* dev */,
+ int /* type */,
+ int /* mode */,
+ int /* detail */,
+ WindowPtr /* pWin */);
+
+extern int
+CheckGrabValues(
+ ClientPtr /* client */,
+ GrabParameters* /* param */);
+
+extern int
+GrabButton(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* modifier_device */,
+ int /* button */,
+ GrabParameters* /* param */,
+ GrabType /* grabtype */,
+ GrabMask* /* eventMask */);
+
+extern int
+GrabKey(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ DeviceIntPtr /* modifier_device */,
+ int /* key */,
+ GrabParameters* /* param */,
+ GrabType /* grabtype */,
+ GrabMask* /* eventMask */);
+
+extern int
+GrabWindow(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* type */,
+ GrabParameters* /* param */,
+ GrabMask* /* eventMask */);
+
+extern int
+SelectForWindow(
+ DeviceIntPtr /* dev */,
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ Mask /* exclusivemasks */);
+
+extern int
+AddExtensionClient (
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ int /* mskidx */);
+
+extern void
+RecalculateDeviceDeliverableEvents(
+ WindowPtr /* pWin */);
+
+extern int
+InputClientGone(
+ WindowPtr /* pWin */,
+ XID /* id */);
+
+extern int
+SendEvent (
+ ClientPtr /* client */,
+ DeviceIntPtr /* d */,
+ Window /* dest */,
+ Bool /* propagate */,
+ xEvent * /* ev */,
+ Mask /* mask */,
+ int /* count */);
+
+extern int
+SetButtonMapping (
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ int /* nElts */,
+ BYTE * /* map */);
+
+extern int
+ChangeKeyMapping(
+ ClientPtr /* client */,
+ DeviceIntPtr /* dev */,
+ unsigned /* len */,
+ int /* type */,
+ KeyCode /* firstKeyCode */,
+ CARD8 /* keyCodes */,
+ CARD8 /* keySymsPerKeyCode */,
+ KeySym * /* map */);
+
+extern void
+DeleteWindowFromAnyExtEvents(
+ WindowPtr /* pWin */,
+ Bool /* freeResources */);
+
+extern int
+MaybeSendDeviceMotionNotifyHint (
+ deviceKeyButtonPointer * /* pEvents */,
+ Mask /* mask */);
+
+extern void
+CheckDeviceGrabAndHintWindow (
+ WindowPtr /* pWin */,
+ int /* type */,
+ deviceKeyButtonPointer * /* xE */,
+ GrabPtr /* grab */,
+ ClientPtr /* client */,
+ Mask /* deliveryMask */);
+
+extern void
+MaybeStopDeviceHint(
+ DeviceIntPtr /* dev */,
+ ClientPtr /* client */);
+
+extern int
+DeviceEventSuppressForWindow(
+ WindowPtr /* pWin */,
+ ClientPtr /* client */,
+ Mask /* mask */,
+ int /* maskndx */);
+
+extern void
+SendEventToAllWindows(
+ DeviceIntPtr /* dev */,
+ Mask /* mask */,
+ xEvent * /* ev */,
+ int /* count */);
+
+extern _X_HIDDEN void XI2EventSwap(
+ xGenericEvent * /* from */,
+ xGenericEvent * /* to */);
+
+/* For an event such as MappingNotify which affects client interpretation
+ * of input events sent by device dev, should we notify the client, or
+ * would it merely be irrelevant and confusing? */
+extern int
+XIShouldNotify(ClientPtr client, DeviceIntPtr dev);
+
+extern void
+XISendDeviceChangedEvent(DeviceIntPtr device, DeviceIntPtr master,
+ DeviceChangedEvent *dce);
+
+extern int
+XISetEventMask(DeviceIntPtr dev, WindowPtr win, ClientPtr client,
+ unsigned int len, unsigned char* mask);
+
+extern int
+XICheckInvalidMaskBits(unsigned char *mask, int len);
+
+#endif /* EXEVENTS_H */
diff --git a/xorg-server/include/input.h b/xorg-server/include/input.h index 1930a308b..a7fdc6671 100644 --- a/xorg-server/include/input.h +++ b/xorg-server/include/input.h @@ -157,6 +157,8 @@ typedef struct _DeviceRec { Bool on; /* used by DDX to keep state */
} DeviceRec, *DevicePtr;
+typedef struct _ValuatorMask ValuatorMask;
+
typedef struct {
int click, bell, bell_pitch, bell_duration;
Bool autoRepeat;
@@ -274,12 +276,6 @@ extern _X_EXPORT int RemoveDevice( extern _X_EXPORT int NumMotionEvents(void);
-extern void RegisterPointerDevice(
- DeviceIntPtr /*device*/);
-
-extern void RegisterKeyboardDevice(
- DeviceIntPtr /*device*/);
-
extern _X_EXPORT int dixLookupDevice(
DeviceIntPtr * /* dev */,
int /* id */,
@@ -451,9 +447,7 @@ extern _X_EXPORT int GetPointerEvents( int type,
int buttons,
int flags,
- int first_valuator,
- int num_valuators,
- int *valuators);
+ const ValuatorMask *mask);
extern _X_EXPORT int GetKeyboardEvents(
EventListPtr events,
@@ -466,17 +460,13 @@ extern int GetKeyboardValuatorEvents( DeviceIntPtr pDev,
int type,
int key_code,
- int first_valuator,
- int num_valuator,
- int *valuators);
+ const ValuatorMask *mask);
extern int GetProximityEvents(
EventListPtr events,
DeviceIntPtr pDev,
int type,
- int first_valuator,
- int num_valuators,
- int *valuators);
+ const ValuatorMask *mask);
extern void PostSyntheticMotion(
DeviceIntPtr pDev,
@@ -556,8 +546,22 @@ extern _X_EXPORT void DDXRingBell( int pitch,
int duration);
+#define VALUATOR_MODE_ALL_AXES -1
+extern _X_HIDDEN int valuator_get_mode(DeviceIntPtr dev, int axis);
+extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
+
/* Set to TRUE by default - os/utils.c sets it to FALSE on user request,
xfixes/cursor.c uses it to determine if the cursor is enabled */
extern Bool EnableCursor;
+/* For server-internal functions, see inpututil.h */
+extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
+extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
+ int first_valuator, int num_valuators,
+ const int* valuators);
+extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask,
+ int valuator,
+ int data);
+extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
+
#endif /* INPUT_H */
diff --git a/xorg-server/include/inputstr.h b/xorg-server/include/inputstr.h index c37f30073..edb7988c3 100644 --- a/xorg-server/include/inputstr.h +++ b/xorg-server/include/inputstr.h @@ -60,6 +60,7 @@ SOFTWARE. #define BitIsOn(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
+extern _X_EXPORT int CountBits(const uint8_t *mask, int len);
#define SameClient(obj,client) \
(CLIENT_BITS((obj)->resource) == (client)->clientAsMask)
@@ -217,6 +218,7 @@ typedef struct _AxisInfo { int min_value;
int max_value;
Atom label;
+ CARD8 mode;
} AxisInfo, *AxisInfoPtr;
typedef struct _ValuatorAccelerationRec {
@@ -238,7 +240,6 @@ typedef struct _ValuatorClassRec { AxisInfoPtr axes;
unsigned short numAxes;
double *axisVal; /* always absolute, but device-coord system */
- CARD8 mode;
ValuatorAccelerationRec accelScheme;
} ValuatorClassRec, *ValuatorClassPtr;
@@ -271,7 +272,7 @@ typedef struct _FocusClassRec { typedef struct _ProximityClassRec {
int sourceid;
- char pad;
+ char in_proximity;
} ProximityClassRec, *ProximityClassPtr;
typedef struct _AbsoluteClassRec {
diff --git a/xorg-server/include/inpututils.h b/xorg-server/include/inpututils.h new file mode 100644 index 000000000..e59bf2860 --- /dev/null +++ b/xorg-server/include/inpututils.h @@ -0,0 +1,48 @@ +/*
+ * Copyright © 2010 Red Hat, Inc.
+ *
+ * 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 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_DIX_CONFIG_H
+#include "dix-config.h"
+#endif
+
+#ifndef INPUTUTILS_H
+#define INPUTUTILS_H
+
+#include "input.h"
+
+struct _ValuatorMask {
+ int8_t last_bit; /* highest bit set in mask */
+ uint8_t mask[(MAX_VALUATORS + 7)/8];
+ int valuators[MAX_VALUATORS]; /* valuator data */
+};
+
+/* server-internal */
+extern _X_HIDDEN int valuator_mask_size(const ValuatorMask *mask);
+extern _X_HIDDEN int valuator_mask_isset(const ValuatorMask *mask, int bit);
+extern _X_HIDDEN void valuator_mask_unset(ValuatorMask *mask, int bit);
+extern _X_HIDDEN int valuator_mask_num_valuators(const ValuatorMask *mask);
+extern _X_HIDDEN void valuator_mask_copy(ValuatorMask *dest, const ValuatorMask *src);
+extern _X_HIDDEN int valuator_mask_get(const ValuatorMask *mask, int valnum);
+
+#endif
diff --git a/xorg-server/include/opaque.h b/xorg-server/include/opaque.h index 877eef68b..5c2e9166c 100644 --- a/xorg-server/include/opaque.h +++ b/xorg-server/include/opaque.h @@ -56,9 +56,6 @@ extern _X_EXPORT Bool disableBackingStore; extern _X_EXPORT Bool enableBackingStore;
extern _X_EXPORT Bool PartialNetwork;
extern _X_EXPORT Bool RunFromSigStopParent;
-#ifndef NOLOGOHACK
-extern _X_EXPORT int logoScreenSaver;
-#endif
#ifdef RLIMIT_DATA
extern _X_EXPORT int limitDataSpace;
#endif
@@ -72,6 +69,7 @@ extern _X_EXPORT Bool defeatAccessControl; extern _X_EXPORT long maxBigRequestSize;
extern _X_EXPORT Bool party_like_its_1989;
extern _X_EXPORT Bool whiteRoot;
+extern _X_EXPORT Bool bgNoneRoot;
extern _X_EXPORT Bool CoreDump;
diff --git a/xorg-server/include/scrnintstr.h b/xorg-server/include/scrnintstr.h index a39dd6107..5efe6506c 100644 --- a/xorg-server/include/scrnintstr.h +++ b/xorg-server/include/scrnintstr.h @@ -605,6 +605,12 @@ typedef struct _Screen { /* Device cursor procedures */
DeviceCursorInitializeProcPtr DeviceCursorInitialize;
DeviceCursorCleanupProcPtr DeviceCursorCleanup;
+
+ /* set it in driver side if X server can copy the framebuffer content.
+ * Meant to be used together with '-background none' option, avoiding
+ * malicious users to steal framebuffer's content if that would be the
+ * default */
+ Bool canDoBGNoneRoot;
} ScreenRec;
static inline RegionPtr BitmapToRegion(ScreenPtr _pScreen, PixmapPtr pPix) {
diff --git a/xorg-server/include/site.h b/xorg-server/include/site.h index 4ec75edd3..dc8f7e20c 100644 --- a/xorg-server/include/site.h +++ b/xorg-server/include/site.h @@ -1,130 +1,127 @@ -/************************************************************ - -Copyright 1987, 1998 The Open Group - -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. - -The above copyright notice and this permission notice 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 -OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 Digital not be -used in advertising or publicity pertaining to distribution of the -software without specific, written prior permission. - -DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING -ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL -DIGITAL 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 SITE_H -#define SITE_H -/* - * The vendor string identifies the vendor responsible for the - * server executable. - */ -#ifndef VENDOR_STRING -#define VENDOR_STRING "HC-Consult" -#endif - -/* - * The vendor release number identifies, for the purpose of submitting - * traceable bug reports, the release number of software produced - * by the vendor. - */ -#ifndef VENDOR_RELEASE -#define VENDOR_RELEASE XORG_VERSION_CURRENT -#endif - -/* - * The following constants are provided solely as a last line of defense. The - * normal build ALWAYS overrides them using a special rule given in - * server/dix/Imakefile. If you want to change either of these constants, - * you should set the DefaultFontPath or DefaultRGBDatabase configuration - * parameters. - * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE! - */ -#ifndef COMPILEDDEFAULTFONTPATH -#define COMPILEDDEFAULTFONTPATH "/usr/share/fonts/X11/misc/" -#endif - -/* - * The following constants contain default values for all of the variables - * that can be initialized on the server command line or in the environment. - */ -#define COMPILEDDEFAULTFONT "fixed" -#define COMPILEDCURSORFONT "cursor" -#ifndef COMPILEDDISPLAYCLASS -#define COMPILEDDISPLAYCLASS "MIT-unspecified" -#endif -#define DEFAULT_TIMEOUT 60 /* seconds */ -#define DEFAULT_KEYBOARD_CLICK 0 -#define DEFAULT_BELL 50 -#define DEFAULT_BELL_PITCH 400 -#define DEFAULT_BELL_DURATION 100 -#define DEFAULT_AUTOREPEAT TRUE -#define DEFAULT_AUTOREPEATS {\ - 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ - 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} - -#define DEFAULT_LEDS 0x0 /* all off */ -#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */ -#define DEFAULT_INT_RESOLUTION 1000 -#define DEFAULT_INT_MIN_VALUE 0 -#define DEFAULT_INT_MAX_VALUE 100 -#define DEFAULT_INT_DISPLAYED 0 - -#define DEFAULT_PTR_NUMERATOR 2 -#define DEFAULT_PTR_DENOMINATOR 1 -#define DEFAULT_PTR_THRESHOLD 4 - -#define DEFAULT_SCREEN_SAVER_TIME (10 * (60 * 1000)) -#define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000)) -#define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking -#define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures -#ifndef NOLOGOHACK -#define DEFAULT_LOGO_SCREEN_SAVER 1 -#endif -#ifndef DEFAULT_ACCESS_CONTROL -#define DEFAULT_ACCESS_CONTROL TRUE -#endif - -/* Default logging parameters. */ -#ifndef DEFAULT_LOG_VERBOSITY -#define DEFAULT_LOG_VERBOSITY 0 -#endif -#ifndef DEFAULT_LOG_FILE_VERBOSITY -#define DEFAULT_LOG_FILE_VERBOSITY 3 -#endif - -#endif /* SITE_H */ +/************************************************************
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+The above copyright notice and this permission notice 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
+OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL 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 SITE_H
+#define SITE_H
+/*
+ * The vendor string identifies the vendor responsible for the
+ * server executable.
+ */
+#ifndef VENDOR_STRING
+#define VENDOR_STRING "HC-Consult"
+#endif
+
+/*
+ * The vendor release number identifies, for the purpose of submitting
+ * traceable bug reports, the release number of software produced
+ * by the vendor.
+ */
+#ifndef VENDOR_RELEASE
+#define VENDOR_RELEASE XORG_VERSION_CURRENT
+#endif
+
+/*
+ * The following constants are provided solely as a last line of defense. The
+ * normal build ALWAYS overrides them using a special rule given in
+ * server/dix/Imakefile. If you want to change either of these constants,
+ * you should set the DefaultFontPath or DefaultRGBDatabase configuration
+ * parameters.
+ * DO NOT CHANGE THESE VALUES OR THE DIX IMAKEFILE!
+ */
+#ifndef COMPILEDDEFAULTFONTPATH
+#define COMPILEDDEFAULTFONTPATH "/usr/share/fonts/X11/misc/"
+#endif
+
+/*
+ * The following constants contain default values for all of the variables
+ * that can be initialized on the server command line or in the environment.
+ */
+#define COMPILEDDEFAULTFONT "fixed"
+#define COMPILEDCURSORFONT "cursor"
+#ifndef COMPILEDDISPLAYCLASS
+#define COMPILEDDISPLAYCLASS "MIT-unspecified"
+#endif
+#define DEFAULT_TIMEOUT 60 /* seconds */
+#define DEFAULT_KEYBOARD_CLICK 0
+#define DEFAULT_BELL 50
+#define DEFAULT_BELL_PITCH 400
+#define DEFAULT_BELL_DURATION 100
+#define DEFAULT_AUTOREPEAT TRUE
+#define DEFAULT_AUTOREPEATS {\
+ 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
+ 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+
+#define DEFAULT_LEDS 0x0 /* all off */
+#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */
+#define DEFAULT_INT_RESOLUTION 1000
+#define DEFAULT_INT_MIN_VALUE 0
+#define DEFAULT_INT_MAX_VALUE 100
+#define DEFAULT_INT_DISPLAYED 0
+
+#define DEFAULT_PTR_NUMERATOR 2
+#define DEFAULT_PTR_DENOMINATOR 1
+#define DEFAULT_PTR_THRESHOLD 4
+
+#define DEFAULT_SCREEN_SAVER_TIME (10 * (60 * 1000))
+#define DEFAULT_SCREEN_SAVER_INTERVAL (10 * (60 * 1000))
+#define DEFAULT_SCREEN_SAVER_BLANKING PreferBlanking
+#define DEFAULT_SCREEN_SAVER_EXPOSURES AllowExposures
+#ifndef DEFAULT_ACCESS_CONTROL
+#define DEFAULT_ACCESS_CONTROL TRUE
+#endif
+
+/* Default logging parameters. */
+#ifndef DEFAULT_LOG_VERBOSITY
+#define DEFAULT_LOG_VERBOSITY 0
+#endif
+#ifndef DEFAULT_LOG_FILE_VERBOSITY
+#define DEFAULT_LOG_FILE_VERBOSITY 3
+#endif
+
+#endif /* SITE_H */
diff --git a/xorg-server/mi/mipointer.c b/xorg-server/mi/mipointer.c index 1f84e5309..f9ca9a70b 100644 --- a/xorg-server/mi/mipointer.c +++ b/xorg-server/mi/mipointer.c @@ -39,6 +39,7 @@ in this Software without prior written authorization from The Open Group. # include "cursorstr.h"
# include "dixstruct.h"
# include "inputstr.h"
+# include "inpututils.h"
DevPrivateKeyRec miPointerScreenKeyRec;
@@ -553,6 +554,7 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) {
int i, nevents;
int valuators[2];
+ ValuatorMask mask;
miPointerMoveNoEvent(pDev, pScreen, x, y);
@@ -571,7 +573,9 @@ miPointerMove (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) }
}
- nevents = GetPointerEvents(events, pDev, MotionNotify, 0, POINTER_SCREEN | POINTER_ABSOLUTE, 0, 2, valuators);
+ valuator_mask_set_range(&mask, 0, 2, valuators);
+ nevents = GetPointerEvents(events, pDev, MotionNotify, 0,
+ POINTER_SCREEN | POINTER_ABSOLUTE, &mask);
OsBlockSignals();
#ifdef XQUARTZ
diff --git a/xorg-server/mi/mispans.c b/xorg-server/mi/mispans.c index ccf2a723e..4202c9bb9 100644 --- a/xorg-server/mi/mispans.c +++ b/xorg-server/mi/mispans.c @@ -215,7 +215,7 @@ void miAppendSpans(SpanGroup *spanGroup, SpanGroup *otherGroup, Spans *spans) void miFreeSpanGroup(SpanGroup *spanGroup)
{
- if (spanGroup->group != NULL) free(spanGroup->group);
+ free(spanGroup->group);
}
static void QuickSortSpansX(
diff --git a/xorg-server/mi/miwideline.c b/xorg-server/mi/miwideline.c index 869142382..2d27dd7dc 100644 --- a/xorg-server/mi/miwideline.c +++ b/xorg-server/mi/miwideline.c @@ -407,7 +407,7 @@ miPolyBuildPoly ( i = top;
j = StepAround (top, -1, count);
- if (slopes[j].dy * slopes[i].dx > slopes[i].dy * slopes[j].dx)
+ if ((int64_t)slopes[j].dy * slopes[i].dx > (int64_t)slopes[i].dy * slopes[j].dx)
{
clockwise = -1;
slopeoff = -1;
diff --git a/xorg-server/miext/rootless/rootlessScreen.c b/xorg-server/miext/rootless/rootlessScreen.c index fd396e464..364a75ac8 100644 --- a/xorg-server/miext/rootless/rootlessScreen.c +++ b/xorg-server/miext/rootless/rootlessScreen.c @@ -92,8 +92,7 @@ RootlessUpdateScreenPixmap(ScreenPtr pScreen) rowbytes = PixmapBytePad(pScreen->width, pScreen->rootDepth);
if (s->pixmap_data_size < rowbytes) {
- if (s->pixmap_data != NULL)
- free(s->pixmap_data);
+ free(s->pixmap_data);
s->pixmap_data_size = rowbytes;
s->pixmap_data = malloc(s->pixmap_data_size);
diff --git a/xorg-server/miext/rootless/rootlessWindow.c b/xorg-server/miext/rootless/rootlessWindow.c index 7c822e34a..ef0d42e4c 100644 --- a/xorg-server/miext/rootless/rootlessWindow.c +++ b/xorg-server/miext/rootless/rootlessWindow.c @@ -1146,10 +1146,8 @@ FinishFrameResize(WindowPtr pWin, Bool gravity, int oldX, int oldY, }
}
- if (gResizeDeathBits != NULL) {
- free(gResizeDeathBits);
- gResizeDeathBits = NULL;
- }
+ free(gResizeDeathBits);
+ gResizeDeathBits = NULL;
if (gravity) {
pScreen->CopyWindow = gResizeOldCopyWindowProc;
diff --git a/xorg-server/miext/shadow/shpacked.c b/xorg-server/miext/shadow/shpacked.c index 9bc869a8d..e5ebbff64 100644 --- a/xorg-server/miext/shadow/shpacked.c +++ b/xorg-server/miext/shadow/shpacked.c @@ -102,8 +102,8 @@ shadowUpdatePacked (ScreenPtr pScreen, width -= i;
scr += i;
#define PickBit(a,i) (((a) >> (i)) & 1)
- while (i--)
- *win++ = *sha++;
+ memcpy(win, sha, i * sizeof(FbBits));
+ sha += i;
}
shaLine += shaStride;
y++;
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c index 21d2cf75c..d2eb04649 100644 --- a/xorg-server/os/io.c +++ b/xorg-server/os/io.c @@ -410,16 +410,29 @@ ReadRequestFromClient(ClientPtr client) else
needed = sizeof(xReq);
}
- oci->lenLastReq = needed;
/* If there are bytes to ignore, ignore them now. */
if (oci->ignoreBytes > 0) {
assert(needed == oci->ignoreBytes || needed == oci->size);
- oci->ignoreBytes -= gotnow;
- needed = gotnow = 0;
+ /*
+ * The _XSERVTransRead call above may return more or fewer bytes than we
+ * want to ignore. Ignore the smaller of the two sizes.
+ */
+ if (gotnow < needed) {
+ oci->ignoreBytes -= gotnow;
+ oci->bufptr += gotnow;
+ gotnow = 0;
+ } else {
+ oci->ignoreBytes -= needed;
+ oci->bufptr += needed;
+ gotnow -= needed;
+ }
+ needed = 0;
}
+ oci->lenLastReq = needed;
+
/*
* Check to see if client has at least one whole request in the
* buffer beyond the request we're returning to the caller.
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c index 0d45b7791..f997e3eee 100644 --- a/xorg-server/os/log.c +++ b/xorg-server/os/log.c @@ -1,629 +1,619 @@ -/* - -Copyright 1987, 1998 The Open Group - -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. - -The above copyright notice and this permission notice 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 OPEN GROUP 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. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - - -Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, -Copyright 1994 Quarterdeck Office Systems. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, -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 names of Digital and -Quarterdeck not be used in advertising or publicity pertaining to -distribution of the software without specific, written prior -permission. - -DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS, IN NO EVENT SHALL DIGITAL 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. - -*/ - -/* - * Copyright (c) 1997-2003 by The XFree86 Project, Inc. - * - * 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 above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include <X11/Xos.h> -#include <stdio.h> -#include <time.h> -#include <sys/stat.h> -#include <stdarg.h> -#include <stdlib.h> /* for malloc() */ -#include <errno.h> - -#include "input.h" -#include "site.h" -#include "opaque.h" - -#ifdef WIN32 -#include <process.h> -#ifndef _MSC_VER -#define getpid(x) _getpid(x) -#endif -#endif - -#ifdef _MSC_VER -#define S_ISREG(m) (((m)&_S_IFMT) == _S_IFREG) -#endif - -#ifdef XF86BIGFONT -#include "xf86bigfontsrv.h" -#endif - -#ifdef DDXOSVERRORF -void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL; -#endif - -static FILE *logFile = NULL; -static Bool logFlush = FALSE; -static Bool logSync = FALSE; -static int logVerbosity = DEFAULT_LOG_VERBOSITY; -static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY; - -/* Buffer to information logged before the log file is opened. */ -static char *saveBuffer = NULL; -static int bufferSize = 0, bufferUnused = 0, bufferPos = 0; -static Bool needBuffer = TRUE; - -#ifdef __APPLE__ -#include <AvailabilityMacros.h> - -static char __crashreporter_info_buff__[4096] = {0}; -static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 -// This is actually a toolchain requirement, but I'm not sure the correct check, -// but it should be fine to just only include it for Leopard and later. This line -// just tells the linker to never strip this symbol (such as for space optimization) -asm (".desc ___crashreporter_info__, 0x10"); -#endif -#endif - -/* Prefix strings for log messages. */ -#ifndef X_UNKNOWN_STRING -#define X_UNKNOWN_STRING "(\?\?)" -#endif -#ifndef X_PROBE_STRING -#define X_PROBE_STRING "(--)" -#endif -#ifndef X_CONFIG_STRING -#define X_CONFIG_STRING "(**)" -#endif -#ifndef X_DEFAULT_STRING -#define X_DEFAULT_STRING "(==)" -#endif -#ifndef X_CMDLINE_STRING -#define X_CMDLINE_STRING "(++)" -#endif -#ifndef X_NOTICE_STRING -#define X_NOTICE_STRING "(!!)" -#endif -#ifndef X_ERROR_STRING -#define X_ERROR_STRING "(EE)" -#endif -#ifndef X_WARNING_STRING -#define X_WARNING_STRING "(WW)" -#endif -#ifndef X_INFO_STRING -#define X_INFO_STRING "(II)" -#endif -#ifndef X_NOT_IMPLEMENTED_STRING -#define X_NOT_IMPLEMENTED_STRING "(NI)" -#endif - -/* - * LogInit is called to start logging to a file. It is also called (with - * NULL arguments) when logging to a file is not wanted. It must always be - * called, otherwise log messages will continue to accumulate in a buffer. - * - * %s, if present in the fname or backup strings, is expanded to the display - * string. - */ - -const char * -LogInit(const char *fname, const char *backup) -{ - char *logFileName = NULL; - - if (fname && *fname) { - /* malloc() can't be used yet. */ - logFileName = malloc(strlen(fname) + strlen(display) + 1); - if (!logFileName) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(logFileName, fname, display); - - if (backup && *backup) { - struct stat buf; - - if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) { - char *suffix; - char *oldLog; - - oldLog = malloc(strlen(logFileName) + strlen(backup) + - strlen(display) + 1); - suffix = malloc(strlen(backup) + strlen(display) + 1); - if (!oldLog || !suffix) - FatalError("Cannot allocate space for the log file name\n"); - sprintf(suffix, backup, display); - sprintf(oldLog, "%s%s", logFileName, suffix); - free(suffix); - if (rename(logFileName, oldLog) == -1) { - FatalError("Cannot move old log file \"%s\" to \"%s\"\n", - logFileName, oldLog); - } - free(oldLog); - } - } - if ((logFile = fopen(logFileName, "w")) == NULL) - FatalError("Cannot open log file \"%s\"\n", logFileName); - setvbuf(logFile, NULL, _IONBF, 0); - - /* Flush saved log information. */ - if (saveBuffer && bufferSize > 0) { - fwrite(saveBuffer, bufferPos, 1, logFile); - fflush(logFile); -#ifndef WIN32 - fsync(fileno(logFile)); -#endif - } - } - - /* - * Unconditionally free the buffer, and flag that the buffer is no longer - * needed. - */ - if (saveBuffer && bufferSize > 0) { - free(saveBuffer); /* Must be free(), not free() */ - saveBuffer = NULL; - bufferSize = 0; - } - needBuffer = FALSE; - - return logFileName; -} - -void -LogClose(void) -{ - if (logFile) { - fclose(logFile); - logFile = NULL; - } -} - -Bool -LogSetParameter(LogParameter param, int value) -{ - switch (param) { - case XLOG_FLUSH: - logFlush = value ? TRUE : FALSE; - return TRUE; - case XLOG_SYNC: - logSync = value ? TRUE : FALSE; - return TRUE; - case XLOG_VERBOSITY: - logVerbosity = value; - return TRUE; - case XLOG_FILE_VERBOSITY: - logFileVerbosity = value; - return TRUE; - default: - return FALSE; - } -} - -/* This function does the actual log message writes. */ - -void -LogVWrite(int verb, const char *f, va_list args) -{ - char tmpBuffer[1024]; - int len = 0; - static Bool newline = TRUE; - - if (newline) { - sprintf(tmpBuffer, "[%10.3f] ", GetTimeInMillis() / 1000.0); - len = strlen(tmpBuffer); - if (logFile) - fwrite(tmpBuffer, len, 1, logFile); - } - - /* - * Since a va_list can only be processed once, write the string to a - * buffer, and then write the buffer out to the appropriate output - * stream(s). - */ - if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) { - vsnprintf(tmpBuffer, sizeof(tmpBuffer)-1, f, args); - tmpBuffer[sizeof(tmpBuffer)-1]=0; - len = strlen(tmpBuffer); - } - newline = (tmpBuffer[len-1] == '\n'); - if ((verb < 0 || logVerbosity >= verb) && len > 0) - fwrite(tmpBuffer, len, 1, stderr); - if ((verb < 0 || logFileVerbosity >= verb) && len > 0) { - if (logFile) { - fwrite(tmpBuffer, len, 1, logFile); - if (logFlush) { - fflush(logFile); -#ifndef WIN32 - if (logSync) - fsync(fileno(logFile)); -#endif - } - } else if (needBuffer) { - /* - * Note, this code is used before OsInit() has been called, so - * malloc() and friends can't be used. - */ - if (len > bufferUnused) { - bufferSize += 1024; - bufferUnused += 1024; - if (saveBuffer) - saveBuffer = realloc(saveBuffer, bufferSize); - else - saveBuffer = malloc(bufferSize); - if (!saveBuffer) - FatalError("realloc() failed while saving log messages\n"); - } - bufferUnused -= len; - memcpy(saveBuffer + bufferPos, tmpBuffer, len); - bufferPos += len; - } - } -} - -void -LogWrite(int verb, const char *f, ...) -{ - va_list args; - - va_start(args, f); - LogVWrite(verb, f, args); - va_end(args); -} - -void -LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) -{ - const char *s = X_UNKNOWN_STRING; - char tmpBuf[1024]; - - /* Ignore verbosity for X_ERROR */ - if (logVerbosity >= verb || logFileVerbosity >= verb || type == X_ERROR) { - switch (type) { - case X_PROBED: - s = X_PROBE_STRING; - break; - case X_CONFIG: - s = X_CONFIG_STRING; - break; - case X_DEFAULT: - s = X_DEFAULT_STRING; - break; - case X_CMDLINE: - s = X_CMDLINE_STRING; - break; - case X_NOTICE: - s = X_NOTICE_STRING; - break; - case X_ERROR: - s = X_ERROR_STRING; - if (verb > 0) - verb = 0; - break; - case X_WARNING: - s = X_WARNING_STRING; - break; - case X_INFO: - s = X_INFO_STRING; - break; - case X_NOT_IMPLEMENTED: - s = X_NOT_IMPLEMENTED_STRING; - break; - case X_UNKNOWN: - s = X_UNKNOWN_STRING; - break; - case X_NONE: - s = NULL; - break; - } - - /* if s is not NULL we need a space before format */ - snprintf(tmpBuf, sizeof(tmpBuf), "%s%s%s", s ? s : "", - s ? " " : "", - format); - LogVWrite(verb, tmpBuf, args); - } -} - -/* Log message with verbosity level specified. */ -void -LogMessageVerb(MessageType type, int verb, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, verb, format, ap); - va_end(ap); -} - -/* Log a message with the standard verbosity level of 1. */ -void -LogMessage(MessageType type, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - LogVMessageVerb(type, 1, format, ap); - va_end(ap); -} - -void -AbortServer(void) _X_NORETURN; - -void -AbortServer(void) -{ -#ifdef XF86BIGFONT - XF86BigfontCleanup(); -#endif - CloseWellKnownConnections(); - OsCleanup(TRUE); - CloseDownDevices(); - AbortDDX(); - fflush(stderr); - if (CoreDump) - OsAbort(); - exit (1); -} - -#define AUDIT_PREFIX "AUDIT: %s: %ld: " -#ifndef AUDIT_TIMEOUT -#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */ -#endif - -static int nrepeat = 0; -static int oldlen = -1; -static OsTimerPtr auditTimer = NULL; - -void -FreeAuditTimer(void) -{ - if (auditTimer != NULL) { - /* Force output of pending messages */ - TimerForce(auditTimer); - TimerFree(auditTimer); - auditTimer = NULL; - } -} - -static char * -AuditPrefix(void) -{ - time_t tm; - char *autime, *s; - char *tmpBuf; - int len; - - time(&tm); - autime = ctime(&tm); - if ((s = strchr(autime, '\n'))) - *s = '\0'; - len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + 1; - tmpBuf = malloc(len); - if (!tmpBuf) - return NULL; - snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid()); - return tmpBuf; -} - -void -AuditF(const char * f, ...) -{ - va_list args; - - va_start(args, f); - - VAuditF(f, args); - va_end(args); -} - -static CARD32 -AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg) -{ - char *prefix; - - if (nrepeat > 0) { - prefix = AuditPrefix(); - ErrorF("%slast message repeated %d times\n", - prefix != NULL ? prefix : "", nrepeat); - nrepeat = 0; - if (prefix != NULL) - free(prefix); - return AUDIT_TIMEOUT; - } else { - /* if the timer expires without anything to print, flush the message */ - oldlen = -1; - return 0; - } -} - -void -VAuditF(const char *f, va_list args) -{ - char *prefix; - char buf[1024]; - int len; - static char oldbuf[1024]; - - prefix = AuditPrefix(); - len = vsnprintf(buf, sizeof(buf), f, args); - - if (len == oldlen && strcmp(buf, oldbuf) == 0) { - /* Message already seen */ - nrepeat++; - } else { - /* new message */ - if (auditTimer != NULL) - TimerForce(auditTimer); - ErrorF("%s%s", prefix != NULL ? prefix : "", buf); - strlcpy(oldbuf, buf, sizeof(oldbuf)); - oldlen = len; - nrepeat = 0; - auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL); - } - if (prefix != NULL) - free(prefix); -} - -extern char g_FatalErrorMessage[1024]; - -void -FatalError(const char *f, ...) -{ - va_list args; - static Bool beenhere = FALSE; - - if (beenhere) - ErrorF("\nFatalError re-entered, aborting\n"); - else - ErrorF("\nFatal server error:\n"); - - va_start(args, f); -#ifdef __APPLE__ - (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args); -#endif -#ifdef WIN32 - vsnprintf(g_FatalErrorMessage, 1024, f, args); -#endif - VErrorF(f, args); - va_end(args); - ErrorF("\n"); - if (!beenhere) - OsVendorFatalError(); - if (!beenhere) { - beenhere = TRUE; - AbortServer(); - } else - OsAbort(); - /*NOTREACHED*/ -} - -void -VErrorF(const char *f, va_list args) -{ -#ifdef DDXOSVERRORF - if (OsVendorVErrorFProc) - OsVendorVErrorFProc(f, args); - else - LogVWrite(-1, f, args); -#else - LogVWrite(-1, f, args); -#endif -} - -void -ErrorF(const char * f, ...) -{ - va_list args; - - va_start(args, f); - VErrorF(f, args); - va_end(args); -} - -/* A perror() workalike. */ - -void -Error(char *str) -{ - char *err = NULL; - int saveErrno = errno; - - if (str) { - err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1); - if (!err) - return; - sprintf(err, "%s: ", str); - strcat(err, strerror(saveErrno)); - LogWrite(-1, "%s", err); - free(err); - } else - LogWrite(-1, "%s", strerror(saveErrno)); -} - -void -LogPrintMarkers(void) -{ - /* Show what the message marker symbols mean. */ - LogWrite(0, "Markers: "); - LogMessageVerb(X_PROBED, 0, "probed, "); - LogMessageVerb(X_CONFIG, 0, "from config file, "); - LogMessageVerb(X_DEFAULT, 0, "default setting,\n\t"); - LogMessageVerb(X_CMDLINE, 0, "from command line, "); - LogMessageVerb(X_NOTICE, 0, "notice, "); - LogMessageVerb(X_INFO, 0, "informational,\n\t"); - LogMessageVerb(X_WARNING, 0, "warning, "); - LogMessageVerb(X_ERROR, 0, "error, "); - LogMessageVerb(X_NOT_IMPLEMENTED, 0, "not implemented, "); - LogMessageVerb(X_UNKNOWN, 0, "unknown.\n"); -} - +/*
+
+Copyright 1987, 1998 The Open Group
+
+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.
+
+The above copyright notice and this permission notice 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 OPEN GROUP 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.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
+Copyright 1994 Quarterdeck Office Systems.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+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 names of Digital and
+Quarterdeck not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+DIGITAL AND QUARTERDECK DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL DIGITAL 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.
+
+*/
+
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
+ *
+ * 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 above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/stat.h>
+#include <stdarg.h>
+#include <stdlib.h> /* for malloc() */
+#include <errno.h>
+
+#include "input.h"
+#include "site.h"
+#include "opaque.h"
+
+#ifdef WIN32
+#include <process.h>
+#ifndef _MSC_VER
+#define getpid(x) _getpid(x)
+#endif
+#endif
+
+#ifdef _MSC_VER
+#define S_ISREG(m) (((m)&_S_IFMT) == _S_IFREG)
+#endif
+
+#ifdef XF86BIGFONT
+#include "xf86bigfontsrv.h"
+#endif
+
+#ifdef DDXOSVERRORF
+void (*OsVendorVErrorFProc)(const char *, va_list args) = NULL;
+#endif
+
+static FILE *logFile = NULL;
+static Bool logFlush = FALSE;
+static Bool logSync = FALSE;
+static int logVerbosity = DEFAULT_LOG_VERBOSITY;
+static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY;
+
+/* Buffer to information logged before the log file is opened. */
+static char *saveBuffer = NULL;
+static int bufferSize = 0, bufferUnused = 0, bufferPos = 0;
+static Bool needBuffer = TRUE;
+
+#ifdef __APPLE__
+#include <AvailabilityMacros.h>
+
+static char __crashreporter_info_buff__[4096] = {0};
+static const char *__crashreporter_info__ = &__crashreporter_info_buff__[0];
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+// This is actually a toolchain requirement, but I'm not sure the correct check,
+// but it should be fine to just only include it for Leopard and later. This line
+// just tells the linker to never strip this symbol (such as for space optimization)
+asm (".desc ___crashreporter_info__, 0x10");
+#endif
+#endif
+
+/* Prefix strings for log messages. */
+#ifndef X_UNKNOWN_STRING
+#define X_UNKNOWN_STRING "(\?\?)"
+#endif
+#ifndef X_PROBE_STRING
+#define X_PROBE_STRING "(--)"
+#endif
+#ifndef X_CONFIG_STRING
+#define X_CONFIG_STRING "(**)"
+#endif
+#ifndef X_DEFAULT_STRING
+#define X_DEFAULT_STRING "(==)"
+#endif
+#ifndef X_CMDLINE_STRING
+#define X_CMDLINE_STRING "(++)"
+#endif
+#ifndef X_NOTICE_STRING
+#define X_NOTICE_STRING "(!!)"
+#endif
+#ifndef X_ERROR_STRING
+#define X_ERROR_STRING "(EE)"
+#endif
+#ifndef X_WARNING_STRING
+#define X_WARNING_STRING "(WW)"
+#endif
+#ifndef X_INFO_STRING
+#define X_INFO_STRING "(II)"
+#endif
+#ifndef X_NOT_IMPLEMENTED_STRING
+#define X_NOT_IMPLEMENTED_STRING "(NI)"
+#endif
+
+/*
+ * LogInit is called to start logging to a file. It is also called (with
+ * NULL arguments) when logging to a file is not wanted. It must always be
+ * called, otherwise log messages will continue to accumulate in a buffer.
+ *
+ * %s, if present in the fname or backup strings, is expanded to the display
+ * string.
+ */
+
+const char *
+LogInit(const char *fname, const char *backup)
+{
+ char *logFileName = NULL;
+
+ if (fname && *fname) {
+ logFileName = malloc(strlen(fname) + strlen(display) + 1);
+ if (!logFileName)
+ FatalError("Cannot allocate space for the log file name\n");
+ sprintf(logFileName, fname, display);
+
+ if (backup && *backup) {
+ struct stat buf;
+
+ if (!stat(logFileName, &buf) && S_ISREG(buf.st_mode)) {
+ char *suffix;
+ char *oldLog;
+
+ oldLog = malloc(strlen(logFileName) + strlen(backup) +
+ strlen(display) + 1);
+ suffix = malloc(strlen(backup) + strlen(display) + 1);
+ if (!oldLog || !suffix)
+ FatalError("Cannot allocate space for the log file name\n");
+ sprintf(suffix, backup, display);
+ sprintf(oldLog, "%s%s", logFileName, suffix);
+ free(suffix);
+ if (rename(logFileName, oldLog) == -1) {
+ FatalError("Cannot move old log file \"%s\" to \"%s\"\n",
+ logFileName, oldLog);
+ }
+ free(oldLog);
+ }
+ }
+ if ((logFile = fopen(logFileName, "w")) == NULL)
+ FatalError("Cannot open log file \"%s\"\n", logFileName);
+ setvbuf(logFile, NULL, _IONBF, 0);
+
+ /* Flush saved log information. */
+ if (saveBuffer && bufferSize > 0) {
+ fwrite(saveBuffer, bufferPos, 1, logFile);
+ fflush(logFile);
+#ifndef WIN32
+ fsync(fileno(logFile));
+#endif
+ }
+ }
+
+ /*
+ * Unconditionally free the buffer, and flag that the buffer is no longer
+ * needed.
+ */
+ if (saveBuffer && bufferSize > 0) {
+ free(saveBuffer); /* Must be free(), not free() */
+ saveBuffer = NULL;
+ bufferSize = 0;
+ }
+ needBuffer = FALSE;
+
+ return logFileName;
+}
+
+void
+LogClose(void)
+{
+ if (logFile) {
+ fclose(logFile);
+ logFile = NULL;
+ }
+}
+
+Bool
+LogSetParameter(LogParameter param, int value)
+{
+ switch (param) {
+ case XLOG_FLUSH:
+ logFlush = value ? TRUE : FALSE;
+ return TRUE;
+ case XLOG_SYNC:
+ logSync = value ? TRUE : FALSE;
+ return TRUE;
+ case XLOG_VERBOSITY:
+ logVerbosity = value;
+ return TRUE;
+ case XLOG_FILE_VERBOSITY:
+ logFileVerbosity = value;
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+/* This function does the actual log message writes. */
+
+void
+LogVWrite(int verb, const char *f, va_list args)
+{
+ char tmpBuffer[1024];
+ int len = 0;
+ static Bool newline = TRUE;
+
+ if (newline) {
+ sprintf(tmpBuffer, "[%10.3f] ", GetTimeInMillis() / 1000.0);
+ len = strlen(tmpBuffer);
+ if (logFile)
+ fwrite(tmpBuffer, len, 1, logFile);
+ }
+
+ /*
+ * Since a va_list can only be processed once, write the string to a
+ * buffer, and then write the buffer out to the appropriate output
+ * stream(s).
+ */
+ if (verb < 0 || logFileVerbosity >= verb || logVerbosity >= verb) {
+ vsnprintf(tmpBuffer, sizeof(tmpBuffer)-1, f, args);
+ tmpBuffer[sizeof(tmpBuffer)-1]=0;
+ len = strlen(tmpBuffer);
+ }
+ newline = (tmpBuffer[len-1] == '\n');
+ if ((verb < 0 || logVerbosity >= verb) && len > 0)
+ fwrite(tmpBuffer, len, 1, stderr);
+ if ((verb < 0 || logFileVerbosity >= verb) && len > 0) {
+ if (logFile) {
+ fwrite(tmpBuffer, len, 1, logFile);
+ if (logFlush) {
+ fflush(logFile);
+#ifndef WIN32
+ if (logSync)
+ fsync(fileno(logFile));
+#endif
+ }
+ } else if (needBuffer) {
+ if (len > bufferUnused) {
+ bufferSize += 1024;
+ bufferUnused += 1024;
+ saveBuffer = realloc(saveBuffer, bufferSize);
+ if (!saveBuffer)
+ FatalError("realloc() failed while saving log messages\n");
+ }
+ bufferUnused -= len;
+ memcpy(saveBuffer + bufferPos, tmpBuffer, len);
+ bufferPos += len;
+ }
+ }
+}
+
+void
+LogWrite(int verb, const char *f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ LogVWrite(verb, f, args);
+ va_end(args);
+}
+
+void
+LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
+{
+ const char *s = X_UNKNOWN_STRING;
+ char tmpBuf[1024];
+
+ /* Ignore verbosity for X_ERROR */
+ if (logVerbosity >= verb || logFileVerbosity >= verb || type == X_ERROR) {
+ switch (type) {
+ case X_PROBED:
+ s = X_PROBE_STRING;
+ break;
+ case X_CONFIG:
+ s = X_CONFIG_STRING;
+ break;
+ case X_DEFAULT:
+ s = X_DEFAULT_STRING;
+ break;
+ case X_CMDLINE:
+ s = X_CMDLINE_STRING;
+ break;
+ case X_NOTICE:
+ s = X_NOTICE_STRING;
+ break;
+ case X_ERROR:
+ s = X_ERROR_STRING;
+ if (verb > 0)
+ verb = 0;
+ break;
+ case X_WARNING:
+ s = X_WARNING_STRING;
+ break;
+ case X_INFO:
+ s = X_INFO_STRING;
+ break;
+ case X_NOT_IMPLEMENTED:
+ s = X_NOT_IMPLEMENTED_STRING;
+ break;
+ case X_UNKNOWN:
+ s = X_UNKNOWN_STRING;
+ break;
+ case X_NONE:
+ s = NULL;
+ break;
+ }
+
+ /* if s is not NULL we need a space before format */
+ snprintf(tmpBuf, sizeof(tmpBuf), "%s%s%s", s ? s : "",
+ s ? " " : "",
+ format);
+ LogVWrite(verb, tmpBuf, args);
+ }
+}
+
+/* Log message with verbosity level specified. */
+void
+LogMessageVerb(MessageType type, int verb, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ LogVMessageVerb(type, verb, format, ap);
+ va_end(ap);
+}
+
+/* Log a message with the standard verbosity level of 1. */
+void
+LogMessage(MessageType type, const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ LogVMessageVerb(type, 1, format, ap);
+ va_end(ap);
+}
+
+void
+AbortServer(void) _X_NORETURN;
+
+void
+AbortServer(void)
+{
+#ifdef XF86BIGFONT
+ XF86BigfontCleanup();
+#endif
+ CloseWellKnownConnections();
+ OsCleanup(TRUE);
+ CloseDownDevices();
+ AbortDDX();
+ fflush(stderr);
+ if (CoreDump)
+ OsAbort();
+ exit (1);
+}
+
+#define AUDIT_PREFIX "AUDIT: %s: %ld: "
+#ifndef AUDIT_TIMEOUT
+#define AUDIT_TIMEOUT ((CARD32)(120 * 1000)) /* 2 mn */
+#endif
+
+static int nrepeat = 0;
+static int oldlen = -1;
+static OsTimerPtr auditTimer = NULL;
+
+void
+FreeAuditTimer(void)
+{
+ if (auditTimer != NULL) {
+ /* Force output of pending messages */
+ TimerForce(auditTimer);
+ TimerFree(auditTimer);
+ auditTimer = NULL;
+ }
+}
+
+static char *
+AuditPrefix(void)
+{
+ time_t tm;
+ char *autime, *s;
+ char *tmpBuf;
+ int len;
+
+ time(&tm);
+ autime = ctime(&tm);
+ if ((s = strchr(autime, '\n')))
+ *s = '\0';
+ len = strlen(AUDIT_PREFIX) + strlen(autime) + 10 + 1;
+ tmpBuf = malloc(len);
+ if (!tmpBuf)
+ return NULL;
+ snprintf(tmpBuf, len, AUDIT_PREFIX, autime, (unsigned long)getpid());
+ return tmpBuf;
+}
+
+void
+AuditF(const char * f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+
+ VAuditF(f, args);
+ va_end(args);
+}
+
+static CARD32
+AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg)
+{
+ char *prefix;
+
+ if (nrepeat > 0) {
+ prefix = AuditPrefix();
+ ErrorF("%slast message repeated %d times\n",
+ prefix != NULL ? prefix : "", nrepeat);
+ nrepeat = 0;
+ free(prefix);
+ return AUDIT_TIMEOUT;
+ } else {
+ /* if the timer expires without anything to print, flush the message */
+ oldlen = -1;
+ return 0;
+ }
+}
+
+void
+VAuditF(const char *f, va_list args)
+{
+ char *prefix;
+ char buf[1024];
+ int len;
+ static char oldbuf[1024];
+
+ prefix = AuditPrefix();
+ len = vsnprintf(buf, sizeof(buf), f, args);
+
+ if (len == oldlen && strcmp(buf, oldbuf) == 0) {
+ /* Message already seen */
+ nrepeat++;
+ } else {
+ /* new message */
+ if (auditTimer != NULL)
+ TimerForce(auditTimer);
+ ErrorF("%s%s", prefix != NULL ? prefix : "", buf);
+ strlcpy(oldbuf, buf, sizeof(oldbuf));
+ oldlen = len;
+ nrepeat = 0;
+ auditTimer = TimerSet(auditTimer, 0, AUDIT_TIMEOUT, AuditFlush, NULL);
+ }
+ free(prefix);
+}
+
+extern char g_FatalErrorMessage[1024];
+
+void
+FatalError(const char *f, ...)
+{
+ va_list args;
+ static Bool beenhere = FALSE;
+
+ if (beenhere)
+ ErrorF("\nFatalError re-entered, aborting\n");
+ else
+ ErrorF("\nFatal server error:\n");
+
+ va_start(args, f);
+#ifdef __APPLE__
+ (void)vsnprintf(__crashreporter_info_buff__, sizeof(__crashreporter_info_buff__), f, args);
+#endif
+#ifdef WIN32
+ vsnprintf(g_FatalErrorMessage, 1024, f, args);
+#endif
+ VErrorF(f, args);
+ va_end(args);
+ ErrorF("\n");
+ if (!beenhere)
+ OsVendorFatalError();
+ if (!beenhere) {
+ beenhere = TRUE;
+ AbortServer();
+ } else
+ OsAbort();
+ /*NOTREACHED*/
+}
+
+void
+VErrorF(const char *f, va_list args)
+{
+#ifdef DDXOSVERRORF
+ if (OsVendorVErrorFProc)
+ OsVendorVErrorFProc(f, args);
+ else
+ LogVWrite(-1, f, args);
+#else
+ LogVWrite(-1, f, args);
+#endif
+}
+
+void
+ErrorF(const char * f, ...)
+{
+ va_list args;
+
+ va_start(args, f);
+ VErrorF(f, args);
+ va_end(args);
+}
+
+/* A perror() workalike. */
+
+void
+Error(char *str)
+{
+ char *err = NULL;
+ int saveErrno = errno;
+
+ if (str) {
+ err = malloc(strlen(strerror(saveErrno)) + strlen(str) + 2 + 1);
+ if (!err)
+ return;
+ sprintf(err, "%s: ", str);
+ strcat(err, strerror(saveErrno));
+ LogWrite(-1, "%s", err);
+ free(err);
+ } else
+ LogWrite(-1, "%s", strerror(saveErrno));
+}
+
+void
+LogPrintMarkers(void)
+{
+ /* Show what the message marker symbols mean. */
+ LogWrite(0, "Markers: ");
+ LogMessageVerb(X_PROBED, 0, "probed, ");
+ LogMessageVerb(X_CONFIG, 0, "from config file, ");
+ LogMessageVerb(X_DEFAULT, 0, "default setting,\n\t");
+ LogMessageVerb(X_CMDLINE, 0, "from command line, ");
+ LogMessageVerb(X_NOTICE, 0, "notice, ");
+ LogMessageVerb(X_INFO, 0, "informational,\n\t");
+ LogMessageVerb(X_WARNING, 0, "warning, ");
+ LogMessageVerb(X_ERROR, 0, "error, ");
+ LogMessageVerb(X_NOT_IMPLEMENTED, 0, "not implemented, ");
+ LogMessageVerb(X_UNKNOWN, 0, "unknown.\n");
+}
+
diff --git a/xorg-server/os/strlcat.c b/xorg-server/os/strlcat.c index 91ceabb1c..e374e2908 100644 --- a/xorg-server/os/strlcat.c +++ b/xorg-server/os/strlcat.c @@ -1,59 +1,59 @@ -/* - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE - * FOR ANY SPECIAL, DIRECT, 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. - */ - - -#ifdef HAVE_XORG_CONFIG_H -#include <xorg-config.h> -#endif - -#include <sys/types.h> -#include <string.h> -#include "os.h" - -/* - * Appends src to string dst of size siz (unlike strncat, siz is the - * full size of dst, not space left). At most siz-1 characters - * will be copied. Always NUL terminates (unless siz <= strlen(dst)). - * Returns strlen(src) + MIN(siz, strlen(initial dst)). - * If retval >= siz, truncation occurred. - */ -size_t -strlcat(char *dst, const char *src, size_t siz) -{ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (n-- != 0 && *d != '\0') - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} +/*
+ * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
+ * FOR ANY SPECIAL, DIRECT, 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.
+ */
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <sys/types.h>
+#include <string.h>
+#include "os.h"
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t
+strlcat(char *dst, const char *src, size_t siz)
+{
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
+ size_t dlen;
+
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0 && *d != '\0')
+ d++;
+ dlen = d - dst;
+ n = siz - dlen;
+
+ if (n == 0)
+ return(dlen + strlen(s));
+ while (*s != '\0') {
+ if (n != 1) {
+ *d++ = *s;
+ n--;
+ }
+ s++;
+ }
+ *d = '\0';
+
+ return(dlen + (s - src)); /* count does not include NUL */
+}
diff --git a/xorg-server/os/strlcpy.c b/xorg-server/os/strlcpy.c index 647adb5e9..006cd7dc2 100644 --- a/xorg-server/os/strlcpy.c +++ b/xorg-server/os/strlcpy.c @@ -14,8 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
#endif
#include <sys/types.h>
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index 11d2ac8fa..9737ced88 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -514,12 +514,9 @@ void UseMsg(void) ErrorF("-ls int limit stack space to N Kb\n");
#endif
ErrorF("-nolock disable the locking mechanism\n");
-#ifndef NOLOGOHACK
- ErrorF("-logo enable logo in screen saver\n");
- ErrorF("nologo disable logo in screen saver\n");
-#endif
ErrorF("-nolisten string don't listen on protocol\n");
ErrorF("-noreset don't reset after last client exists\n");
+ ErrorF("-background [none] create root window with no background\n");
ErrorF("-reset reset after last client exists\n");
ErrorF("-p # screen-saver pattern duration (minutes)\n");
ErrorF("-pn accept failure to listen on all ports\n");
@@ -773,16 +770,6 @@ ProcessCommandLine(int argc, char *argv[]) #endif
nolock = TRUE;
}
-#ifndef NOLOGOHACK
- else if ( strcmp( argv[i], "-logo") == 0)
- {
- logoScreenSaver = 1;
- }
- else if ( strcmp( argv[i], "nologo") == 0)
- {
- logoScreenSaver = 0;
- }
-#endif
else if ( strcmp( argv[i], "-nolisten") == 0)
{
if(++i < argc) {
@@ -860,6 +847,14 @@ ProcessCommandLine(int argc, char *argv[]) defaultBackingStore = WhenMapped;
else if ( strcmp( argv[i], "-wr") == 0)
whiteRoot = TRUE;
+ else if ( strcmp( argv[i], "-background") == 0) {
+ if(++i < argc) {
+ if (!strcmp ( argv[i], "none"))
+ bgNoneRoot = TRUE;
+ else
+ UseMsg();
+ }
+ }
else if ( strcmp( argv[i], "-maxbigreqsize") == 0) {
if(++i < argc) {
long reqSizeArg = atol(argv[i]);
diff --git a/xorg-server/render/Makefile.am b/xorg-server/render/Makefile.am index 216c6134e..b060c07eb 100644 --- a/xorg-server/render/Makefile.am +++ b/xorg-server/render/Makefile.am @@ -1,21 +1,20 @@ -noinst_LTLIBRARIES = librender.la - -AM_CFLAGS = $(DIX_CFLAGS) - -librender_la_SOURCES = \ - animcur.c \ - filter.c \ - glyph.c \ - matrix.c \ - miindex.c \ - mipict.c \ - mirect.c \ - mitrap.c \ - mitri.c \ - picture.c \ - render.c \ - renderedge.c - -if XORG -sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h renderedge.h -endif +noinst_LTLIBRARIES = librender.la
+
+AM_CFLAGS = $(DIX_CFLAGS)
+
+librender_la_SOURCES = \
+ animcur.c \
+ filter.c \
+ glyph.c \
+ matrix.c \
+ miindex.c \
+ mipict.c \
+ mirect.c \
+ mitrap.c \
+ mitri.c \
+ picture.c \
+ render.c
+
+if XORG
+sdk_HEADERS = picture.h mipict.h glyphstr.h picturestr.h
+endif
diff --git a/xorg-server/render/makefile b/xorg-server/render/makefile index dfd905a7c..86d66a6d3 100644 --- a/xorg-server/render/makefile +++ b/xorg-server/render/makefile @@ -12,5 +12,4 @@ CSRCS = \ mitrap.c \
mitri.c \
picture.c \
- render.c \
- renderedge.c
+ render.c
diff --git a/xorg-server/render/miindex.c b/xorg-server/render/miindex.c index 75f941477..23c871ba1 100644 --- a/xorg-server/render/miindex.c +++ b/xorg-server/render/miindex.c @@ -322,16 +322,10 @@ void miCloseIndexed (ScreenPtr pScreen,
PictFormatPtr pFormat)
{
- if (pFormat->index.devPrivate)
- {
- free(pFormat->index.devPrivate);
- pFormat->index.devPrivate = 0;
- }
- if (pFormat->index.pValues)
- {
- free(pFormat->index.pValues);
- pFormat->index.pValues = 0;
- }
+ free(pFormat->index.devPrivate);
+ pFormat->index.devPrivate = NULL;
+ free(pFormat->index.pValues);
+ pFormat->index.pValues = NULL;
}
void
diff --git a/xorg-server/render/picture.c b/xorg-server/render/picture.c index 17b1a2714..b2418ef36 100644 --- a/xorg-server/render/picture.c +++ b/xorg-server/render/picture.c @@ -1391,11 +1391,8 @@ SetPictureTransform (PicturePtr pPicture, }
else
{
- if (pPicture->transform)
- {
- free(pPicture->transform);
- pPicture->transform = 0;
- }
+ free(pPicture->transform);
+ pPicture->transform = NULL;
}
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
diff --git a/xorg-server/render/renderedge.c b/xorg-server/render/renderedge.c deleted file mode 100644 index 8771fe164..000000000 --- a/xorg-server/render/renderedge.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include <dix-config.h> -#endif - -#include "renderedge.h" - -/* - * Compute the smallest value no less than y which is on a - * grid row - */ - -xFixed -RenderSampleCeilY (xFixed y, int n) -{ - return pixman_sample_ceil_y (y, n); -} - -#define _div(a,b) ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b))) - -/* - * Compute the largest value no greater than y which is on a - * grid row - */ -xFixed -RenderSampleFloorY (xFixed y, int n) -{ - return pixman_sample_floor_y (y, n); -} - -/* - * Step an edge by any amount (including negative values) - */ -void -RenderEdgeStep (RenderEdge *e, int n) -{ - pixman_edge_step (e, n); -} - -/* - * Initialize one edge structure given the line endpoints and a - * starting y value - */ -void -RenderEdgeInit (RenderEdge *e, - int n, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot) -{ - pixman_edge_init (e, n, y_start, x_top, y_top, x_bot, y_bot); -} - -/* - * Initialize one edge structure given a line, starting y value - * and a pixel offset for the line - */ -void -RenderLineFixedEdgeInit (RenderEdge *e, - int n, - xFixed y, - xLineFixed *line, - int x_off, - int y_off) -{ - pixman_line_fixed_edge_init (e, n, y, (pixman_line_fixed_t *)line, x_off, y_off); -} - diff --git a/xorg-server/render/renderedge.h b/xorg-server/render/renderedge.h deleted file mode 100644 index 6585aeb90..000000000 --- a/xorg-server/render/renderedge.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright © 2004 Keith Packard - * - * 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 Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD 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 _RENDEREDGE_H_ -#define _RENDEREDGE_H_ - -#include "picturestr.h" - -#define MAX_ALPHA(n) ((1 << (n)) - 1) -#define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1) -#define N_X_FRAC(n) ((1 << ((n)/2)) + 1) - -#define STEP_Y_SMALL(n) (xFixed1 / N_Y_FRAC(n)) -#define STEP_Y_BIG(n) (xFixed1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) - -#define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2) -#define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n)) - -#define STEP_X_SMALL(n) (xFixed1 / N_X_FRAC(n)) -#define STEP_X_BIG(n) (xFixed1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n)) - -#define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2) -#define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n)) - -#define RenderSamplesX(x,n) ((n) == 1 ? 0 : (xFixedFrac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n)) - -/* - * An edge structure. This represents a single polygon edge - * and can be quickly stepped across small or large gaps in the - * sample grid - */ -typedef pixman_edge_t RenderEdge; - -/* - * Step across a small sample grid gap - */ -#define RenderEdgeStepSmall(edge) { \ - edge->x += edge->stepx_small; \ - edge->e += edge->dx_small; \ - if (edge->e > 0) \ - { \ - edge->e -= edge->dy; \ - edge->x += edge->signdx; \ - } \ -} - -/* - * Step across a large sample grid gap - */ -#define RenderEdgeStepBig(edge) { \ - edge->x += edge->stepx_big; \ - edge->e += edge->dx_big; \ - if (edge->e > 0) \ - { \ - edge->e -= edge->dy; \ - edge->x += edge->signdx; \ - } \ -} - -extern _X_EXPORT xFixed -RenderSampleCeilY (xFixed y, int bpp); - -extern _X_EXPORT xFixed -RenderSampleFloorY (xFixed y, int bpp); - -extern _X_EXPORT void -RenderEdgeStep (RenderEdge *e, int n); - -extern _X_EXPORT void -RenderEdgeInit (RenderEdge *e, - int bpp, - xFixed y_start, - xFixed x_top, - xFixed y_top, - xFixed x_bot, - xFixed y_bot); - -extern _X_EXPORT void -RenderLineFixedEdgeInit (RenderEdge *e, - int bpp, - xFixed y, - xLineFixed *line, - int x_off, - int y_off); - -#endif /* _RENDEREDGE_H_ */ diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c index 240c2905b..abcc8926b 100644 --- a/xorg-server/test/input.c +++ b/xorg-server/test/input.c @@ -38,6 +38,7 @@ #include "exevents.h"
#include "dixgrabs.h"
#include "eventstr.h"
+#include "inpututils.h"
#include <glib.h>
/**
@@ -65,7 +66,6 @@ static void dix_init_valuators(void) g_assert(val);
g_assert(val->numAxes == num_axes);
g_assert(val->numMotionEvents == 0);
- g_assert(val->mode == Absolute);
g_assert(val->axisVal);
for (i = 0; i < num_axes; i++)
@@ -73,6 +73,7 @@ static void dix_init_valuators(void) g_assert(val->axisVal[i] == 0);
g_assert(val->axes->min_value == NO_AXIS_LIMITS);
g_assert(val->axes->max_value == NO_AXIS_LIMITS);
+ g_assert(val->axes->mode == Absolute);
}
g_assert(dev.last.numValuators == num_axes);
@@ -903,18 +904,127 @@ static void dix_input_attributes(void) FreeInputAttributes(new);
}
+static void dix_input_valuator_masks(void)
+{
+ ValuatorMask *mask = NULL, *copy;
+ int nvaluators = MAX_VALUATORS;
+ int valuators[nvaluators];
+ int i;
+ int first_val, num_vals;
+
+ for (i = 0; i < nvaluators; i++)
+ valuators[i] = i;
+
+ mask = valuator_mask_new(nvaluators);
+ g_assert(mask != NULL);
+ g_assert(valuator_mask_size(mask) == 0);
+ g_assert(valuator_mask_num_valuators(mask) == 0);
+
+ for (i = 0; i < nvaluators; i++)
+ {
+ g_assert(!valuator_mask_isset(mask, i));
+ valuator_mask_set(mask, i, valuators[i]);
+ g_assert(valuator_mask_isset(mask, i));
+ g_assert(valuator_mask_get(mask, i) == valuators[i]);
+ g_assert(valuator_mask_size(mask) == i + 1);
+ g_assert(valuator_mask_num_valuators(mask) == i + 1);
+ }
+
+ for (i = 0; i < nvaluators; i++)
+ {
+ g_assert(valuator_mask_isset(mask, i));
+ valuator_mask_unset(mask, i);
+ /* we're removing valuators from the front, so size should stay the
+ * same until the last bit is removed */
+ if (i < nvaluators - 1)
+ g_assert(valuator_mask_size(mask) == nvaluators);
+ g_assert(!valuator_mask_isset(mask, i));
+ }
+
+ g_assert(valuator_mask_size(mask) == 0);
+ valuator_mask_zero(mask);
+ g_assert(valuator_mask_size(mask) == 0);
+ g_assert(valuator_mask_num_valuators(mask) == 0);
+ for (i = 0; i < nvaluators; i++)
+ g_assert(!valuator_mask_isset(mask, i));
+
+ first_val = 5;
+ num_vals = 6;
+
+ valuator_mask_set_range(mask, first_val, num_vals, valuators);
+ g_assert(valuator_mask_size(mask) == first_val + num_vals);
+ g_assert(valuator_mask_num_valuators(mask) == num_vals);
+ for (i = 0; i < nvaluators; i++)
+ {
+ if (i < first_val || i >= first_val + num_vals)
+ g_assert(!valuator_mask_isset(mask, i));
+ else
+ {
+ g_assert(valuator_mask_isset(mask, i));
+ g_assert(valuator_mask_get(mask, i) == valuators[i - first_val]);
+ }
+ }
+
+ copy = valuator_mask_new(nvaluators);
+ valuator_mask_copy(copy, mask);
+ g_assert(mask != copy);
+ g_assert(valuator_mask_size(mask) == valuator_mask_size(copy));
+ g_assert(valuator_mask_num_valuators(mask) == valuator_mask_num_valuators(copy));
+
+ for (i = 0; i < nvaluators; i++)
+ {
+ g_assert(valuator_mask_isset(mask, i) == valuator_mask_isset(copy, i));
+ g_assert(valuator_mask_get(mask, i) == valuator_mask_get(copy, i));
+ }
+
+ free(mask);
+}
+
+static void dix_valuator_mode(void)
+{
+ DeviceIntRec dev;
+ const int num_axes = MAX_VALUATORS;
+ int i;
+ Atom atoms[MAX_VALUATORS] = { 0 };
+
+ memset(&dev, 0, sizeof(DeviceIntRec));
+ dev.type = MASTER_POINTER; /* claim it's a master to stop ptracccel */
+
+ g_assert(InitValuatorClassDeviceStruct(NULL, 0, atoms, 0, 0) == FALSE);
+ g_assert(InitValuatorClassDeviceStruct(&dev, num_axes, atoms, 0, Absolute));
+
+ for (i = 0; i < num_axes; i++)
+ {
+ g_assert(valuator_get_mode(&dev, i) == Absolute);
+ valuator_set_mode(&dev, i, Relative);
+ g_assert(dev.valuator->axes[i].mode == Relative);
+ g_assert(valuator_get_mode(&dev, i) == Relative);
+ }
+
+ valuator_set_mode(&dev, VALUATOR_MODE_ALL_AXES, Absolute);
+ for (i = 0; i < num_axes; i++)
+ g_assert(valuator_get_mode(&dev, i) == Absolute);
+
+ valuator_set_mode(&dev, VALUATOR_MODE_ALL_AXES, Relative);
+ for (i = 0; i < num_axes; i++)
+ g_assert(valuator_get_mode(&dev, i) == Relative);
+}
+
+
int main(int argc, char** argv)
{
g_test_init(&argc, &argv,NULL);
g_test_bug_base("https://bugzilla.freedesktop.org/show_bug.cgi?id=");
+ g_test_add_func("/dix/input/valuator-masks", dix_input_valuator_masks);
g_test_add_func("/dix/input/attributes", dix_input_attributes);
g_test_add_func("/dix/input/init-valuators", dix_init_valuators);
g_test_add_func("/dix/input/event-core-conversion", dix_event_to_core_conversion);
g_test_add_func("/dix/input/check-grab-values", dix_check_grab_values);
g_test_add_func("/dix/input/xi2-struct-sizes", xi2_struct_sizes);
g_test_add_func("/dix/input/grab_matching", dix_grab_matching);
+ g_test_add_func("/dix/input/valuator_mode", dix_valuator_mode);
g_test_add_func("/include/byte_padding_macros", include_byte_padding_macros);
g_test_add_func("/Xi/xiproperty/register-unregister", xi_unregister_handlers);
diff --git a/xorg-server/test/xi2/protocol-common.c b/xorg-server/test/xi2/protocol-common.c index d396a233d..86a7201b8 100644 --- a/xorg-server/test/xi2/protocol-common.c +++ b/xorg-server/test/xi2/protocol-common.c @@ -28,6 +28,7 @@ #include <stdint.h>
#include "extinit.h" /* for XInputExtensionInit */
#include "exglobals.h"
+#include "xkbsrv.h" /* for XkbInitPrivates */
#include <glib.h>
#include "protocol-common.h"
diff --git a/xorg-server/xkb/XKBAlloc.c b/xorg-server/xkb/XKBAlloc.c index 9dab41c5e..8c439ba0b 100644 --- a/xorg-server/xkb/XKBAlloc.c +++ b/xorg-server/xkb/XKBAlloc.c @@ -212,10 +212,8 @@ XkbNamesPtr names; register XkbKeyTypePtr type;
type= map->types;
for (i=0;i<map->num_types;i++,type++) {
- if (type->level_names!=NULL) {
- free(type->level_names);
- type->level_names= NULL;
- }
+ free(type->level_names);
+ type->level_names = NULL;
}
}
}
diff --git a/xorg-server/xkb/XKBGAlloc.c b/xorg-server/xkb/XKBGAlloc.c index a6d10c4b0..d5e49349e 100644 --- a/xorg-server/xkb/XKBGAlloc.c +++ b/xorg-server/xkb/XKBGAlloc.c @@ -50,10 +50,8 @@ _XkbFreeGeomLeafElems( Bool freeAll, {
if ((freeAll)||(*elems==NULL)) {
*num_inout= *sz_inout= 0;
- if (*elems!=NULL) {
- free(*elems);
- *elems= NULL;
- }
+ free(*elems);
+ *elems = NULL;
return;
}
@@ -373,22 +371,16 @@ XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in; switch (doodad->any.type) {
case XkbTextDoodad:
{
- if (doodad->text.text!=NULL) {
- free(doodad->text.text);
- doodad->text.text= NULL;
- }
- if (doodad->text.font!=NULL) {
- free(doodad->text.font);
- doodad->text.font= NULL;
- }
+ free(doodad->text.text);
+ doodad->text.text = NULL;
+ free(doodad->text.font);
+ doodad->text.font = NULL;
}
break;
case XkbLogoDoodad:
{
- if (doodad->logo.logo_name!=NULL) {
- free(doodad->logo.logo_name);
- doodad->logo.logo_name= NULL;
- }
+ free(doodad->logo.logo_name);
+ doodad->logo.logo_name = NULL;
}
break;
}
@@ -434,10 +426,8 @@ XkbFreeGeometry(XkbGeometryPtr geom,unsigned which,Bool freeMap) if ((which&XkbGeomKeyAliasesMask)&&(geom->key_aliases!=NULL))
XkbFreeGeomKeyAliases(geom,0,geom->num_key_aliases,TRUE);
if (freeMap) {
- if (geom->label_font!=NULL) {
- free(geom->label_font);
- geom->label_font= NULL;
- }
+ free(geom->label_font);
+ geom->label_font = NULL;
free(geom);
}
return;
diff --git a/xorg-server/xkb/XKBMAlloc.c b/xorg-server/xkb/XKBMAlloc.c index 28995de81..ad13b940c 100644 --- a/xorg-server/xkb/XKBMAlloc.c +++ b/xorg-server/xkb/XKBMAlloc.c @@ -292,11 +292,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; }
type= &xkb->map->types[type_ndx];
if (map_count==0) {
- if (type->map!=NULL)
- free(type->map);
+ free(type->map);
type->map= NULL;
- if (type->preserve!=NULL)
- free(type->preserve);
+ free(type->preserve);
type->preserve= NULL;
type->map_count= 0;
}
@@ -321,9 +319,9 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys; return BadAlloc;
}
}
- else if (type->preserve!=NULL) {
+ else {
free(type->preserve);
- type->preserve= NULL;
+ type->preserve = NULL;
}
type->map_count= map_count;
}
@@ -807,19 +805,13 @@ XkbClientMapPtr map; register int i;
XkbKeyTypePtr type;
for (i=0,type=map->types;i<map->num_types;i++,type++) {
- if (type->map!=NULL) {
- free(type->map);
- type->map= NULL;
- }
- if (type->preserve!=NULL) {
- free(type->preserve);
- type->preserve= NULL;
- }
+ free(type->map);
+ type->map = NULL;
+ free(type->preserve);
+ type->preserve = NULL;
type->map_count= 0;
- if (type->level_names!=NULL) {
- free(type->level_names);
- type->level_names= NULL;
- }
+ free(type->level_names);
+ type->level_names = NULL;
}
}
free(map->types);
@@ -828,10 +820,8 @@ XkbClientMapPtr map; }
}
if (what&XkbKeySymsMask) {
- if (map->key_sym_map!=NULL) {
- free(map->key_sym_map);
- map->key_sym_map= NULL;
- }
+ free(map->key_sym_map);
+ map->key_sym_map = NULL;
if (map->syms!=NULL) {
free(map->syms);
map->size_syms= map->num_syms= 0;
@@ -864,10 +854,8 @@ XkbServerMapPtr map; map->explicit= NULL;
}
if (what&XkbKeyActionsMask) {
- if (map->key_acts!=NULL) {
- free(map->key_acts);
- map->key_acts= NULL;
- }
+ free(map->key_acts);
+ map->key_acts = NULL;
if (map->acts!=NULL) {
free(map->acts);
map->num_acts= map->size_acts= 0;
diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c index 127180a34..3a1cf0f8f 100644 --- a/xorg-server/xkb/ddxLoad.c +++ b/xorg-server/xkb/ddxLoad.c @@ -267,8 +267,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, strncpy(nameRtrn,keymap,nameRtrnLen);
nameRtrn[nameRtrnLen-1]= '\0';
}
- if (buf != NULL)
- free(buf);
+ free(buf);
#ifdef WIN32
/* remove the temporary file */
unlink(tmpname);
@@ -291,8 +290,7 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb, }
if (nameRtrn)
nameRtrn[0]= '\0';
- if (buf != NULL)
- free(buf);
+ free(buf);
return FALSE;
}
diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c index 7a5f2b241..83e5eaf41 100644 --- a/xorg-server/xkb/xkbActions.c +++ b/xorg-server/xkb/xkbActions.c @@ -42,6 +42,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <ctype.h>
#include "mi.h"
#include "mipointer.h"
+#include "inpututils.h"
#define EXTENSION_EVENT_BASE 64
DevPrivateKeyRec xkbDevicePrivateKeyRec;
@@ -1354,7 +1355,7 @@ xkbStateNotify sn; * First one on drinking island wins!
*/
static void
-InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int num_valuators, int *valuators)
+InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, ValuatorMask *mask)
{
ScreenPtr pScreen;
EventListPtr events;
@@ -1376,8 +1377,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int nu OsBlockSignals();
pScreen = miPointerGetScreen(ptr);
saveWait = miPointerSetWaitForUpdate(pScreen, FALSE);
- nevents = GetPointerEvents(events, ptr, type, button, flags, 0,
- num_valuators, valuators);
+ nevents = GetPointerEvents(events, ptr, type, button, flags, mask);
if (IsMaster(dev) && (lastSlave && lastSlave != ptr))
UpdateFromMaster(&events[nevents], lastSlave, DEVCHANGE_POINTER_EVENT, &nevents);
miPointerSetWaitForUpdate(pScreen, saveWait);
@@ -1393,6 +1393,7 @@ InjectPointerKeyEvents(DeviceIntPtr dev, int type, int button, int flags, int nu static void
XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y)
{
+ ValuatorMask mask;
int gpe_flags = 0;
int Point[]={x, y};
@@ -1405,7 +1406,9 @@ XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags,int x,int y) else
gpe_flags = POINTER_RELATIVE;
- InjectPointerKeyEvents(dev, MotionNotify, 0, gpe_flags, 2, Point);
+ valuator_mask_set_range(&mask, 0, 2, Point);
+
+ InjectPointerKeyEvents(dev, MotionNotify, 0, gpe_flags, &mask);
}
void
@@ -1435,5 +1438,5 @@ XkbFakeDeviceButton(DeviceIntPtr dev,Bool press,int button) return;
InjectPointerKeyEvents(dev, press ? ButtonPress : ButtonRelease,
- button, 0, 0, NULL);
+ button, 0, NULL);
}
diff --git a/xorg-server/xkeyboard-config/geometry/Makefile.am b/xorg-server/xkeyboard-config/geometry/Makefile.am index 84619fb96..7c9e395fa 100644 --- a/xorg-server/xkeyboard-config/geometry/Makefile.am +++ b/xorg-server/xkeyboard-config/geometry/Makefile.am @@ -1,15 +1,15 @@ -SUBDIRS = digital_vndr sgi_vndr - -geomdir = $(xkb_base)/geometry - -dist_geom_DATA = \ -amiga ataritt chicony \ -dell everex fujitsu \ -hhk hp keytronic kinesis \ -macintosh microsoft nec nokia \ -northgate pc sony thinkpad \ -sun typematrix winbook README - -dir_data = $(dist_geom_DATA) - -include $(top_srcdir)/xkbrules.am +SUBDIRS = digital_vndr sgi_vndr
+
+geomdir = $(xkb_base)/geometry
+
+dist_geom_DATA = \
+amiga ataritt chicony \
+dell everex fujitsu \
+hhk hp keytronic kinesis \
+macintosh microsoft nec nokia \
+northgate pc sanwa sony thinkpad \
+sun typematrix winbook README
+
+dir_data = $(dist_geom_DATA)
+
+include $(top_srcdir)/xkbrules.am
diff --git a/xorg-server/xkeyboard-config/geometry/makefile b/xorg-server/xkeyboard-config/geometry/makefile index 4b4aedac5..896e186f4 100644 --- a/xorg-server/xkeyboard-config/geometry/makefile +++ b/xorg-server/xkeyboard-config/geometry/makefile @@ -11,7 +11,7 @@ amiga ataritt chicony \ dell everex fujitsu \ hhk hp keytronic kinesis \ macintosh microsoft nec nokia \ -northgate pc sony thinkpad \ +northgate pc sanwa sony thinkpad \ sun typematrix winbook README DATA_FILES=$(dist_xkbdata_geometry_DATA:%=$(DESTDIR)\%) diff --git a/xorg-server/xkeyboard-config/geometry/sanwa b/xorg-server/xkeyboard-config/geometry/sanwa new file mode 100644 index 000000000..5434bdf43 --- /dev/null +++ b/xorg-server/xkeyboard-config/geometry/sanwa @@ -0,0 +1,151 @@ +// $Xorg: $
+//
+//Copyright 1996, 1998 The Open Group
+//
+//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.
+//
+//The above copyright notice and this permission notice 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 OPEN GROUP 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.
+//
+//Except as contained in this notice, the name of The Open Group shall
+//not be used in advertising or otherwise to promote the sale, use or
+//other dealings in this Software without prior written authorization
+//from The Open Group.
+//
+default xkb_geometry "sanwaskbkg3" {
+
+ description= "Sanwa Supply SKB-KG3";
+ // SKB-KG3BK (black)
+ // http://www.sanwa.co.jp/product/syohin.asp?code=SKB-KG3BK
+ // http://www.sanwa.co.jp/zooma/keybord/SKB-KG3BK/
+ // SKB-KG3W (white)
+ // http://www.sanwa.co.jp/product/syohin.asp?code=SKB-KG3W
+ // http://www.sanwa.co.jp/zooma/keybord/SKB-KG3SW/
+ // SKB-KG3SV (silver)
+ // http://www.sanwa.co.jp/product/syohin.asp?code=SKB-KG3SV
+ // http://www.sanwa.co.jp/zooma/keybord/SKB-KG3SV/
+
+ width= 304;
+ height= 127;
+
+ shape.cornerRadius= 1;
+ shape "TOP" { { [15.25,13] }, { [2,2], [13.25,11] } };
+ shape "NORM" { { [17,16] }, { [2,2], [15,14] } };
+ shape "TBBK" { { [24.5,16] }, { [2,2], [22.5,14] } };
+ shape "RTRN" { { [0,0], [36,0], [36,34], [8.5,34], [8.5,16], [0,16] },
+ { [2,2], [34,2], [34,32], [10.5,32], [10.5,14], [2,14] } };
+ shape "CAPS" { { [33,16] }, { [28,16] }, { [2,2], [26,14] } };
+ shape "LFSH" { { [41,16] }, { [2,2], [39,14] } };
+ shape "CTSH" { { [19.5,16] }, { [2,2], [17.5,14] } };
+ shape "SPCE" { { [57.5,16] }, { [2,2], [55.5,14] } };
+
+ shape "LED" { cornerRadius= 0, { [5,1] } };
+
+ indicator.onColor= "green";
+ indicator.offColor= "green30";
+ indicator.top= 3;
+ indicator.shape= "LED";
+ indicator "Num Lock" { left= 247; };
+ indicator "Caps Lock" { left= 266; };
+ indicator "Scroll Lock" { left= 285; };
+ text.color= "black";
+ text.top= 1;
+ text "Vendor1" { left= 10; text="SANWA"; };
+ text.top= 4.5;
+ text "Vendor2" { left= 10; text="SUPPLY"; };
+ text "NumLockLabel" { left= 241; text="Num Lock"; };
+ text "CapsLockLabel" { left= 260; text="Caps Lock"; };
+ text "ScrollLockLabel" { left= 279; text="Scroll Lock"; };
+
+ section.left= 3;
+ row.left= 1;
+ key.shape= "NORM";
+ key.gap= 2;
+ section "Function" {
+ key.shape= "TOP";
+ top= 10;
+ row {
+ top= 1;
+ keys { <ESC>, <FK01>, <FK02>, <FK03>, <FK04>, <FK05>, <FK06>,
+ <FK07>, <FK08>, <FK09>, <FK10>, <FK11>, <FK12>, <PRSC>,
+ {<NMLK>, color="grey20"}, <PAUS>, {<DELE>, color="grey20"}
+ };
+ };
+ overlay "SCLK" {
+ <NMLK>=<SCLK>
+ };
+ overlay "FN" {
+ <DELE>=<INS>
+ };
+ }; // End of "Function" section
+
+ section "Alpha" {
+ top= 24;
+ row {
+ top= 2;
+ keys { <HZTG>, <AE01>, <AE02>, <AE03>, <AE04>, <AE05>, <AE06>,
+ {<AE07>, color="grey20"}, {<AE08>, color="grey20"},
+ {<AE09>, color="grey20"}, {<AE10>, color="grey20"},
+ <AE11>, <AE12>, <AE13>, { <BKSP>, "TBBK" }
+ };
+ };
+ row {
+ top= 20;
+ keys { { <TAB>, "TBBK" }, <AD01>, <AD02>, <AD03>, <AD04>, <AD05>,
+ <AD06>, {<AD07>, color="grey20"}, {<AD08>, color="grey20"},
+ {<AD09>, color="grey20"}, {<AD10>, color="grey20"}, <AD11>,
+ <AD12>, { <RTRN>, "RTRN" }
+ };
+ };
+ row {
+ top= 38;
+ keys { { <CAPS>, "CAPS" }, <AC01>, <AC02>, <AC03>, <AC04>, <AC05>,
+ <AC06>, {<AC07>, color="grey20"}, {<AC08>, color="grey20"},
+ {<AC09>, color="grey20"}, {<AC10>, color="grey20"}, <AC11>,
+ <AC12>
+ };
+ };
+ row {
+ top= 56;
+ keys { { <LFSH>, "LFSH" }, <AB01>, <AB02>, <AB03>, <AB04>, <AB05>,
+ <AB06>, {<AB07>, color="grey20"}, <AB08>,
+ {<AB09>, color="grey20"}, {<AB10>, color="grey20"}, <AB11>,
+ {<UP>, color="grey20"}, {<RTSH>, key.shape= "CTSH" }
+ };
+ };
+ row {
+ top= 74;
+ keys { { <LCTL>, key.shape= "CTSH" }, {<FN>, color="grey20"},
+ <LWIN>, <LALT>, <NFER>, {<SPCE>, "SPCE" }, <XFER>, <HKTG>,
+ <RALT>, <MENU>, {<LEFT>, color="grey20"},
+ {<DOWN>, color="grey20"},
+ {<RGHT>, key.shape= "CTSH", color="grey20"}
+ };
+ };
+ overlay "SCLK" {
+ <AE07>=<KO7>, <AE08>=<KO8>, <AE09>=<KO9>, <AE10>=<KOMU>,
+ <AD07>=<KO4>, <AD08>=<KO5>, <AD09>=<KO6>, <AD10>=<KOSU>,
+ <AC07>=<KO1>, <AC08>=<KO2>, <AC09>=<KO3>, <AC10>=<KOAD>,
+ <AB07>=<KO0>, <AB09>=<KODL>, <AB10>=<KODV>
+ };
+ overlay "FN" {
+ <UP>=<PGUP>, <LEFT>=<HOME>, <DOWN>=<PGDN>, <RGHT>=<END>
+ };
+ }; // End of "Alpha" section
+
+ alias <AC00> = <CAPS>;
+ alias <AA00> = <LCTL>;
+
+}; // End of "default" geometry
diff --git a/xorg-server/xkeyboard-config/rules/base.lists.part b/xorg-server/xkeyboard-config/rules/base.lists.part index a18585680..a0fecdff1 100644 --- a/xorg-server/xkeyboard-config/rules/base.lists.part +++ b/xorg-server/xkeyboard-config/rules/base.lists.part @@ -50,7 +50,7 @@ genius geniuscomfy2 \
gyration honeywell_euroboard \
hp250x hp5xx hp500fa hpdv5 \
- hpi6 hpxe3gc hpxe3gf hpxe4xxx hpxt1000 hpzt11xx \
+ hpi6 hpxe3gc hpxe3gf hpxe4xxx hpxt1000 hpzt11xx htcdream \
ibm_spacesaver ipaq inspiron intel \
logiaccess logicda logicink \
logiex110 logiclx300 \
@@ -104,3 +104,4 @@ lt lv nl no pl pt ro ru \
se sk tr tw ua
+! $htcdreamlayouts = us it de
diff --git a/xorg-server/xkeyboard-config/rules/base.m_g.part b/xorg-server/xkeyboard-config/rules/base.m_g.part index eab19eb9d..978aac0c7 100644 --- a/xorg-server/xkeyboard-config/rules/base.m_g.part +++ b/xorg-server/xkeyboard-config/rules/base.m_g.part @@ -8,6 +8,7 @@ hpmini110 = hp(mini110)
hpdv5 = hp(dv5)
omnikey101 = northgate(omnikey101)
+ sanwaskbkg3 = sanwa(sanwaskbkg3)
$pcmodels = pc(%m)
$pcgeometries = pc(%m)
everex = everex(STEPnote)
diff --git a/xorg-server/xkeyboard-config/rules/base.ml_s.part b/xorg-server/xkeyboard-config/rules/base.ml_s.part index d59c54f26..22bf49a92 100644 --- a/xorg-server/xkeyboard-config/rules/base.ml_s.part +++ b/xorg-server/xkeyboard-config/rules/base.ml_s.part @@ -36,5 +36,7 @@ olpc $olpclayouts = olpc+%l%(m)
olpc * = olpc+%l%(v)
$thinkpads br = pc+br(thinkpad)
+ htcdream $htcdreamlayouts = %l(htcdream)
* $nonlatin = pc+us+%l%(v):2
* * = pc+%l%(v)
+ htcdream us de it = %l(htcdream)
diff --git a/xorg-server/xkeyboard-config/rules/base.o_s.part b/xorg-server/xkeyboard-config/rules/base.o_s.part index 95e81ddb3..2b400e634 100644 --- a/xorg-server/xkeyboard-config/rules/base.o_s.part +++ b/xorg-server/xkeyboard-config/rules/base.o_s.part @@ -111,6 +111,7 @@ esperanto:qwerty = +epo(qwerty)
esperanto:dvorak = +epo(dvorak)
terminate:ctrl_alt_bksp = +terminate(ctrl_alt_bksp)
+ keypad:pointerkeys = +keypad(pointerkeys)
apple:alupckeys = +macintosh_vndr/apple(alupckeys)
shift:both_capslock = +shift(both_capslock)
shift:lshift_both_capslock = +shift(lshift_both_capslock)
diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in index 8c9b23d82..27cf6e6ff 100644 --- a/xorg-server/xkeyboard-config/rules/base.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.xml.in @@ -449,6 +449,13 @@ </model>
<model>
<configItem>
+ <name>htcdream</name>
+ <_description>HTC Dream</_description>
+ <vendor>HTC</vendor>
+ </configItem>
+ </model>
+ <model>
+ <configItem>
<name>kinesis</name>
<_description>Kinesis</_description>
<vendor>Kinesis</vendor>
@@ -897,6 +904,13 @@ </model>
<model>
<configItem>
+ <name>sanwaskbkg3</name>
+ <description>Sanwa Supply SKB-KG3</description>
+ <vendor>Sanwa Supply Inc.</vendor>
+ </configItem>
+ </model>
+ <model>
+ <configItem>
<name>sk1300</name>
<_description>SK-1300</_description>
<vendor>NEC</vendor>
@@ -1210,6 +1224,13 @@ <vendor>Creative</vendor>
</configItem>
</model>
+ <model>
+ <configItem>
+ <name>htcdream</name>
+ <_description>Htc Dream phone</_description>
+ <vendor>htc</vendor>
+ </configItem>
+ </model>
</modelList>
<layoutList>
<layout>
@@ -2954,6 +2975,12 @@ </variant>
<variant>
<configItem>
+ <name>kana86</name>
+ <_description>Kana 86</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
<name>OADG109A</name>
<_description>OADG 109A</_description>
</configItem>
@@ -4518,6 +4545,130 @@ <languageList><iso639Id>tsn</iso639Id></languageList>
</configItem>
</layout>
+ <layout>
+ <configItem>
+ <name>ph</name>
+ <_shortDescription>Phi</_shortDescription>
+ <_description>Philippines</_description>
+ <languageList><iso639Id>eng</iso639Id>
+ <iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ <variantList>
+ <variant>
+ <configItem>
+ <name>qwerty-bay</name>
+ <_description>QWERTY (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>capewell-dvorak</name>
+ <_description>Capewell-Dvorak (Latin)</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>capewell-dvorak-bay</name>
+ <_description>Capewell-Dvorak (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>capewell-qwerf2k6</name>
+ <_description>Capewell-QWERF 2006 (Latin)</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>capewell-qwerf2k6-bay</name>
+ <_description>Capewell-QWERF 2006 (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>colemak</name>
+ <_description>Colemak (Latin)</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>colemak-bay</name>
+ <_description>Colemak (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>dvorak</name>
+ <_description>Dvorak (Latin)</_description>
+ </configItem>
+ </variant>
+ <variant>
+ <configItem>
+ <name>dvorak-bay</name>
+ <_description>Dvorak (Baybayin)</_description>
+ <languageList><iso639Id>bik</iso639Id>
+ <iso639Id>ceb</iso639Id>
+ <iso639Id>fil</iso639Id>
+ <iso639Id>hil</iso639Id>
+ <iso639Id>ilo</iso639Id>
+ <iso639Id>pam</iso639Id>
+ <iso639Id>pag</iso639Id>
+ <iso639Id>phi</iso639Id>
+ <iso639Id>tgl</iso639Id>
+ <iso639Id>war</iso639Id></languageList>
+ </configItem>
+ </variant>
+ </variantList>
+ </layout>
</layoutList>
<optionList>
<group allowMultipleSelection="true">
@@ -5304,6 +5455,12 @@ <description>Both Shift-Keys together toggle ShiftLock</description>
</configItem>
</option>
+ <option>
+ <configItem>
+ <name>keypad:pointerkeys</name>
+ <_description>Toggle PointerKeys with Shift + NumLock.</_description>
+ </configItem>
+ </option>
</group>
<group allowMultipleSelection="true">
<!-- Special shortcuts for the Euro character -->
diff --git a/xorg-server/xkeyboard-config/symbols/Makefile.am b/xorg-server/xkeyboard-config/symbols/Makefile.am index 138578941..79e9ad162 100644 --- a/xorg-server/xkeyboard-config/symbols/Makefile.am +++ b/xorg-server/xkeyboard-config/symbols/Makefile.am @@ -24,7 +24,7 @@ ma mao me \ mk ml mm \
mn mt mv \
ng nl no np \
-pc pk pl pt \
+pc ph pk pl pt \
ro rs ru \
se si sk sn \
sy th \
diff --git a/xorg-server/xkeyboard-config/symbols/de b/xorg-server/xkeyboard-config/symbols/de index b8d482129..241b9c826 100644 --- a/xorg-server/xkeyboard-config/symbols/de +++ b/xorg-server/xkeyboard-config/symbols/de @@ -553,3 +553,48 @@ key.type[group1]="FOUR_LEVEL_ALPHABETIC"; include "level3(ralt_switch)"
};
+
+partial alphanumeric_keys
+xkb_symbols "htcdream" {
+ include "inet(htcdream)"
+
+ name[Group1]= "Germany - htcdream";
+
+ //second row
+ key <AD01> { [ q, Q, Tab, Tab ] };
+ key <AD02> { [ w, W, grave, grave ] };
+ key <AD03> { [ e, E, EuroSign, EuroSign ] };
+ key <AD04> { [ r, R, underscore, underscore ] };
+ key <AD05> { [ t, T, sterling, sterling] };
+ key <AD06> { [ z, Z, division, division ] };
+ key <AD07> { [ u, U, udiaeresis, udiaeresis ] };
+ key <AD08> { [ i, I, minus, minus ] };
+ key <AD09> { [ o, O, odiaeresis, odiaeresis ] };
+ key <AD10> { [ p, P, equal, equal ] };
+
+ //third row
+ key <AC01> { [ a, A, adiaeresis, adiaeresis ] };
+ key <AC02> { [ s, S, ssharp, ssharp] };
+ key <AC03> { [ d ,D, backslash, backslash ] };
+ key <AC04> { [ f, F, braceleft, braceleft ] };
+ key <AC05> { [ g, G, braceright, braceright ] };
+ key <AC06> { [ h, H, multiply, multiply ] };
+ key <AC07> { [ j, J, colon, colon ] };
+ key <AC08> { [ k, K, plus, plus ] };
+ key <AC09> { [ l, L, apostrophe, apostrophe ] };
+
+ //forth row
+ key <AB01> { [ y, Y, bar, bar ] };
+ key <AB02> { [ x, X, bracketleft, bracketleft ] };
+ key <AB03> { [ c, C, bracketright, bracketright ] };
+ key <AB04> { [ v, V, less, less ] };
+ key <AB05> { [ b, B, greater, greater ] };
+ key <AB06> { [ n, N, semicolon, semicolon ] };
+ key <AB07> { [ m, M, quotedbl, quotedbl ] };
+ key <AB08> { [ comma, comma, question, question ] };
+
+ //fifth row
+ key <FK15> { [ at, at, asciitilde, asciitilde ] };
+
+ include "level3(alt_switch)"
+};
diff --git a/xorg-server/xkeyboard-config/symbols/extras/ru b/xorg-server/xkeyboard-config/symbols/extras/ru index 7e2404250..65ea58653 100644 --- a/xorg-server/xkeyboard-config/symbols/extras/ru +++ b/xorg-server/xkeyboard-config/symbols/extras/ru @@ -13,7 +13,7 @@ xkb_symbols "chu" key <AE02> { [ U0454, U0404, U0465, U0464] }; // є Є ѥ Ѥ
key <AE03> { [ U046F, U046E, U0469, U0468] }; // ѯ Ѯ ѩ Ѩ
key <AE04> { [ U0471, U0470, U046D, U046C] }; // ѱ Ѱ ѭ Ѭ
- key <AE05> { [ U0473, U0472, Cyrillic_ya, Cyrillic_YA] }; // ѳ Ѳ я Я (WHERE Я IS I+A, NOT SMALL YUS)
+ key <AE05> { [ U0473, U0472, UA657, UA656] }; // ѳ Ѳ iotified A
key <AE06> { [ U0475, U0474, U0477, U0476] }; // ѵ Ѵ ѷ Ѷ
key <AE07> { [ U047B, U047A, UA64D, UA64C] }; // ѻ Ѻ ꙍ Ꙍ
key <AE08> { [ U047F, U047E, U046B, U046A] }; // ѿ Ѿ ѫ Ѫ
diff --git a/xorg-server/xkeyboard-config/symbols/inet b/xorg-server/xkeyboard-config/symbols/inet index b3b155bca..478a15371 100644 --- a/xorg-server/xkeyboard-config/symbols/inet +++ b/xorg-server/xkeyboard-config/symbols/inet @@ -120,7 +120,9 @@ xkb_symbols "evdev" { key <HNGL> { [ Hangul ] };
key <HJCV> { [ Hangul_Hanja ] };
- key <FK22> { [ XF86TouchpadToggle ] };
+ key <FK21> { [ XF86TouchpadToggle ] };
+ key <FK22> { [ XF86TouchpadOn ] };
+ key <FK23> { [ XF86TouchpadOff ] };
// key <I120> { [ ] }; // KEY_MACRO
key <I126> { [ plusminus ] };
@@ -1825,3 +1827,31 @@ partial alphanumeric_keys xkb_symbols "pc105" {
include "inet(media_nav_acpi_common)"
};
+
+// HTC Dream
+partial alphanumeric_keys
+xkb_symbols "htcdream" {
+ key <BKSP> { [ BackSpace ] };
+ key <RTRN> { [ Return ] };
+
+ //first row
+ key <AE01> { [ 1, 1, exclam, exclam ] };
+ key <AE02> { [ 2, 2, at, at ] };
+ key <AE03> { [ 3, 3, numbersign, numbersign ] };
+ key <AE04> { [ 4, 4, dollar, dollar ] };
+ key <AE05> { [ 5, 5, percent, percent ] };
+ key <AE06> { [ 6, 6, dead_circumflex, dead_circumflex ] };
+ key <AE07> { [ 7, 7, ampersand, ampersand ] };
+ key <AE08> { [ 8, 8, asterisk, asterisk ] };
+ key <AE09> { [ 9, 9, parenleft, parenleft ] };
+ key <AE10> { [ 0, 0, parenright, parenright ] };
+
+ //fifth row
+ key <LFSH> { [ Shift_L ] };
+ key <SPCE> { [ space ] };
+ key <AB09> { [ period, period, slash, slash ] };
+ key <RTSH> { [ Shift_R ] };
+
+ //modifiers
+ modifier_map Shift { <LFSH>, <RTSH> };
+};
diff --git a/xorg-server/xkeyboard-config/symbols/it b/xorg-server/xkeyboard-config/symbols/it index 7f703d16f..9222a1ca4 100644 --- a/xorg-server/xkeyboard-config/symbols/it +++ b/xorg-server/xkeyboard-config/symbols/it @@ -1,218 +1,262 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/it' file -// 17 May 2003 Modified by Sebastiano Vigna (vigna@dsi.unimi.it) -// -// $XFree86: xc/programs/xkbcomp/symbols/it,v 1.4 2003/04/19 12:22:12 pascal Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "latin(type4)" - - name[Group1]="Italy"; - - key <TLDE> { [ backslash, bar, notsign, brokenbar ] }; - - key <AE02> { [ 2, quotedbl, twosuperior, dead_doubleacute ] }; - key <AE03> { [ 3, sterling,threesuperior, dead_tilde ] }; - key <AE04> { [ 4, dollar, onequarter, oneeighth ] }; - - key <AE10> { [ 0, equal, braceright, dead_ogonek ] }; - key <AE11> { [apostrophe, question, grave, questiondown ] }; - key <AE12> { [ igrave, asciicircum, asciitilde, dead_circumflex ] }; - - key <AD11> { [ egrave, eacute, bracketleft, braceleft ] }; - key <AD12> { [ plus, asterisk, bracketright, braceright ] }; - - key <AC10> { [ ograve, ccedilla, at, dead_cedilla ] }; - key <AC11> { [ agrave, degree, numbersign, dead_abovering ] }; - - key <AB06> { [ n, N, ntilde, Ntilde ] }; - key <AB08> { [ comma, semicolon, dead_acute, multiply ] }; - key <AB09> { [ period, colon,periodcentered, dead_diaeresis ] }; - key <AB10> { [ minus, underscore, dead_macron, division ] }; - - key <BKSL> { [ ugrave, section, dead_grave, dead_breve ] }; - - key <LSGT> { [ less, greater,guillemotleft,guillemotright] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - // Modifies the basic italian layout to eliminate all dead keys - - include "it(basic)" - - name[Group1]="Italy - Eliminate dead keys"; - - key <AE02> { [ 2, quotedbl, twosuperior, doubleacute ] }; - key <AE03> { [ 3, sterling,threesuperior, asciitilde ] }; - - key <AE10> { [ 0, equal, braceright, ogonek ] }; - key <AE12> { [ igrave, asciicircum, asciitilde, asciicircum ] }; - - key <AC10> { [ ograve, ccedilla, at, cedilla ] }; - key <AC11> { [ agrave, degree, numbersign, degree ] }; - - key <AB08> { [ comma, semicolon, acute, multiply ] }; - key <AB09> { [ period, colon,periodcentered, diaeresis ] }; - key <AB10> { [ minus, underscore, macron, division ] }; - - key <BKSL> { [ ugrave, section, grave, breve ] }; -}; - -// Copied from macintosh_vndr/it -partial alphanumeric_keys -xkb_symbols "mac" { - - name[Group1]= "Italy - Macintosh"; - - // Alphanumeric section - key <LSGT> { [ less, greater ] }; - key <TLDE> { [ at, numbersign, periodcentered ] }; - key <AE01> { [ ampersand, 1, guillemotleft,guillemotright ] }; - key <AE02> { [ quotedbl, 2 ] }; - key <AE03> { [ apostrophe, 3 ] }; - key <AE04> { [ parenleft, 4, braceleft, bracketleft ] }; - key <AE05> { [ ccedilla, 5, Ccedilla, Iacute ] }; - key <AE06> { [ egrave, 6, paragraph, periodcentered] }; - key <AE07> { [ parenright, 7, braceright, bracketright ] }; - key <AE08> { [ sterling, 8, infinity ] }; - key <AE09> { [ agrave, 9, acute, Ocircumflex ] }; - key <AE10> { [ eacute, 0, grave, Oacute ] }; - key <AE11> { [ minus, underscore ] }; - key <AE12> { [ equal, plus, notequal, plusminus ] }; - - key <AD01> { [ q, Q ] }; - key <AD02> { [ z, Z ] }; - key <AD03> { [ e, E, EuroSign ] }; - key <AD04> { [ r, R, registered ] }; - key <AD05> { [ t, T ] }; - key <AD06> { [ y, Y, Uacute, ydiaeresis ] }; - key <AD07> { [ u, U ] }; - key <AD08> { [ i, I, icircumflex, idiaeresis ] }; - key <AD09> { [ o, O ] }; - key <AD10> { [ p, P ] }; - key <AD11> { [ igrave, asciicircum ] }; - key <AD12> { [ dollar, asterisk ] }; - key <BKSL> { [ section, degree, at, numbersign ] }; - - key <AC01> { [ a, A, aring, Aring ] }; - key <AC02> { [ s, S, ssharp ] }; - key <AC03> { [ d, D ] }; - key <AC04> { [ f, F ] }; - key <AC05> { [ g, G ] }; - key <AC06> { [ h, H, Igrave, Icircumflex ] }; - key <AC07> { [ j, J, Idiaeresis, Iacute ] }; - key <AC08> { [ k, K, Egrave, Ediaeresis ] }; - key <AC09> { [ l, L, ssharp, bar ] }; - key <AC10> { [ m, M, mu, Oacute ] }; - key <AC11> { [ ugrave, percent, ae, AE ] }; - - key <AB01> { [ w, W ] }; - key <AB02> { [ x, X ] }; - key <AB03> { [ c, C, copyright, copyright ] }; - key <AB04> { [ v, V ] }; - key <AB05> { [ b, B ] }; - key <AB06> { [ n, N, dead_tilde ] }; - key <AB07> { [ comma, question, questiondown ] }; - key <AB08> { [ semicolon, period ] }; - key <AB09> { [ colon, slash, bar, backslash ] }; - key <AB10> { [ ograve, exclam, exclamdown ] }; - - // End alphanumeric section - - include "kpdl(dot)" - include "level3(ralt_switch)" -}; - -// Used by Georgian people in Italy, -// contributed by Vladimer Sichinava -partial alphanumeric_keys -xkb_symbols "geo" { - include "it" - include "ge(basic)" - - name[Group1]= "Italy - Georgian"; - key <TLDE> { [ backslash, bar, notsign, brokenbar ] }; - key <AE01> { [ 1, exclam, onesuperior ] }; - key <AE02> { [ 2, quotedbl, twosuperior, dead_doubleacute ] }; - key <AE03> { [ 3, sterling, threesuperior, dead_tilde ] }; - key <AE04> { [ 4, dollar, onequarter, oneeighth ] }; - key <AE05> { [ 5, percent, onehalf ] }; - key <AE06> { [ 6, ampersand ] }; - key <AE07> { [ 7, slash, braceleft ] }; - key <AE08> { [ 8, parenleft, bracketleft ] }; - key <AE09> { [ 9, parenright ] }; - key <AE10> { [ 0, equal, braceright, dead_ogonek ] }; - key <AE11> { [apostrophe, question, grave, questiondown ] }; - key <AE12> { [ igrave, asciicircum, asciitilde, dead_circumflex ] }; - - key <AD03> { [0x010010d4, E, EuroSign ] }; - key <AD11> { [ egrave, eacute, bracketleft, braceleft ] }; - key <AD12> { [ plus, asterisk, bracketright, braceright ] }; - - key <AC10> { [ ograve, ccedilla, at, dead_cedilla ] }; - key <AC11> { [ agrave, degree, numbersign, degree ] }; - key <BKSL> { [ ugrave, section, dead_grave, dead_breve ] }; - key <LSGT> { [ less, greater ] }; - - key <AB08> { [ comma, semicolon ] }; - key <AB09> { [ period, colon ] }; - key <AB10> { [ minus, underscore ] }; -}; - -// OLPC Section -xkb_symbols "olpc" { - - include "it(basic)" - - key <AE12> { [ igrave, asciicircum, asciitilde, dead_tilde ] }; - key <BKSL> { [ ugrave, section, Egrave, dead_breve ] }; - key <I219> { [ less, greater, guillemotleft, guillemotright ] }; -}; - -partial alphanumeric_keys modifier_keys -xkb_symbols "us" { - - name[Group1]= "Italy - US keyboard with Italian letters"; - - include "us(euro)" - - // Alphanumeric section - - key <TLDE> { [ grave, asciitilde, dead_grave, dead_tilde ] }; - key <AE01> { [ 1, exclam, onesuperior ] }; - key <AE02> { [ 2, at, twosuperior ] }; - key <AE03> { [ 3, numbersign, threesuperior ] }; - key <AE06> { [ 6,asciicircum,dead_circumflex ] }; - key <AE10> { [ 0, parenright, degree ] }; - key <AE11> { [ minus, underscore, dead_macron ] }; - - key <AD03> { [ e, E, egrave, Egrave ] }; - key <AD04> { [ r, R, registered ] }; - key <AD07> { [ u, U, ugrave, Ugrave ] }; - key <AD08> { [ i, I, igrave, Igrave ] }; - key <AD09> { [ o, O, ograve, Ograve ] }; - - key <AC01> { [ a, A, agrave, Agrave ] }; - key <AC03> { [ d, D, eacute, Eacute ] }; - key <AC07> { [ j, J, uacute, Uacute ] }; - key <AC08> { [ k, K, iacute, Iacute ] }; - key <AC09> { [ l, L, oacute, Oacute ] }; - key <AC10> { [ semicolon, colon,dead_diaeresis, dead_diaeresis ] }; - key <AC11> { [apostrophe, quotedbl, dead_acute ] }; - - key <AB01> { [ z, Z, aacute, Aacute ] }; - key <AB03> { [ c, C, copyright ] }; - key <AB06> { [ n, N, ntilde, Ntilde ] }; - key <AB08> { [ comma, less, guillemotleft ] }; - key <AB09> { [ period, greater, guillemotright ] }; - - include "level3(ralt_switch)" -}; - +// $XKeyboardConfig$
+
+// based on a keyboard map from an 'xkb/symbols/it' file
+// 17 May 2003 Modified by Sebastiano Vigna (vigna@dsi.unimi.it)
+//
+// $XFree86: xc/programs/xkbcomp/symbols/it,v 1.4 2003/04/19 12:22:12 pascal Exp $
+
+partial default alphanumeric_keys
+xkb_symbols "basic" {
+
+ include "latin(type4)"
+
+ name[Group1]="Italy";
+
+ key <TLDE> { [ backslash, bar, notsign, brokenbar ] };
+
+ key <AE02> { [ 2, quotedbl, twosuperior, dead_doubleacute ] };
+ key <AE03> { [ 3, sterling,threesuperior, dead_tilde ] };
+ key <AE04> { [ 4, dollar, onequarter, oneeighth ] };
+
+ key <AE10> { [ 0, equal, braceright, dead_ogonek ] };
+ key <AE11> { [apostrophe, question, grave, questiondown ] };
+ key <AE12> { [ igrave, asciicircum, asciitilde, dead_circumflex ] };
+
+ key <AD11> { [ egrave, eacute, bracketleft, braceleft ] };
+ key <AD12> { [ plus, asterisk, bracketright, braceright ] };
+
+ key <AC10> { [ ograve, ccedilla, at, dead_cedilla ] };
+ key <AC11> { [ agrave, degree, numbersign, dead_abovering ] };
+
+ key <AB06> { [ n, N, ntilde, Ntilde ] };
+ key <AB08> { [ comma, semicolon, dead_acute, multiply ] };
+ key <AB09> { [ period, colon,periodcentered, dead_diaeresis ] };
+ key <AB10> { [ minus, underscore, dead_macron, division ] };
+
+ key <BKSL> { [ ugrave, section, dead_grave, dead_breve ] };
+
+ key <LSGT> { [ less, greater,guillemotleft,guillemotright] };
+
+ include "level3(ralt_switch)"
+};
+
+partial alphanumeric_keys
+xkb_symbols "nodeadkeys" {
+
+ // Modifies the basic italian layout to eliminate all dead keys
+
+ include "it(basic)"
+
+ name[Group1]="Italy - Eliminate dead keys";
+
+ key <AE02> { [ 2, quotedbl, twosuperior, doubleacute ] };
+ key <AE03> { [ 3, sterling,threesuperior, asciitilde ] };
+
+ key <AE10> { [ 0, equal, braceright, ogonek ] };
+ key <AE12> { [ igrave, asciicircum, asciitilde, asciicircum ] };
+
+ key <AC10> { [ ograve, ccedilla, at, cedilla ] };
+ key <AC11> { [ agrave, degree, numbersign, degree ] };
+
+ key <AB08> { [ comma, semicolon, acute, multiply ] };
+ key <AB09> { [ period, colon,periodcentered, diaeresis ] };
+ key <AB10> { [ minus, underscore, macron, division ] };
+
+ key <BKSL> { [ ugrave, section, grave, breve ] };
+};
+
+// Copied from macintosh_vndr/it
+partial alphanumeric_keys
+xkb_symbols "mac" {
+
+ name[Group1]= "Italy - Macintosh";
+
+ // Alphanumeric section
+ key <LSGT> { [ less, greater ] };
+ key <TLDE> { [ at, numbersign, periodcentered ] };
+ key <AE01> { [ ampersand, 1, guillemotleft,guillemotright ] };
+ key <AE02> { [ quotedbl, 2 ] };
+ key <AE03> { [ apostrophe, 3 ] };
+ key <AE04> { [ parenleft, 4, braceleft, bracketleft ] };
+ key <AE05> { [ ccedilla, 5, Ccedilla, Iacute ] };
+ key <AE06> { [ egrave, 6, paragraph, periodcentered] };
+ key <AE07> { [ parenright, 7, braceright, bracketright ] };
+ key <AE08> { [ sterling, 8, infinity ] };
+ key <AE09> { [ agrave, 9, acute, Ocircumflex ] };
+ key <AE10> { [ eacute, 0, grave, Oacute ] };
+ key <AE11> { [ minus, underscore ] };
+ key <AE12> { [ equal, plus, notequal, plusminus ] };
+
+ key <AD01> { [ q, Q ] };
+ key <AD02> { [ z, Z ] };
+ key <AD03> { [ e, E, EuroSign ] };
+ key <AD04> { [ r, R, registered ] };
+ key <AD05> { [ t, T ] };
+ key <AD06> { [ y, Y, Uacute, ydiaeresis ] };
+ key <AD07> { [ u, U ] };
+ key <AD08> { [ i, I, icircumflex, idiaeresis ] };
+ key <AD09> { [ o, O ] };
+ key <AD10> { [ p, P ] };
+ key <AD11> { [ igrave, asciicircum ] };
+ key <AD12> { [ dollar, asterisk ] };
+ key <BKSL> { [ section, degree, at, numbersign ] };
+
+ key <AC01> { [ a, A, aring, Aring ] };
+ key <AC02> { [ s, S, ssharp ] };
+ key <AC03> { [ d, D ] };
+ key <AC04> { [ f, F ] };
+ key <AC05> { [ g, G ] };
+ key <AC06> { [ h, H, Igrave, Icircumflex ] };
+ key <AC07> { [ j, J, Idiaeresis, Iacute ] };
+ key <AC08> { [ k, K, Egrave, Ediaeresis ] };
+ key <AC09> { [ l, L, ssharp, bar ] };
+ key <AC10> { [ m, M, mu, Oacute ] };
+ key <AC11> { [ ugrave, percent, ae, AE ] };
+
+ key <AB01> { [ w, W ] };
+ key <AB02> { [ x, X ] };
+ key <AB03> { [ c, C, copyright, copyright ] };
+ key <AB04> { [ v, V ] };
+ key <AB05> { [ b, B ] };
+ key <AB06> { [ n, N, dead_tilde ] };
+ key <AB07> { [ comma, question, questiondown ] };
+ key <AB08> { [ semicolon, period ] };
+ key <AB09> { [ colon, slash, bar, backslash ] };
+ key <AB10> { [ ograve, exclam, exclamdown ] };
+
+ // End alphanumeric section
+
+ include "kpdl(dot)"
+ include "level3(ralt_switch)"
+};
+
+// Used by Georgian people in Italy,
+// contributed by Vladimer Sichinava
+partial alphanumeric_keys
+xkb_symbols "geo" {
+ include "it"
+ include "ge(basic)"
+
+ name[Group1]= "Italy - Georgian";
+ key <TLDE> { [ backslash, bar, notsign, brokenbar ] };
+ key <AE01> { [ 1, exclam, onesuperior ] };
+ key <AE02> { [ 2, quotedbl, twosuperior, dead_doubleacute ] };
+ key <AE03> { [ 3, sterling, threesuperior, dead_tilde ] };
+ key <AE04> { [ 4, dollar, onequarter, oneeighth ] };
+ key <AE05> { [ 5, percent, onehalf ] };
+ key <AE06> { [ 6, ampersand ] };
+ key <AE07> { [ 7, slash, braceleft ] };
+ key <AE08> { [ 8, parenleft, bracketleft ] };
+ key <AE09> { [ 9, parenright ] };
+ key <AE10> { [ 0, equal, braceright, dead_ogonek ] };
+ key <AE11> { [apostrophe, question, grave, questiondown ] };
+ key <AE12> { [ igrave, asciicircum, asciitilde, dead_circumflex ] };
+
+ key <AD03> { [0x010010d4, E, EuroSign ] };
+ key <AD11> { [ egrave, eacute, bracketleft, braceleft ] };
+ key <AD12> { [ plus, asterisk, bracketright, braceright ] };
+
+ key <AC10> { [ ograve, ccedilla, at, dead_cedilla ] };
+ key <AC11> { [ agrave, degree, numbersign, degree ] };
+ key <BKSL> { [ ugrave, section, dead_grave, dead_breve ] };
+ key <LSGT> { [ less, greater ] };
+
+ key <AB08> { [ comma, semicolon ] };
+ key <AB09> { [ period, colon ] };
+ key <AB10> { [ minus, underscore ] };
+};
+
+// OLPC Section
+xkb_symbols "olpc" {
+
+ include "it(basic)"
+
+ key <AE12> { [ igrave, asciicircum, asciitilde, dead_tilde ] };
+ key <BKSL> { [ ugrave, section, Egrave, dead_breve ] };
+ key <I219> { [ less, greater, guillemotleft, guillemotright ] };
+};
+
+partial alphanumeric_keys modifier_keys
+xkb_symbols "us" {
+
+ name[Group1]= "Italy - US keyboard with Italian letters";
+
+ include "us(euro)"
+
+ // Alphanumeric section
+
+ key <TLDE> { [ grave, asciitilde, dead_grave, dead_tilde ] };
+ key <AE01> { [ 1, exclam, onesuperior ] };
+ key <AE02> { [ 2, at, twosuperior ] };
+ key <AE03> { [ 3, numbersign, threesuperior ] };
+ key <AE06> { [ 6,asciicircum,dead_circumflex ] };
+ key <AE10> { [ 0, parenright, degree ] };
+ key <AE11> { [ minus, underscore, dead_macron ] };
+
+ key <AD03> { [ e, E, egrave, Egrave ] };
+ key <AD04> { [ r, R, registered ] };
+ key <AD07> { [ u, U, ugrave, Ugrave ] };
+ key <AD08> { [ i, I, igrave, Igrave ] };
+ key <AD09> { [ o, O, ograve, Ograve ] };
+
+ key <AC01> { [ a, A, agrave, Agrave ] };
+ key <AC03> { [ d, D, eacute, Eacute ] };
+ key <AC07> { [ j, J, uacute, Uacute ] };
+ key <AC08> { [ k, K, iacute, Iacute ] };
+ key <AC09> { [ l, L, oacute, Oacute ] };
+ key <AC10> { [ semicolon, colon,dead_diaeresis, dead_diaeresis ] };
+ key <AC11> { [apostrophe, quotedbl, dead_acute ] };
+
+ key <AB01> { [ z, Z, aacute, Aacute ] };
+ key <AB03> { [ c, C, copyright ] };
+ key <AB06> { [ n, N, ntilde, Ntilde ] };
+ key <AB08> { [ comma, less, guillemotleft ] };
+ key <AB09> { [ period, greater, guillemotright ] };
+
+ include "level3(ralt_switch)"
+};
+
+partial alphanumeric_keys
+xkb_symbols "htcdream" {
+ include "inet(htcdream)"
+ name[Group1]= "Italy - htcdream";
+
+ //second row
+ key <AD01> { [ q, Q, Tab, Tab ] };
+ key <AD02> { [ w, W, grave, grave ] };
+ key <AD03> { [ e, E, egrave, egrave] };
+ key <AD04> { [ r, R, eacute, eacute ] };
+ key <AD05> { [ t, T, quotedbl, quotedbl ] };
+ key <AD06> { [ y, Y, apostrophe, apostrophe ] };
+ key <AD07> { [ u, U, ugrave, ugrave ] };
+ key <AD08> { [ i, I, igrave, igrave ] };
+ key <AD09> { [ o, O, ograve, ograve ] };
+ key <AD10> { [ p, P, NoSymbol, NoSymbol ] };
+
+ //third row
+ key <AC01> { [ a, A, agrave, agrave ] };
+ key <AC02> { [ s, S, bar, bar ] };
+ key <AC03> { [ d ,D, EuroSign, EuroSign ] };
+ key <AC04> { [ f, F, sterling, sterling ] };
+ key <AC05> { [ g, G, division, division ] };
+ key <AC06> { [ h, H, multiply, multiply ] };
+ key <AC07> { [ j, J, minus, minus ] };
+ key <AC08> { [ k, K, plus, plus ] };
+ key <AC09> { [ l, L, equal, equal ] };
+
+ //forth row
+ key <AB01> { [ z, Z, underscore, underscore ] };
+ key <AB02> { [ x, X, asciitilde, asciitilde ] };
+ key <AB03> { [ c, C, less, less ] };
+ key <AB04> { [ v, V, greater, greater ] };
+ key <AB05> { [ b, B, backslash, backslash ] };
+ key <AB06> { [ n, N, colon, colon ] };
+ key <AB07> { [ m, M, semicolon, semicolon ] };
+ key <AB08> { [ comma, comma, question, question ] };
+
+ //fifth row
+ key <FK15> { [ at, at, NoSymbol, NoSymbol ] };
+
+ include "level3(alt_switch)"
+};
+
diff --git a/xorg-server/xkeyboard-config/symbols/jp b/xorg-server/xkeyboard-config/symbols/jp index 7a4016fc5..5e4ba14b7 100644 --- a/xorg-server/xkeyboard-config/symbols/jp +++ b/xorg-server/xkeyboard-config/symbols/jp @@ -116,6 +116,34 @@ xkb_symbols "OADG109A" { key <AE13> { [ yen, bar ] };
};
+// 86 keys with kana map
+partial alphanumeric_keys
+xkb_symbols "kana86" {
+
+ include "pc(function)"
+ include "pc(editing)"
+ include "keypad(numoperdecsep)"
+ include "altwin(menu)"
+ include "jp(kana)"
+ include "jp(OADG109A)"
+ name[Group1]= "Japan - Kana 86";
+
+ key <ESC> { [ Escape ] };
+ key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
+ key <BKSP> { [ BackSpace ] };
+ key <TAB> { [ Tab, ISO_Left_Tab ] };
+ key <RTRN> { [ Return ] };
+ key <LFSH> { [ Shift_L ] };
+ key <RTSH> { [ Shift_R ] };
+ key <LWIN> { [ Super_L ] };
+ key <LALT> { [ Alt_L ] };
+ key <SPCE> { [ space ] };
+ key <RALT> { [ Alt_R ] };
+// for compatability with other keyboards connected at the same time
+ key <RWIN> { [ Super_R ] };
+ key <RCTL> { [ Control_R ] };
+};
+
partial alphanumeric_keys
xkb_symbols "kana" {
diff --git a/xorg-server/xkeyboard-config/symbols/keypad b/xorg-server/xkeyboard-config/symbols/keypad index fe0c2fd36..4dfa1a7e2 100644 --- a/xorg-server/xkeyboard-config/symbols/keypad +++ b/xorg-server/xkeyboard-config/symbols/keypad @@ -579,3 +579,58 @@ xkb_symbols "atm" { key <KP2> { [ NoSymbol, KP_8 ] };
key <KP3> { [ NoSymbol, KP_9 ] };
};
+
+
+partial default modifier_keys
+xkb_symbols "pointerkeys" {
+ key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
+};
+
+// Only numbers, operators and decimal separator,
+// as seen on keypad overlay on Japanese keyboard.
+// ┌─┬─┬─┬─┐
+// │7│8│9│*│
+// ├─┼─┼─┼─┤
+// │4│5│6│-│
+// ├─┼─┼─┼─┤
+// │1│2│3│+│
+// ├─┼─┼─┼─┤
+// │0│ │·│/│
+// └─┴─┴─┴─┘
+partial keypad_keys
+xkb_symbols "numoperdecsep" {
+ key <KO7> { [ KP_7 ] };
+ key <KO8> { [ KP_8 ] };
+ key <KO9> { [ KP_9 ] };
+// ClsGrb kills whichever client has a grab in effect
+ key <KOMU> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Multiply, XF86_ClearGrab ]
+ };
+
+ key <KO4> { [ KP_4 ] };
+ key <KO5> { [ KP_5 ] };
+ key <KO6> { [ KP_6 ] };
+// -VMode switches to the previous video mode
+ key <KOSU> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Subtract, XF86_Prev_VMode ]
+ };
+
+ key <KO1> { [ KP_1 ] };
+ key <KO2> { [ KP_2 ] };
+ key <KO3> { [ KP_3 ] };
+// +VMode switches to the next video mode
+ key <KOAD> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Add, XF86_Next_VMode ]
+ };
+
+ key <KO0> { [ KP_0 ] };
+ key <KODL> { [ KP_Decimal ] };
+// Ungrab cancels server/keyboard/pointer grabs
+ key <KODV> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ KP_Divide, XF86_Ungrab ]
+ };
+};
diff --git a/xorg-server/xkeyboard-config/symbols/makefile b/xorg-server/xkeyboard-config/symbols/makefile index cc15ea7d3..acbbdf182 100644 --- a/xorg-server/xkeyboard-config/symbols/makefile +++ b/xorg-server/xkeyboard-config/symbols/makefile @@ -31,7 +31,7 @@ ma mao me \ mk ml mm \ mn mt mv \ ng nl no np \ -pc pk pl pt \ +pc ph pk pl pt \ ro rs ru \ se si sk sn \ sy th \ diff --git a/xorg-server/xkeyboard-config/symbols/pc b/xorg-server/xkeyboard-config/symbols/pc index a359b8023..a6b2063d5 100644 --- a/xorg-server/xkeyboard-config/symbols/pc +++ b/xorg-server/xkeyboard-config/symbols/pc @@ -1,148 +1,148 @@ -// $XKeyboardConfig$ - -// -// $XFree86: xc/programs/xkbcomp/symbols/pc,v 1.9 2003/06/09 19:59:46 dawes Exp $ - -default partial alphanumeric_keys modifier_keys -xkb_symbols "pc105" { - - key <ESC> { [ Escape ] }; - - // the extra key on most European keyboards - key <LSGT> { [ less, greater, bar, brokenbar ] }; - - // these keys are common to all layouts - key <BKSL> { [ backslash, bar ] }; - key <SPCE> { [ space ] }; - - include "pc(function)" - include "pc(editing)" - include "keypad(x11)" - - key <BKSP> { [ BackSpace ] }; - - key <TAB> { [ Tab, ISO_Left_Tab ] }; - key <RTRN> { [ Return ] }; - - key <CAPS> { [ Caps_Lock ] }; - - key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] }; - - key <LFSH> { [ Shift_L ] }; - key <LCTL> { [ Control_L ] }; - - key <LWIN> { [ Super_L ] }; - - key <RTSH> { [ Shift_R ] }; - key <RCTL> { [ Control_R ] }; - - key <RWIN> { [ Super_R ] }; - - key <MENU> { [ Menu ] }; - - // begin modifier mappings - modifier_map Shift { Shift_L, Shift_R }; - modifier_map Lock { Caps_Lock, ISO_Lock }; - modifier_map Control{ Control_L, Control_R }; - modifier_map Mod2 { Num_Lock }; - modifier_map Mod4 { Super_L, Super_R }; - - // Fake keys for virtual<->real modifiers mapping - key <LVL3> { [ ISO_Level3_Shift ] }; - key <MDSW> { [ Mode_switch ] }; - modifier_map Mod5 { <LVL3>, <MDSW> }; - - key <ALT> { [ NoSymbol, Alt_L ] }; - include "altwin(meta_alt)" - - key <META> { [ NoSymbol, Meta_L ] }; - modifier_map Mod1 { <META> }; - - key <SUPR> { [ NoSymbol, Super_L ] }; - modifier_map Mod4 { <SUPR> }; - - key <HYPR> { [ NoSymbol, Hyper_L ] }; - modifier_map Mod4 { <HYPR> }; - - key <OUTP> { [ XF86Display ] }; - key <KITG> { [ XF86KbdLightOnOff ] }; - key <KIDN> { [ XF86KbdBrightnessDown ] }; - key <KIUP> { [ XF86KbdBrightnessUp ] }; -}; - -partial hidden alphanumeric_keys -xkb_symbols "function" { - key <FK01> { - type="CTRL+ALT", - symbols[Group1]= [ F1, XF86_Switch_VT_1 ] - }; - key <FK02> { - type="CTRL+ALT", - symbols[Group1]= [ F2, XF86_Switch_VT_2 ] - }; - key <FK03> { - type="CTRL+ALT", - symbols[Group1]= [ F3, XF86_Switch_VT_3 ] - }; - key <FK04> { - type="CTRL+ALT", - symbols[Group1]= [ F4, XF86_Switch_VT_4 ] - }; - key <FK05> { - type="CTRL+ALT", - symbols[Group1]= [ F5, XF86_Switch_VT_5 ] - }; - key <FK06> { - type="CTRL+ALT", - symbols[Group1]= [ F6, XF86_Switch_VT_6 ] - }; - key <FK07> { - type="CTRL+ALT", - symbols[Group1]= [ F7, XF86_Switch_VT_7 ] - }; - key <FK08> { - type="CTRL+ALT", - symbols[Group1]= [ F8, XF86_Switch_VT_8 ] - }; - key <FK09> { - type="CTRL+ALT", - symbols[Group1]= [ F9, XF86_Switch_VT_9 ] - }; - key <FK10> { - type="CTRL+ALT", - symbols[Group1]= [ F10, XF86_Switch_VT_10 ] - }; - key <FK11> { - type="CTRL+ALT", - symbols[Group1]= [ F11, XF86_Switch_VT_11 ] - }; - key <FK12> { - type="CTRL+ALT", - symbols[Group1]= [ F12, XF86_Switch_VT_12 ] - }; -}; - -partial hidden alphanumeric_keys -xkb_symbols "editing" { - key <PRSC> { - type= "PC_ALT_LEVEL2", - symbols[Group1]= [ Print, Sys_Req ] - }; - key <SCLK> { [ Scroll_Lock ] }; - key <PAUS> { - type= "PC_CONTROL_LEVEL2", - symbols[Group1]= [ Pause, Break ] - }; - key <INS> { [ Insert ] }; - key <HOME> { [ Home ] }; - key <PGUP> { [ Prior ] }; - key <DELE> { [ Delete ] }; - key <END> { [ End ] }; - key <PGDN> { [ Next ] }; - - key <UP> { [ Up ] }; - key <LEFT> { [ Left ] }; - key <DOWN> { [ Down ] }; - key <RGHT> { [ Right ] }; -}; - +// $XKeyboardConfig$
+
+//
+// $XFree86: xc/programs/xkbcomp/symbols/pc,v 1.9 2003/06/09 19:59:46 dawes Exp $
+
+default partial alphanumeric_keys modifier_keys
+xkb_symbols "pc105" {
+
+ key <ESC> { [ Escape ] };
+
+ // the extra key on most European keyboards
+ key <LSGT> { [ less, greater, bar, brokenbar ] };
+
+ // these keys are common to all layouts
+ key <BKSL> { [ backslash, bar ] };
+ key <SPCE> { [ space ] };
+
+ include "pc(function)"
+ include "pc(editing)"
+ include "keypad(x11)"
+
+ key <BKSP> { [ BackSpace ] };
+
+ key <TAB> { [ Tab, ISO_Left_Tab ] };
+ key <RTRN> { [ Return ] };
+
+ key <CAPS> { [ Caps_Lock ] };
+
+ key <NMLK> { [ Num_Lock ] };
+
+ key <LFSH> { [ Shift_L ] };
+ key <LCTL> { [ Control_L ] };
+
+ key <LWIN> { [ Super_L ] };
+
+ key <RTSH> { [ Shift_R ] };
+ key <RCTL> { [ Control_R ] };
+
+ key <RWIN> { [ Super_R ] };
+
+ key <MENU> { [ Menu ] };
+
+ // begin modifier mappings
+ modifier_map Shift { Shift_L, Shift_R };
+ modifier_map Lock { Caps_Lock, ISO_Lock };
+ modifier_map Control{ Control_L, Control_R };
+ modifier_map Mod2 { Num_Lock };
+ modifier_map Mod4 { Super_L, Super_R };
+
+ // Fake keys for virtual<->real modifiers mapping
+ key <LVL3> { [ ISO_Level3_Shift ] };
+ key <MDSW> { [ Mode_switch ] };
+ modifier_map Mod5 { <LVL3>, <MDSW> };
+
+ key <ALT> { [ NoSymbol, Alt_L ] };
+ include "altwin(meta_alt)"
+
+ key <META> { [ NoSymbol, Meta_L ] };
+ modifier_map Mod1 { <META> };
+
+ key <SUPR> { [ NoSymbol, Super_L ] };
+ modifier_map Mod4 { <SUPR> };
+
+ key <HYPR> { [ NoSymbol, Hyper_L ] };
+ modifier_map Mod4 { <HYPR> };
+
+ key <OUTP> { [ XF86Display ] };
+ key <KITG> { [ XF86KbdLightOnOff ] };
+ key <KIDN> { [ XF86KbdBrightnessDown ] };
+ key <KIUP> { [ XF86KbdBrightnessUp ] };
+};
+
+partial hidden alphanumeric_keys
+xkb_symbols "function" {
+ key <FK01> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F1, XF86_Switch_VT_1 ]
+ };
+ key <FK02> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F2, XF86_Switch_VT_2 ]
+ };
+ key <FK03> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F3, XF86_Switch_VT_3 ]
+ };
+ key <FK04> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F4, XF86_Switch_VT_4 ]
+ };
+ key <FK05> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F5, XF86_Switch_VT_5 ]
+ };
+ key <FK06> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F6, XF86_Switch_VT_6 ]
+ };
+ key <FK07> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F7, XF86_Switch_VT_7 ]
+ };
+ key <FK08> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F8, XF86_Switch_VT_8 ]
+ };
+ key <FK09> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F9, XF86_Switch_VT_9 ]
+ };
+ key <FK10> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F10, XF86_Switch_VT_10 ]
+ };
+ key <FK11> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F11, XF86_Switch_VT_11 ]
+ };
+ key <FK12> {
+ type="CTRL+ALT",
+ symbols[Group1]= [ F12, XF86_Switch_VT_12 ]
+ };
+};
+
+partial hidden alphanumeric_keys
+xkb_symbols "editing" {
+ key <PRSC> {
+ type= "PC_ALT_LEVEL2",
+ symbols[Group1]= [ Print, Sys_Req ]
+ };
+ key <SCLK> { [ Scroll_Lock ] };
+ key <PAUS> {
+ type= "PC_CONTROL_LEVEL2",
+ symbols[Group1]= [ Pause, Break ]
+ };
+ key <INS> { [ Insert ] };
+ key <HOME> { [ Home ] };
+ key <PGUP> { [ Prior ] };
+ key <DELE> { [ Delete ] };
+ key <END> { [ End ] };
+ key <PGDN> { [ Next ] };
+
+ key <UP> { [ Up ] };
+ key <LEFT> { [ Left ] };
+ key <DOWN> { [ Down ] };
+ key <RGHT> { [ Right ] };
+};
+
diff --git a/xorg-server/xkeyboard-config/symbols/ph b/xorg-server/xkeyboard-config/symbols/ph new file mode 100644 index 000000000..9ed2112e8 --- /dev/null +++ b/xorg-server/xkeyboard-config/symbols/ph @@ -0,0 +1,999 @@ +////////////////////////////////////////////////////////////////////////////////
+// Philippines National Keyboard Layout v1.0.0 (2010-10-23) //
+// http://laibcoms.com/sandbox/the-philippines-national-keyboard-layout //
+// //
+// License: GNU/GPLv3 //
+// //
+// Loosely based on ISO/IEC 9995-3:2009 //
+// * glyphs that are not used in Philippine Languages and //
+// Philippine English were not included //
+// * Additions/Changes that are not part of ISO/IEC 9995-3:2009 //
+// were added //
+// //
+// http://en.wikipedia.org/wiki/ISO/IEC_9995 //
+// http://www.fileformat.info/info/unicode/char/20B1/index.htm //
+// //
+// By: Ubuntu Philippines LoCo Team //
+// Site: http://ubuntu-ph.org //
+// //
+// Project Contact: JC John Sese Cuneta / 謝施洗 / ᜑᜓᜏᜈ᜔ ᜃᜓᜈᜒᜆ //
+// XMPP/Jabber: jcjohn.sesecuneta@talkr.im //
+// Email: jcjohn.sesecuneta@laibcoms.com //
+////////////////////////////////////////////////////////////////////////////////
+
+// QWERTY (Latin) version
+// http://en.wikipedia.org/wiki/QWERTY
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & ← │ * → │ ( ↑ │ ) ↓ │ _ ◌͠ │ + ∓ ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ - ¬ │ = ± ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ Q │ W │ E Œ │ R ¶ │ T │ Y │ U │ I İ │ O Ø │ P │ { │ } │ | Ə │
+// ┃Tab ↹ ┃ q │ w │ e œ │ r ® │ t ™ │ y ¥ │ u │ i ı │ o ø │ p ₱ │ [ │ ] │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ A Æ │ S │ D │ F ª │ G │ H │ J │ K │ L │ : │ " ̋◌ ┃ Enter ┃
+// ┃Caps ⇬ ┃ a æ │ s § │ d │ f │ g │ h │ j │ k │ l │ ; │ ' ́◌ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ Z » │ X · │ C ¢ │ V ‘ │ B ’ │ N Ñ │ M º │ < ̨◌ │ > ␣ │ ? ¿ ┃ ┃
+// ┃Shift ⇧┃ │ z « │ x × │ c © │ v “ │ b ” │ n ñ │ m µ │ , ̧◌ │ . … │ / ÷ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial default alphanumeric_keys
+xkb_symbols "basic" {
+
+ name[Group1]= "Philippines";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+ key <AE12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AD02> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AD03> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AD04> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AD05> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ // D row; QWERTY row, right side
+ key <AD06> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ key <AD07> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ key <AD08> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ key <AD09> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AD10> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AD11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AD12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC02> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC03> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ key <AC04> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ key <AC05> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ // C row; Home row, right side
+ key <AC06> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC07> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ key <AC08> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AC09> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AC10> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+ key <AC11> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+ key <AB02> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ key <AB03> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AB04> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB05> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ // B row; Lower row, right side
+ key <AB06> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AB09> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AB10> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// QWERTY (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ ᜁ │ │ │ │ ᜂ │ ᜁ │ ᜂ │ │ │ │ │
+// ┃Tab ↹ ┃ │ ᜏ │ ◌ᜒ │ ᜍ │ ᜆ │ ᜌ │ ◌ᜓ │ ◌ᜒ │ ◌ᜓ │ ᜉ │ │ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ᜀ │ ᜐ │ ᜇ │ │ ᜄ │ ᜑ │ │ ᜃ │ ᜎ │ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ ᜅ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ ᜊ │ ᜈ │ ᜋ │ ᜵ │ ᜶ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "qwerty-bay" {
+
+ name[Group1]= "Philippines - QWERTY (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AD03> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AD04> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AD05> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ // D row; QWERTY row, right side
+ key <AD06> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ key <AD07> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AD08> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AD09> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AD10> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC02> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC03> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ key <AC04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AC05> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ // C row; Home row, right side
+ key <AC06> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AC08> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AC09> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AC10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB05> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ // B row; Lower row, right side
+ key <AB06> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AB09> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Capewell-Dvorak (Latin) version
+// http://www.michaelcapewell.com/projects/keyboard/index.htm#The_Capewell-Dvorak_Layout
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & → │ * → │ ( ↑ │ ) ↓ │ { │ } ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ [ │ ] ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ " ̋◌ │ < ̨◌ │ > ␣ │ P │ Y │ Q │ F ª │ G │ R ¶ │ K │ ? ¿ │ + ∓ │ | Ə │
+// ┃Tab ↹ ┃ ' ́◌ │ , ̧◌ │ . … │ p ₱ │ y ¥ │ q │ f │ g │ r ® │ k │ / ÷ │ = ± │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ O Ø │ A Æ │ E Œ │ I İ │ U │ D │ H │ T │ N Ñ │ S │ _ ◌͠ ┃ Enter ┃
+// ┃Caps ⇬ ┃ o ø │ a æ │ e œ │ i ı │ u │ d │ h │ t ™ │ n ñ │ s § │ - ¬ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ Z » │ X · │ C ¢ │ V ‘ │ J │ L │ M º │ W │ B ’ │ : ┃ ┃
+// ┃Shift ⇧┃ │ z « │ x × │ c © │ v “ │ j │ l │ m µ │ w │ b ” │ ; ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "capewell-dvorak" {
+
+ name[Group1]= "Philippines - Capewell-Dvorak (Latin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AE12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+
+ // D row; Upper row, left side
+ key <AD01> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+ key <AD02> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AD03> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AD04> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AD05> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ // D row; Upper row, right side
+ key <AD06> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AD07> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ key <AD08> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ key <AD09> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AD10> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AD11> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+ key <AD12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AC02> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC03> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AC04> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ key <AC05> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ // C row; Home row, right side
+ key <AC06> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ key <AC07> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC08> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ key <AC09> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AC10> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+ key <AB02> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ key <AB03> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AB04> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB05> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ // B row; Lower row, right side
+ key <AB06> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AB09> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ key <AB10> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Capewell-Dvorak (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ │ │
+// ┃Tab ↹ ┃ │ ᜵ │ ᜶ │ ᜉ │ ᜌ │ │ │ ᜄ │ ᜍ │ ᜃ │ │ ◌᜔ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ ᜂ │ │ ᜁ │ ᜁ │ ᜂ │ │ │ │ ᜅ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ◌ᜓ │ ᜀ │ ◌ᜒ │ ◌ᜒ │ ◌ᜓ │ ᜇ │ ᜑ │ ᜆ │ ᜈ │ ᜐ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ │ ᜎ │ ᜋ │ ᜏ │ ᜊ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "capewell-dvorak-bay" {
+
+ name[Group1]= "Philippines - Capewell-Dvorak (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AD03> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AD04> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AD05> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ // D row; QWERTY row, right side
+ key <AD06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD08> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ key <AD09> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AD10> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC02> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC03> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC04> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC05> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ // C row; Home row, right side
+ key <AC06> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ key <AC07> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC08> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ key <AC09> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AC10> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // B row; Lower row, right side
+ key <AB06> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AB09> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Capewell-QWERF 2006 (Latin) version
+// http://www.michaelcapewell.com/projects/keyboard/index.htm#The_QWERF_Layout
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & → │ * → │ ( ↑ │ ) ↓ │ _ ◌͠ │ + ∓ ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ - ¬ │ = ± ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ Q │ W │ E Œ │ R ¶ │ F ª │ J │ Y │ K │ L │ : │ { │ } │ | Ə │
+// ┃Tab ↹ ┃ q │ w │ e œ │ r ® │ f │ j │ y ¥ │ k │ l │ ; │ [ │ ] │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ A Æ │ S │ D │ T │ G │ H │ U │ I İ │ O Ø │ P │ " ̋◌ ┃ Enter ┃
+// ┃Caps ⇬ ┃ a æ │ s § │ d │ t ™ │ g │ h │ u │ i ı │ o ø │ p ₱ │ ' ́◌ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ Z » │ X · │ C ¢ │ V ‘ │ B ’ │ N Ñ │ M º │ < ̨◌ │ > ␣ │ ? ¿ ┃ ┃
+// ┃Shift ⇧┃ │ z « │ x × │ c © │ v “ │ b ” │ n ñ │ m µ │ , ̧◌ │ . … │ / ÷ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "capewell-qwerf2k6" {
+
+ name[Group1]= "Philippines - Capewell-QWERF 2006 (Latin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+ key <AE12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+
+ // D row; Upper row, left side
+ key <AD01> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AD02> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AD03> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AD04> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AD05> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ // D row; Upper row, right side
+ key <AD06> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ key <AD07> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ key <AD08> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AD09> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AD10> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+ key <AD11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AD12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC02> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC03> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ key <AC04> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ key <AC05> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ // C row; Home row, right side
+ key <AC06> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC07> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ key <AC08> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ key <AC09> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AC10> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AC11> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+ key <AB02> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ key <AB03> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AB04> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB05> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ // B row; Lower row, right side
+ key <AB06> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AB09> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AB10> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Capewell-QWERF 2006 (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ ᜁ │ │ │ │ │ │ │ │ │ │ │
+// ┃Tab ↹ ┃ │ ᜏ │ ◌ᜒ │ ᜍ │ │ │ ᜌ │ ᜃ │ ᜎ │ │ │ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ │ │ │ │ │ ᜂ │ ᜁ │ ᜂ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ᜀ │ ᜐ │ ᜇ │ ᜆ │ ᜄ │ ᜑ │ ◌ᜓ │ ◌ᜒ │ ◌ᜓ │ ᜉ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ ᜅ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ ᜊ │ ᜈ │ ᜋ │ ᜵ │ ᜶ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "capewell-qwerf2k6-bay" {
+
+ name[Group1]= "Philippines - Capewell-QWERF 2006 (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AD03> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AD04> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AD05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // D row; QWERTY row, right side
+ key <AD06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD07> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ key <AD08> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AD09> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AD10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC02> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC03> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ key <AC04> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ key <AC05> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ // C row; Home row, right side
+ key <AC06> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC07> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC08> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC09> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC10> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB05> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ // B row; Lower row, right side
+ key <AB06> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AB09> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Colemak (Latin) version
+// http://colemak.com
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & → │ * → │ ( ↑ │ ) ↓ │ _ ◌͠ │ + ∓ ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ - ¬ │ = ± ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ Q │ W │ F ª │ P │ G │ J │ L │ U │ Y │ : │ { │ } │ | Ə │
+// ┃Tab ↹ ┃ q │ w │ f │ p ₱ │ g │ j │ l │ u │ y ¥ │ ; │ [ │ ] │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ A Æ │ R ¶ │ S │ T │ D │ H │ N Ñ │ E Œ │ I İ │ O Ø │ " ̋◌ ┃ Enter ┃
+// ┃Caps ⇬ ┃ a æ │ r ® │ s § │ t ™ │ d │ h │ n ñ │ e œ │ i ı │ o ø │ ' ́◌ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ Z » │ X · │ C ¢ │ V ‘ │ B ’ │ K │ M º │ < ̨◌ │ > ␣ │ ? ¿ ┃ ┃
+// ┃Shift ⇧┃ │ z « │ x × │ c © │ v “ │ b ” │ k │ m µ │ , ̧◌ │ . … │ / ÷ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "colemak" {
+
+ name[Group1]= "Philippines - Colemak (Latin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+ key <AE12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+
+ // D row; Upper row, left side
+ key <AD01> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AD02> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AD03> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ key <AD04> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AD05> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ // D row; Upper row, right side
+ key <AD06> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ key <AD07> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AD08> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ key <AD09> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ key <AD10> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+ key <AD11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AD12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC02> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AC03> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC04> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ key <AC05> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ // C row; Home row, right side
+ key <AC06> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC07> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AC08> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AC09> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ key <AC10> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AC11> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+ key <AB02> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ key <AB03> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AB04> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB05> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ // B row; Lower row, right side
+ key <AB06> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AB09> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AB10> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Colemak (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ │ │ │ │ │ ᜂ │ │ │ │ │ │
+// ┃Tab ↹ ┃ │ ᜏ │ │ ᜉ │ ᜄ │ │ ᜎ │ ◌ᜓ │ ᜌ │ │ │ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ │ │ │ │ │ ᜅ │ ᜁ │ ᜁ │ ᜂ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ᜀ │ ᜍ │ ᜐ │ ᜆ │ ᜇ │ ᜑ │ ᜈ │ ◌ᜒ │ ◌ᜒ │ ◌ᜓ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ ᜊ │ ᜃ │ ᜋ │ ᜵ │ ᜶ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "colemak-bay" {
+
+ name[Group1]= "Philippines - Colemak (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AD03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD04> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AD05> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ // D row; QWERTY row, right side
+ key <AD06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD07> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AD08> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AD09> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ key <AD10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC02> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AC03> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC04> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ key <AC05> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ // C row; Home row, right side
+ key <AC06> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC07> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AC08> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC09> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC10> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB05> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ // B row; Lower row, right side
+ key <AB06> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AB09> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Dvorak Simplified (Latin) version
+// http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ ~ ̃◌ │ ! ¡ │ @ ¤ │ # £ │ $ € │ % ° │ ^ ̂◌ │ & → │ * → │ ( ↑ │ ) ↓ │ { │ } ┃ ⌫ Bak ┃
+// │ ` ̀◌ │ 1 ¹ │ 2 ² │ 3 ³ │ 4 ¼ │ 5 ½ │ 6 ¾ │ 7 ⅛ │ 8 ⅜ │ 9 ⅝ │ 0 ⅞ │ [ │ ] ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ " ̋◌ │ < ̨◌ │ > ␣ │ P │ Y │ F ª │ G │ C ¢ │ R ¶ │ L │ ? ¿ │ + ∓ │ | Ə │
+// ┃Tab ↹ ┃ ' ́◌ │ , ̧◌ │ . … │ p ₱ │ y ¥ │ f │ g │ c © │ r ® │ l │ / ÷ │ = ± │ \ ə │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ A Æ │ O Ø │ E Œ │ U │ I İ │ D │ H │ T │ N Ñ │ S │ _ ◌͠ ┃ Enter ┃
+// ┃Caps ⇬ ┃ a æ │ o ø │ e œ │ u │ i ı │ d │ h │ t ™ │ n ñ │ s § │ - ¬ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ ¦ │ : │ Q │ J │ K │ X · │ B ’ │ M º │ W │ V ‘ │ Z » ┃ ┃
+// ┃Shift ⇧┃ │ ; │ q │ j │ k │ x × │ b ” │ m µ │ w │ v “ │ z « ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "dvorak" {
+
+ name[Group1]= "Philippines - Dvorak (Latin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ U0060, U007E, U0300, U0303 ] }; // ` ~ ̀◌ ̃◌ (combining grave accent) (combining tilde)
+ key <AE01> { [ U0031, U0021, U00B9, U00A1 ] }; // 1 ! ¹ ¡
+ key <AE02> { [ U0032, U0040, U00B2, U00A4 ] }; // 2 @ ² ¤
+ key <AE03> { [ U0033, U0023, U00B3, U00A3 ] }; // 3 # ³ £
+ key <AE04> { [ U0034, U0024, U00BC, U20AC ] }; // 4 $ ¼ €
+ key <AE05> { [ U0035, U0025, U00BD, U00B0 ] }; // 5 % ½ °
+ // E row; Numerals row, right side
+ key <AE06> { [ U0036, U005E, U00BE, U0302 ] }; // 6 ^ ¾ ̂◌ (combining circumflex accent)
+ key <AE07> { [ U0037, U0026, U215B, U2190 ] }; // 7 & ⅛ ←
+ key <AE08> { [ U0038, U002A, U215C, U2192 ] }; // 8 * ⅜ →
+ key <AE09> { [ U0039, U0028, U215D, U2191 ] }; // 9 ( ⅝ ↑
+ key <AE10> { [ U0030, U0029, U215E, U2193 ] }; // 0 ) ⅞ ↓
+ key <AE11> { [ U005B, U007B, VoidSymbol, VoidSymbol ] }; // [ {
+ key <AE12> { [ U005D, U007D, VoidSymbol, VoidSymbol ] }; // ] }
+
+ // D row; Upper row, left side
+ key <AD01> { [ U0027, U0022, U0301, U030B ] }; // ' " ́◌ ̋◌ (combining acute accent) (combining double-acute accent)
+ key <AD02> { [ U002C, U003C, U0327, U0328 ] }; // , < ̧◌ ̨◌ (combining cedilla) (combining ogonek)
+ key <AD03> { [ U002E, U003E, U2026, U2423 ] }; // . > … ␣
+ key <AD04> { [ U0070, U0050, U20B1, VoidSymbol ] }; // p P ₱
+ key <AD05> { [ U0079, U0059, U00A5, VoidSymbol ] }; // y Y ¥
+ // D row; Upper row, right side
+ key <AD06> { [ U0066, U0046, VoidSymbol, U00AA ] }; // f F ª
+ key <AD07> { [ U0067, U0047, VoidSymbol, VoidSymbol ] }; // g G
+ key <AD08> { [ U0063, U0043, U00A9, U00A2 ] }; // c C © ¢
+ key <AD09> { [ U0072, U0052, U00AE, U00B6 ] }; // r R ® ¶
+ key <AD10> { [ U006C, U004C, VoidSymbol, VoidSymbol ] }; // l L
+ key <AD11> { [ U002F, U003F, U00F7, U00BF ] }; // / ? ÷ ¿
+ key <AD12> { [ U003D, U002B, U00B1, U2213 ] }; // = + ± ∓
+ key <BKSL> { [ U005C, U007C, U0259, U018F ] }; // \ | ə Ə
+
+ // C row; Home row, left side
+ key <AC01> { [ U0061, U0041, U00E6, U00C6 ] }; // a A æ Æ
+ key <AC02> { [ U006F, U004F, U00F8, U00D8 ] }; // o O ø Ø
+ key <AC03> { [ U0065, U0045, U0153, U0152 ] }; // e E œ Œ
+ key <AC04> { [ U0075, U0055, VoidSymbol, VoidSymbol ] }; // u U
+ key <AC05> { [ U0069, U0049, U0131, U0130 ] }; // i I ı İ
+ // C row; Home row, right side
+ key <AC06> { [ U0064, U0044, VoidSymbol, VoidSymbol ] }; // d D
+ key <AC07> { [ U0068, U0048, VoidSymbol, VoidSymbol ] }; // h H
+ key <AC08> { [ U0074, U0054, U2122, VoidSymbol ] }; // t T ™
+ key <AC09> { [ U006E, U004E, U00F1, U00D1 ] }; // n N ñ Ñ
+ key <AC10> { [ U0073, U0053, U00A7, VoidSymbol ] }; // s S §
+ key <AC11> { [ U002D, U005F, U00AC, U0360 ] }; // - _ ¬ ◌͠
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, U00A6 ] }; // ¦
+ key <AB01> { [ U003B, U003A, VoidSymbol, VoidSymbol ] }; // ; :
+ key <AB02> { [ U0071, U0051, VoidSymbol, VoidSymbol ] }; // q Q
+ key <AB03> { [ U006A, U004A, VoidSymbol, VoidSymbol ] }; // j J
+ key <AB04> { [ U006B, U004B, VoidSymbol, VoidSymbol ] }; // k K
+ key <AB05> { [ U0078, U0058, U00D7, U00B7 ] }; // x X × ·
+ // B row; Lower row, right side
+ key <AB06> { [ U0062, U0042, U201D, U2019 ] }; // b B ” ’
+ key <AB07> { [ U006D, U004D, U00B5, U00BA ] }; // m M µ º
+ key <AB08> { [ U0077, U0057, VoidSymbol, VoidSymbol ] }; // w W
+ key <AB09> { [ U0076, U0056, U201C, U2018 ] }; // v V “ ‘
+ key <AB10> { [ U007A, U005A, U00AB, U00BB ] }; // z Z « »
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+// Dvorak Simplified (Baybayin) version
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ │ ◌᜔ │ │
+// ┃Tab ↹ ┃ │ ᜵ │ ᜶ │ ᜉ │ ᜌ │ │ ᜄ │ │ ᜍ │ ᜎ │ │ ◌᜔ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ ᜂ │ ᜁ │ ᜂ │ ᜁ │ │ │ │ ᜅ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ ᜀ │ ◌ᜓ │ ◌ᜒ │ ◌ᜓ │ ◌ᜒ │ ᜇ │ ᜑ │ ᜆ │ ᜈ │ ᜐ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ ᜃ │ │ ᜊ │ ᜋ │ ᜏ │ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+partial alphanumeric_keys
+xkb_symbols "dvorak-bay" {
+
+ name[Group1]= "Philippines - Dvorak (Baybayin)";
+
+// ISO grouping: |--------- Group1 ---------| |--------- Group2 ---------|
+// Level1 Level2 Level3 Level4
+// Base Shift AltGr AltGr+Shift
+
+ // E row; Numerals row, left side
+ key <TLDE> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE04> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // E row; Numerals row, right side
+ key <AE06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE07> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AE12> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // D row; QWERTY row, left side
+ key <AD01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD02> { [ U1735, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜵ (comma)
+ key <AD03> { [ U1736, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜶ (period)
+ key <AD04> { [ U1709, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜉ (Pa)
+ key <AD05> { [ U170C, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜌ (Ya)
+ // D row; QWERTY row, right side
+ key <AD06> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD07> { [ U1704, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜄ (Ga)
+ key <AD08> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD09> { [ U170D, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜍ (Ra)
+ key <AD10> { [ U170E, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜎ (La)
+ key <AD11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AD12> { [ U1714, U1714, VoidSymbol, VoidSymbol ] }; // ◌᜔ (virama) ◌᜔ (virama)
+ key <BKSL> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // C row; Home row, left side
+ key <AC01> { [ U1700, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜀ (A)
+ key <AC02> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC03> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ key <AC04> { [ U1713, U1702, VoidSymbol, VoidSymbol ] }; // ◌ᜓ (o/u) ᜂ (O/U)
+ key <AC05> { [ U1712, U1701, VoidSymbol, VoidSymbol ] }; // ◌ᜒ (e/i) ᜁ (E/I)
+ // C row; Home row, right side
+ key <AC06> { [ U1707, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜇ (Da)
+ key <AC07> { [ U1711, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜑ (Ha)
+ key <AC08> { [ U1706, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜆ (Ta)
+ key <AC09> { [ U1708, U1705, VoidSymbol, VoidSymbol ] }; // ᜈ (Na) ᜅ (Nga)
+ key <AC10> { [ U1710, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜐ (Sa)
+ key <AC11> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // B row; Lower row, left side
+ key <AB00> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB01> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB02> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB03> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB04> { [ U1703, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜃ (Ka)
+ key <AB05> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ // B row; Lower row, right side
+ key <AB06> { [ U170A, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜊ (Ba)
+ key <AB07> { [ U170B, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜋ (Ma)
+ key <AB08> { [ U170F, VoidSymbol, VoidSymbol, VoidSymbol ] }; // ᜏ (Wa)
+ key <AB09> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+ key <AB10> { [ VoidSymbol, VoidSymbol, VoidSymbol, VoidSymbol ] }; //
+
+ // A row
+ key <AA03> { [ U0020, U0020, U0020, U0020 ] }; // (space) (space) (space) (space)
+
+ include "level3(ralt_switch)"
+};
+
+
+//
+// ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┲━━━━━━━┓
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ ⌫ Bak ┃
+// │ │ │ │ │ │ │ │ │ │ │ │ │ ┃ Space ┃
+// ┢━━━━━┷━┱───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┺━┯━━━━━┩
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ │ │ │
+// ┃Tab ↹ ┃ │ │ │ │ │ │ │ │ │ │ │ │ │
+// ┣━━━━━━━┻┱────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┲━━━━┷━━━━━┪
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ Enter ┃
+// ┃Caps ⇬ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ⏎ ┃
+// ┣━━━━━━━┳┹────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┬┴────┲┻━━━━━━━━━━┫
+// ┃ ┃ │ │ │ │ │ │ │ │ │ │ ┃ ┃
+// ┃Shift ⇧┃ │ │ │ │ │ │ │ │ │ │ ┃Shift ⇧ ┃
+// ┣━━━━━━━╋━━━━━┷━┳━━━┷━━━┱─┴─────┴─────┴─────┴─────┴───┲━┷━━━━━╈━━━━━┷━┳━━━┻━━━┳━━━━━━━┫
+// ┃ ┃Win ┃ ┃ ␣ Space Space ␣ ┃ ┃Win ┃ ┃ ┃
+// ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃
+// ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛
+//
+
+
+
diff --git a/xorg-server/xkeyboard-config/symbols/us b/xorg-server/xkeyboard-config/symbols/us index e2c40a4e5..2d9523922 100644 --- a/xorg-server/xkeyboard-config/symbols/us +++ b/xorg-server/xkeyboard-config/symbols/us @@ -1147,3 +1147,48 @@ xkb_symbols "srp" { include "level3(ralt_switch)"
};
+
+//based on http://upload.wikimedia.org/wikipedia/commons/1/18/T-Mobile_G1_launch_event_2.jpg
+partial alphanumeric_keys
+xkb_symbols "htcdream" {
+ include "inet(htcdream)"
+ name[Group1]= "USA - htcdream";
+
+ //second row
+ key <AD01> { [ q, Q, Tab, Tab ] };
+ key <AD02> { [ w, W, grave, grave ] };
+ key <AD03> { [ e, E, underscore, underscore ] };
+ key <AD04> { [ r, R, sterling, sterling ] };
+ key <AD05> { [ t, T, EuroSign, EuroSign ] };
+ key <AD06> { [ y, Y, division, division ] };
+ key <AD07> { [ u, U, multiply, multiply ] };
+ key <AD08> { [ i, I, minus, minus ] };
+ key <AD09> { [ o, O, plus, plus ] };
+ key <AD10> { [ p, P, equal, equal ] };
+
+ //third row
+ key <AC01> { [ a, A, NoSymbol, NoSymbol ] };
+ key <AC02> { [ s, S, bar, bar ] };
+ key <AC03> { [ d ,D, backslash, backslash ] };
+ key <AC04> { [ f, F, braceleft, braceleft ] };
+ key <AC05> { [ g, G, braceright, braceright ] };
+ key <AC06> { [ h, H, colon, colon ] };
+ key <AC07> { [ j, J, semicolon, semicolon ] };
+ key <AC08> { [ k, K, quotedbl, quotedbl ] };
+ key <AC09> { [ l, L, apostrophe, apostrophe ] };
+
+ //forth row
+ key <AB01> { [ z, Z, NoSymbol, NoSymbol ] };
+ key <AB02> { [ x, X, NoSymbol, NoSymbol ] };
+ key <AB03> { [ c, C, NoSymbol, NoSymbol ] };
+ key <AB04> { [ v, V, bracketleft, bracketleft ] };
+ key <AB05> { [ b, B, bracketright, bracketright ] };
+ key <AB06> { [ n, N, less, less ] };
+ key <AB07> { [ m, M, greater, greater ] };
+ key <AB08> { [ comma, comma, question, question ] };
+
+ //fifth row
+ key <FK15> { [ at, at, asciitilde, asciitilde ] };
+
+ include "level3(alt_switch)"
+};
\ No newline at end of file |