summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-Jin Park <sj76.park@samsung.com>2017-10-20 16:37:50 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2023-12-22 08:40:34 +0900
commit81db8c9a7280c4af7d1d567ae8a058c2a8f310d0 (patch)
tree3102f515a505946a5eb3bd2f9ca2f5c25627de3d
parenta36937c45d46c2a166c9e41d1f76cb26b42aaf9c (diff)
downloadlibxkbcommon-81db8c9a7280c4af7d1d567ae8a058c2a8f310d0.tar.gz
libxkbcommon-81db8c9a7280c4af7d1d567ae8a058c2a8f310d0.tar.bz2
libxkbcommon-81db8c9a7280c4af7d1d567ae8a058c2a8f310d0.zip
Generate a tizen keymap header using a tizen key layout file - The tizen keylayout file is defined in specific profiles (except a common profile)
Change-Id: I96eef7cea11466129fd723a6ee6b35fb378c4dae
-rwxr-xr-xgen_tables.sh5
-rwxr-xr-xmake_tizen_keymap.sh62
-rw-r--r--meson.build7
-rw-r--r--meson_options.txt7
-rw-r--r--packaging/libxkbcommon.spec17
-rw-r--r--xkbcommon-uninstalled.pc.in8
-rw-r--r--xkbcommon-x11-uninstalled.pc.in10
-rw-r--r--xkbcommon-x11.pc.in12
-rw-r--r--xkbcommon.pc.in10
9 files changed, 137 insertions, 1 deletions
diff --git a/gen_tables.sh b/gen_tables.sh
new file mode 100755
index 0000000..2661cf9
--- /dev/null
+++ b/gen_tables.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+BASE_HEADER_FILE="./xkbcommon/xkbcommon-keysyms.h"
+
+LC_CTYPE=C python ./makekeys.py ${BASE_HEADER_FILE} > ./src/ks_tables.h
diff --git a/make_tizen_keymap.sh b/make_tizen_keymap.sh
new file mode 100755
index 0000000..8617112
--- /dev/null
+++ b/make_tizen_keymap.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+KEYMAP_FILE_PATH="/usr/share/X11/xkb/tizen_key_layout.txt"
+BASE_KEYSYM="0x10090000"
+TARGET_HEADER_FILE="./xkbcommon/tizen_keymap.h"
+TEMP_TEXT_FILE="./temp_file.txt"
+NEW_DEFINE_SYM_FILE="./new_define_sym.txt"
+KEYMAP_HEADER_FILE="./xkbcommon/xkbcommon-keysyms.h"
+cout=1
+BASE_KEYSYM_DEC=`python -c "print int('$BASE_KEYSYM', 16)"`
+
+if [ -e ${KEYMAP_FILE_PATH} ]
+then
+ echo "${TIZEN_PROFILE} have a key layout file: ${KEYMAP_FILE_PATH}"
+else
+ echo "${TIZEN_PROFILE} doesn't have a key layout file: ${KEYMAP_FILE_PATH}"
+ exit
+fi
+
+echo "Generate a tizen keymap header file"
+
+while read KEYNAME KEYCODE
+do
+ KEYSYM="XKB_KEY_${KEYNAME}"
+ grep -rn "${KEYSYM}" $KEYMAP_HEADER_FILE > $TEMP_TEXT_FILE
+ FINDED_DEFINE=`cat temp_file.txt | awk '{print $2}'`
+
+ BOOL_FOUND_SYM=false
+ for SEARCH_SYM in ${FINDED_DEFINE}
+ do
+ if [ "$SEARCH_SYM" = "$KEYSYM" ]
+ then
+ BOOL_FOUND_SYM=true
+ break
+ fi
+ done
+ if [ "$BOOL_FOUND_SYM" = false ]
+ then
+ echo "${KEYSYM}" >> $NEW_DEFINE_SYM_FILE
+ fi
+done < ${KEYMAP_FILE_PATH}
+
+sed -i '$s/#endif//g' ${KEYMAP_HEADER_FILE}
+echo "/**************************************************************" >> ${KEYMAP_HEADER_FILE}
+echo " * These keys defined for tizen platform." >> ${KEYMAP_HEADER_FILE}
+echo " * Key symbols are defined by keymap builder." >> ${KEYMAP_HEADER_FILE}
+echo " */" >> ${KEYMAP_HEADER_FILE}
+
+while read KEYNAME
+do
+ KEYSYM_DEC=$(echo $BASE_KEYSYM_DEC $cout | awk '{print $1 + $2}')
+ KEYSYM=$(printf "%x" $KEYSYM_DEC)
+ echo -en "#define ${KEYNAME}\t\t0x$KEYSYM\n" >> ${KEYMAP_HEADER_FILE}
+ cout=$(echo $cout 1 | awk '{print $1 + $2}')
+done < ${NEW_DEFINE_SYM_FILE}
+
+echo "" >> ${KEYMAP_HEADER_FILE}
+echo "" >> ${KEYMAP_HEADER_FILE}
+echo "#endif" >> ${KEYMAP_HEADER_FILE}
+
+rm $NEW_DEFINE_SYM_FILE
+rm $TEMP_TEXT_FILE
diff --git a/meson.build b/meson.build
index eaef4fb..7317317 100644
--- a/meson.build
+++ b/meson.build
@@ -245,6 +245,13 @@ elif cc.get_argument_syntax() == 'msvc'
libxkbcommon_link_deps += libxkbcommon_def
libxkbcommon_link_args += '/DEF:' + libxkbcommon_def.full_path()
endif
+
+## For tizen profile ##
+tizen_profile = get_option('tizen-profile')
+if tizen_profile == 'common'
+ libxkbcommon_link_args += '-D_F_TIZEN_COMMON_PROFILE_'
+endif
+
libxkbcommon = library(
'xkbcommon',
'include/xkbcommon/xkbcommon.h',
diff --git a/meson_options.txt b/meson_options.txt
index d52cc37..eb1314b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -90,3 +90,10 @@ option(
value: true,
description: 'Enable installing bash completion scripts',
)
+option(
+ 'tizen-profile',
+ type: 'string',
+ value: 'common',
+ description: 'Enable support for Wayland utility programs',
+)
+
diff --git a/packaging/libxkbcommon.spec b/packaging/libxkbcommon.spec
index e3f4d18..6fe3e0b 100644
--- a/packaging/libxkbcommon.spec
+++ b/packaging/libxkbcommon.spec
@@ -15,6 +15,11 @@ BuildRequires: bison
BuildRequires: flex
BuildRequires: libtool >= 2
BuildRequires: pkgconfig(xorg-macros) >= 1.8
+%if "%{?profile}" == "common"
+%else
+BuildRequires: python
+BuildRequires: e-tizen-data
+%endif
%description
Keyboard handling library using XKB data.
@@ -34,8 +39,18 @@ in %{name}.
%setup -qn %{name}
cp %{SOURCE1001} .
+# Generate tizen keymap header except common profile
+%if "%{?profile}" == "common"
+%else
+export TIZEN_PROFILE="%{?profile}"
+chmod a+x ./make_tizen_keymap.sh
+./make_tizen_keymap.sh
+chmod a+x ./gen_tables.sh
+./gen_tables.sh
+%endif
+
%build
-%autogen --disable-static --disable-x11
+%autogen --disable-static --disable-x11 --with-tizen-profile="%{?profile}"
%__make %{?_smp_mflags} V=1;
%install
diff --git a/xkbcommon-uninstalled.pc.in b/xkbcommon-uninstalled.pc.in
new file mode 100644
index 0000000..789c2fe
--- /dev/null
+++ b/xkbcommon-uninstalled.pc.in
@@ -0,0 +1,8 @@
+libdir=@abs_top_builddir@/.libs
+includedir=@abs_top_srcdir@
+
+Name: xkbcommon
+Description: XKB API common to servers and clients (uninstalled)
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir} @TIZEN_COMMON_CFLAGS@
+Libs: -L${libdir} -lxkbcommon
diff --git a/xkbcommon-x11-uninstalled.pc.in b/xkbcommon-x11-uninstalled.pc.in
new file mode 100644
index 0000000..0c64dfe
--- /dev/null
+++ b/xkbcommon-x11-uninstalled.pc.in
@@ -0,0 +1,10 @@
+libdir=@abs_top_builddir@/.libs
+includedir=@abs_top_srcdir@
+
+Name: xkbcommon-x11
+Description: XKB API common to servers and clients - X11 support (uninstalled)
+Version: @PACKAGE_VERSION@
+Requires: xkbcommon
+Requires.private: xcb xcb-xkb
+Cflags: -I${includedir} @TIZEN_COMMON_CFLAGS@
+Libs: -L${libdir} -lxkbcommon-x11
diff --git a/xkbcommon-x11.pc.in b/xkbcommon-x11.pc.in
new file mode 100644
index 0000000..922f35a
--- /dev/null
+++ b/xkbcommon-x11.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: xkbcommon-x11
+Description: XKB API common to servers and clients - X11 support
+Version: @PACKAGE_VERSION@
+Requires: xkbcommon
+Requires.private: xcb xcb-xkb
+Cflags: -I${includedir} @TIZEN_COMMON_CFLAGS@
+Libs: -L${libdir} -lxkbcommon-x11
diff --git a/xkbcommon.pc.in b/xkbcommon.pc.in
new file mode 100644
index 0000000..2e9a8bd
--- /dev/null
+++ b/xkbcommon.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: xkbcommon
+Description: XKB API common to servers and clients
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir} @TIZEN_COMMON_CFLAGS@
+Libs: -L${libdir} -lxkbcommon