Make xkbcommon mandatory

We really need xkbcommon. There is so much stuff (including parsing of
keyboard shortcuts in conf.c) that depends on it. Therefore, we make it
mandatory now which allows us to use xkbcommon functions all over the
place.

Note that xkbcommon itself has no runtime dependencies so it is a small
self-contained library. The only reason I didn't do this ealier is that
xkbcommon has not seen a public release, yet. However, that should be done
in the near future.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-10-01 10:10:50 +02:00
parent e827ef4d6a
commit a3abdfc5bc
6 changed files with 15 additions and 3081 deletions

View File

@ -183,6 +183,7 @@ libuterm_la_SOURCES = \
src/uterm_monitor.c \ src/uterm_monitor.c \
src/uterm_vt.c \ src/uterm_vt.c \
src/uterm_input.c \ src/uterm_input.c \
src/uterm_input_uxkb.c \
src/uterm_input_plain.c \ src/uterm_input_plain.c \
external/imKStoUCS.h \ external/imKStoUCS.h \
external/imKStoUCS.c external/imKStoUCS.c
@ -230,11 +231,6 @@ libuterm_la_SOURCES += \
src/uterm_video_dumb.c src/uterm_video_dumb.c
endif endif
if BUILD_ENABLE_XKBCOMMON
libuterm_la_SOURCES += \
src/uterm_input_uxkb.c
endif
# #
# Shaders # Shaders
# As there is no need to modify shaders at run-time, we statically compile them # As there is no need to modify shaders at run-time, we statically compile them

25
README
View File

@ -8,6 +8,14 @@ console.
Kmscon requires the following software: Kmscon requires the following software:
- libudev: providing input, video, etc. device hotplug support - libudev: providing input, video, etc. device hotplug support
- libxkbcommon: providing internationalized keyboard handling
libxkbcommon has no public release, yet, but is available on freedesktop.org.
Building libxkbcommon from Git without root:
- You can fetch it from Git using: git clone git://anongit.freedesktop.org/xorg/lib/libxkbcommon
- You can then ``./autogen.sh && make`` in its directory
- You configure kmscon using:
PKG_CONFIG_PATH="libxkbcommon/" ./configure --enable-debug
assuming you cloned it into a subfolder of kmscon called libxkbcommon.
Everything else is optional: Everything else is optional:
@ -19,21 +27,6 @@ console.
- OpenGLES2: For accelerated video output via OpenGLESv2 the following must - OpenGLES2: For accelerated video output via OpenGLESv2 the following must
be installed: libdrm, libgbm, egl, glesv2 (i.e., mesa) be installed: libdrm, libgbm, egl, glesv2 (i.e., mesa)
By default a very limited built-in keyboard handling is used. To get other
keyboard layouts working, the following is required:
- libxkbcommon: keyboard handling (optional but strongly recommended)
Without libxkbcommon, basic US-ASCII input is provided.
libxkbcommon has no public release, yet, but is available on freedesktop.org.
Use "--disable-xkbcommon" if you have problems due to compile-errors.
Building libxkbcommon from Git without root:
- You can fetch it from Git using: git clone git://anongit.freedesktop.org/xorg/lib/libxkbcommon
- You can then ``./autogen.sh && make`` in its directory
- You configure kmscon using:
PKG_CONFIG_PATH="libxkbcommon/" ./configure --enable-debug --enable-xkbcommon
assuming you cloned it into a subfolder of kmscon.
For font handling the following is required: For font handling the following is required:
- 8x16: The 8x16 font is a static built-in font which does not require - 8x16: The 8x16 font is a static built-in font which does not require
external dependencies. external dependencies.
@ -71,8 +64,6 @@ console.
--enable-drm: This adds DRM video output support. [default: on] --enable-drm: This adds DRM video output support. [default: on]
--enable-gles2: This adds OpenGL hardware accelerated font rendering --enable-gles2: This adds OpenGL hardware accelerated font rendering
[default: on] [default: on]
--enable-xkbcommon: Use xkbcommon for internationalized keyboard handling.
[default: on]
--enable-f8x16: The 8x16 font is a static built-in fallback font --enable-f8x16: The 8x16 font is a static built-in fallback font
[default: on] [default: on]
--enable-freetype2: Uses freetype2 and fontconfig as font-backend. --enable-freetype2: Uses freetype2 and fontconfig as font-backend.

View File

