arm: fix compile on bigendian host

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
ui/cocoa: Pass command key through to guest when VM has mousegrab

The guest might want to be able to use the command key for its won
purposes (as command if it is MacOS X, or for the Windows key if
it is a PC guest, for instance). In line with other UI frontends,
pass it through if the guest has mousegrab, and only use it for UI
menu accelerators if not grabbed.

Thanks to John Arbuckle for reporting this problem, helping
us work through what the best solution would be and providing
a patch which was the initial inspiration for this one.

Reported-by: John Arbuckle <programmingkidx@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1386543546-31919-2-git-send-email-peter.maydell@linaro.org
ui/cocoa: Correct typos in comments and variable names

Fix various non-user-visible typos in comments and variable names.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1386543546-31919-3-git-send-email-peter.maydell@linaro.org
ui/cocoa: Send warning message to stderr, not stdout

Bring a warning message into line with the others in this file by
sending it to stderr, not stdout.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1386543546-31919-4-git-send-email-peter.maydell@linaro.org
ui/cocoa: Add ".qcow2" to extension list for image load dialog

Add ".qcow2" to the list of file extensions which are accepted
by the initial disk image load dialog which is displayed if the
user runs QEMU without any command line arguments.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1386543546-31919-5-git-send-email-peter.maydell@linaro.org
ui/cocoa: Fix code for starting QEMU via image file load dialog

Fix a number of bugs in the code for starting QEMU via the image
file load dialog:
 * use the actual argv[0] rather than "qemu": this avoids failures to
   find BIOS image files caused by not looking in the correct directory
   relative to the executable path
 * allocate a large enough argv array to NULL terminate it
 * use g_strdup(X) rather than g_strdup_printf("%s", X) or
   g_strdup_printf(X)
 * disable the printing of the simulated command line argument
   (which is presumably intended for debug only)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1386543546-31919-6-git-send-email-peter.maydell@linaro.org
ui/cocoa: Redraw at correct size when switching surface

If the surface switch involved a resize, we were doing the redraw
at the old size rather than the new, because the update of
screen.width and screen.height was being done after the setFrame
method calls which triggered a redraw. Normally this isn't very
noticeable because typically after the guest triggers the window
resize it also draws something to it, which will in turn cause
us to redraw. However, the combination of a guest which never
draws to the display and a command line setting of a screen size
larger than the default can reveal odd effects.

Move most of the handling of resizes to the top of the method,
and guard it with a check that the surface size actually changed,
to avoid unnecessary operations (including some user visible ones
like "recenter the window on the screen") if the surface is the
same size as the old one.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1387853507-26298-2-git-send-email-peter.maydell@linaro.org
ui/cocoa: Draw black rectangle if we have no data yet

If our redraw method is called before we have any data from the guest,
then draw a black rectangle rather than leaving the window empty.
This mostly only matters when the guest machine has no framebuffer
device, but it is more in line with the behaviour of other QEMU UIs.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1387853507-26298-3-git-send-email-peter.maydell@linaro.org
ui/cocoa: Remove stray tabs

The ui/cocoa.m file has just three lines with hardcoded tabs; fix them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1387886052-27067-1-git-send-email-peter.maydell@linaro.org
MAINTAINERS: add myself as cocoa UI co-maintainer

Add myself to the maintainers list for the cocoa UI; status
remains "Odd Fixes".

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <andreas.faerber@web.de>
Message-id: 1387207075-10280-1-git-send-email-peter.maydell@linaro.org
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20140112' into staging

target-arm queue:
 * build fix for bigendian hosts

# gpg: Signature made Sun 12 Jan 2014 01:38:22 PM PST using RSA key ID 14360CDE
# gpg: Can't check signature: public key not found

* pmaydell/tags/pull-target-arm-20140112:
  arm: fix compile on bigendian host

Message-id: 1389562970-30944-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Merge remote-tracking branch 'pmaydell/tags/pull-cocoa-20140112' into staging

cocoa queue:
 * pass command key to guest when VM has mousegrab
 * add .qcow2 to extension list for image load dialog
 * fix bugs in code for starting QEMU via image load dialog
 * fix resize/redraw interaction
 * draw window black if guest hasn't sent anything to screen
 * minor style/typo fixes
 * add myself as cocoa co-maintainer

# gpg: Signature made Sun 12 Jan 2014 02:45:52 PM PST using RSA key ID 14360CDE
# gpg: Can't check signature: public key not found

* pmaydell/tags/pull-cocoa-20140112:
  MAINTAINERS: add myself as cocoa UI co-maintainer
  ui/cocoa: Remove stray tabs
  ui/cocoa: Draw black rectangle if we have no data yet
  ui/cocoa: Redraw at correct size when switching surface
  ui/cocoa: Fix code for starting QEMU via image file load dialog
  ui/cocoa: Add ".qcow2" to extension list for image load dialog
  ui/cocoa: Send warning message to stderr, not stdout
  ui/cocoa: Correct typos in comments and variable names
  ui/cocoa: Pass command key through to guest when VM has mousegrab

Message-id: 1389567158-31066-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
Merge branch 'master' of git://git.qemu.org/qemu

Conflicts:
	ui/cocoa.m