summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2018-11-16 17:07:33 +0100
committerGatis Paeglis <gatis.paeglis@qt.io>2018-11-30 09:47:03 +0000
commitc3a963da1f9e7b1d37e63eedded61da4fbdaaf9a (patch)
treeabe3ac72e69cd6e85ec3a4cfb587405151076493 /src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c
parent1f1dc3fc4c2e5e2d94e86dfc7235a4b762da2e72 (diff)
src/3rdparty: remove xkbcommon
The only reason why we bundled this library ~6 years ago was because it was not available on distributions that we supported at the time, but library was a hard dependency for XCB plugin. See: 2122e731abdb619249df89642c0800640b2fa428 Later more and more projects started to depend on it (compose input context plugin, libinput, mir, wayland). The configuration had become too complex, because some projects used bundled and some used the version from the system. Having libxkbcommon in 3rdparty sources is not necessary anymore, after RHEL 6.6 was removed from the list of supported platforms for Qt 5.12. Ubuntu 16.04 - 0.5.0 Ubuntu 18.04 - 0.8.0 openSUSE 42.3 - 0.6.1 RHEL-7.4 - 0.7.1 This will also simplify further development, e.g. QTBUG-42181 Bumped the minimal required version 0.4.1 -> 0.5.0. The patch also contains a code marked with "TRANSITION HACK", which is temporary needed so we can update the dependent wayland module. [ChangeLog][Third-Party Code] Removed xkbcommon from bundled sources. This library is present on all supported platforms. The minimal required version now is 0.5.0. Task-number: QTBUG-65503 Change-Id: Iec50829bb6f8fbb19f3c4e4ad62e332beb837de5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c')
-rw-r--r--src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c139
1 files changed, 0 insertions, 139 deletions
diff --git a/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c b/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c
deleted file mode 100644
index 007e3f73e8..0000000000
--- a/src/3rdparty/xkbcommon/src/xkbcomp/xkbcomp.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright © 2009 Dan Nicholson
- * Copyright © 2012 Intel Corporation
- * Copyright © 2012 Ran Benita <ran234@gmail.com>
- *
- * 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.
- *
- * Authors: Dan Nicholson <dbn.lists@gmail.com>
- * Ran Benita <ran234@gmail.com>
- * Daniel Stone <daniel@fooishbar.org>
- */
-
-#include "xkbcomp-priv.h"
-#include "rules.h"
-
-static bool
-compile_keymap_file(struct xkb_keymap *keymap, XkbFile *file)
-{
- if (file->file_type != FILE_TYPE_KEYMAP) {
- log_err(keymap->ctx,
- "Cannot compile a %s file alone into a keymap\n",
- xkb_file_type_to_string(file->file_type));
- return false;
- }
-
- if (!CompileKeymap(file, keymap, MERGE_OVERRIDE)) {
- log_err(keymap->ctx,
- "Failed to compile keymap\n");
- return false;
- }
-
- return true;
-}
-
-static bool
-text_v1_keymap_new_from_names(struct xkb_keymap *keymap,
- const struct xkb_rule_names *rmlvo)
-{
- bool ok;
- struct xkb_component_names kccgst;
- XkbFile *file;
-
- log_dbg(keymap->ctx,
- "Compiling from RMLVO: rules '%s', model '%s', layout '%s', "
- "variant '%s', options '%s'\n",
- rmlvo->rules, rmlvo->model, rmlvo->layout, rmlvo->variant,
- rmlvo->options);
-
- ok = xkb_components_from_rules(keymap->ctx, rmlvo, &kccgst);
- if (!ok) {
- log_err(keymap->ctx,
- "Couldn't look up rules '%s', model '%s', layout '%s', "
- "variant '%s', options '%s'\n",
- rmlvo->rules, rmlvo->model, rmlvo->layout, rmlvo->variant,
- rmlvo->options);
- return false;
- }
-
- log_dbg(keymap->ctx,
- "Compiling from KcCGST: keycodes '%s', types '%s', "
- "compat '%s', symbols '%s'\n",
- kccgst.keycodes, kccgst.types, kccgst.compat, kccgst.symbols);
-
- file = XkbFileFromComponents(keymap->ctx, &kccgst);
-
- free(kccgst.keycodes);
- free(kccgst.types);
- free(kccgst.compat);
- free(kccgst.symbols);
-
- if (!file) {
- log_err(keymap->ctx,
- "Failed to generate parsed XKB file from components\n");
- return false;
- }
-
- ok = compile_keymap_file(keymap, file);
- FreeXkbFile(file);
- return ok;
-}
-
-static bool
-text_v1_keymap_new_from_string(struct xkb_keymap *keymap,
- const char *string, size_t len)
-{
- bool ok;
- XkbFile *xkb_file;
-
- xkb_file = XkbParseString(keymap->ctx, string, len, "(input string)", NULL);
- if (!xkb_file) {
- log_err(keymap->ctx, "Failed to parse input xkb string\n");
- return NULL;
- }
-
- ok = compile_keymap_file(keymap, xkb_file);
- FreeXkbFile(xkb_file);
- return ok;
-}
-
-static bool
-text_v1_keymap_new_from_file(struct xkb_keymap *keymap, FILE *file)
-{
- bool ok;
- XkbFile *xkb_file;
-
- xkb_file = XkbParseFile(keymap->ctx, file, "(unknown file)", NULL);
- if (!xkb_file) {
- log_err(keymap->ctx, "Failed to parse input xkb file\n");
- return false;
- }
-
- ok = compile_keymap_file(keymap, xkb_file);
- FreeXkbFile(xkb_file);
- return ok;
-}
-
-const struct xkb_keymap_format_ops text_v1_keymap_format_ops = {
- .keymap_new_from_names = text_v1_keymap_new_from_names,
- .keymap_new_from_string = text_v1_keymap_new_from_string,
- .keymap_new_from_file = text_v1_keymap_new_from_file,
- .keymap_get_as_string = text_v1_keymap_get_as_string,
-};