@ -154,12 +154,6 @@ AC_ARG_ENABLE([gles2],
[provide uterm OpenGLES2 support])]) [provide uterm OpenGLES2 support])])
AC_MSG_RESULT([ok]) AC_MSG_RESULT([ok])
AC_MSG_CHECKING([whether to use xkbcommon keyboard backend])
AC_ARG_ENABLE([xkbcommon],
[AS_HELP_STRING([--disable-xkbcommon],
[disable xkbcommon keyboard backend])])
AC_MSG_RESULT([ok])
AC_MSG_CHECKING([whether to use static unifont backend]) AC_MSG_CHECKING([whether to use static unifont backend])
AC_ARG_ENABLE([unifont], AC_ARG_ENABLE([unifont],
[AS_HELP_STRING([--enable-unifont], [AS_HELP_STRING([--enable-unifont],
@ -291,7 +285,6 @@ if test x$enable_wlterm = xyes ; then
enable_eloop=yes enable_eloop=yes
enable_tsm=yes enable_tsm=yes
enable_wayland=yes enable_wayland=yes
enable_xkbcommon=yes
fi fi
AM_CONDITIONAL([BUILD_ENABLE_WLTERM], AM_CONDITIONAL([BUILD_ENABLE_WLTERM],
@ -498,29 +491,18 @@ fi
# #
# xkbcommon keyboard backend # xkbcommon keyboard backend
# This checks for the xkbcommon library for keyboard handling in uterm. If it is # This checks for the xkbcommon library for keyboard handling in uterm. We
# not available, we use a dumb-keyboard backend as fall-back. # require this library as there is no other way to handle keyboard input
# properly.
# #
xkbcommon_enabled=no xkbcommon_enabled=no
if test ! x$enable_xkbcommon = xno ; then if test ! x$have_xkbcommon = xno ; then
if test x$have_xkbcommon = xyes ; then
xkbcommon_enabled=yes xkbcommon_enabled=yes
elif test x$enable_xkbcommon = xyes ; then
AC_ERROR([xkbcommon not found for keyboard backend])
fi
fi
if test x$xkbcommon_enabled = xyes ; then
AC_DEFINE([BUILD_ENABLE_XKBCOMMON], [1],
[Use xkbcommon as input keyboard handling backend])
else else
XKBCOMMON_CFLAGS="" AC_ERROR([xkbcommon not found for keyboard backend])
XKBCOMMON_LIBS=""
fi fi
AM_CONDITIONAL([BUILD_ENABLE_XKBCOMMON], [test x$xkbcommon_enabled = xyes])
# #
# Font backends # Font backends
# This checks for the unifont, 8x16, freetype2 and pango font backends and # This checks for the unifont, 8x16, freetype2 and pango font backends and

File diff suppressed because it is too large Load Diff

View File

@ -499,9 +499,5 @@ int uterm_input_string_to_keysym(struct uterm_input *input, const char *n,
if (input) if (input)
return kbd_desc_string_to_keysym(input->desc, n, out); return kbd_desc_string_to_keysym(input->desc, n, out);
#ifdef BUILD_ENABLE_XKBCOMMON
return uxkb_string_to_keysym(n, out); return uxkb_string_to_keysym(n, out);
#endif
return plain_string_to_keysym(n, out);
} }

View File

@ -71,8 +71,6 @@ extern const struct kbd_dev_ops plain_dev_ops;
extern int plain_string_to_keysym(const char *n, uint32_t *out); extern int plain_string_to_keysym(const char *n, uint32_t *out);
#ifdef BUILD_ENABLE_XKBCOMMON
struct uxkb_desc { struct uxkb_desc {
struct xkb_context *ctx; struct xkb_context *ctx;
struct xkb_keymap *keymap; struct xkb_keymap *keymap;
@ -88,22 +86,6 @@ extern const struct kbd_dev_ops uxkb_dev_ops;
extern int uxkb_string_to_keysym(const char *n, uint32_t *out); extern int uxkb_string_to_keysym(const char *n, uint32_t *out);
#else /* !BUILD_ENABLE_XKBCOMMON */
struct uxkb_desc {
int unused;
};
struct uxkb_dev {
int unused;
};
static const bool uxkb_available = false;
static const struct kbd_desc_ops uxkb_desc_ops;
static const struct kbd_dev_ops uxkb_dev_ops;
#endif /* BUILD_ENABLE_XKBCOMMON */
struct kbd_desc { struct kbd_desc {
unsigned long ref; unsigned long ref;
const struct kbd_desc_ops *ops; const struct kbd_desc_ops *ops;