ifdef CONFIG_DARWIN
QEMU_CFLAGS += -framework Foundation -framework SystemConfiguration
QEMU_CFLAGS += -framework Cocoa -framework QTKit -framework CoreVideo
-QEMU_CFLAGS += -I/usr/X11/include -L/usr/X11/lib
+QEMU_CFLAGS += -framework AppKit
endif
ifndef CONFIG_DEBUG_EXEC
CFLAGS += -g -O2
endif
ifdef CONFIG_DARWIN
# FIXME: disabled codec on Mac now
-LIBS += -lavformat -lavcodec -lavutil -lm -lX11
+LIBS += -lavformat -lavcodec -lavutil -lm
endif
ifdef CONFIG_DEBUG_EXEC
obj-$(CONFIG_WIN32) += maru_camera_win32_pci.o
obj-$(CONFIG_DARWIN) += maru_camera_darwin_converter.o
obj-$(CONFIG_DARWIN) += maru_camera_darwin_pci.o
+obj-$(CONFIG_DARWIN) += emul_state_darwin.o
ifdef CONFIG_LINUX # libs for maru camera on linux host
LIBS += -lv4l2 -lv4lconvert
#include "emul_state.h"
#include "debug_ch.h"
-#if defined(CONFIG_WIN32)
-#include <windows.h>
-#else
+#if defined(CONFIG_LINUX)
#include <X11/XKBlib.h>
+#elif defined (CONFIG_WIN32)
+#include <windows.h>
#endif
MULTI_DEBUG_CHANNEL(qemu, emul_state);
int get_host_lock_key_state(int key)
{
/* support only capslock, numlock */
-#if defined(CONFIG_WIN32)
- if (key == HOST_CAPSLOCK_KEY) {
- return (GetKeyState(VK_CAPITAL) & 1) != 0;
- } else if (key == HOST_NUMLOCK_KEY) {
- return (GetKeyState(VK_NUMLOCK) & 1) != 0;
- }
-#else
+#if defined(CONFIG_LINUX)
unsigned state = 0;
Display *display = XOpenDisplay((char*)0);
if (display) {
} else if (key == HOST_NUMLOCK_KEY) {
return (state & 0x02) != 0;
}
+
+#elif defined(CONFIG_WIN32)
+ if (key == HOST_CAPSLOCK_KEY) {
+ return (GetKeyState(VK_CAPITAL) & 1) != 0;
+ } else if (key == HOST_NUMLOCK_KEY) {
+ return (GetKeyState(VK_NUMLOCK) & 1) != 0;
+ }
+#elif defined(CONFIG_DARWIN)
+ return get_host_lock_key_state_darwin(key);
#endif
return -1;
{
return _emul_state.qemu_num_lock;
}
-
-
short get_emul_rotation(void);
MultiTouchState *get_emul_multi_touch_state(void);
int get_host_lock_key_state(int key);
+int get_host_lock_key_state_darwin(int key);
int get_emul_caps_lock_state(void);
int get_emul_num_lock_state(void);
--- /dev/null
+/*
+ * Emulator
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Kitae Kim <kt920.kim@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * MunKyu Im <munkyu.im@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#import <Cocoa/Cocoa.h>
+#import <AppKit/NSEvent.h>
+
+#include "emul_state.h"
+
+/* retrieves the status of the host lock key */
+int get_host_lock_key_state_darwin(int key)
+{
+ /* support only capslock */
+ if (key == HOST_CAPSLOCK_KEY) {
+ return ((NSAlphaShiftKeyMask & [NSEvent modifierFlags]) ? 1 : 0);
+ } else if (key == HOST_NUMLOCK_KEY) {
+ return 0;
+ }
+
+ return -1;
+}