提交 a4faa268 编写于 作者: P Peter Maydell

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20171016-pull-request' into staging

ui: use keycodemapdb for key code mappings, part one (v2)
ui: add qemu-keymap, update reverse keymaps (for qemu -k $map)
ui: fix for vte 0.50
ui: gtk texture fix

# gpg: Signature made Mon 16 Oct 2017 14:12:49 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20171016-pull-request:
  gtk: fix wrong id between texture and framebuffer
  ui/gtk: Fix deprecation of vte_terminal_copy_clipboard
  pc-bios/keymaps: keymaps update
  Add pc-bios/keymaps/Makefile
  tools: add qemu-keymap
  ui: don't export qemu_input_event_new_key
  ui: convert key events to QKeyCodes immediately
  ui: convert common input code to keycodemapdb
  ui: add keycodemapdb repository as a GIT submodule
  docker: don't rely on submodules existing in the main checkout
  build: automatically handle GIT submodule checkout for dtc
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
......@@ -14,6 +14,7 @@
/trace/generated-tcg-tracers.h
/ui/shader/texture-blit-frag.h
/ui/shader/texture-blit-vert.h
/ui/input-keymap-*.c
*-timestamp
/*-softmmu
/*-darwin-user
......@@ -113,6 +114,7 @@
/docs/version.texi
*.tps
.stgit-*
.git-submodule-status
cscope.*
tags
TAGS
......
......@@ -34,3 +34,6 @@
[submodule "roms/QemuMacDrivers"]
path = roms/QemuMacDrivers
url = git://git.qemu.org/QemuMacDrivers.git
[submodule "ui/keycodemapdb"]
path = ui/keycodemapdb
url = git://git.qemu.org/keycodemapdb.git
......@@ -1960,3 +1960,9 @@ M: Daniel P. Berrange <berrange@redhat.com>
S: Odd Fixes
F: docs/devel/build-system.txt
Build System
------------
GIT submodules
M: Daniel P. Berrange <berrange@redhat.com>
S: Odd Fixes
F: scripts/git-submodule.sh
......@@ -14,6 +14,27 @@ ifneq ($(wildcard config-host.mak),)
all:
include config-host.mak
git-submodule-update:
.PHONY: git-submodule-update
ifeq (0,$(MAKELEVEL))
git_module_status := $(shell \
cd '$(SRC_PATH)' && \
./scripts/git-submodule.sh status $(GIT_SUBMODULES); \
echo $$?; \
)
ifeq (1,$(git_module_status))
git-submodule-update:
$(call quiet-command, \
(cd $(SRC_PATH) && ./scripts/git-submodule.sh update $(GIT_SUBMODULES)), \
"GIT","$(GIT_SUBMODULES)")
endif
endif
.git-submodule-status: git-submodule-update config-host.mak
# Check that we're not trying to do an out-of-tree build from
# a tree that's been used for an in-tree build.
ifneq ($(realpath $(SRC_PATH)),$(realpath .))
......@@ -84,6 +105,7 @@ endif
GENERATED_FILES += $(TRACE_HEADERS)
GENERATED_FILES += $(TRACE_SOURCES)
GENERATED_FILES += $(BUILD_DIR)/trace-events-all
GENERATED_FILES += .git-submodule-status
trace-group-name = $(shell dirname $1 | sed -e 's/[^a-zA-Z0-9]/_/g')
......@@ -191,6 +213,31 @@ trace-dtrace-root.h: trace-dtrace-root.dtrace
trace-dtrace-root.o: trace-dtrace-root.dtrace
KEYCODEMAP_GEN = $(SRC_PATH)/ui/keycodemapdb/tools/keymap-gen
KEYCODEMAP_CSV = $(SRC_PATH)/ui/keycodemapdb/data/keymaps.csv
KEYCODEMAP_FILES = \
ui/input-keymap-linux-to-qcode.c \
ui/input-keymap-qcode-to-qnum.c \
ui/input-keymap-qnum-to-qcode.c \
$(NULL)
GENERATED_FILES += $(KEYCODEMAP_FILES)
ui/input-keymap-%.c: $(KEYCODEMAP_GEN) $(KEYCODEMAP_CSV) $(SRC_PATH)/ui/Makefile.objs
$(call quiet-command,\
src=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\1,") && \
dst=$$(echo $@ | sed -E -e "s,^ui/input-keymap-(.+)-to-(.+)\.c$$,\2,") && \
test -e $(KEYCODEMAP_GEN) && \
$(PYTHON) $(KEYCODEMAP_GEN) \
--lang glib2 \
--varname qemu_input_map_$${src}_to_$${dst} \
code-map $(KEYCODEMAP_CSV) $${src} $${dst} \
> $@ || rm -f $@, "GEN", "$@")
$(KEYCODEMAP_GEN): .git-submodule-status
$(KEYCODEMAP_CSV): .git-submodule-status
# Don't try to regenerate Makefile or configure
# We don't generate any of them
Makefile: ;
......@@ -330,7 +377,7 @@ DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_src
DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
subdir-dtc:dtc/libfdt dtc/tests
subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests
$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
dtc/%:
......@@ -371,6 +418,8 @@ qemu-io$(EXESUF): qemu-io.o $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
qemu-keymap$(EXESUF): qemu-keymap.o ui/input-keymap.o $(COMMON_LDADDS)
fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o $(COMMON_LDADDS)
fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
......@@ -385,6 +434,9 @@ qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
qemu-keymap$(EXESUF): LIBS += $(XKBCOMMON_LIBS)
qemu-keymap$(EXESUF): QEMU_CFLAGS += $(XKBCOMMON_CFLAGS)
gen-out-type = $(subst .,-,$(suffix $@))
qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
......
......@@ -265,6 +265,13 @@ libs_qga=""
debug_info="yes"
stack_protector=""
if test -e "$source_path/.git"
then
git_submodules="ui/keycodemapdb"
else
git_submodules=""
fi
# Don't accept a target_list environment variable.
unset target_list
......@@ -297,6 +304,7 @@ vde=""
vnc_sasl=""
vnc_jpeg=""
vnc_png=""
xkbcommon=""
xen=""
xen_ctrl_version=""
xen_pv_domain_build="no"
......@@ -2900,6 +2908,21 @@ EOF
fi
fi
##########################################
# xkbcommon probe
if test "$xkbcommon" != "no" ; then
if $pkg_config xkbcommon --exists; then
xkbcommon_cflags=$($pkg_config xkbcommon --cflags)
xkbcommon_libs=$($pkg_config xkbcommon --libs)
xkbcommon=yes
else
if test "$xkbcommon" = "yes" ; then
feature_not_found "xkbcommon" "Install libxkbcommon-devel"
fi
xkbcommon=no
fi
fi
##########################################
# fnmatch() probe, used for ACL routines
fnmatch="no"
......@@ -3590,27 +3613,30 @@ EOF
if compile_prog "" "$fdt_libs" ; then
# system DTC is good - use it
fdt=yes
elif test -d ${source_path}/dtc/libfdt ; then
# have submodule DTC - use it
fdt=yes
dtc_internal="yes"
mkdir -p dtc
if [ "$pwd_is_source_path" != "y" ] ; then
symlink "$source_path/dtc/Makefile" "dtc/Makefile"
symlink "$source_path/dtc/scripts" "dtc/scripts"
fi
fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
elif test "$fdt" = "yes" ; then
# have neither and want - prompt for system/submodule install
error_exit "DTC (libfdt) version >= 1.4.2 not present. Your options:" \
" (1) Preferred: Install the DTC (libfdt) devel package" \
" (2) Fetch the DTC submodule, using:" \
" git submodule update --init dtc"
else
# don't have and don't want
fdt_libs=
fdt=no
# have GIT checkout, so activate dtc submodule
if test -e "${source_path}/.git" ; then
git_submodules="${git_submodules} dtc"
fi
if test -d "${source_path}/dtc/libfdt" || test -e "${source_path}/.git" ; then
fdt=yes
dtc_internal="yes"
mkdir -p dtc
if [ "$pwd_is_source_path" != "y" ] ; then
symlink "$source_path/dtc/Makefile" "dtc/Makefile"
symlink "$source_path/dtc/scripts" "dtc/scripts"
fi
fdt_cflags="-I\$(SRC_PATH)/dtc/libfdt"
fdt_libs="-L\$(BUILD_DIR)/dtc/libfdt $fdt_libs"
elif test "$fdt" = "yes" ; then
# Not a git build & no libfdt found, prompt for system install
error_exit "DTC (libfdt) version >= 1.4.2 not present." \
"Please install the DTC (libfdt) devel package"
else
# don't have and don't want
fdt_libs=
fdt=no
fi
fi
fi
......@@ -5103,6 +5129,9 @@ if test "$softmmu" = yes ; then
mpath=no
fi
fi
if test "$xkbcommon" = "yes"; then
tools="qemu-keymap\$(EXESUF) $tools"
fi
# Probe for guest agent support/options
......@@ -5301,6 +5330,7 @@ echo "local state directory queried at runtime"
echo "Windows SDK $win_sdk"
fi
echo "Source path $source_path"
echo "GIT submodules $git_submodules"
echo "C compiler $cc"
echo "Host C compiler $host_cc"
echo "C++ compiler $cxx"
......@@ -5490,6 +5520,7 @@ echo "extra_cxxflags=$EXTRA_CXXFLAGS" >> $config_host_mak
echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak
echo "qemu_localedir=$qemu_localedir" >> $config_host_mak
echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
echo "ARCH=$ARCH" >> $config_host_mak
......@@ -5601,6 +5632,10 @@ fi
if test "$vnc_png" = "yes" ; then
echo "CONFIG_VNC_PNG=y" >> $config_host_mak
fi
if test "$xkbcommon" = "yes" ; then
echo "XKBCOMMON_CFLAGS=$xkbcommon_cflags" >> $config_host_mak
echo "XKBCOMMON_LIBS=$xkbcommon_libs" >> $config_host_mak
fi
if test "$fnmatch" = "yes" ; then
echo "CONFIG_FNMATCH=y" >> $config_host_mak
fi
......
......@@ -38,12 +38,11 @@ void qemu_input_event_send_impl(QemuConsole *src, InputEvent *evt);
void qemu_input_event_sync(void);
void qemu_input_event_sync_impl(void);
InputEvent *qemu_input_event_new_key(KeyValue *key, bool down);
void qemu_input_event_send_key(QemuConsole *src, KeyValue *key, bool down);
void qemu_input_event_send_key_number(QemuConsole *src, int num, bool down);
void qemu_input_event_send_key_qcode(QemuConsole *src, QKeyCode q, bool down);
void qemu_input_event_send_key_delay(uint32_t delay_ms);
int qemu_input_key_number_to_qcode(uint8_t nr);
int qemu_input_key_number_to_qcode(unsigned int nr);
int qemu_input_key_value_to_number(const KeyValue *value);
int qemu_input_key_value_to_qcode(const KeyValue *value);
int qemu_input_key_value_to_scancode(const KeyValue *value, bool down,
......@@ -69,4 +68,13 @@ void qemu_input_check_mode_change(void);
void qemu_add_mouse_mode_change_notifier(Notifier *notify);
void qemu_remove_mouse_mode_change_notifier(Notifier *notify);
extern const guint qemu_input_map_linux_to_qcode_len;
extern const guint16 qemu_input_map_linux_to_qcode[];
extern const guint qemu_input_map_qcode_to_qnum_len;
extern const guint16 qemu_input_map_qcode_to_qnum[];
extern const guint qemu_input_map_qnum_to_qcode_len;
extern const guint16 qemu_input_map_qnum_to_qcode[];
#endif /* INPUT_H */
KEYMAP := $(shell which qemu-keymap 2>/dev/null)
MAPS := ar bepo cz da de de-ch en-us en-gb es et fi fo \
fr fr-be fr-ca fr-ch \
hr hu is it ja lt lv mk nl no pl pt pt-br ru th tr
ar : MAP_FLAGS := -l ar
bepo : MAP_FLAGS := -l fr -v dvorak
cz : MAP_FLAGS := -l cz
da : MAP_FLAGS := -l dk
de : MAP_FLAGS := -l de
de-ch : MAP_FLAGS := -l ch
en-us : MAP_FLAGS := -l us
en-gb : MAP_FLAGS := -l gb
es : MAP_FLAGS := -l es
et : MAP_FLAGS := -l et
fi : MAP_FLAGS := -l fi
fo : MAP_FLAGS := -l fo
fr : MAP_FLAGS := -l fr
fr-be : MAP_FLAGS := -l be
fr-ca : MAP_FLAGS := -l ca -v fr
fr-ch : MAP_FLAGS := -l ch -v fr
hr : MAP_FLAGS := -l hr
hu : MAP_FLAGS := -l hu
is : MAP_FLAGS := -l is
it : MAP_FLAGS := -l it
ja : MAP_FLAGS := -l jp -m jp106
lt : MAP_FLAGS := -l lt
lv : MAP_FLAGS := -l lv
mk : MAP_FLAGS := -l mk
nl : MAP_FLAGS := -l nl
no : MAP_FLAGS := -l no
pl : MAP_FLAGS := -l pl
pt : MAP_FLAGS := -l pt
pt-br : MAP_FLAGS := -l br
ru : MAP_FLAGS := -l ru
th : MAP_FLAGS := -l th
tr : MAP_FLAGS := -l tr
ifeq ($(KEYMAP),)
all:
@echo "nothing to do (qemu-keymap not found)"
else
all: $(MAPS)
clean:
rm -f $(MAPS)
$(MAPS): $(KEYMAP) Makefile
$(KEYMAP) -f $@ $(MAP_FLAGS)
endif
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -18,15 +18,37 @@ if test $# -lt 1; then
error "Usage: $0 <output tarball>"
fi
tar_file="$1"
list_file="$1.list"
submodules=$(git submodule foreach --recursive --quiet 'echo $name')
tar_file=`realpath "$1"`
list_file="${tar_file}.list"
vroot_dir="${tar_file}.vroot"
if test $? -ne 0; then
error "git submodule command failed"
# We want a predictable list of submodules for builds, that is
# independent of what the developer currently has initialized
# in their checkout, because the build environment is completely
# different to the host OS.
submodules="dtc ui/keycodemapdb"
trap "status=$?; rm -rf \"$list_file\" \"$vroot_dir\"; exit \$status" 0 1 2 3 15
if git diff-index --quiet HEAD -- &>/dev/null
then
HEAD=HEAD
else
HEAD=`git stash create`
fi
git clone --shared . "$vroot_dir"
test $? -ne 0 && error "failed to clone into '$vroot_dir'"
cd "$vroot_dir"
test $? -ne 0 && error "failed to change into '$vroot_dir'"
git checkout $HEAD
test $? -ne 0 && error "failed to checkout $HEAD revision"
trap "status=$?; rm -f \"$list_file\"; exit \$status" 0 1 2 3 15
for sm in $submodules; do
git submodule update --init $sm
test $? -ne 0 && error "failed to init submodule $sm"
done
if test -n "$submodules"; then
{
......
#!/bin/sh
#
# This code is licensed under the GPL version 2 or later. See
# the COPYING file in the top-level directory.
set -e
substat=".git-submodule-status"
command=$1
shift
modules="$@"
if test -z "$modules"
then
test -e $substat || touch $substat
exit 0
fi
if ! test -e ".git"
then
echo "$0: unexpectedly called with submodules but no git checkout exists"
exit 1
fi
case "$command" in
status)
test -f "$substat" || exit 1
trap "rm -f ${substat}.tmp" EXIT
git submodule status $modules > "${substat}.tmp"
diff "${substat}" "${substat}.tmp" >/dev/null
exit $?
;;
update)
git submodule update --init $modules 1>/dev/null 2>&1
git submodule status $modules > "${substat}"
;;
esac
......@@ -178,8 +178,7 @@ void gd_gl_area_scanout_texture(DisplayChangeListener *dcl,
gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
if (vc->gfx.guest_fb.framebuffer == 0 ||
vc->gfx.w == 0 || vc->gfx.h == 0) {
if (backing_id == 0 || vc->gfx.w == 0 || vc->gfx.h == 0) {
gtk_gl_area_set_scanout_mode(vc, false);
return;
}
......
......@@ -1702,7 +1702,12 @@ static void gd_menu_copy(GtkMenuItem *item, void *opaque)
GtkDisplayState *s = opaque;
VirtualConsole *vc = gd_vc_find_current(s);
#if VTE_CHECK_VERSION(0, 50, 0)
vte_terminal_copy_clipboard_format(VTE_TERMINAL(vc->vte.terminal),
VTE_FORMAT_TEXT);
#else
vte_terminal_copy_clipboard(VTE_TERMINAL(vc->vte.terminal));
#endif
}
static void gd_vc_adjustment_changed(GtkAdjustment *adjustment, void *opaque)
......
此差异已折叠。
此差异已折叠。
keycodemapdb @ 56ce5650
Subproject commit 56ce5650d2c6ea216b4580df44b9a6dd3bc92c3b
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册