diff options
author | Evgeny Voevodin <e.voevodin@samsung.com> | 2012-07-27 10:23:49 +0400 |
---|---|---|
committer | Evgeny Voevodin <e.voevodin@samsung.com> | 2012-07-27 11:46:01 +0400 |
commit | 3a18528e2651a7d2af8abe0872cc328bedccc02d (patch) | |
tree | de850aed6f360cb612cf0dac0c11465ba382da29 | |
parent | 63a90916f25dde0bcc3b33a0a9764bfe4fc52f47 (diff) | |
download | qemu-3a18528e2651a7d2af8abe0872cc328bedccc02d.tar.gz qemu-3a18528e2651a7d2af8abe0872cc328bedccc02d.tar.bz2 qemu-3a18528e2651a7d2af8abe0872cc328bedccc02d.zip |
Merge remote-tracking branch 'score/develop' into tizen-arm-v1.1.0-develop
Conflicts:
configure
fpu/softfloat.h
hw/virtio-pci.c
tizen/emulator_configure.sh
tizen/src/Makefile
tizen/src/Makefile.tizen
tizen/src/emulator.c
tizen/src/maru_sdl.c
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/maruskin_operation.c
vl.c
146 files changed, 3522 insertions, 2396 deletions
diff --git a/.gitignore b/.gitignore index 5188b1cfe4..fd3e5fd8e6 100644 --- a/.gitignore +++ b/.gitignore @@ -96,4 +96,7 @@ tizen/src/skin/client/bin tizen/src/skin/client/build tizen/src/skin/client/emulator-skin.jar tizen/src/skin/client/lib +tizen/src/skin/client/native_src/*.so +tizen/src/skin/client/native_src/*.dynlib + diff --git a/block/raw-win32.c b/block/raw-win32.c index 3fa580c28d..03e9b76f43 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -85,6 +85,7 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags) s->type = FTYPE_FILE; +#ifndef CONFIG_MARU if (flags & BDRV_O_RDWR) { access_flags = GENERIC_READ | GENERIC_WRITE; } else { @@ -96,25 +97,55 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags) overlapped |= FILE_FLAG_NO_BUFFERING; if (!(flags & BDRV_O_CACHE_WB)) overlapped |= FILE_FLAG_WRITE_THROUGH; -#ifndef CONFIG_MARU s->hfile = CreateFile(filename, access_flags, FILE_SHARE_READ, NULL, OPEN_EXISTING, overlapped, NULL); -#else - s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename), - access_flags, - FILE_SHARE_READ, NULL, - OPEN_EXISTING, overlapped, NULL); -#endif - if (s->hfile == INVALID_HANDLE_VALUE) { + if (s->hfile == INVALID_HANDLE_VALUE) { int err = GetLastError(); if (err == ERROR_ACCESS_DENIED) return -EACCES; return -1; } - return 0; + +#else + /* + s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename), + access_flags, + FILE_SHARE_READ, NULL, + OPEN_EXISTING, overlapped, NULL); + */ + +#include <errno.h> + int open_flags = O_BINARY; + open_flags &= ~O_ACCMODE; + if (flags & BDRV_O_RDWR) { + open_flags |= O_RDWR; + } else { + open_flags |= O_RDONLY; + } + + /* Use O_DSYNC for write-through caching, no flags for write-back caching, + * and O_DIRECT for no caching. */ + /* + if ((flags & BDRV_O_NOCACHE)) { + open_flags |= O_DIRECT; + } + if (!(flags & BDRV_O_CACHE_WB)) { + open_flags |= O_DSYNC; + } + */ + + int ret = qemu_open(filename, open_flags, 0644); + if (ret < 0) { + error_report("raw_open failed(%d) \n", ret); + return -errno; + } + s->hfile = (HANDLE)_get_osfhandle(ret); + +#endif + return 0; } static int raw_read(BlockDriverState *bs, int64_t sector_num, @@ -382,7 +413,8 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags) } s->type = find_device_type(bs, filename); - if (flags & BDRV_O_RDWR) { +#ifndef CONFIG_MARU + if (flags & BDRV_O_RDWR) { access_flags = GENERIC_READ | GENERIC_WRITE; } else { access_flags = GENERIC_READ; @@ -394,25 +426,56 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags) overlapped |= FILE_FLAG_NO_BUFFERING; if (!(flags & BDRV_O_CACHE_WB)) overlapped |= FILE_FLAG_WRITE_THROUGH; -#ifndef CONFIG_MARU + s->hfile = CreateFile(filename, access_flags, FILE_SHARE_READ, NULL, create_flags, overlapped, NULL); -#else - s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename), - access_flags, - FILE_SHARE_READ, NULL, - create_flags, overlapped, NULL); -#endif - if (s->hfile == INVALID_HANDLE_VALUE) { + if (s->hfile == INVALID_HANDLE_VALUE) { int err = GetLastError(); if (err == ERROR_ACCESS_DENIED) return -EACCES; return -1; } - return 0; + +#else + /* + s->hfile = CreateFile(g_win32_locale_filename_from_utf8(filename), + access_flags, + FILE_SHARE_READ, NULL, + create_flags, overlapped, NULL); + */ +#include <errno.h> + + int open_flags = O_BINARY; + open_flags &= ~O_ACCMODE; + if (flags & BDRV_O_RDWR) { + open_flags |= O_RDWR; + } else { + open_flags |= O_RDONLY; + } + + /* Use O_DSYNC for write-through caching, no flags for write-back caching, + * and O_DIRECT for no caching. */ + /* + if ((flags & BDRV_O_NOCACHE)) { + open_flags |= O_DIRECT; + } + if (!(flags & BDRV_O_CACHE_WB)) { + open_flags |= O_DSYNC; + } + */ + + int ret = qemu_open(filename, open_flags, 0644); + if (ret < 0) { + error_report("raw_open failed(%d) \n", ret); + return -errno; + } + s->hfile = (HANDLE)_get_osfhandle(ret); + +#endif + return 0; } static int hdev_has_zero_init(BlockDriverState *bs) @@ -435,7 +435,7 @@ Darwin) else QEMU_CFLAGS="-mdynamic-no-pic $QEMU_CFLAGS" fi - cocoa="yes" + cocoa="no" audio_drv_list="coreaudio" audio_possible_drivers="coreaudio sdl fmod" LDFLAGS="-framework CoreFoundation -framework IOKit $LDFLAGS" diff --git a/fpu/softfloat.h b/fpu/softfloat.h index feec3a180e..1e4a0572e2 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -57,6 +57,9 @@ these four paragraphs for those parts of this code that are retained. typedef uint8_t flag; typedef uint8_t uint8; typedef int8_t int8; +#if !(defined(__APPLE__) && defined(_UINT16)) +#define _UINT16 +#endif typedef unsigned int uint32; typedef signed int int32; typedef uint64_t uint64; diff --git a/hw/9pfs/virtio-9p-handle.c b/hw/9pfs/virtio-9p-handle.c index e403a84462..513ea5dbf0 100644 --- a/hw/9pfs/virtio-9p-handle.c +++ b/hw/9pfs/virtio-9p-handle.c @@ -54,6 +54,16 @@ struct handle_data { int handle_bytes; }; +#ifndef AT_REMOVEDIR +#define AT_REMOVEDIR 0x200 +#endif +#ifndef AT_EMPTY_PATH +#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */ +#endif +#ifndef O_PATH +#define O_PATH 010000000 +#endif + static inline int name_to_handle(int dirfd, const char *name, struct file_handle *fh, int *mnt_id, int flags) { diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index 19c0b078fd..e1605a17a7 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -15,6 +15,7 @@ * GNU GPL, version 2 or (at your option) any later version. */ + #include <inttypes.h> #include "virtio.h" @@ -811,6 +812,7 @@ static int virtio_balloon_exit_pci(PCIDevice *pci_dev) } #ifdef CONFIG_VIRTIO_GL +#if defined(CONFIG_MARU) && (!defined(CONFIG_DARWIN)) static int virtio_gl_init_pci(PCIDevice *pci_dev) { VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); @@ -824,6 +826,7 @@ static int virtio_gl_init_pci(PCIDevice *pci_dev) return 0; } #endif +#endif static Property virtio_blk_properties[] = { DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), @@ -1007,7 +1010,7 @@ static TypeInfo virtio_scsi_info = { .class_init = virtio_scsi_class_init, }; - +#if defined(CONFIG_MARU) && (!defined(CONFIG_DARWIN)) #ifdef CONFIG_VIRTIO_GL static void virtio_gl_class_init(ObjectClass *klass, void *data) { @@ -1030,6 +1033,7 @@ static TypeInfo virtio_gl_info = { .class_init = virtio_gl_class_init, }; #endif +#endif static void virtio_pci_register_types(void) { diff --git a/package/build.macos-64 b/package/build.macos-64 new file mode 100755 index 0000000000..40856e0334 --- /dev/null +++ b/package/build.macos-64 @@ -0,0 +1,52 @@ +#!/bin/sh -xe +# clean +clean() +{ + prepare + + cd $SRCDIR/tizen/ + if test -e "Makefile" + then + ./emulator_configure.sh + make clean + fi + rm -rf $SRCDIR/*.zip + rm -rf $SRCDIR/*.tar.gz +} + +# check build environment +prepare() +{ + if [ "$JAVA_HOME" = "" ] + then + echo "Make sure that you have installed JDK" + echo "and then set installed JDK/bin path into JAVA_HOME" + echo "as a system environment variable on your PC!!" + exit 1 + fi +} + +# build +build() +{ + cd $SRCDIR/tizen/ +# ./emulator_configure.sh + make all_dibs +} + +# install +install() +{ + BIN_DIR=$SRCDIR/package/emulator-qemu-x86.package.${TARGET_OS}/data/tools + mkdir -p $BIN_DIR + + cd $SRCDIR/tizen + make install_dibs + mv emulator $BIN_DIR +} + +[ "$1" = "clean" ] && clean +[ "$1" = "build" ] && build +[ "$1" = "install" ] && install + +echo "success" diff --git a/package/build.ubuntu-32 b/package/build.ubuntu-32 index a47b51e85a..40856e0334 100755 --- a/package/build.ubuntu-32 +++ b/package/build.ubuntu-32 @@ -2,6 +2,8 @@ # clean clean() { + prepare + cd $SRCDIR/tizen/ if test -e "Makefile" then @@ -12,6 +14,18 @@ clean() rm -rf $SRCDIR/*.tar.gz } +# check build environment +prepare() +{ + if [ "$JAVA_HOME" = "" ] + then + echo "Make sure that you have installed JDK" + echo "and then set installed JDK/bin path into JAVA_HOME" + echo "as a system environment variable on your PC!!" + exit 1 + fi +} + # build build() { diff --git a/package/build.ubuntu-64 b/package/build.ubuntu-64 index a47b51e85a..40856e0334 100755 --- a/package/build.ubuntu-64 +++ b/package/build.ubuntu-64 @@ -2,6 +2,8 @@ # clean clean() { + prepare + cd $SRCDIR/tizen/ if test -e "Makefile" then @@ -12,6 +14,18 @@ clean() rm -rf $SRCDIR/*.tar.gz } +# check build environment +prepare() +{ + if [ "$JAVA_HOME" = "" ] + then + echo "Make sure that you have installed JDK" + echo "and then set installed JDK/bin path into JAVA_HOME" + echo "as a system environment variable on your PC!!" + exit 1 + fi +} + # build build() { diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index ee1c3b671c..4eea922722 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,29 +1,31 @@ +Version: 1.3.7 +Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com> +Source: emulator + Package: emulator-qemu-x86 -Version: 1.3.2 OS: ubuntu-32 Build-host-os: ubuntu-32 -Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com> -Build-dependency: emulator-lib [ ubuntu-32] +Build-dependency: emulator-lib [ ubuntu-32 ] Install-dependency: emulator-kernel-x86 [ ubuntu-32 ], vgabios [ ubuntu-32 ] -Source: emulator Description: Tizen Emulator Package: emulator-qemu-x86 -Version: 1.3.2 OS: ubuntu-64 Build-host-os: ubuntu-64 -Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com> -Build-dependency: emulator-lib [ ubuntu-64] +Build-dependency: emulator-lib [ ubuntu-64 ] Install-dependency: emulator-kernel-x86 [ ubuntu-64 ], vgabios [ ubuntu-64 ] -Source: emulator Description: Tizen Emulator Package: emulator-qemu-x86 -Version: 1.3.2 OS: windows-32 Build-host-os: windows-32 -Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com> Build-dependency: SDL-1.2.14 [ windows-32 ], apache-ant-1.8.3-bin [ windows-32 ], gtk-bundle_2.16.6 [ windows-32 ], directx-dev [ windows-32 ], emulator-lib [ windows-32 ] Install-dependency: emulator-kernel-x86 [ windows-32 ], vgabios [ windows-32 ] -Source: emulator +Description: Tizen Emulator + +Package: emulator-qemu-x86 +OS: macos-64 +Build-host-os: macos-64 +Build-dependency: emulator-lib [ macos-64 ] +Install-dependency: emulator-kernel-x86 [ macos-64 ], vgabios [ macos-64 ] Description: Tizen Emulator diff --git a/qemu-char.c b/qemu-char.c index 068663e136..a4c27292bb 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1516,9 +1516,22 @@ static int win_chr_init(CharDriverState *chr, const char *filename) GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); #else - s->hcom = CreateFile(g_win32_locale_filename_from_utf8(filename), + /* + s->hcom = CreateFile(g_win32_locale_filename_from_utf8(filename), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); + */ + int open_flags = O_BINARY; + open_flags |= O_RDWR; + // TODO : FILE_FLAG_OVERLAPPED + + int ret = qemu_open(filename, open_flags, 0644); + if (ret < 0) { + error_report("win_chr_init failed(%d) \n", ret); + return -errno; + } + s->hcom = (HANDLE)_get_osfhandle(ret); + #endif if (s->hcom == INVALID_HANDLE_VALUE) { fprintf(stderr, "Failed CreateFile (%lu)\n", GetLastError()); @@ -1807,8 +1820,21 @@ static CharDriverState *qemu_chr_open_win_file_out(QemuOpts *opts) fd_out = CreateFile(file_out, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); #else + /* fd_out = CreateFile(g_win32_locale_filename_from_utf8(file_out), GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + */ + int open_flags = O_BINARY; + open_flags |= O_RDWR; + open_flags |= O_CREAT; + + int ret = qemu_open(file_out, open_flags, 0644); + if (ret < 0) { + error_report("qemu_chr_open_win_file_out failed(%d) \n", ret); + return -errno; + } + fd_out = (HANDLE)_get_osfhandle(ret); + #endif if (fd_out == INVALID_HANDLE_VALUE) { @@ -92,6 +92,9 @@ typedef enum DisplayType DT_CURSES, DT_SDL, DT_NOGRAPHIC, +#ifdef CONFIG_MARU + DT_MARU, +#endif DT_NONE, } DisplayType; diff --git a/tizen/emulator_configure.sh b/tizen/emulator_configure.sh index f909e99a22..0861391781 100755 --- a/tizen/emulator_configure.sh +++ b/tizen/emulator_configure.sh @@ -3,10 +3,11 @@ targetos=`uname -s` targetarch=`echo | gcc -E -dM - | grep __x86_64` bindir="i386" - -if test "$targetarch" = "x86_64" +ffmpegarc="x86" +if test "$targetarch" != "" then bindir="x86_64" + ffmpegarc="x86_64" fi echo "##### checking for os... targetos $targetos" @@ -17,7 +18,7 @@ cd distrib/libav echo "" echo "##### FFMPEG configure for emulator" ./configure \ - --prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 + --prefix=./$bindir --arch=${ffmpegarc} --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 cd ../.. cd .. @@ -29,12 +30,10 @@ exec ./configure \ --disable-werror \ --audio-drv-list=alsa \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ --enable-opengles \ --enable-gl \ --disable-pie @@ -54,14 +53,33 @@ exec ./configure \ --target-list="i386-softmmu arm-softmmu" \ --audio-drv-list=winwave \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-hax \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ --enable-opengles \ --enable-gl $1 ;; +Darwin*) +cd distrib/libav +echo "" +echo "##### FFMPEG configure for emulator" +./configure \ +--prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 --cc=cc +cd ../.. + +cd .. +echo "" +echo "##### QEMU configure for emulator" +./configure \ + --target-list=i386-softmmu \ + --audio-drv-list=coreaudio \ + --enable-mixemu \ + --audio-card-list=ac97 \ + --enable-maru \ + --disable-vnc \ + --disable-sdl \ + --disable-gl +;; esac diff --git a/tizen/emulator_configure_arm.sh b/tizen/emulator_configure_arm.sh index d352e1eb78..f7c2b8cedd 100755 --- a/tizen/emulator_configure_arm.sh +++ b/tizen/emulator_configure_arm.sh @@ -3,10 +3,11 @@ targetos=`uname -s` targetarch=`echo | gcc -E -dM - | grep __x86_64` bindir="i386" - -if test "$targetarch" = "x86_64" +ffmpegarc="x86" +if test "$targetarch" != "" then bindir="x86_64" + ffmpegarc="x86_64" fi echo "##### checking for os... targetos $targetos" @@ -17,7 +18,7 @@ cd distrib/libav echo "" echo "##### FFMPEG configure for emulator" ./configure \ - --prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 + --prefix=./$bindir --arch=${ffmpegarc} --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 cd ../.. cd .. @@ -29,12 +30,10 @@ exec ./configure \ --disable-werror \ --audio-drv-list=alsa \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ --enable-opengles \ --enable-gl \ --disable-pie @@ -54,14 +53,37 @@ exec ./configure \ --target-list="arm-softmmu" \ --audio-drv-list=winwave \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-hax \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ --enable-opengles \ --enable-gl $1 ;; +Darwin*) +cd distrib/libav +echo "" +echo "##### FFMPEG configure for emulator" +./configure \ + --prefix=./$bindir --arch=${ffmpegarc} --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 +cd ../.. + +cd .. + +echo "" +echo "##### QEMU configure for emulator" +exec ./configure \ + --target-list="arm-softmmu" \ + --disable-werror \ + --audio-drv-list=alsa \ + --enable-mixemu \ + --audio-card-list=ac97 \ + --enable-ldst-optimization \ + --enable-maru \ + --disable-vnc \ + --enable-opengles \ + --enable-gl \ + --disable-pie +;; esac diff --git a/tizen/emulator_configure_arm_debug.sh b/tizen/emulator_configure_arm_debug.sh index 1196fae6a6..3351432cc0 100755 --- a/tizen/emulator_configure_arm_debug.sh +++ b/tizen/emulator_configure_arm_debug.sh @@ -3,10 +3,11 @@ targetos=`uname -s` targetarch=`echo | gcc -E -dM - | grep __x86_64` bindir="i386" - -if test "$targetarch" = "x86_64" +ffmpegarc="x86" +if test "$targetarch" != "" then bindir="x86_64" + ffmpegarc="x86_64" fi echo "##### checking for os... targetos $targetos" @@ -17,7 +18,7 @@ cd distrib/libav echo "" echo "##### FFMPEG configure for emulator" ./configure \ - --prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 + --prefix=./$bindir --arch=${ffmpegarc} --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 cd ../.. cd .. @@ -29,15 +30,14 @@ exec ./configure \ --disable-werror \ --audio-drv-list=alsa \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ --enable-opengles \ - --enable-efence \ - --enable-debug + --enable-gl \ + --enable-debug \ + --disable-pie ;; MINGW*) cd distrib/libav @@ -54,15 +54,39 @@ exec ./configure \ --target-list="arm-softmmu" \ --audio-drv-list=winwave \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-hax \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ + --enable-opengles \ + --enable-debug \ + --enable-gl $1 +;; +Darwin*) +cd distrib/libav +echo "" +echo "##### FFMPEG configure for emulator" +./configure \ + --prefix=./$bindir --arch=${ffmpegarc} --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 +cd ../.. + +cd .. + +echo "" +echo "##### QEMU configure for emulator" +exec ./configure \ + --target-list="arm-softmmu" \ + --disable-werror \ + --audio-drv-list=alsa \ + --enable-mixemu \ + --audio-card-list=ac97 \ + --enable-ldst-optimization \ + --enable-maru \ + --disable-vnc \ --enable-opengles \ - --enable-efence \ --enable-debug \ + --enable-gl \ + --disable-pie ;; esac diff --git a/tizen/emulator_configure_debug.sh b/tizen/emulator_configure_debug.sh index 7f420115c3..6a6d941095 100755 --- a/tizen/emulator_configure_debug.sh +++ b/tizen/emulator_configure_debug.sh @@ -3,10 +3,11 @@ targetos=`uname -s` targetarch=`echo | gcc -E -dM - | grep __x86_64` bindir="i386" - -if test "$targetarch" = "x86_64" +ffmpegarc="x86" +if test "$targetarch" != "" then bindir="x86_64" + ffmpegarc="x86_64" fi echo "##### checking for os... targetos $targetos" @@ -17,7 +18,7 @@ cd distrib/libav echo "" echo "##### FFMPEG configure for emulator" ./configure \ - --prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 + --prefix=./$bindir --arch=${ffmpegarc} --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 cd ../.. cd .. @@ -29,16 +30,14 @@ exec ./configure \ --disable-werror \ --audio-drv-list=alsa \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ --enable-opengles \ - --enable-efence \ + --enable-gl \ --enable-debug \ - --enable-gl + --disable-pie ;; MINGW*) cd distrib/libav @@ -55,16 +54,35 @@ exec ./configure \ --target-list="i386-softmmu arm-softmmu" \ --audio-drv-list=winwave \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-hax \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ --enable-opengles \ - --enable-efence \ --enable-debug \ --enable-gl $1 ;; +Darwin*) +cd distrib/libav +echo "" +echo "##### FFMPEG configure for emulator" +./configure \ +--prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 --cc=cc +cd ../.. + +cd .. +echo "" +echo "##### QEMU configure for emulator" +./configure \ + --target-list=i386-softmmu \ + --audio-drv-list=coreaudio \ + --enable-mixemu \ + --audio-card-list=ac97 \ + --enable-maru \ + --disable-vnc \ + --disable-sdl \ + --enable-debug \ + --disable-gl +;; esac diff --git a/tizen/emulator_configure_x86.sh b/tizen/emulator_configure_x86.sh index 78eea9fcbd..a3edf49312 100755 --- a/tizen/emulator_configure_x86.sh +++ b/tizen/emulator_configure_x86.sh @@ -1,41 +1,42 @@ #!/bin/sh # OS specific -#--target-list=i386-softmmu,arm-softmmu \ - targetos=`uname -s` targetarch=`echo | gcc -E -dM - | grep __x86_64` bindir="i386" - -if test "$targetarch" = "x86_64" +ffmpegarc="x86" +if test "$targetarch" != "" then bindir="x86_64" + ffmpegarc="x86_64" fi echo "##### checking for os... targetos $targetos" + case $targetos in Linux*) cd distrib/libav echo "" echo "##### FFMPEG configure for emulator" ./configure \ - --prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 + --prefix=./$bindir --arch=${ffmpegarc} --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 cd ../.. cd .. + echo "" echo "##### QEMU configure for emulator" -./configure \ - --target-list=i386-softmmu \ +exec ./configure \ + --target-list="i386-softmmu" \ --disable-werror \ --audio-drv-list=alsa \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ - --enable-gl + --disable-vnc \ + --enable-opengles \ + --enable-gl \ + --disable-pie ;; MINGW*) cd distrib/libav @@ -48,17 +49,37 @@ cd ../.. cd .. echo "" echo "##### QEMU configure for emulator" -./configure \ - --target-list=i386-softmmu \ +exec ./configure \ + --target-list="i386-softmmu" \ --audio-drv-list=winwave \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-hax \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ + --disable-vnc \ + --enable-opengles \ --enable-gl $1 ;; +Darwin*) +cd distrib/libav +echo "" +echo "##### FFMPEG configure for emulator" +./configure \ +--prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 --cc=cc +cd ../.. + +cd .. +echo "" +echo "##### QEMU configure for emulator" +./configure \ + --target-list=i386-softmmu \ + --audio-drv-list=coreaudio \ + --enable-mixemu \ + --audio-card-list=ac97 \ + --enable-maru \ + --disable-vnc \ + --disable-sdl \ + --disable-gl +;; esac diff --git a/tizen/emulator_configure_x86_debug.sh b/tizen/emulator_configure_x86_debug.sh index d8f5f9b05a..fbd17b2d3e 100755 --- a/tizen/emulator_configure_x86_debug.sh +++ b/tizen/emulator_configure_x86_debug.sh @@ -1,43 +1,43 @@ #!/bin/sh # OS specific -#--target-list=i386-softmmu,arm-softmmu \ - targetos=`uname -s` targetarch=`echo | gcc -E -dM - | grep __x86_64` bindir="i386" - -if test "$targetarch" = "x86_64" +ffmpegarc="x86" +if test "$targetarch" != "" then bindir="x86_64" + ffmpegarc="x86_64" fi echo "##### checking for os... targetos $targetos" + case $targetos in Linux*) cd distrib/libav echo "" echo "##### FFMPEG configure for emulator" ./configure \ - --prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 + --prefix=./$bindir --arch=${ffmpegarc} --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 cd ../.. cd .. + echo "" echo "##### QEMU configure for emulator" -./configure \ - --target-list=i386-softmmu \ +exec ./configure \ + --target-list="i386-softmmu" \ --disable-werror \ --audio-drv-list=alsa \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ - --enable-efence \ + --disable-vnc \ + --enable-opengles \ + --enable-gl \ --enable-debug \ - --enable-gl + --disable-pie ;; MINGW*) cd distrib/libav @@ -50,19 +50,39 @@ cd ../.. cd .. echo "" echo "##### QEMU configure for emulator" -./configure \ - --target-list=i386-softmmu \ +exec ./configure \ + --target-list="i386-softmmu" \ --audio-drv-list=winwave \ --enable-mixemu \ - --disable-vnc-tls \ --audio-card-list=ac97 \ --enable-ldst-optimization \ --enable-hax \ --enable-maru \ - --disable-vnc-jpeg \ - --disable-vnc-png \ - --enable-efence \ - --enable-debug \ + --disable-vnc \ + --enable-opengles \ + --enable-debug \ --enable-gl $1 ;; +Darwin*) +cd distrib/libav +echo "" +echo "##### FFMPEG configure for emulator" +./configure \ +--prefix=./$bindir --arch=x86 --enable-static --enable-pic --enable-optimizations --disable-doc --disable-gpl --disable-yasm --disable-postproc --disable-swscale --disable-ffmpeg --disable-ffprobe --disable-ffserver --disable-ffplay --disable-decoders --disable-encoders --disable-muxers --disable-demuxers --disable-parsers --disable-protocols --disable-network --disable-bsfs --disable-devices --disable-filters --enable-encoder=h263 --enable-encoder=h263p --enable-encoder=mpeg4 --enable-encoder=msmpeg4v2 --enable-encoder=msmpeg4v3 --enable-decoder=aac --enable-decoder=h263 --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=mp3adu --enable-decoder=mpeg4 --enable-decoder=mpegvideo --enable-decoder=msmpeg4v1 --enable-decoder=msmpeg4v2 --enable-decoder=msmpeg4v3 --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmv3 --enable-decoder=vc1 --cc=cc +cd ../.. + +cd .. +echo "" +echo "##### QEMU configure for emulator" +./configure \ + --target-list=i386-softmmu \ + --audio-drv-list=coreaudio \ + --enable-mixemu \ + --audio-card-list=ac97 \ + --enable-maru \ + --disable-vnc \ + --disable-sdl \ + --enable-debug \ + --disable-gl +;; esac diff --git a/tizen/src/Makefile b/tizen/src/Makefile index 75139ecab9..8ec1b8ef53 100755 --- a/tizen/src/Makefile +++ b/tizen/src/Makefile @@ -50,20 +50,21 @@ ffmpeg_install: ffmpeg ffmpeg_clean: cd ../distrib/libav/ && $(MAKE) clean ffmpeg_distclean: - cd ../distrib/libav/ && $(MAKE) clean + cd ../distrib/libav/ && $(MAKE) clean && rm -rf ${ARCH} -clean: qemu_clean ffmpeg_clean +clean: ffmpeg_clean qemu_clean ifdef CONFIG_WIN32 rm -f check-hax.exe else endif -distclean: qemu_distclean ffmpeg_distclean +distclean: ffmpeg_distclean qemu_distclean install: all mkdir -p $(EMUL_DIR)/bin mkdir -p $(EMUL_DIR)/etc mkdir -p $(EMUL_DIR)/data +ifndef CONFIG_DARWIN @for target in $(TARGET_DIRS); do \ case "$$target" in \ i386-softmmu) \ @@ -86,7 +87,30 @@ install: all ;; \ esac; \ done - +else + @for target in $(TARGET_DIRS); do \ + case "$$target" in \ + i386-softmmu) \ + mkdir -p $(EMUL_DIR)/data/bios ;\ + echo "Copying i386-softmmu/qemu-system-i386 to $(EMUL_DIR)/bin/emulator-x86" ;\ + cp ../../i386-softmmu/qemu-system-i386 $(EMUL_DIR)/bin/emulator-x86 ;\ + echo "Copying bioses to $(EMUL_DIR)/data/bios" ;\ + cp -pPR ../../pc-bios/bios.bin $(EMUL_DIR)/data/bios ;\ + cp -pPR ../../pc-bios/linuxboot.bin $(EMUL_DIR)/data/bios ;\ + cp -pPR ../../pc-bios/pxe-rtl8139.rom $(EMUL_DIR)/data/bios ;\ + cp -pPR ../../pc-bios/pxe-virtio.rom $(EMUL_DIR)/data/bios ;\ + ;; \ + arm-softmmu) \ + echo "Copying arm-softmmu/qemu-system-arm to $(EMUL_DIR)/bin/emulator-arm" ;\ + cp ../../arm-softmmu/qemu-system-arm $(EMUL_DIR)/bin/emulator-arm ;\ + if [ ! -z "$$CONFIG_OPENGLES" ] ; then \ + echo "Copying OpenGLES libraries to $(EMUL_DIR)/bin/" ;\ + cp -pP -t $(EMUL_DIR)/bin/ $(GLESLIBS_LIST) ;\ + fi ;\ + ;; \ + esac; \ + done +endif cp skin/client/emulator-skin.jar $(EMUL_DIR)/bin ifdef CONFIG_WIN32 @@ -94,9 +118,18 @@ ifdef CONFIG_WIN32 else endif + +ifndef CONFIG_DARWIN cp ../../qemu-img $(EMUL_DIR)/bin cp -dpr ../license $(EMUL_DIR) cp skin/client/lib/swt.jar $(EMUL_DIR)/bin/swt.jar + cp -dpr skin/client/skins $(EMUL_DIR) +else + cp ../../qemu-img $(EMUL_DIR)/bin + cp -pPR ../license $(EMUL_DIR) + cp skin/client/lib/swt.jar $(EMUL_DIR)/bin/swt.jar + cp -pPR skin/client/skins $(EMUL_DIR) +endif # for dibs system... all_dibs: qemu skin_client_dibs @@ -107,6 +140,7 @@ install_dibs: all_dibs mkdir -p $(EMUL_DIR)/etc mkdir -p $(EMUL_DIR)/data mkdir -p $(EMUL_DIR)/data/bios +ifndef CONFIG_DARWIN @for target in $(TARGET_DIRS); do \ case "$$target" in \ i386-softmmu) \ @@ -129,11 +163,46 @@ install_dibs: all_dibs ;; \ esac; \ done +else + @for target in $(TARGET_DIRS); do \ + case "$$target" in \ + i386-softmmu) \ + mkdir -p $(EMUL_DIR)/data/bios ;\ + echo "Copying i386-softmmu/qemu-system-i386 to $(EMUL_DIR)/bin/emulator-x86" ;\ + cp ../../i386-softmmu/qemu-system-i386 $(EMUL_DIR)/bin/emulator-x86 ;\ + echo "Copying bioses to $(EMUL_DIR)/data/bios" ;\ + cp -pPR ../../pc-bios/bios.bin $(EMUL_DIR)/data/bios ;\ + cp -pPR ../../pc-bios/linuxboot.bin $(EMUL_DIR)/data/bios ;\ + cp -pPR ../../pc-bios/pxe-rtl8139.rom $(EMUL_DIR)/data/bios ;\ + cp -pPR ../../pc-bios/pxe-virtio.rom $(EMUL_DIR)/data/bios ;\ + ;; \ + arm-softmmu) \ + echo "Copying arm-softmmu/qemu-system-arm to $(EMUL_DIR)/bin/emulator-arm" ;\ + cp ../../arm-softmmu/qemu-system-arm $(EMUL_DIR)/bin/emulator-arm ;\ + if [ ! -z "$$CONFIG_OPENGLES" ] ; then \ + echo "Copying OpenGLES libraries to $(EMUL_DIR)/bin/" ;\ + cp -pP -t $(EMUL_DIR)/bin/ $(GLESLIBS_LIST) ;\ + fi ;\ + ;; \ + esac; \ + done +endif + cp skin/client/emulator-skin.jar $(EMUL_DIR)/bin ifdef CONFIG_WIN32 cp check-hax.exe $(EMUL_DIR)/bin else endif + +ifndef CONFIG_DARWIN cp ../../qemu-img $(EMUL_DIR)/bin - cp -dpr ../license $(EMUL_DIR)
\ No newline at end of file + cp -dpr ../license $(EMUL_DIR) + cp skin/client/lib/swt.jar $(EMUL_DIR)/bin/swt.jar + cp -dpr skin/client/skins $(EMUL_DIR) +else + cp ../../qemu-img $(EMUL_DIR)/bin + cp -pPR ../license $(EMUL_DIR) + cp skin/client/lib/swt.jar $(EMUL_DIR)/bin/swt.jar + cp -pPR skin/client/skins $(EMUL_DIR) +endif diff --git a/tizen/src/Makefile.tizen b/tizen/src/Makefile.tizen index 94cd85f68d..bb137acac4 100755 --- a/tizen/src/Makefile.tizen +++ b/tizen/src/Makefile.tizen @@ -16,10 +16,15 @@ CFLAGS += -g -O0 endif ifdef CONFIG_WIN32 -LIBS += -lavformat -lavcodec -lavutil -lm -else +LIBS += -lavformat -lavcodec -lavutil -lm -lopengl32 -lglu32 -lgdi32 +endif +ifdef CONFIG_LINUX LIBS += -lavformat -lavcodec -lavutil -lm -lGL endif +ifdef CONFIG_DARWIN +# FIXME: disabled codec on Mac now +# LIBS += -lavformat -lavcodec -lavutil -lm +endif ifdef CONFIG_DEBUG_EXEC GL_CFLAGS := -Wall -g -O0 -fno-strict-aliasing @@ -27,6 +32,7 @@ else GL_CFLAGS := -Wall -g -O2 -fno-strict-aliasing endif +ifndef CONFIG_DARWIN ########################################################### ## Build openGL # i386 @@ -55,12 +61,16 @@ opengl_exec.o : opengl_exec.c server_stub.c opengl_func.h gl_beginend.h opengl_p endif #CONFIG_GL ########################################################### +endif #!CONFIG_DARWIN # maru loader obj-y += emulator.o emul_state.o option.o maru_err_table.o # maru display +obj-y += maru_display.o maru_shm.o +ifndef CONFIG_DARWIN obj-y += maru_sdl.o sdl_rotate.o maru_finger.o +endif # sdb obj-y += sdb.o @@ -82,10 +92,13 @@ obj-arm-y += maru_arm_vpci.o obj-arm-y += maru_arm_pmu.o obj-y += maru_brightness.o obj-y += maru_touchscreen.o +ifndef CONFIG_DARWIN obj-y += maru_codec.o obj-$(CONFIG_PCI) += maru_camera_common_pci.o obj-$(CONFIG_LINUX) += maru_camera_linux_pci.o obj-$(CONFIG_WIN32) += maru_camera_win32_pci.o +endif + ifdef CONFIG_LINUX # libs for maru camera on linux host LIBS += -lv4l2 -lv4lconvert endif @@ -100,7 +113,7 @@ obj-y += maruskin_client.o maruskin_server.o maruskin_operation.o maruskin_keyma # guest server obj-y += guest_server.o -ifndef CONFIG_WIN32 +ifndef CONFIG_DARWIN ########################################################### ## opengl library for i386 obj-$(CONFIG_GL) += virtio-gl.o diff --git a/tizen/src/emul_state.c b/tizen/src/emul_state.c index a455bdb03a..4896085837 100644 --- a/tizen/src/emul_state.c +++ b/tizen/src/emul_state.c @@ -30,6 +30,7 @@ */ +#include "maru_common.h" #include "emul_state.h" #include "debug_ch.h" @@ -161,7 +162,9 @@ MultiTouchState *get_emul_multi_touch_state(void) /* retrieves the status of the host lock key */ int get_host_lock_key_state(int key) { -#if defined( __linux__) + /* support only capslock, numlock */ + +#if defined(CONFIG_LINUX) unsigned state = 0; Display *display = XOpenDisplay((char*)0); if (display) { @@ -169,7 +172,6 @@ int get_host_lock_key_state(int key) } XCloseDisplay(display); - if (key == HOST_CAPSLOCK_KEY) { return (state & 0x01) != 0; } else if (key == HOST_NUMLOCK_KEY) { @@ -177,16 +179,18 @@ int get_host_lock_key_state(int key) } return -1; -#elif defined(_WIN32) - int nVirtKey = 0; +#elif defined(CONFIG_WIN32) if (key == HOST_CAPSLOCK_KEY) { - nVirtKey = VK_CAPITAL; + return (GetKeyState(VK_CAPITAL) & 1) != 0; } else if (key == HOST_NUMLOCK_KEY) { - nVirtKey = VK_NUMLOCK; + return (GetKeyState(VK_NUMLOCK) & 1) != 0; } - return (GetKeyState(nVirtKey) & 1) != 0; + return -1; + +#elif defined(CONFIG_DARWIN) + //TODO: #endif return 0; diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c index 5c690360c7..8616b1161d 100644 --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -1,579 +1,541 @@ -/* - * Emulator - * - * Copyright (C) 2011, 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * SeokYeon Hwang <syeon.hwang@samsung.com> - * HyunJun Son <hj79.son@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 - * - */ - - -#include <stdlib.h> -#include <SDL.h> -#include "maru_common.h" -#include "emulator.h" -#include "sdb.h" -#include "string.h" -#include "skin/maruskin_server.h" -#include "skin/maruskin_client.h" -#include "guest_server.h" -#include "debug_ch.h" -#include "option.h" -#include "emul_state.h" -#include "qemu_socket.h" -#include "build_info.h" -#include "maru_err_table.h" -#include <glib.h> -#include <glib/gstdio.h> - -#if defined( _WIN32) -#include <windows.h> -#elif defined(__linux__) -#include <linux/version.h> -#include <sys/utsname.h> -#include <sys/sysinfo.h> -#include <sys/ipc.h> -#include <sys/shm.h> - -#endif - -#include "mloop_event.h" - -MULTI_DEBUG_CHANNEL(qemu, main); - - -#define IMAGE_PATH_PREFIX "file=" -#define IMAGE_PATH_SUFFIX ",if=virtio" -#define SDB_PORT_PREFIX "sdb_port=" -#define LOGS_SUFFIX "/logs/" -#define LOGFILE "emulator.log" -#define MIDBUF 128 -int tizen_base_port = 0; - -char tizen_target_path[MAXLEN] = {0, }; -char logpath[MAXLEN] = { 0, }; - -static int skin_argc = 0; -static char** skin_argv = NULL; -static int qemu_argc = 0; -static char** qemu_argv = NULL; - -extern void maruskin_sdl_quit(void); - -void exit_emulator(void) -{ - cleanup_multi_touch_state(); - - mloop_ev_stop(); - shutdown_skin_server(); - shutdown_guest_server(); - - maruskin_sdl_quit(); -} - -static int check_port_bind_listen(u_int port) -{ - struct sockaddr_in addr; - int s, opt = 1; - int ret = -1; - socklen_t addrlen = sizeof(addr); - memset(&addr, 0, addrlen); - - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = INADDR_ANY; - addr.sin_port = htons(port); - - if (((s = socket(AF_INET,SOCK_STREAM,0)) < 0) || - (setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)) < 0) || - (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) || - (listen(s,1) < 0)) { - - /* fail */ - ret = -1; - ERR( "check port(%d) bind listen fail \n", port); - }else{ - /*fsucess*/ - ret = 1; - INFO( "check port(%d) bind listen ok \n", port); - } - -#ifdef _WIN32 - closesocket(s); -#else - close(s); -#endif - - return ret; -} - - -void check_shdmem(void) -{ -#ifndef _WIN32 - int shm_id; - void *shm_addr; - u_int port; - int val; - struct shmid_ds shm_info; - - for(port=26100;port < 26200; port += 10) - { - if ( -1 != ( shm_id = shmget( (key_t)port, 0, 0))) - { - if((void *)-1 == (shm_addr = shmat(shm_id, (void *)0, 0))) - { - ERR( "error occured at shmat()\n"); - break; - } - - val = shmctl(shm_id, IPC_STAT, &shm_info); - if(val != -1) - { - INFO( "count of process that use shared memory : %d\n", shm_info.shm_nattch); - if(shm_info.shm_nattch > 0 && strcmp(tizen_target_path, (char*)shm_addr) == 0) - { - if(check_port_bind_listen(port+1) > 0){ - shmdt(shm_addr); - continue; - } - shmdt(shm_addr); - maru_register_exit_msg(MARU_EXIT_UNKNOWN, (char*)"Can not execute this VM.\nThe same name is running now."); - exit(0); - } - else{ - shmdt(shm_addr); - } - } - } - } - -#else /* _WIN32*/ - u_int port; - char* base_port = NULL; - char* pBuf; - HANDLE hMapFile; - for(port=26100;port < 26200; port += 10) - { - base_port = g_strdup_printf("%d", port); - hMapFile = OpenFileMapping( - FILE_MAP_READ, - TRUE, - base_port); - if(hMapFile == NULL) - { - INFO("port %s is not used.\n", base_port); - continue; - } - else - { - pBuf = (char*)MapViewOfFile(hMapFile, - FILE_MAP_READ, - 0, - 0, - 50); - if (pBuf == NULL) - { - ERR("Could not map view of file (%d).\n", GetLastError()); - CloseHandle(hMapFile); - return -1; - } - - if(strcmp(pBuf, tizen_target_path) == 0) - { - if(check_port_bind_listen(port+1) > 0) - { - UnmapViewOfFile(pBuf); - CloseHandle(hMapFile); - continue; - } - - maru_register_exit_msg(MARU_EXIT_UNKNOWN, "Can not execute this VM.\nThe same name is running now."); - UnmapViewOfFile(pBuf); - CloseHandle(hMapFile); - free(base_port); - exit(0); - } - else - UnmapViewOfFile(pBuf); - } - - CloseHandle(hMapFile); - free(base_port); - } -#endif -} - -void make_shdmem(void) -{ -#ifndef _WIN32 - int shmid; - char *shared_memory; - shmid = shmget((key_t)tizen_base_port, MAXLEN, 0666|IPC_CREAT); - if (shmid == -1) - { - ERR("shmget failed\n"); - return; - } - shared_memory = shmat(shmid, (char*)0x00, 0); - if (shared_memory == (void *)-1) - { - ERR("shmat failed\n"); - return; - } - sprintf(shared_memory, "%s", tizen_target_path); - INFO( "shared memory key: %d value: %s\n", tizen_base_port, (char*)shared_memory); -#else - HANDLE hMapFile; - char* pBuf; - char* port_in_use; - char *shared_memory; - shared_memory = g_strdup_printf("%s", tizen_target_path); - port_in_use = g_strdup_printf("%d", tizen_base_port); - hMapFile = CreateFileMapping( - INVALID_HANDLE_VALUE, // use paging file - NULL, // default security - PAGE_READWRITE, // read/write access - 0, // maximum object size (high-order DWORD) - 50, // maximum object size (low-order DWORD) - port_in_use); // name of mapping object - if (hMapFile == NULL) - { - ERR("Could not create file mapping object (%d).\n", GetLastError()); - return; - } - pBuf = MapViewOfFile(hMapFile, // handle to map object - FILE_MAP_ALL_ACCESS, // read/write permission - 0, - 0, - 50); - - if (pBuf == NULL) - { - ERR("Could not map view of file (%d).\n", GetLastError()); - CloseHandle(hMapFile); - return; - } - - CopyMemory((PVOID)pBuf, shared_memory, strlen(shared_memory)); - free(port_in_use); - free(shared_memory); -#endif - return; -} - - - -static void construct_main_window(int skin_argc, char* skin_argv[], int qemu_argc, char* qemu_argv[] ) -{ - INFO("construct main window\n"); - - start_skin_server( skin_argc, skin_argv, qemu_argc, qemu_argv ); - - if (get_emul_skin_enable() == 1) { //this line is check for debugging, etc.. - if ( 0 > start_skin_client(skin_argc, skin_argv) ) { - maru_register_exit_msg(MARU_EXIT_SKIN_SERVER_FAILED, NULL); - exit( -1 ); - } - } - - set_emul_caps_lock_state(0); - set_emul_num_lock_state(0); -} - -static void parse_options(int argc, char* argv[], int* skin_argc, char*** skin_argv, int* qemu_argc, char*** qemu_argv) -{ - int i; - int j; - -// FIXME !!! -// TODO: - - for(i = 1; i < argc; ++i) - { - if(strncmp(argv[i], "--skin-args", 11) == 0) - { - *skin_argv = &(argv[i + 1]); - break; - } - } - for(j = i; j < argc; ++j) - { - if(strncmp(argv[j], "--qemu-args", 11) == 0) - { - *skin_argc = j - i - 1; - - *qemu_argc = argc - j - i + 1; - *qemu_argv = &(argv[j]); - - argv[j] = argv[0]; - } - } -} - -static void get_bin_dir( char* exec_argv ) { - - if ( !exec_argv ) { - return; - } - - char* data = strdup( exec_argv ); - if ( !data ) { - fprintf( stderr, "Fail to strdup for paring a binary directory.\n" ); - return; - } - - char* p = NULL; -#ifdef _WIN32 - p = strrchr( data, '\\' ); - if ( !p ) { - p = strrchr( data, '/' ); - } -#else - p = strrchr( data, '/' ); -#endif - if ( !p ) { - free( data ); - return; - } - - strncpy( bin_dir, data, strlen( data ) - strlen( p ) ); - - free( data ); - -} - -void set_image_and_log_path(char* qemu_argv) -{ - int i; - int j = 0; - int name_len = 0; - int prefix_len = 0; - int suffix_len = 0; - int max = 0; - char *path = malloc(MAXLEN); - name_len = strlen(qemu_argv); - prefix_len = strlen(IMAGE_PATH_PREFIX); - suffix_len = strlen(IMAGE_PATH_SUFFIX); - max = name_len - suffix_len; - for(i = prefix_len , j = 0; i < max; i++) - { - path[j++] = qemu_argv[i]; - } - path[j] = '\0'; - if(!g_path_is_absolute(path)) - strcpy(tizen_target_path, g_get_current_dir()); - else - strcpy(tizen_target_path, g_path_get_dirname(path)); - - strcpy(logpath, tizen_target_path); - strcat(logpath, LOGS_SUFFIX); -#ifdef _WIN32 - if(access(g_win32_locale_filename_from_utf8(logpath), R_OK) != 0) { - g_mkdir(g_win32_locale_filename_from_utf8(logpath), 0755); - } -#else - if(access(logpath, R_OK) != 0) { - g_mkdir(logpath, 0755); - } -#endif - strcat(logpath, LOGFILE); - set_log_path(logpath); -} - -void redir_output(void) -{ - FILE *fp; - - fp = freopen(logpath, "a+", stdout); - if(fp ==NULL) - fprintf(stderr, "log file open error\n"); - fp = freopen(logpath, "a+", stderr); - if(fp ==NULL) - fprintf(stderr, "log file open error\n"); - - setvbuf(stdout, NULL, _IOLBF, BUFSIZ); - setvbuf(stderr, NULL, _IOLBF, BUFSIZ); -} - -void extract_info(int qemu_argc, char** qemu_argv) -{ - int i; - - for(i = 0; i < qemu_argc; ++i) - { - if(strstr(qemu_argv[i], IMAGE_PATH_PREFIX) != NULL) { - set_image_and_log_path(qemu_argv[i]); - break; - } - } - - tizen_base_port = get_sdb_base_port(); -} - -static void system_info(void) -{ -#define DIV 1024 - -#ifdef __linux__ - char lscmd[MAXLEN] = "lspci >> "; -#endif - char timeinfo[64] = {0, }; - struct tm *tm_time; - struct timeval tval; - - INFO("* SDK Version : %s\n", build_version); - INFO("* Package %s\n", pkginfo_version); - INFO("* User name : %s\n", g_get_real_name()); -#ifdef _WIN32 - INFO("* Host name : %s\n", g_get_host_name()); -#endif - - /* timestamp */ - INFO("* Build date : %s\n", build_date); - gettimeofday(&tval, NULL); - tm_time = localtime(&(tval.tv_sec)); - strftime(timeinfo, sizeof(timeinfo), "%Y/%m/%d %H:%M:%S", tm_time); - INFO("* Current time : %s\n", timeinfo); - - /* Gets the version of the dynamically linked SDL library */ - INFO("* Host sdl version : (%d, %d, %d)\n", - SDL_Linked_Version()->major, SDL_Linked_Version()->minor, SDL_Linked_Version()->patch); - -#if defined( _WIN32) - /* Retrieves information about the current os */ - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - - if (GetVersionEx(&osvi)) { - INFO("* MajorVersion : %d, MinorVersion : %d, BuildNumber : %d, PlatformId : %d, CSDVersion : %s\n", - osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber, osvi.dwPlatformId, osvi.szCSDVersion); - } - - /* Retrieves information about the current system */ - SYSTEM_INFO sysi; - ZeroMemory(&sysi, sizeof(SYSTEM_INFO)); - - GetSystemInfo(&sysi); - INFO("* Processor type : %d, Number of processors : %d\n", sysi.dwProcessorType, sysi.dwNumberOfProcessors); - - MEMORYSTATUSEX memInfo; - memInfo.dwLength = sizeof(MEMORYSTATUSEX); - GlobalMemoryStatusEx(&memInfo); - INFO("* Total Ram : %llu kB, Free: %lld kB\n", - memInfo.ullTotalPhys / DIV, memInfo.ullAvailPhys / DIV); - -#elif defined(__linux__) - /* depends on building */ - INFO("* Qemu build machine linux kernel version : (%d, %d, %d)\n", - LINUX_VERSION_CODE >> 16, (LINUX_VERSION_CODE >> 8) & 0xff, LINUX_VERSION_CODE & 0xff); - - /* depends on launching */ - struct utsname host_uname_buf; - if (uname(&host_uname_buf) == 0) { - INFO("* Host machine uname : %s %s %s %s %s\n", host_uname_buf.sysname, host_uname_buf.nodename, - host_uname_buf.release, host_uname_buf.version, host_uname_buf.machine); - } - - struct sysinfo sys_info; - if (sysinfo(&sys_info) == 0) { - INFO("* Total Ram : %llu kB, Free: %llu kB\n", - sys_info.totalram * (unsigned long long)sys_info.mem_unit / DIV, - sys_info.freeram * (unsigned long long)sys_info.mem_unit / DIV); - } - - /* pci device description */ - INFO("* Pci devices :\n"); - strcat(lscmd, logpath); - int i = system(lscmd); - INFO("system function command : %s, system function returned value : %d\n", lscmd, i); -#endif - - INFO("\n"); -} - -void prepare_maru(void) -{ - INFO("Prepare maru specified feature\n"); - - sdb_setup(); - - INFO("call construct_main_window\n"); - - construct_main_window(skin_argc, skin_argv, qemu_argc, qemu_argv); - - int guest_server_port = tizen_base_port + SDB_UDP_SENSOR_INDEX; - start_guest_server( guest_server_port ); - - mloop_ev_init(); -} - -int qemu_main(int argc, char** argv, char** envp); - -int main(int argc, char* argv[]) -{ - parse_options(argc, argv, &skin_argc, &skin_argv, &qemu_argc, &qemu_argv); - get_bin_dir( qemu_argv[0] ); - socket_init(); - extract_info(qemu_argc, qemu_argv); - - INFO("Emulator start !!!\n"); - - atexit(maru_atexit); - - check_shdmem(); - make_shdmem(); - - system_info(); - - INFO("Prepare running...\n"); - redir_output(); // Redirect stdout, stderr after debug_ch is initialized... - - int i; - - fprintf(stdout, "qemu args : ==========================================\n"); - for(i = 0; i < qemu_argc; ++i) - { - fprintf(stdout, "%s ", qemu_argv[i]); - } - fprintf(stdout, "\n"); - fprintf(stdout, "======================================================\n"); - - fprintf(stdout, "skin args : ==========================================\n"); - for(i = 0; i < skin_argc; ++i) - { - fprintf(stdout, "%s ", skin_argv[i]); - } - fprintf(stdout, "\n"); - fprintf(stdout, "======================================================\n"); - - INFO("qemu main start!\n"); - qemu_main(qemu_argc, qemu_argv, NULL); - - exit_emulator(); - - return 0; -} - +/*
+ * Emulator
+ *
+ * Copyright (C) 2011, 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * HyunJun Son <hj79.son@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
+ *
+ */
+
+
+#include <stdlib.h>
+#include <SDL.h>
+#include "maru_common.h"
+#include "emulator.h"
+#include "sdb.h"
+#include "string.h"
+#include "skin/maruskin_server.h"
+#include "skin/maruskin_client.h"
+#include "guest_server.h"
+#include "debug_ch.h"
+#include "option.h"
+#include "emul_state.h"
+#include "qemu_socket.h"
+#include "build_info.h"
+#include "maru_err_table.h"
+#include <glib.h>
+#include <glib/gstdio.h>
+
+#if defined( _WIN32)
+#include <windows.h>
+#elif defined(__linux__)
+#include <linux/version.h>
+#include <sys/utsname.h>
+#include <sys/sysinfo.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+#endif
+
+#include "mloop_event.h"
+
+MULTI_DEBUG_CHANNEL(qemu, main);
+
+
+#define IMAGE_PATH_PREFIX "file="
+#define IMAGE_PATH_SUFFIX ",if=virtio"
+#define SDB_PORT_PREFIX "sdb_port="
+#define LOGS_SUFFIX "/logs/"
+#define LOGFILE "emulator.log"
+#define MIDBUF 128
+int tizen_base_port = 0;
+static pthread_mutex_t event_mutex = PTHREAD_MUTEX_INITIALIZER;
+char tizen_target_path[MAXLEN] = {0, };
+char logpath[MAXLEN] = { 0, };
+
+static int skin_argc = 0;
+static char** skin_argv = NULL;
+static int qemu_argc = 0;
+static char** qemu_argv = NULL;
+
+extern void maruskin_sdl_quit(void);
+
+void exit_emulator(void)
+{
+ cleanup_multi_touch_state();
+
+ mloop_ev_stop();
+ shutdown_skin_server();
+ shutdown_guest_server();
+
+ maruskin_sdl_quit();
+}
+
+void check_shdmem(void)
+{
+#ifndef CONFIG_WIN32
+ int shm_id;
+ void *shm_addr;
+ u_int port;
+ int val;
+ struct shmid_ds shm_info;
+
+ for(port=26100;port < 26200; port += 10)
+ {
+ if ( -1 != ( shm_id = shmget( (key_t)port, 0, 0)))
+ {
+ if((void *)-1 == (shm_addr = shmat(shm_id, (void *)0, 0)))
+ {
+ ERR( "error occured at shmat()\n");
+ break;
+ }
+
+ val = shmctl(shm_id, IPC_STAT, &shm_info);
+ if(val != -1)
+ {
+ INFO( "count of process that use shared memory : %d\n", shm_info.shm_nattch);
+ if(shm_info.shm_nattch > 0 && strcmp(tizen_target_path, (char*)shm_addr) == 0)
+ {
+ if(check_port_bind_listen(port+1) > 0){
+ shmdt(shm_addr);
+ continue;
+ }
+ shmdt(shm_addr);
+ maru_register_exit_msg(MARU_EXIT_UNKNOWN, (char*)"Can not execute this VM.\nThe same name is running now.");
+ exit(0);
+ }
+ else{
+ shmdt(shm_addr);
+ }
+ }
+ }
+ }
+
+#else /* _WIN32*/
+ u_int port;
+ char* base_port = NULL;
+ char* pBuf;
+ HANDLE hMapFile;
+ for(port=26100;port < 26200; port += 10)
+ {
+ base_port = g_strdup_printf("%d", port);
+ hMapFile = OpenFileMapping(
+ FILE_MAP_READ,
+ TRUE,
+ base_port);
+ if(hMapFile == NULL)
+ {
+ INFO("port %s is not used.\n", base_port);
+ continue;
+ }
+ else
+ {
+ pBuf = (char*)MapViewOfFile(hMapFile,
+ FILE_MAP_READ,
+ 0,
+ 0,
+ 50);
+ if (pBuf == NULL)
+ {
+ ERR("Could not map view of file (%d).\n", GetLastError());
+ CloseHandle(hMapFile);
+ }
+
+ if(strcmp(pBuf, tizen_target_path) == 0)
+ {
+ /*
+ if(check_port_bind_listen(port+1) > 0)
+ {
+ UnmapViewOfFile(pBuf);
+ CloseHandle(hMapFile);
+ continue;
+ }
+ */
+ maru_register_exit_msg(MARU_EXIT_UNKNOWN, "Can not execute this VM.\nThe same name is running now.");
+ UnmapViewOfFile(pBuf);
+ CloseHandle(hMapFile);
+ free(base_port);
+ exit(0);
+ }
+ else
+ UnmapViewOfFile(pBuf);
+ }
+
+ CloseHandle(hMapFile);
+ free(base_port);
+ }
+#endif
+}
+
+void make_shdmem(void)
+{
+#ifndef _WIN32
+ int shmid;
+ char *shared_memory;
+ shmid = shmget((key_t)tizen_base_port, MAXLEN, 0666|IPC_CREAT);
+ if (shmid == -1)
+ {
+ ERR("shmget failed\n");
+ return;
+ }
+ shared_memory = shmat(shmid, (char*)0x00, 0);
+ if (shared_memory == (void *)-1)
+ {
+ ERR("shmat failed\n");
+ return;
+ }
+ sprintf(shared_memory, "%s", tizen_target_path);
+ INFO( "shared memory key: %d value: %s\n", tizen_base_port, (char*)shared_memory);
+#else
+ HANDLE hMapFile;
+ char* pBuf;
+ char* port_in_use;
+ char *shared_memory;
+ shared_memory = g_strdup_printf("%s", tizen_target_path);
+ port_in_use = g_strdup_printf("%d", tizen_base_port);
+ hMapFile = CreateFileMapping(
+ INVALID_HANDLE_VALUE, // use paging file
+ NULL, // default security
+ PAGE_READWRITE, // read/write access
+ 0, // maximum object size (high-order DWORD)
+ 50, // maximum object size (low-order DWORD)
+ port_in_use); // name of mapping object
+ if (hMapFile == NULL)
+ {
+ ERR("Could not create file mapping object (%d).\n", GetLastError());
+ return;
+ }
+ pBuf = MapViewOfFile(hMapFile, // handle to map object
+ FILE_MAP_ALL_ACCESS, // read/write permission
+ 0,
+ 0,
+ 50);
+
+ if (pBuf == NULL)
+ {
+ ERR("Could not map view of file (%d).\n", GetLastError());
+ CloseHandle(hMapFile);
+ return;
+ }
+
+ CopyMemory((PVOID)pBuf, shared_memory, strlen(shared_memory));
+ free(port_in_use);
+ free(shared_memory);
+#endif
+ return;
+}
+
+
+
+static void construct_main_window(int skin_argc, char* skin_argv[], int qemu_argc, char* qemu_argv[] )
+{
+ INFO("construct main window\n");
+
+ start_skin_server( skin_argc, skin_argv, qemu_argc, qemu_argv );
+
+ if (get_emul_skin_enable() == 1) { //this line is check for debugging, etc..
+ if ( 0 > start_skin_client(skin_argc, skin_argv) ) {
+ maru_register_exit_msg(MARU_EXIT_SKIN_SERVER_FAILED, NULL);
+ exit( -1 );
+ }
+ }
+
+ set_emul_caps_lock_state(0);
+ set_emul_num_lock_state(0);
+}
+
+static void parse_options(int argc, char* argv[], int* skin_argc, char*** skin_argv, int* qemu_argc, char*** qemu_argv)
+{
+ int i;
+ int j;
+
+// FIXME !!!
+// TODO:
+
+ for(i = 1; i < argc; ++i)
+ {
+ if(strncmp(argv[i], "--skin-args", 11) == 0)
+ {
+ *skin_argv = &(argv[i + 1]);
+ break;
+ }
+ }
+ for(j = i; j < argc; ++j)
+ {
+ if(strncmp(argv[j], "--qemu-args", 11) == 0)
+ {
+ *skin_argc = j - i - 1;
+
+ *qemu_argc = argc - j - i + 1;
+ *qemu_argv = &(argv[j]);
+
+ argv[j] = argv[0];
+ }
+ }
+}
+
+static void get_bin_dir( char* exec_argv ) {
+
+ if ( !exec_argv ) {
+ return;
+ }
+
+ char* data = strdup( exec_argv );
+ if ( !data ) {
+ fprintf( stderr, "Fail to strdup for paring a binary directory.\n" );
+ return;
+ }
+
+ char* p = NULL;
+#ifdef _WIN32
+ p = strrchr( data, '\\' );
+ if ( !p ) {
+ p = strrchr( data, '/' );
+ }
+#else
+ p = strrchr( data, '/' );
+#endif
+ if ( !p ) {
+ free( data );
+ return;
+ }
+
+ strncpy( bin_dir, data, strlen( data ) - strlen( p ) );
+
+ free( data );
+
+}
+
+void set_image_and_log_path(char* qemu_argv)
+{
+ int i;
+ int j = 0;
+ int name_len = 0;
+ int prefix_len = 0;
+ int suffix_len = 0;
+ int max = 0;
+ char *path = malloc(MAXLEN);
+ name_len = strlen(qemu_argv);
+ prefix_len = strlen(IMAGE_PATH_PREFIX);
+ suffix_len = strlen(IMAGE_PATH_SUFFIX);
+ max = name_len - suffix_len;
+ for(i = prefix_len , j = 0; i < max; i++)
+ {
+ path[j++] = qemu_argv[i];
+ }
+ path[j] = '\0';
+ if(!g_path_is_absolute(path))
+ strcpy(tizen_target_path, g_get_current_dir());
+ else
+ strcpy(tizen_target_path, g_path_get_dirname(path));
+
+ strcpy(logpath, tizen_target_path);
+ strcat(logpath, LOGS_SUFFIX);
+#ifdef _WIN32
+ if(access(g_win32_locale_filename_from_utf8(logpath), R_OK) != 0) {
+ g_mkdir(g_win32_locale_filename_from_utf8(logpath), 0755);
+ }
+#else
+ if(access(logpath, R_OK) != 0) {
+ g_mkdir(logpath, 0755);
+ }
+#endif
+ strcat(logpath, LOGFILE);
+ set_log_path(logpath);
+}
+
+void redir_output(void)
+{
+ FILE *fp;
+
+ fp = freopen(logpath, "a+", stdout);
+ if(fp ==NULL)
+ fprintf(stderr, "log file open error\n");
+ fp = freopen(logpath, "a+", stderr);
+ if(fp ==NULL)
+ fprintf(stderr, "log file open error\n");
+
+ setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
+ setvbuf(stderr, NULL, _IOLBF, BUFSIZ);
+}
+
+void extract_info(int qemu_argc, char** qemu_argv)
+{
+ int i;
+
+ for(i = 0; i < qemu_argc; ++i)
+ {
+ if(strstr(qemu_argv[i], IMAGE_PATH_PREFIX) != NULL) {
+ set_image_and_log_path(qemu_argv[i]);
+ break;
+ }
+ }
+
+ tizen_base_port = get_sdb_base_port();
+}
+
+static void system_info(void)
+{
+#define DIV 1024
+
+ char timeinfo[64] = {0, };
+ struct tm *tm_time;
+ struct timeval tval;
+
+ INFO("* SDK Version : %s\n", build_version);
+ INFO("* Package %s\n", pkginfo_version);
+ INFO("* User name : %s\n", g_get_real_name());
+ INFO("* Host name : %s\n", g_get_host_name());
+
+ /* timestamp */
+ INFO("* Build date : %s\n", build_date);
+ gettimeofday(&tval, NULL);
+ tm_time = localtime(&(tval.tv_sec));
+ strftime(timeinfo, sizeof(timeinfo), "%Y/%m/%d %H:%M:%S", tm_time);
+ INFO("* Current time : %s\n", timeinfo);
+
+ /* Gets the version of the dynamically linked SDL library */
+ INFO("* Host sdl version : (%d, %d, %d)\n",
+ SDL_Linked_Version()->major, SDL_Linked_Version()->minor, SDL_Linked_Version()->patch);
+
+#if defined(CONFIG_WIN32)
+ /* Retrieves information about the current os */
+ OSVERSIONINFO osvi;
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+ if (GetVersionEx(&osvi)) {
+ INFO("* MajorVersion : %d, MinorVersion : %d, BuildNumber : %d, PlatformId : %d, CSDVersion : %s\n",
+ osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber, osvi.dwPlatformId, osvi.szCSDVersion);
+ }
+
+ /* Retrieves information about the current system */
+ SYSTEM_INFO sysi;
+ ZeroMemory(&sysi, sizeof(SYSTEM_INFO));
+
+ GetSystemInfo(&sysi);
+ INFO("* Processor type : %d, Number of processors : %d\n", sysi.dwProcessorType, sysi.dwNumberOfProcessors);
+
+ MEMORYSTATUSEX memInfo;
+ memInfo.dwLength = sizeof(MEMORYSTATUSEX);
+ GlobalMemoryStatusEx(&memInfo);
+ INFO("* Total Ram : %llu kB, Free: %lld kB\n",
+ memInfo.ullTotalPhys / DIV, memInfo.ullAvailPhys / DIV);
+
+#elif defined(CONFIG_LINUX)
+ /* depends on building */
+ INFO("* Qemu build machine linux kernel version : (%d, %d, %d)\n",
+ LINUX_VERSION_CODE >> 16, (LINUX_VERSION_CODE >> 8) & 0xff, LINUX_VERSION_CODE & 0xff);
+
+ /* depends on launching */
+ struct utsname host_uname_buf;
+ if (uname(&host_uname_buf) == 0) {
+ INFO("* Host machine uname : %s %s %s %s %s\n", host_uname_buf.sysname, host_uname_buf.nodename,
+ host_uname_buf.release, host_uname_buf.version, host_uname_buf.machine);
+ }
+
+ struct sysinfo sys_info;
+ if (sysinfo(&sys_info) == 0) {
+ INFO("* Total Ram : %llu kB, Free: %llu kB\n",
+ sys_info.totalram * (unsigned long long)sys_info.mem_unit / DIV,
+ sys_info.freeram * (unsigned long long)sys_info.mem_unit / DIV);
+ }
+
+ /* pci device description */
+ INFO("* Pci devices :\n");
+ char lscmd[MAXLEN] = "lspci >> ";
+ strcat(lscmd, logpath);
+ int i = system(lscmd);
+ INFO("system function command : %s, system function returned value : %d\n", lscmd, i);
+
+#elif defined(CONFIG_DARWIN)
+ //TODO:
+#endif
+
+ INFO("\n");
+}
+
+void prepare_maru(void)
+{
+ INFO("Prepare maru specified feature\n");
+
+ INFO("call construct_main_window\n");
+
+ construct_main_window(skin_argc, skin_argv, qemu_argc, qemu_argv);
+
+ int guest_server_port = tizen_base_port + SDB_UDP_SENSOR_INDEX;
+ start_guest_server( guest_server_port );
+
+ mloop_ev_init();
+}
+
+int qemu_main(int argc, char** argv, char** envp);
+
+int main(int argc, char* argv[])
+{
+ parse_options(argc, argv, &skin_argc, &skin_argv, &qemu_argc, &qemu_argv);
+ get_bin_dir( qemu_argv[0] );
+ socket_init();
+ extract_info(qemu_argc, qemu_argv);
+
+ INFO("Emulator start !!!\n");
+
+ atexit(maru_atexit);
+
+ check_shdmem();
+ make_shdmem();
+ sdb_setup();
+
+ system_info();
+
+ INFO("Prepare running...\n");
+ redir_output(); // Redirect stdout, stderr after debug_ch is initialized...
+
+ int i;
+
+ fprintf(stdout, "qemu args : ==========================================\n");
+ for(i = 0; i < qemu_argc; ++i)
+ {
+ fprintf(stdout, "%s ", qemu_argv[i]);
+ }
+ fprintf(stdout, "\n");
+ fprintf(stdout, "======================================================\n");
+
+ fprintf(stdout, "skin args : ==========================================\n");
+ for(i = 0; i < skin_argc; ++i)
+ {
+ fprintf(stdout, "%s ", skin_argv[i]);
+ }
+ fprintf(stdout, "\n");
+ fprintf(stdout, "======================================================\n");
+
+ INFO("qemu main start!\n");
+ qemu_main(qemu_argc, qemu_argv, NULL);
+
+ exit_emulator();
+
+ return 0;
+}
+
diff --git a/tizen/src/hw/GL/wglext.h b/tizen/src/hw/GL/wglext.h new file mode 100644 index 0000000000..b5dc7bf7f1 --- /dev/null +++ b/tizen/src/hw/GL/wglext.h @@ -0,0 +1,943 @@ +#ifndef __wglext_h_ +#define __wglext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2012 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE 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 +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Function declaration macros - to move into glplatform.h */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include <windows.h> +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number */ +/* wglext.h last updated 2012/01/04 */ +/* Current version at http://www.opengl.org/registry/ */ +#define WGL_WGLEXT_VERSION 24 + +#ifndef WGL_ARB_buffer_region +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 +#endif + +#ifndef WGL_ARB_multisample +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 +#endif + +#ifndef WGL_ARB_extensions_string +#endif + +#ifndef WGL_ARB_pixel_format +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#endif + +#ifndef WGL_ARB_make_current_read +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 +#endif + +#ifndef WGL_ARB_pbuffer +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 +#endif + +#ifndef WGL_ARB_render_texture +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 +#endif + +#ifndef WGL_ARB_pixel_format_float +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 +#endif + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 +#endif + +#ifndef WGL_ARB_create_context +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#endif + +#ifndef WGL_ARB_create_context_profile +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define ERROR_INVALID_PROFILE_ARB 0x2096 +#endif + +#ifndef WGL_ARB_create_context_robustness +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif + +#ifndef WGL_EXT_make_current_read +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 +#endif + +#ifndef WGL_EXT_pixel_format +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C +#endif + +#ifndef WGL_EXT_pbuffer +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 +#endif + +#ifndef WGL_EXT_depth_float +#define WGL_DEPTH_FLOAT_EXT 0x2040 +#endif + +#ifndef WGL_3DFX_multisample +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 +#endif + +#ifndef WGL_EXT_multisample +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 +#endif + +#ifndef WGL_I3D_digital_video_control +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 +#endif + +#ifndef WGL_I3D_gamma +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F +#endif + +#ifndef WGL_I3D_genlock +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C +#endif + +#ifndef WGL_I3D_image_buffer +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 +#endif + +#ifndef WGL_I3D_swap_frame_lock +#endif + +#ifndef WGL_NV_render_depth_texture +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 +#endif + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 +#endif + +#ifndef WGL_ATI_pixel_format_float +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#endif + +#ifndef WGL_NV_float_buffer +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 +#endif + +#ifndef WGL_3DL_stereo_control +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 +#endif + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 +#endif + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 +#endif + +#ifndef WGL_NV_present_video +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 +#endif + +#ifndef WGL_NV_video_out +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC +#endif + +#ifndef WGL_NV_swap_group +#endif + +#ifndef WGL_NV_gpu_affinity +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 +#endif + +#ifndef WGL_AMD_gpu_association +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 +#endif + +#ifndef WGL_NV_video_capture +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF +#endif + +#ifndef WGL_NV_copy_image +#endif + +#ifndef WGL_NV_multisample_coverage +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 +#endif + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 +#endif + +#ifndef WGL_NV_DX_interop +#define WGL_ACCESS_READ_ONLY_NV 0x00000000 +#define WGL_ACCESS_READ_WRITE_NV 0x00000001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002 +#endif + +#ifndef WGL_NV_DX_interop2 +#endif + +#ifndef WGL_EXT_swap_control_tear +#endif + + +/*************************************************************/ + +#ifndef WGL_ARB_pbuffer +DECLARE_HANDLE(HPBUFFERARB); +#endif +#ifndef WGL_EXT_pbuffer +DECLARE_HANDLE(HPBUFFEREXT); +#endif +#ifndef WGL_NV_present_video +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); +#endif +#ifndef WGL_NV_video_output +DECLARE_HANDLE(HPVIDEODEV); +#endif +#ifndef WGL_NV_gpu_affinity +DECLARE_HANDLE(HPGPUNV); +DECLARE_HANDLE(HGPUNV); + +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; +#endif +#ifndef WGL_NV_video_capture +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); +#endif + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType); +extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion); +extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height); +extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +#endif + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 +#endif + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern const char * WINAPI wglGetExtensionsStringARB (HDC hdc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); +#endif + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +extern BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +extern HDC WINAPI wglGetCurrentReadDCARB (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void); +#endif + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer); +extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC); +extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer); +extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue); +#endif + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer); +extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer); +extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList); +#endif + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 +#endif + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList); +#endif + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 +#endif + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 +#endif + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id); +extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length); +extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id); +extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length); +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +#endif + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern const char * WINAPI wglGetExtensionsStringEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); +#endif + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +extern HDC WINAPI wglGetCurrentReadDCEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void); +#endif + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer); +extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC); +extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer); +extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue); +#endif + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); +extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); +extern BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +#endif + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglSwapIntervalEXT (int interval); +extern int WINAPI wglGetSwapIntervalEXT (void); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +#endif + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 +#endif + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern void* WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +extern void WINAPI wglFreeMemoryNV (void *pointer); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); +#endif + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 +#endif + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 +#endif + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); +extern BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator); +extern INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +extern BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); +extern BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc); +#endif + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue); +extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); +#endif + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue); +extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue); +extern BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); +extern BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue); +#endif + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnableGenlockI3D (HDC hDC); +extern BOOL WINAPI wglDisableGenlockI3D (HDC hDC); +extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag); +extern BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource); +extern BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource); +extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge); +extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge); +extern BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate); +extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate); +extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay); +extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay); +extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay); +#endif + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags); +extern BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress); +extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); +extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count); +#endif + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnableFrameLockI3D (void); +extern BOOL WINAPI wglDisableFrameLockI3D (void); +extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag); +extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag); +#endif + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetFrameUsageI3D (float *pUsage); +extern BOOL WINAPI wglBeginFrameTrackingI3D (void); +extern BOOL WINAPI wglEndFrameTrackingI3D (void); +extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage); +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); +#endif + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 +#endif + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 +#endif + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); +#endif + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 +#endif + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList); +extern BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +extern BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue); +#endif + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice); +extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice); +extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer); +extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock); +extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +#endif + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group); +extern BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier); +extern BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier); +extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); +extern BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count); +extern BOOL WINAPI wglResetFrameCountNV (HDC hDC); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); +#endif + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu); +extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList); +extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +extern BOOL WINAPI wglDeleteDCNV (HDC hdc); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +#endif + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids); +extern INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data); +extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc); +extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id); +extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList); +extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc); +extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc); +extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void); +extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +extern UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +extern BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +extern BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +extern BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +#endif + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 +#endif + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 +#ifdef WGL_WGLEXT_PROTOTYPES +extern BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle); +extern HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice); +extern BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice); +extern HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access); +extern BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject); +extern BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access); +extern BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects); +extern BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects); +#endif /* WGL_WGLEXT_PROTOTYPES */ +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice); +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects); +#endif + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 +#endif + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tizen/src/hw/gl_func_perso.h b/tizen/src/hw/gl_func_perso.h index 7ee6278bf0..7ee6278bf0 100755..100644 --- a/tizen/src/hw/gl_func_perso.h +++ b/tizen/src/hw/gl_func_perso.h diff --git a/tizen/src/hw/gloffscreen.h b/tizen/src/hw/gloffscreen.h index e860c07a5c..e860c07a5c 100755..100644 --- a/tizen/src/hw/gloffscreen.h +++ b/tizen/src/hw/gloffscreen.h diff --git a/tizen/src/hw/gloffscreen_common.c b/tizen/src/hw/gloffscreen_common.c index c97b9c195c..c97b9c195c 100755..100644 --- a/tizen/src/hw/gloffscreen_common.c +++ b/tizen/src/hw/gloffscreen_common.c diff --git a/tizen/src/hw/gloffscreen_glx.c b/tizen/src/hw/gloffscreen_glx.c index e807c6ba9a..e807c6ba9a 100755..100644 --- a/tizen/src/hw/gloffscreen_glx.c +++ b/tizen/src/hw/gloffscreen_glx.c diff --git a/tizen/src/hw/gloffscreen_test.c b/tizen/src/hw/gloffscreen_test.c index 1e9e9bc9a0..1e9e9bc9a0 100755..100644 --- a/tizen/src/hw/gloffscreen_test.c +++ b/tizen/src/hw/gloffscreen_test.c diff --git a/tizen/src/hw/gloffscreen_wgl.c b/tizen/src/hw/gloffscreen_wgl.c index 491af01c6a..68487b3302 100755..100644 --- a/tizen/src/hw/gloffscreen_wgl.c +++ b/tizen/src/hw/gloffscreen_wgl.c @@ -35,7 +35,7 @@ #include <wingdi.h> #include <GL/gl.h> #include <GL/glext.h> -#include <GL/wglext.h> +#include "GL/wglext.h" /* In Windows, you must create a window *before* you can create a pbuffer or * get a context. So we create a hidden Window on startup (see glo_init/GloMain). diff --git a/tizen/src/hw/gloffscreen_xcomposite.c b/tizen/src/hw/gloffscreen_xcomposite.c index f111e9873c..f111e9873c 100755..100644 --- a/tizen/src/hw/gloffscreen_xcomposite.c +++ b/tizen/src/hw/gloffscreen_xcomposite.c diff --git a/tizen/src/hw/helper_opengl.c b/tizen/src/hw/helper_opengl.c index a13ca40df0..fa0d810858 100755..100644 --- a/tizen/src/hw/helper_opengl.c +++ b/tizen/src/hw/helper_opengl.c @@ -108,8 +108,7 @@ static inline int do_decode_call_int(ProcessStruct *process, void *args_in, int if ((args[i] == 0 && args_size == 0 && !IS_NULL_POINTER_OK_FOR_FUNC(func_number)) || - (args[i] == 0 && args_size != 0) || - (args[i] != 0 && args_size == 0)) + (args[i] == 0 && args_size != 0)) return 0; argptr += 4; diff --git a/tizen/src/hw/maru_board.c b/tizen/src/hw/maru_board.c index 067ed3f152..b18475d0d9 100644 --- a/tizen/src/hw/maru_board.c +++ b/tizen/src/hw/maru_board.c @@ -309,12 +309,14 @@ static void maru_x86_machine_init(MemoryRegion *system_memory, pc_pci_device_init(pci_bus); } -// maru specialized device init... +#ifndef CONFIG_DARWIN + // maru specialized device init... if (pci_enabled) { maru_camera_pci_init(pci_bus); //tizen_ac97_init(pci_bus); codec_init(pci_bus); } +#endif } static void maru_x86_board_init(ram_addr_t ram_size, diff --git a/tizen/src/hw/maru_camera_win32_pci.c b/tizen/src/hw/maru_camera_win32_pci.c index 85bcce9d90..d32d3f8116 100644 --- a/tizen/src/hw/maru_camera_win32_pci.c +++ b/tizen/src/hw/maru_camera_win32_pci.c @@ -1455,6 +1455,14 @@ void marucam_device_open(MaruCamState* state) MaruCamParam *param = state->param;
param->top = 0;
+ hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ if (FAILED(hr)) {
+ ERR("CoInitailizeEx\n");
+ ERR("camera device open failed!!!, [HRESULT : 0x%x]\n", hr);
+ param->errCode = EINVAL;
+ return;
+ }
+
hr = GraphBuilder_Init();
if (FAILED(hr)) {
ERR("GraphBuilder_Init\n");
@@ -1496,6 +1504,7 @@ void marucam_device_open(MaruCamState* state) error_failed:
CloseInterfaces();
+ CoUninitialize();
param->errCode = EINVAL;
ERR("camera device open failed!!!, [HRESULT : 0x%x]\n", hr);
}
@@ -1507,6 +1516,7 @@ void marucam_device_close(MaruCamState* state) param->top = 0;
CloseInterfaces();
+ CoUninitialize();
INFO("Close successfully!!!\n");
}
diff --git a/tizen/src/hw/maru_vga.c b/tizen/src/hw/maru_vga.c index 42c464098c..0c82c26f9b 100644 --- a/tizen/src/hw/maru_vga.c +++ b/tizen/src/hw/maru_vga.c @@ -28,6 +28,14 @@ * */ + +#include "maru_common.h" + +#ifdef CONFIG_DARWIN +//shared memory +#define USE_SHM +#endif + #include "hw.h" #include "console.h" #include "pc.h" @@ -41,8 +49,13 @@ #include "emul_state.h" #include "debug_ch.h" +#ifdef USE_SHM +#include <sys/shm.h> +#endif + MULTI_DEBUG_CHANNEL(qemu, maru_vga); + //#define DEBUG_VGA //#define DEBUG_VGA_MEM //#define DEBUG_VGA_REG @@ -76,6 +89,13 @@ MULTI_DEBUG_CHANNEL(qemu, maru_vga); #define MARU_VGA +#ifdef USE_SHM +/* shared memory */ +void *shared_memory = (void*)0; +int shmid; +#endif + + static const uint32_t mask16[16] = { PAT(0x00000000), PAT(0x000000ff), @@ -946,12 +966,19 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) qemu_free_displaysurface(s->ds); #ifdef MARU_VGA // create new sufrace by malloc in MARU VGA - s->ds->surface = qemu_create_displaysurface( s->ds, disp_width, height ); + +#ifdef USE_SHM + s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth, + disp_width * 4, (uint8_t*)shared_memory); #else + s->ds->surface = qemu_create_displaysurface(s->ds, disp_width, height); +#endif //USE_SHM + +#else //MARU_VGA s->ds->surface = qemu_create_displaysurface_from(disp_width, height, depth, s->line_offset, s->vram_ptr + (s->start_addr * 4)); -#endif +#endif //MARU_VGA #if defined(HOST_WORDS_BIGENDIAN) != defined(TARGET_WORDS_BIGENDIAN) s->ds->surface->pf = qemu_different_endianness_pixelformat(depth); @@ -967,12 +994,15 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) s->last_line_offset = s->line_offset; s->last_depth = depth; full_update = 1; +#ifndef USE_SHM } else if (is_buffer_shared(s->ds->surface) && (full_update || s->ds->surface->data != s->vram_ptr + (s->start_addr * 4))) { s->ds->surface->data = s->vram_ptr + (s->start_addr * 4); dpy_setdata(s->ds); } - +#else + } +#endif s->rgb_to_pixel = rgb_to_pixel_dup_table[get_depth_index(s->ds)]; @@ -1025,7 +1055,11 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) } maru_vga_draw_line = maru_vga_draw_line_table[v * NB_DEPTHS + get_depth_index(s->ds)]; +#ifndef USE_SHM if (!is_buffer_shared(s->ds->surface) && s->cursor_invalidate) +#else + if (s->cursor_invalidate) +#endif s->cursor_invalidate(s); line_offset = s->line_offset; @@ -1071,11 +1105,15 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) page_min = page0; if (page1 > page_max) page_max = page1; +#ifndef USE_SHM if (!(is_buffer_shared(s->ds->surface))) { +#endif maru_vga_draw_line(s, d, s->vram_ptr + addr, width); if (s->cursor_draw_line) s->cursor_draw_line(s, d, y); +#ifndef USE_SHM } +#endif #ifdef MARU_VGA @@ -1499,6 +1537,24 @@ void maru_vga_common_init(VGACommonState *s, int vga_ram_size) break; } vga_dirty_log_start(s); + +#ifdef USE_SHM + int mykey = getuid(); + shmid = shmget((key_t)mykey, (size_t)vga_ram_size, 0666 | IPC_CREAT); + if (shmid == -1) { + fprintf(stderr, "shmget failed\n"); + exit(1); + } + + shared_memory = shmat(shmid, (void*)0, 0); + if (shared_memory == (void *)-1) { + fprintf(stderr, "shmat failed\n"); + exit(1); + } + + printf("Memory attached at %X\n", (int)shared_memory); +#endif + } /********************************************************/ diff --git a/tizen/src/hw/mesa_gl.h b/tizen/src/hw/mesa_gl.h index b62c9a8113..b62c9a8113 100755..100644 --- a/tizen/src/hw/mesa_gl.h +++ b/tizen/src/hw/mesa_gl.h diff --git a/tizen/src/hw/mesa_glext.h b/tizen/src/hw/mesa_glext.h index 1b3a1709f6..1b3a1709f6 100755..100644 --- a/tizen/src/hw/mesa_glext.h +++ b/tizen/src/hw/mesa_glext.h diff --git a/tizen/src/hw/mesa_glu.h b/tizen/src/hw/mesa_glu.h index eae5fa672a..eae5fa672a 100755..100644 --- a/tizen/src/hw/mesa_glu.h +++ b/tizen/src/hw/mesa_glu.h diff --git a/tizen/src/hw/mesa_mipmap.c b/tizen/src/hw/mesa_mipmap.c index 1263cd5fe0..1263cd5fe0 100755..100644 --- a/tizen/src/hw/mesa_mipmap.c +++ b/tizen/src/hw/mesa_mipmap.c diff --git a/tizen/src/hw/mesa_mipmap.h b/tizen/src/hw/mesa_mipmap.h index 047596f259..047596f259 100755..100644 --- a/tizen/src/hw/mesa_mipmap.h +++ b/tizen/src/hw/mesa_mipmap.h diff --git a/tizen/src/hw/op_helper.c b/tizen/src/hw/op_helper.c index bc3b94e149..bc3b94e149 100755..100644 --- a/tizen/src/hw/op_helper.c +++ b/tizen/src/hw/op_helper.c diff --git a/tizen/src/hw/opengl_exec.c b/tizen/src/hw/opengl_exec.c index 001a202908..001a202908 100755..100644 --- a/tizen/src/hw/opengl_exec.c +++ b/tizen/src/hw/opengl_exec.c diff --git a/tizen/src/hw/opengl_exec.h b/tizen/src/hw/opengl_exec.h index 9bd828b084..9bd828b084 100755..100644 --- a/tizen/src/hw/opengl_exec.h +++ b/tizen/src/hw/opengl_exec.h diff --git a/tizen/src/hw/opengl_func.h b/tizen/src/hw/opengl_func.h index b2c8a1c343..b2c8a1c343 100755..100644 --- a/tizen/src/hw/opengl_func.h +++ b/tizen/src/hw/opengl_func.h diff --git a/tizen/src/hw/opengl_process.h b/tizen/src/hw/opengl_process.h index 5a923878fe..5a923878fe 100755..100644 --- a/tizen/src/hw/opengl_process.h +++ b/tizen/src/hw/opengl_process.h diff --git a/tizen/src/hw/parse_gl_h.c b/tizen/src/hw/parse_gl_h.c index e37cf71b9c..e37cf71b9c 100755..100644 --- a/tizen/src/hw/parse_gl_h.c +++ b/tizen/src/hw/parse_gl_h.c diff --git a/tizen/src/hw/range_alloc.h b/tizen/src/hw/range_alloc.h index c1a8d779bc..c1a8d779bc 100755..100644 --- a/tizen/src/hw/range_alloc.h +++ b/tizen/src/hw/range_alloc.h diff --git a/tizen/src/hw/virtio-gl.c b/tizen/src/hw/virtio-gl.c index 4ca1ed757f..4ca1ed757f 100755..100644 --- a/tizen/src/hw/virtio-gl.c +++ b/tizen/src/hw/virtio-gl.c diff --git a/tizen/src/maru_common.h b/tizen/src/maru_common.h index 89d19058e2..17ceb29f85 100644 --- a/tizen/src/maru_common.h +++ b/tizen/src/maru_common.h @@ -37,6 +37,7 @@ #ifndef __MARU_COMMON_H__ #define __MARU_COMMON_H__ +#include "config-host.h" #include <stddef.h> #include <stdint.h> #include <stdbool.h> diff --git a/tizen/src/maru_display.c b/tizen/src/maru_display.c new file mode 100644 index 0000000000..99358cd9c9 --- /dev/null +++ b/tizen/src/maru_display.c @@ -0,0 +1,103 @@ +/* + * MARU display driver + * + * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * GiWoong Kim <giwoong.kim@samsung.com> + * SeokYeon Hwang <syeon.hwang@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 + * + */ + + +#include "maru_common.h" + +#ifdef CONFIG_DARWIN +//shared memory +#define USE_SHM +#endif + +#include "maru_display.h" +#include "debug_ch.h" + +#ifndef USE_SHM +#include "maru_sdl.h" +#else +#include "maru_shm.h" +#endif + +MULTI_DEBUG_CHANNEL(tizen, display); + + +//TODO: interface +void maru_display_init(DisplayState *ds) +{ + INFO("init qemu display\n"); + + /* graphics context information */ + DisplayChangeListener *dcl; + + dcl = g_malloc0(sizeof(DisplayChangeListener)); +#ifndef USE_SHM + /* sdl library */ + dcl->dpy_update = qemu_ds_sdl_update; + dcl->dpy_resize = qemu_ds_sdl_resize; + dcl->dpy_refresh = qemu_ds_sdl_refresh; +#else + /* shared memroy */ + dcl->dpy_update = qemu_ds_shm_update; + dcl->dpy_resize = qemu_ds_shm_resize; + dcl->dpy_refresh = qemu_ds_shm_refresh; +#endif + + register_displaychangelistener(ds, dcl); +} + +void maru_display_fini(void) +{ + INFO("fini qemu display\n"); + +#ifndef USE_SHM + maruskin_sdl_quit(); +#else + //TODO: +#endif +} + +void maruskin_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize) +{ +#ifndef USE_SHM + maruskin_sdl_init(swt_handle, lcd_size_width, lcd_size_height, is_resize); +#else + maruskin_shm_init(swt_handle, lcd_size_width, lcd_size_height, is_resize); +#endif +} + +DisplaySurface* get_qemu_display_surface(void) { +#ifndef USE_SHM + return maruskin_sdl_get_display(); +#else + //TODO: +#endif + + return NULL; +} + diff --git a/tizen/src/maru_display.h b/tizen/src/maru_display.h new file mode 100644 index 0000000000..d0d3c31819 --- /dev/null +++ b/tizen/src/maru_display.h @@ -0,0 +1,42 @@ +/* + * MARU display driver + * + * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * GiWoong Kim <giwoong.kim@samsung.com> + * SeokYeon Hwang <syeon.hwang@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 + * + */ + + +#ifndef MARU_DISPLAY_H_ +#define MARU_DISPLAY_H_ + +#include "console.h" + + +void maru_display_init(DisplayState *ds); +void maru_display_fini(void); +void maruskin_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize); +DisplaySurface* get_qemu_display_surface(void); + +#endif /* MARU_DISPLAY_H_ */ diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c index 753d8615b2..d6a4ba2a5b 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -1,11 +1,11 @@ /* - * MARU SDL display driver + * SDL_WINDOWID hack * * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: - * HyunJun Son <hj79.son@samsung.com> * GiWoong Kim <giwoong.kim@samsung.com> + * SeokYeon Hwang <syeon.hwang@samsung.com> * YeongKyoon Lee <yeongkyoon.lee@samsung.com> * * This program is free software; you can redistribute it and/or @@ -68,6 +68,112 @@ static int sdl_thread_initialized = 0; #define SDL_FLAGS (SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_NOFRAME) #define SDL_BPP 32 + +void qemu_ds_sdl_update(DisplayState *ds, int x, int y, int w, int h) +{ + /* call sdl update */ +#ifdef SDL_THREAD + pthread_mutex_lock(&sdl_mutex); + + pthread_cond_signal(&sdl_cond); + + pthread_mutex_unlock(&sdl_mutex); +#else + qemu_update(); +#endif +} + +void qemu_ds_sdl_resize(DisplayState *ds) +{ + TRACE("%d, %d\n", ds_get_width(ds), ds_get_height(ds)); + +#ifdef SDL_THREAD + pthread_mutex_lock(&sdl_mutex); +#endif + + /* create surface_qemu */ + surface_qemu = SDL_CreateRGBSurfaceFrom(ds_get_data(ds), + ds_get_width(ds), + ds_get_height(ds), + ds_get_bits_per_pixel(ds), + ds_get_linesize(ds), + ds->surface->pf.rmask, + ds->surface->pf.gmask, + ds->surface->pf.bmask, + ds->surface->pf.amask); + +#ifdef SDL_THREAD + pthread_mutex_unlock(&sdl_mutex); +#endif + + if (surface_qemu == NULL) { + ERR("Unable to set the RGBSurface: %s\n", SDL_GetError()); + return; + } + +} + +static int maru_sdl_poll_event(SDL_Event *ev) +{ + int ret = 0; + + if (sdl_initialized == 1) { + //pthread_mutex_lock(&sdl_mutex); + ret = SDL_PollEvent(ev); + //pthread_mutex_unlock(&sdl_mutex); + } + + return ret; +} +void qemu_ds_sdl_refresh(DisplayState *ds) +{ + SDL_Event ev1, *ev = &ev1; + + // surface may be NULL in init func. + qemu_display_surface = ds->surface; + + while (maru_sdl_poll_event(ev)) { + switch (ev->type) { + case SDL_VIDEORESIZE: + { + pthread_mutex_lock(&sdl_mutex); + + maruskin_sdl_init(0, get_emul_lcd_width(), get_emul_lcd_height(), true); + + pthread_mutex_unlock(&sdl_mutex); + vga_hw_invalidate(); + break; + } + + default: + break; + } + } + + vga_hw_update(); + +#ifdef TARGET_ARM +#ifdef SDL_THREAD + pthread_mutex_lock(&sdl_mutex); +#endif + + /* + * It is necessary only for exynos4210 FIMD in connection with + * some WM (xfwm4, for example) + */ + + SDL_UpdateRect(surface_screen, 0, 0, 0, 0); + +#ifdef SDL_THREAD + pthread_mutex_unlock(&sdl_mutex); +#endif +#endif +} + + + + + extern int capability_check_gl; static void _sdl_init(void) { @@ -97,7 +203,7 @@ static void _sdl_init(void) h = temp; } - if (capability_check_gl != 0) { + /*if (capability_check_gl != 0) { ERR("GL check returned non-zero\n"); surface_screen = NULL; } else { @@ -107,17 +213,17 @@ static void _sdl_init(void) if (surface_screen == NULL) { sdl_opengl = 0; INFO("No OpenGL support on this system!??\n"); - ERR("%s\n", SDL_GetError()); + ERR("%s\n", SDL_GetError());*/ surface_screen = SDL_SetVideoMode(w, h, get_emul_sdl_bpp(), SDL_FLAGS); if (surface_screen == NULL) { ERR("Could not open SDL display (%dx%dx%d): %s\n", w, h, get_emul_sdl_bpp(), SDL_GetError()); return; } - } else { + /*} else { sdl_opengl = 1; INFO("OpenGL is supported on this system.\n"); - } + }*/ if (sdl_opengl == 1) { /* Set the OpenGL state */ @@ -317,164 +423,6 @@ static void* run_qemu_update(void* arg) } #endif -static void qemu_ds_update(DisplayState *ds, int x, int y, int w, int h) -{ - /* call sdl update */ -#ifdef SDL_THREAD - pthread_mutex_lock(&sdl_mutex); - - pthread_cond_signal(&sdl_cond); - - pthread_mutex_unlock(&sdl_mutex); -#else - qemu_update(); -#endif -} - -static void qemu_ds_resize(DisplayState *ds) -{ - TRACE("%d, %d\n", ds_get_width(ds), ds_get_height(ds)); - -#ifdef SDL_THREAD - pthread_mutex_lock(&sdl_mutex); -#endif - - /* create surface_qemu */ - surface_qemu = SDL_CreateRGBSurfaceFrom(ds_get_data(ds), - ds_get_width(ds), - ds_get_height(ds), - ds_get_bits_per_pixel(ds), - ds_get_linesize(ds), - ds->surface->pf.rmask, - ds->surface->pf.gmask, - ds->surface->pf.bmask, - ds->surface->pf.amask); - -#ifdef SDL_THREAD - pthread_mutex_unlock(&sdl_mutex); -#endif - - if (surface_qemu == NULL) { - ERR("Unable to set the RGBSurface: %s\n", SDL_GetError()); - return; - } - -} - -static int maru_sdl_poll_event(SDL_Event *ev) -{ - int ret = 0; - - if (sdl_initialized == 1) { - //pthread_mutex_lock(&sdl_mutex); - ret = SDL_PollEvent(ev); - //pthread_mutex_unlock(&sdl_mutex); - } - - return ret; -} - -static void put_hardkey_code( SDL_UserEvent event ) -{ - // use pointer as integer - int event_type = (int) event.data1; - int keycode = (int) event.data2; - - if ( KEY_PRESSED == event_type ) { - - if ( kbd_mouse_is_absolute() ) { - ps2kbd_put_keycode( keycode & 0x7f ); - } - - } else if ( KEY_RELEASED == event_type ) { - - if ( kbd_mouse_is_absolute() ) { - ps2kbd_put_keycode( keycode | 0x80 ); - } - - } else { - ERR( "Unknown hardkey event type.[event_type:%d]\n", event_type ); - } - -} - -static void handle_sdl_user_event ( SDL_UserEvent event ) -{ - int code = event.code; - - switch ( code ) { - case SDL_USER_EVENT_CODE_HARDKEY: { - put_hardkey_code( event ); - break; - } - default: { - ERR( "Unknown sdl user event.[event code:%d]\n", code ); - break; - } - } - -} - -static void qemu_ds_refresh(DisplayState *ds) -{ - SDL_Event ev1, *ev = &ev1; - - // surface may be NULL in init func. - qemu_display_surface = ds->surface; - - while (maru_sdl_poll_event(ev)) { - switch (ev->type) { - case SDL_VIDEORESIZE: - { - pthread_mutex_lock(&sdl_mutex); - - maruskin_sdl_init(0, get_emul_lcd_width(), get_emul_lcd_height(), true); - - pthread_mutex_unlock(&sdl_mutex); - vga_hw_invalidate(); - break; - } - - default: - break; - } - } - - vga_hw_update(); - -#ifdef TARGET_ARM -#ifdef SDL_THREAD - pthread_mutex_lock(&sdl_mutex); -#endif - - /* - * It is necessary only for exynos4210 FIMD in connection with - * some WM (xfwm4, for example) - */ - - SDL_UpdateRect(surface_screen, 0, 0, 0, 0); - -#ifdef SDL_THREAD - pthread_mutex_unlock(&sdl_mutex); -#endif -#endif -} - -void maruskin_display_init(DisplayState *ds) -{ - INFO("qemu display initialization\n"); - - /* graphics context information */ - DisplayChangeListener *dcl; - - dcl = g_malloc0(sizeof(DisplayChangeListener)); - dcl->dpy_update = qemu_ds_update; - dcl->dpy_resize = qemu_ds_resize; - dcl->dpy_refresh = qemu_ds_refresh; - - register_displaychangelistener(ds, dcl); -} - void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize) { gchar SDL_windowhack[32]; @@ -483,7 +431,7 @@ void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_heigh INFO("maru sdl initialization = %d\n", is_resize); - if (is_resize == FALSE) { + if (is_resize == FALSE) { //once sprintf(SDL_windowhack, "%ld", window_id); g_setenv("SDL_WINDOWID", SDL_windowhack, 1); INFO("register SDL environment variable. (SDL_WINDOWID = %s)\n", SDL_windowhack); @@ -528,6 +476,7 @@ void maruskin_sdl_quit(void) /* remove multi-touch finger points */ get_emul_multi_touch_state()->multitouch_enable = 0; clear_finger_slot(); + cleanup_multi_touch_state(); if (sdl_opengl == 1) { glDeleteTextures(1, &texture); @@ -549,13 +498,7 @@ void maruskin_sdl_resize(void) SDL_PushEvent(&ev); } -void maruskin_sdl_free(void) -{ - SDL_FreeSurface(surface_screen); - SDL_FreeSurface(surface_qemu); -} - -DisplaySurface* get_qemu_display_surface( void ) { +DisplaySurface* maruskin_sdl_get_display(void) { return qemu_display_surface; } diff --git a/tizen/src/maru_sdl.h b/tizen/src/maru_sdl.h index f9d3ba7f92..5ead7a3150 100644 --- a/tizen/src/maru_sdl.h +++ b/tizen/src/maru_sdl.h @@ -1,11 +1,11 @@ /* - * MARU SDL display driver + * SDL_WINDOWID hack * * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: - * HyunJun Son <hj79.son@samsung.com> * GiWoong Kim <giwoong.kim@samsung.com> + * SeokYeon Hwang <syeon.hwang@samsung.com> * YeongKyoon Lee <yeongkyoon.lee@samsung.com> * * This program is free software; you can redistribute it and/or @@ -32,26 +32,19 @@ #define MARU_SDL_H_ #include "console.h" - -#if 0 -#ifdef _WIN32 -#include <windows.h> -#include <winbase.h> -#endif -#endif - #include <SDL.h> #include <SDL_syswm.h> #include "qemu-common.h" -#define SDL_USER_EVENT_CODE_HARDKEY 1 -void maruskin_display_init(DisplayState *ds); +void qemu_ds_sdl_update(DisplayState *ds, int x, int y, int w, int h); +void qemu_ds_sdl_resize(DisplayState *ds); +void qemu_ds_sdl_refresh(DisplayState *ds); + void maruskin_sdl_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize); void maruskin_sdl_resize(void); void maruskin_sdl_quit(void); - -DisplaySurface* get_qemu_display_surface( void ); +DisplaySurface* maruskin_sdl_get_display(void); #endif /* MARU_SDL_H_ */ diff --git a/tizen/src/maru_shm.c b/tizen/src/maru_shm.c new file mode 100644 index 0000000000..248445ce55 --- /dev/null +++ b/tizen/src/maru_shm.c @@ -0,0 +1,62 @@ +/* + * Shared memory + * + * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * GiWoong Kim <giwoong.kim@samsung.com> + * SeokYeon Hwang <syeon.hwang@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 + * + */ + + +#include "maru_shm.h" +#include "emul_state.h" +#include "debug_ch.h" + +MULTI_DEBUG_CHANNEL(tizen, maru_shm); + + +void qemu_ds_shm_update(DisplayState *ds, int x, int y, int w, int h) +{ + //TODO: +} + +void qemu_ds_shm_resize(DisplayState *ds) +{ + //TODO: +} + +void qemu_ds_shm_refresh(DisplayState *ds) +{ + //TODO: +} + +void maruskin_shm_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize) +{ + INFO("maru shm initialization = %d\n", is_resize); + + if (is_resize == FALSE) { //once + set_emul_lcd_size(lcd_size_width, lcd_size_height); + set_emul_sdl_bpp(32); + } +} + diff --git a/tizen/src/maru_shm.h b/tizen/src/maru_shm.h new file mode 100644 index 0000000000..12035b4aff --- /dev/null +++ b/tizen/src/maru_shm.h @@ -0,0 +1,42 @@ +/* + * Shared memory + * + * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * GiWoong Kim <giwoong.kim@samsung.com> + * SeokYeon Hwang <syeon.hwang@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 + * + */ + + +#ifndef MARU_SHM_H_ +#define MARU_SHM_H_ + +#include "console.h" + + +void qemu_ds_shm_update(DisplayState *ds, int x, int y, int w, int h); +void qemu_ds_shm_resize(DisplayState *ds); +void qemu_ds_shm_refresh(DisplayState *ds); +void maruskin_shm_init(uint64 swt_handle, int lcd_size_width, int lcd_size_height, bool is_resize); + +#endif /* MARU_SHM_H_ */ diff --git a/tizen/src/option.c b/tizen/src/option.c index 547cde94d6..6ee0f43c78 100644 --- a/tizen/src/option.c +++ b/tizen/src/option.c @@ -35,7 +35,7 @@ */ #include "option.h" - +#include "emulator.h" #ifndef _WIN32 #include <sys/ioctl.h> #include <sys/types.h> @@ -57,6 +57,11 @@ #include "debug_ch.h" +#define HTTP_PROTOCOL "http=" +#define HTTPS_PROTOCOL "https=" +#define FTP_PROTOCOL "ftp=" +#define SOCKS_PROTOCOL "socks=" + //DEFAULT_DEBUG_CHANNEL(tizen); MULTI_DEBUG_CHANNEL(tizen, option); @@ -141,12 +146,80 @@ int gethostDNS(char *dns1, char *dns2) return 0; } +void remove_protocol(char *src, char *dst, const char *protocol) +{ + int len = strlen(protocol); + int i, j; + int max_len = strlen(src); + + for(i = len, j = 0; i < max_len; i++) + { + dst[j++] = src[i]; + } + + dst[j] = '\0'; +} + +void getlinuxproxy(char *http_proxy, char *https_proxy, char *ftp_proxy, char *socks_proxy) +{ + char buf[MAXLEN]; + FILE *output; + memset(buf, 0, MAXLEN); + + output = popen("gconftool-2 --get /system/http_proxy/host", "r"); + fscanf(output , "%s", buf); + sprintf(http_proxy, "%s", buf); + pclose(output); + + output = popen("gconftool-2 --get /system/http_proxy/port", "r"); + fscanf(output , "%s", buf); + sprintf(http_proxy, "%s:%s", http_proxy, buf); + pclose(output); + memset(buf, 0, MAXLEN); + INFO("http_proxy : %s\n", http_proxy); + + output = popen("gconftool-2 --get /system/proxy/secure_host", "r"); + fscanf(output , "%s", buf); + sprintf(https_proxy, "%s", buf); + pclose(output); + + output = popen("gconftool-2 --get /system/proxy/secure_port", "r"); + fscanf(output , "%s", buf); + sprintf(https_proxy, "%s:%s", https_proxy, buf); + pclose(output); + memset(buf, 0, MAXLEN); + INFO("https_proxy : %s\n", https_proxy); + + output = popen("gconftool-2 --get /system/proxy/ftp_host", "r"); + fscanf(output , "%s", buf); + sprintf(ftp_proxy, "%s", buf); + pclose(output); + + output = popen("gconftool-2 --get /system/proxy/ftp_port", "r"); + fscanf(output , "%s", buf); + sprintf(ftp_proxy, "%s:%s", ftp_proxy, buf); + pclose(output); + memset(buf, 0, MAXLEN); + INFO("ftp_proxy : %s\n", ftp_proxy); + + output = popen("gconftool-2 --get /system/proxy/socks_host", "r"); + fscanf(output , "%s", buf); + sprintf(socks_proxy, "%s", buf); + pclose(output); + + output = popen("gconftool-2 --get /system/proxy/socks_port", "r"); + fscanf(output , "%s", buf); + sprintf(socks_proxy, "%s:%s", socks_proxy, buf); + pclose(output); + INFO("socks_proxy : %s\n", socks_proxy); +} + /** @brief get host proxy server address @param proxy: return value (proxy server address) @return always 0 */ -int gethostproxy(char *proxy) +int gethostproxy(char *http_proxy, char *https_proxy, char *ftp_proxy, char *socks_proxy) { #ifndef _WIN32 char buf[255]; @@ -157,17 +230,8 @@ int gethostproxy(char *proxy) pclose(output); if (strcmp(buf, "manual") == 0){ - output = popen("gconftool-2 --get /system/http_proxy/host", "r"); - fscanf(output , "%s", buf); - sprintf(proxy, "%s", buf); - pclose(output); - - output = popen("gconftool-2 --get /system/http_proxy/port", "r"); - fscanf(output , "%s", buf); - sprintf(proxy, "%s:%s", proxy, buf); - pclose(output); - - }else if (strcmp(buf, "auto") == 0){ + getlinuxproxy(http_proxy, https_proxy, ftp_proxy, socks_proxy); + }else if (strcmp(buf, "auto") == 0){ INFO( "Emulator can't support automatic proxy currently. starts up with normal proxy.\n"); //can't support proxy auto setting // output = popen("gconftool-2 --get /system/proxy/autoconfig_url", "r"); @@ -181,6 +245,9 @@ int gethostproxy(char *proxy) int nRet; LONG lRet; BYTE *proxyenable, *proxyserver; + char *p; + char *real_proxy; + DWORD dwLength = 0; nRet = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", @@ -243,8 +310,39 @@ int gethostproxy(char *proxy) RegCloseKey(hKey); return 0; } - if (proxyserver != NULL) strcpy(proxy, (char*)proxyserver); - free(proxyserver); + if((char*)proxyserver != NULL) { + INFO("proxy value: is %s\n", (char*)proxyserver); + for(p = strtok((char*)proxyserver, ";"); p; p = strtok(NULL, ";")){ + real_proxy = malloc(MAXLEN); + if(strstr(p, HTTP_PROTOCOL)) { + remove_protocol(p, real_proxy, HTTP_PROTOCOL); + strcpy(http_proxy, real_proxy); + } + else if(strstr(p, HTTPS_PROTOCOL)) { + remove_protocol(p, real_proxy, HTTPS_PROTOCOL); + strcpy(https_proxy, real_proxy); + } + else if(strstr(p, FTP_PROTOCOL)) { + remove_protocol(p, real_proxy, FTP_PROTOCOL); + strcpy(ftp_proxy, real_proxy); + } + else if(strstr(p, SOCKS_PROTOCOL)) { + remove_protocol(p, real_proxy, SOCKS_PROTOCOL); + strcpy(socks_proxy, real_proxy); + } + else { + INFO("all protocol uses the same proxy server: %s\n", p); + strcpy(http_proxy, p); + strcpy(https_proxy, p); + strcpy(ftp_proxy, p); + strcpy(socks_proxy, p); + } + } + } + else { + fprintf(stderr, "proxy is null\n"); + return 0; + } RegCloseKey(hKey); #endif return 0; diff --git a/tizen/src/option.h b/tizen/src/option.h index f7b1ddfd83..397f306ea8 100644 --- a/tizen/src/option.h +++ b/tizen/src/option.h @@ -44,6 +44,8 @@ #include <string.h> int gethostDNS(char *dns1, char *dns2); -int gethostproxy(char *proxy); +int gethostproxy(char *http_proxy, char *https_proxy, char *ftp_proxy, char *socks_proxy); +void getlinuxproxy(char *http_proxy, char *https_proxy, char *ftp_proxy, char *socks_proxy); +void remove_protocol(char *src, char *dst, const char *protocol); #endif diff --git a/tizen/src/sdb.c b/tizen/src/sdb.c index 4291fdd6a7..423750fbe4 100644 --- a/tizen/src/sdb.c +++ b/tizen/src/sdb.c @@ -1,369 +1,368 @@ -/* Copyright (C) 2006-2010 The Android Open Source Project -** -** This software is licensed under the terms of the GNU General Public -** License version 2, as published by the Free Software Foundation, and -** may be copied, distributed, and modified under those terms. -** -** 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. -*/ - - -#ifdef _WIN32 -#include <windows.h> -#include <winsock2.h> -#include <ws2tcpip.h> -#else /* !_WIN32 */ -#include <sys/ioctl.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <netinet/tcp.h> -#include <netdb.h> -#endif /* !_WIN32 */ - -#include "net/slirp.h" -#include "qemu_socket.h" -#include "sdb.h" -#include "nbd.h" -#include "tizen/src/debug_ch.h" - -//DEFAULT_DEBUG_CHANNEL(qemu); -MULTI_DEBUG_CHANNEL(qemu, sdb); - -/* QSOCKET_CALL is used to deal with the fact that EINTR happens pretty - * easily in QEMU since we use SIGALRM to implement periodic timers - */ - -#ifdef _WIN32 -# define QSOCKET_CALL(_ret,_cmd) \ - do { _ret = (_cmd); } while ( _ret < 0 && WSAGetLastError() == WSAEINTR ) -#else -# define QSOCKET_CALL(_ret,_cmd) \ - do { \ - errno = 0; \ - do { _ret = (_cmd); } while ( _ret < 0 && errno == EINTR ); \ - } while (0); -#endif - -#ifdef _WIN32 - -#include <errno.h> - -static int winsock_error; - -#define WINSOCK_ERRORS_LIST \ - EE(WSA_INVALID_HANDLE,EINVAL,"invalid handle") \ -EE(WSA_NOT_ENOUGH_MEMORY,ENOMEM,"not enough memory") \ -EE(WSA_INVALID_PARAMETER,EINVAL,"invalid parameter") \ -EE(WSAEINTR,EINTR,"interrupted function call") \ -EE(WSAEALREADY,EALREADY,"operation already in progress") \ -EE(WSAEBADF,EBADF,"bad file descriptor") \ -EE(WSAEACCES,EACCES,"permission denied") \ -EE(WSAEFAULT,EFAULT,"bad address") \ -EE(WSAEINVAL,EINVAL,"invalid argument") \ -EE(WSAEMFILE,EMFILE,"too many opened files") \ -EE(WSAEWOULDBLOCK,EWOULDBLOCK,"resource temporarily unavailable") \ -EE(WSAEINPROGRESS,EINPROGRESS,"operation now in progress") \ -EE(WSAEALREADY,EAGAIN,"operation already in progress") \ -EE(WSAENOTSOCK,EBADF,"socket operation not on socket") \ -EE(WSAEDESTADDRREQ,EDESTADDRREQ,"destination address required") \ -EE(WSAEMSGSIZE,EMSGSIZE,"message too long") \ -EE(WSAEPROTOTYPE,EPROTOTYPE,"wrong protocol type for socket") \ -EE(WSAENOPROTOOPT,ENOPROTOOPT,"bad protocol option") \ -EE(WSAEADDRINUSE,EADDRINUSE,"address already in use") \ -EE(WSAEADDRNOTAVAIL,EADDRNOTAVAIL,"cannot assign requested address") \ -EE(WSAENETDOWN,ENETDOWN,"network is down") \ -EE(WSAENETUNREACH,ENETUNREACH,"network unreachable") \ -EE(WSAENETRESET,ENETRESET,"network dropped connection on reset") \ -EE(WSAECONNABORTED,ECONNABORTED,"software caused connection abort") \ -EE(WSAECONNRESET,ECONNRESET,"connection reset by peer") \ -EE(WSAENOBUFS,ENOBUFS,"no buffer space available") \ -EE(WSAEISCONN,EISCONN,"socket is already connected") \ -EE(WSAENOTCONN,ENOTCONN,"socket is not connected") \ -EE(WSAESHUTDOWN,ESHUTDOWN,"cannot send after socket shutdown") \ -EE(WSAETOOMANYREFS,ETOOMANYREFS,"too many references") \ -EE(WSAETIMEDOUT,ETIMEDOUT,"connection timed out") \ -EE(WSAECONNREFUSED,ECONNREFUSED,"connection refused") \ -EE(WSAELOOP,ELOOP,"cannot translate name") \ -EE(WSAENAMETOOLONG,ENAMETOOLONG,"name too long") \ -EE(WSAEHOSTDOWN,EHOSTDOWN,"host is down") \ -EE(WSAEHOSTUNREACH,EHOSTUNREACH,"no route to host") \ - -typedef struct { - int winsock; - int unix; - const char* string; -} WinsockError; - -static const WinsockError _winsock_errors[] = { -#define EE(w,u,s) { w, u, s }, - WINSOCK_ERRORS_LIST -#undef EE - { -1, -1, NULL } -}; - -/* this function reads the latest winsock error code and updates - * errno to a matching value. It also returns the new value of - * errno. - */ -static int _fix_errno( void ) -{ - const WinsockError* werr = _winsock_errors; - int unix = EINVAL; /* generic error code */ - - winsock_error = WSAGetLastError(); - - for ( ; werr->string != NULL; werr++ ) { - if (werr->winsock == winsock_error) { - unix = werr->unix; - break; - } - } - errno = unix; - return -1; -} - -#else -static int _fix_errno( void ) -{ - return -1; -} - -#endif - -#define SOCKET_CALL(cmd) \ - int ret; \ -QSOCKET_CALL(ret, (cmd)); \ -if (ret < 0) \ -return _fix_errno(); \ -return ret; \ - -int socket_send(int fd, const void* buf, int buflen) -{ - SOCKET_CALL(send(fd, buf, buflen, 0)) -} - -#ifdef _WIN32 - - static void -socket_close_handler( void* _fd ) -{ - int fd = (int)_fd; - int ret; - char buff[64]; - - /* we want to drain the read side of the socket before closing it */ - do { - ret = recv( fd, buff, sizeof(buff), 0 ); - } while (ret < 0 && WSAGetLastError() == WSAEINTR); - - if (ret < 0 && WSAGetLastError() == EWOULDBLOCK) - return; - - qemu_set_fd_handler( fd, NULL, NULL, NULL ); - closesocket( fd ); -} - - void -socket_close( int fd ) -{ - int old_errno = errno; - - shutdown( fd, SD_BOTH ); - /* we want to drain the socket before closing it */ - qemu_set_fd_handler( fd, socket_close_handler, NULL, (void*)fd ); - - errno = old_errno; -} - -#else /* !_WIN32 */ - -#include <unistd.h> - - void -socket_close( int fd ) -{ - int old_errno = errno; - - shutdown( fd, SHUT_RDWR ); - close( fd ); - - errno = old_errno; -} - -#endif /* !_WIN32 */ - -int inet_strtoip(const char* str, uint32_t *ip) -{ - int comp[4]; - - if (sscanf(str, "%d.%d.%d.%d", &comp[0], &comp[1], &comp[2], &comp[3]) != 4) - return -1; - - if ((unsigned)comp[0] >= 256 || - (unsigned)comp[1] >= 256 || - (unsigned)comp[2] >= 256 || - (unsigned)comp[3] >= 256) - return -1; - - *ip = (uint32_t)((comp[0] << 24) | (comp[1] << 16) | - (comp[2] << 8) | comp[3]); - return 0; -} - -static int check_port_bind_listen(u_int port) -{ - struct sockaddr_in addr; - int s, opt = 1; - int ret = -1; - socklen_t addrlen = sizeof(addr); - memset(&addr, 0, addrlen); - - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = INADDR_ANY; - addr.sin_port = htons(port); - - if (((s = qemu_socket(AF_INET, SOCK_STREAM, 0)) < 0) || -#ifndef _WIN32 - (setsockopt(s, SOL_SOCKET,SO_REUSEADDR, (char *)&opt, sizeof(int)) < 0) || -#endif - (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) || - (listen(s, 1) < 0)) { - - /* fail */ - ret = -1; - ERR( "port(%d) listen fail \n", port); - }else{ - /*fsucess*/ - ret = 1; - INFO( "port(%d) listen ok \n", port); - } - -#ifdef _WIN32 - closesocket(s); -#else - close(s); -#endif - - return ret; -} - -int get_sdb_base_port(void) -{ - int tries = 10; - int success = 0; - u_int port = 26100; - - if(tizen_base_port == 0){ - - for ( ; tries > 0; tries--, port += 10 ) { - if(check_port_bind_listen(port + 1) < 0 ) - continue; - - success = 1; - break; - } - - if (!success) { - ERR( "it seems too many emulator instances are running on this machine. Aborting\n" ); - exit(1); - } - - tizen_base_port = port; - INFO( "sdb port is %d \n", tizen_base_port); - } - - return tizen_base_port; -} - -void sdb_setup(void) -{ - int tries = 10; - int success = 0; - uint32_t guest_ip; - char buf[64] = {0,}; - - inet_strtoip("10.0.2.16", &guest_ip); - - for ( ; tries > 0; tries--, tizen_base_port += 10 ) { - // redir form [tcp:26101:10.0.2.16:26101] - sprintf(buf, "tcp:%d:10.0.2.16:26101", tizen_base_port + 1); - if(net_slirp_redir((char*)buf) < 0) - continue; - - INFO( "SDBD established on port %d\n", tizen_base_port + 1); - success = 1; - break; - } - - INFO("redirect [%s] success\n", buf); - if (!success) { - ERR( "it seems too many emulator instances are running on this machine. Aborting\n" ); - exit(1); - } - - INFO( "Port(%d/tcp) listen for SDB \n", tizen_base_port + 1); - - /* for sensort */ - sprintf(buf, "tcp:%d:10.0.2.16:3577", tizen_base_port + SDB_TCP_EMULD_INDEX ); - if(net_slirp_redir((char*)buf) < 0){ - ERR( "redirect [%s] fail \n", buf); - }else{ - INFO("redirect [%s] success\n", buf); - } -} - -int sdb_loopback_client(int port, int type) -{ - struct sockaddr_in addr; - int s; - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - - s = socket(AF_INET, type, 0); - if(s < 0) return -1; - - if(connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - close(s); - return -1; - } - - return s; - -} - -void notify_sdb_daemon_start(void) { - int s; - /* - * send a simple message to the SDB host server to tell it we just started. - * it should be listening on port 26099. - */ - do { - char tmp[32] = { 0 }; - - // when connecting to loopback:26099, do not use tcp_socket_outgoing function - // tcp_socket_outgoing may occur "dns name service not known" in case of network unavaliable status. - s = sdb_loopback_client(SDB_HOST_PORT, SOCK_STREAM); - if (s < 0) { - INFO("can't create socket to talk to the SDB server \n"); - INFO("This emulator will be scaned by the SDB server \n"); - break; - } - - /* length is hex: 0x13 = 19 */ - sprintf(tmp, "0013host:emulator:%d", tizen_base_port + 1); - - if (socket_send(s, tmp, 30) < 0) { - ERR( "message sending to sdb server error!\n"); - } - - } while (0); - - if (s >= 0) - socket_close(s); -} +/* Copyright (C) 2006-2010 The Android Open Source Project
+**
+** This software is licensed under the terms of the GNU General Public
+** License version 2, as published by the Free Software Foundation, and
+** may be copied, distributed, and modified under those terms.
+**
+** 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.
+*/
+
+
+#ifdef _WIN32
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else /* !_WIN32 */
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <netdb.h>
+#endif /* !_WIN32 */
+
+#include "net/slirp.h"
+#include "qemu_socket.h"
+#include "sdb.h"
+#include "nbd.h"
+#include "tizen/src/debug_ch.h"
+
+//DEFAULT_DEBUG_CHANNEL(qemu);
+MULTI_DEBUG_CHANNEL(qemu, sdb);
+
+/* QSOCKET_CALL is used to deal with the fact that EINTR happens pretty
+ * easily in QEMU since we use SIGALRM to implement periodic timers
+ */
+
+#ifdef _WIN32
+# define QSOCKET_CALL(_ret,_cmd) \
+ do { _ret = (_cmd); } while ( _ret < 0 && WSAGetLastError() == WSAEINTR )
+#else
+# define QSOCKET_CALL(_ret,_cmd) \
+ do { \
+ errno = 0; \
+ do { _ret = (_cmd); } while ( _ret < 0 && errno == EINTR ); \
+ } while (0);
+#endif
+
+#ifdef _WIN32
+
+#include <errno.h>
+
+static int winsock_error;
+
+#define WINSOCK_ERRORS_LIST \
+ EE(WSA_INVALID_HANDLE,EINVAL,"invalid handle") \
+EE(WSA_NOT_ENOUGH_MEMORY,ENOMEM,"not enough memory") \
+EE(WSA_INVALID_PARAMETER,EINVAL,"invalid parameter") \
+EE(WSAEINTR,EINTR,"interrupted function call") \
+EE(WSAEALREADY,EALREADY,"operation already in progress") \
+EE(WSAEBADF,EBADF,"bad file descriptor") \
+EE(WSAEACCES,EACCES,"permission denied") \
+EE(WSAEFAULT,EFAULT,"bad address") \
+EE(WSAEINVAL,EINVAL,"invalid argument") \
+EE(WSAEMFILE,EMFILE,"too many opened files") \
+EE(WSAEWOULDBLOCK,EWOULDBLOCK,"resource temporarily unavailable") \
+EE(WSAEINPROGRESS,EINPROGRESS,"operation now in progress") \
+EE(WSAEALREADY,EAGAIN,"operation already in progress") \
+EE(WSAENOTSOCK,EBADF,"socket operation not on socket") \
+EE(WSAEDESTADDRREQ,EDESTADDRREQ,"destination address required") \
+EE(WSAEMSGSIZE,EMSGSIZE,"message too long") \
+EE(WSAEPROTOTYPE,EPROTOTYPE,"wrong protocol type for socket") \
+EE(WSAENOPROTOOPT,ENOPROTOOPT,"bad protocol option") \
+EE(WSAEADDRINUSE,EADDRINUSE,"address already in use") \
+EE(WSAEADDRNOTAVAIL,EADDRNOTAVAIL,"cannot assign requested address") \
+EE(WSAENETDOWN,ENETDOWN,"network is down") \
+EE(WSAENETUNREACH,ENETUNREACH,"network unreachable") \
+EE(WSAENETRESET,ENETRESET,"network dropped connection on reset") \
+EE(WSAECONNABORTED,ECONNABORTED,"software caused connection abort") \
+EE(WSAECONNRESET,ECONNRESET,"connection reset by peer") \
+EE(WSAENOBUFS,ENOBUFS,"no buffer space available") \
+EE(WSAEISCONN,EISCONN,"socket is already connected") \
+EE(WSAENOTCONN,ENOTCONN,"socket is not connected") \
+EE(WSAESHUTDOWN,ESHUTDOWN,"cannot send after socket shutdown") \
+EE(WSAETOOMANYREFS,ETOOMANYREFS,"too many references") \
+EE(WSAETIMEDOUT,ETIMEDOUT,"connection timed out") \
+EE(WSAECONNREFUSED,ECONNREFUSED,"connection refused") \
+EE(WSAELOOP,ELOOP,"cannot translate name") \
+EE(WSAENAMETOOLONG,ENAMETOOLONG,"name too long") \
+EE(WSAEHOSTDOWN,EHOSTDOWN,"host is down") \
+EE(WSAEHOSTUNREACH,EHOSTUNREACH,"no route to host") \
+
+typedef struct {
+ int winsock;
+ int unix;
+ const char* string;
+} WinsockError;
+
+static const WinsockError _winsock_errors[] = {
+#define EE(w,u,s) { w, u, s },
+ WINSOCK_ERRORS_LIST
+#undef EE
+ { -1, -1, NULL }
+};
+
+/* this function reads the latest winsock error code and updates
+ * errno to a matching value. It also returns the new value of
+ * errno.
+ */
+static int _fix_errno( void )
+{
+ const WinsockError* werr = _winsock_errors;
+ int unix = EINVAL; /* generic error code */
+
+ winsock_error = WSAGetLastError();
+
+ for ( ; werr->string != NULL; werr++ ) {
+ if (werr->winsock == winsock_error) {
+ unix = werr->unix;
+ break;
+ }
+ }
+ errno = unix;
+ return -1;
+}
+
+#else
+static int _fix_errno( void )
+{
+ return -1;
+}
+
+#endif
+
+#define SOCKET_CALL(cmd) \
+ int ret; \
+QSOCKET_CALL(ret, (cmd)); \
+if (ret < 0) \
+return _fix_errno(); \
+return ret; \
+
+int socket_send(int fd, const void* buf, int buflen)
+{
+ SOCKET_CALL(send(fd, buf, buflen, 0))
+}
+
+#ifdef _WIN32
+
+ static void
+socket_close_handler( void* _fd )
+{
+ int fd = (int)_fd;
+ int ret;
+ char buff[64];
+
+ /* we want to drain the read side of the socket before closing it */
+ do {
+ ret = recv( fd, buff, sizeof(buff), 0 );
+ } while (ret < 0 && WSAGetLastError() == WSAEINTR);
+
+ if (ret < 0 && WSAGetLastError() == EWOULDBLOCK)
+ return;
+
+ qemu_set_fd_handler( fd, NULL, NULL, NULL );
+ closesocket( fd );
+}
+
+ void
+socket_close( int fd )
+{
+ int old_errno = errno;
+
+ shutdown( fd, SD_BOTH );
+ /* we want to drain the socket before closing it */
+ qemu_set_fd_handler( fd, socket_close_handler, NULL, (void*)fd );
+
+ errno = old_errno;
+}
+
+#else /* !_WIN32 */
+
+#include <unistd.h>
+
+ void
+socket_close( int fd )
+{
+ int old_errno = errno;
+
+ shutdown( fd, SHUT_RDWR );
+ close( fd );
+
+ errno = old_errno;
+}
+
+#endif /* !_WIN32 */
+
+int inet_strtoip(const char* str, uint32_t *ip)
+{
+ int comp[4];
+
+ if (sscanf(str, "%d.%d.%d.%d", &comp[0], &comp[1], &comp[2], &comp[3]) != 4)
+ return -1;
+
+ if ((unsigned)comp[0] >= 256 ||
+ (unsigned)comp[1] >= 256 ||
+ (unsigned)comp[2] >= 256 ||
+ (unsigned)comp[3] >= 256)
+ return -1;
+
+ *ip = (uint32_t)((comp[0] << 24) | (comp[1] << 16) |
+ (comp[2] << 8) | comp[3]);
+ return 0;
+}
+
+int check_port_bind_listen(u_int port)
+{
+ struct sockaddr_in addr;
+ int s, opt = 1;
+ int ret = -1;
+ socklen_t addrlen = sizeof(addr);
+ memset(&addr, 0, addrlen);
+
+ addr.sin_family = AF_INET;
+ addr.sin_addr.s_addr = INADDR_ANY;
+ addr.sin_port = htons(port);
+
+ if (((s = qemu_socket(AF_INET, SOCK_STREAM, 0)) < 0) ||
+#ifndef _WIN32
+ (setsockopt(s, SOL_SOCKET,SO_REUSEADDR, (char *)&opt, sizeof(int)) < 0) ||
+#endif
+ (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) ||
+ (listen(s, 1) < 0)) {
+
+ /* fail */
+ ret = -1;
+ ERR( "port(%d) listen fail \n", port);
+ }else{
+ /*fsucess*/
+ ret = 1;
+ INFO( "port(%d) listen ok \n", port);
+ }
+
+#ifdef _WIN32
+ closesocket(s);
+#else
+ close(s);
+#endif
+
+ return ret;
+}
+
+int get_sdb_base_port(void)
+{
+ int tries = 10;
+ int success = 0;
+ u_int port = 26100;
+
+ if(tizen_base_port == 0){
+
+ for ( ; tries > 0; tries--, port += 10 ) {
+ if(check_port_bind_listen(port + 1) < 0 )
+ continue;
+
+ success = 1;
+ break;
+ }
+
+ if (!success) {
+ ERR( "it seems too many emulator instances are running on this machine. Aborting\n" );
+ exit(1);
+ }
+
+ tizen_base_port = port;
+ INFO( "sdb port is %d \n", tizen_base_port);
+ }
+
+ return tizen_base_port;
+}
+
+void sdb_setup(void)
+{
+ int tries = 10;
+ int success = 0;
+ uint32_t guest_ip;
+ char buf[64] = {0,};
+ inet_strtoip("10.0.2.16", &guest_ip);
+
+ for ( ; tries > 0; tries--, tizen_base_port += 10 ) {
+ // redir form [tcp:26101:10.0.2.16:26101]
+ sprintf(buf, "tcp:%d:10.0.2.16:26101", tizen_base_port + 1);
+ if(net_slirp_redir((char*)buf) < 0)
+ continue;
+
+ INFO( "SDBD established on port %d\n", tizen_base_port + 1);
+ success = 1;
+ break;
+ }
+
+ INFO("redirect [%s] success\n", buf);
+ if (!success) {
+ ERR( "it seems too many emulator instances are running on this machine. Aborting\n" );
+ exit(1);
+ }
+
+ INFO( "Port(%d/tcp) listen for SDB \n", tizen_base_port + 1);
+
+ /* for sensort */
+ sprintf(buf, "tcp:%d:10.0.2.16:3577", tizen_base_port + SDB_TCP_EMULD_INDEX );
+ if(net_slirp_redir((char*)buf) < 0){
+ ERR( "redirect [%s] fail \n", buf);
+ }else{
+ INFO("redirect [%s] success\n", buf);
+ }
+}
+
+int sdb_loopback_client(int port, int type)
+{
+ struct sockaddr_in addr;
+ int s;
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(port);
+ addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+
+ s = socket(AF_INET, type, 0);
+ if(s < 0) return -1;
+
+ if(connect(s, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+ close(s);
+ return -1;
+ }
+
+ return s;
+
+}
+
+void notify_sdb_daemon_start(void) {
+ int s;
+ /*
+ * send a simple message to the SDB host server to tell it we just started.
+ * it should be listening on port 26099.
+ */
+ do {
+ char tmp[32] = { 0 };
+
+ // when connecting to loopback:26099, do not use tcp_socket_outgoing function
+ // tcp_socket_outgoing may occur "dns name service not known" in case of network unavaliable status.
+ s = sdb_loopback_client(SDB_HOST_PORT, SOCK_STREAM);
+ if (s < 0) {
+ INFO("can't create socket to talk to the SDB server \n");
+ INFO("This emulator will be scaned by the SDB server \n");
+ break;
+ }
+
+ /* length is hex: 0x13 = 19 */
+ sprintf(tmp, "0013host:emulator:%d", tizen_base_port + 1);
+
+ if (socket_send(s, tmp, 30) < 0) {
+ ERR( "message sending to sdb server error!\n");
+ }
+
+ } while (0);
+
+ if (s >= 0)
+ socket_close(s);
+}
diff --git a/tizen/src/sdb.h b/tizen/src/sdb.h index b30951611e..68b48e8e14 100644 --- a/tizen/src/sdb.h +++ b/tizen/src/sdb.h @@ -111,3 +111,4 @@ int socket_send(int fd, const void* buf, int buflen); void socket_close(int fd); void notify_sdb_daemon_start(void); int sdb_loopback_client(int port, int type); +int check_port_bind_listen(u_int port); diff --git a/tizen/src/skin/client/build.xml b/tizen/src/skin/client/build.xml index f82c044a9b..8344cc75fd 100644 --- a/tizen/src/skin/client/build.xml +++ b/tizen/src/skin/client/build.xml @@ -1,6 +1,17 @@ <?xml version="1.0" standalone="yes"?> <project name="emulator-skin" basedir="." default="make-jar"> + <condition property="isWindows"> + <os family="windows" /> + </condition> + <condition property="isLinux"> + <os family="unix" /> + </condition> + <condition property="isMac"> + <os family="mac" /> + </condition> + + <property environment="env" /> <property name="jar.file" value="emulator-skin.jar" /> <property name="mainclass" value="org.tizen.emulator.skin.EmulatorSkinMain" /> @@ -65,7 +76,45 @@ <delete dir="build" /> </target> - <target name="make-jar" depends="compile, create-jar" /> + <target name="create-native-linux" if="isLinux" unless="isMac"> + <echo message="create native shared library on linux..." /> + <javah classpath="build;lib/swt.jar" destdir="native_src"> + <class name="org.tizen.emulator.skin.EmulatorSkin" /> + </javah> + <exec dir="native_src" executable="gcc" failifexecutionfails="false"> + <arg line="-shared" /> + <arg line="-c" /> + <arg line="Share.c" /> + <arg line="-o" /> + <arg line="libshare.so" /> + <arg line="-I${env.JAVA_HOME}/include" /> + <arg line="-fPIC" /> + </exec> + <delete> + <fileset dir="native_src" includes="**/*.h" /> + </delete> + </target> + + <target name="create-native-mac" if="isMac"> + <echo message="create native shared library on mac..." /> + <javah classpath="build;lib/swt.jar" destdir="native_src"> + <class name="org.tizen.emulator.skin.EmulatorSkin" /> + </javah> + <exec dir="native_src" executable="gcc" failifexecutionfails="false"> + <arg line="-dynamiclib" /> + <arg line="-c" /> + <arg line="Share.c" /> + <arg line="-o" /> + <arg line="libshare.dylib" /> + <arg line="-I${env.JAVA_HOME}/Headers" /> + <arg line="-fPIC" /> + </exec> + <delete> + <fileset dir="native_src" includes="**/*.h" /> + </delete> + </target> + + <target name="make-jar" depends="compile, create-native-linux, create-native-mac, create-jar" /> <!-- for dibs system... --> <path id="classpath-dibs"> @@ -79,5 +128,5 @@ </javac> </target> - <target name="make-jar-dibs" depends="compile-dibs, create-jar" /> + <target name="make-jar-dibs" depends="compile-dibs, create-native-linux, create-native-mac, create-jar" /> </project> diff --git a/tizen/src/skin/client/native_src/Share.c b/tizen/src/skin/client/native_src/Share.c new file mode 100644 index 0000000000..20a03e9596 --- /dev/null +++ b/tizen/src/skin/client/native_src/Share.c @@ -0,0 +1,66 @@ +#include <jni.h> +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/ipc.h> +#include <sys/shm.h> +#include "org_tizen_emulator_skin_EmulatorSkin.h" + + +void *shared_memory = (void *)0; +int shmid; + + +JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorSkin_shmget + (JNIEnv *env, jobject obj, jint vga_ram_size) +{ + int mykey = getuid(); + + shmid = shmget((key_t)mykey, (size_t)vga_ram_size, 0666 | IPC_CREAT); + if (shmid == -1) { + return 1; + } + + /* We now make the shared memory accessible to the program. */ + shared_memory = shmat(shmid, (void *)0, 0); + if (shared_memory == (void *)-1) { + return 2; + } + + //printf("Memory attached at %X\n", (int)shared_memory); + + return 0; +} + +JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorSkin_shmdt + (JNIEnv *env, jobject obj) +{ + /* Lastly, the shared memory is detached */ + if (shmdt(shared_memory) == -1) { + return 1; + } + + return 0; +} + +JNIEXPORT jint JNICALL Java_org_tizen_emulator_skin_EmulatorSkin_getPixels + (JNIEnv *env, jobject obj, jintArray array) +{ + int i = 0; + int len = (*env)->GetArrayLength(env, array); + if (len <= 0) { + return -1; + } + + int *framebuffer = (int *)shared_memory; + + jint value = 0xFFFFFFFF; + for(i = 0; i < len; i++) { + value = framebuffer[i]; + (*env)->SetIntArrayRegion(env, array, i, 1, &value); + } + + return len; +} + diff --git a/tizen/src/skin/client/skins/emul_320x480/default.dbi b/tizen/src/skin/client/skins/emul-320x480/default.dbi index b57c94a10f..517493cf64 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default.dbi +++ b/tizen/src/skin/client/skins/emul-320x480/default.dbi @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <dbi version="2.0"/> <rotations> <rotation name="Portrait"> <lcd id="0"> diff --git a/tizen/src/skin/client/skins/emul_320x480/default_0.png b/tizen/src/skin/client/skins/emul-320x480/default_0.png Binary files differindex 3409f5f16d..3409f5f16d 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default_0.png +++ b/tizen/src/skin/client/skins/emul-320x480/default_0.png diff --git a/tizen/src/skin/client/skins/emul_320x480/default_0_p.png b/tizen/src/skin/client/skins/emul-320x480/default_0_p.png Binary files differindex 66932f6430..66932f6430 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default_0_p.png +++ b/tizen/src/skin/client/skins/emul-320x480/default_0_p.png diff --git a/tizen/src/skin/client/skins/emul_320x480/default_180.png b/tizen/src/skin/client/skins/emul-320x480/default_180.png Binary files differindex 692ca84956..692ca84956 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default_180.png +++ b/tizen/src/skin/client/skins/emul-320x480/default_180.png diff --git a/tizen/src/skin/client/skins/emul_320x480/default_180_p.png b/tizen/src/skin/client/skins/emul-320x480/default_180_p.png Binary files differindex c7641f36e7..c7641f36e7 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default_180_p.png +++ b/tizen/src/skin/client/skins/emul-320x480/default_180_p.png diff --git a/tizen/src/skin/client/skins/emul_320x480/default_L90.png b/tizen/src/skin/client/skins/emul-320x480/default_L90.png Binary files differindex 3150710ce2..3150710ce2 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default_L90.png +++ b/tizen/src/skin/client/skins/emul-320x480/default_L90.png diff --git a/tizen/src/skin/client/skins/emul_320x480/default_L90_p.png b/tizen/src/skin/client/skins/emul-320x480/default_L90_p.png Binary files differindex b1b4d65f05..b1b4d65f05 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default_L90_p.png +++ b/tizen/src/skin/client/skins/emul-320x480/default_L90_p.png diff --git a/tizen/src/skin/client/skins/emul_320x480/default_R90.png b/tizen/src/skin/client/skins/emul-320x480/default_R90.png Binary files differindex 691bcef729..691bcef729 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default_R90.png +++ b/tizen/src/skin/client/skins/emul-320x480/default_R90.png diff --git a/tizen/src/skin/client/skins/emul_320x480/default_R90_p.png b/tizen/src/skin/client/skins/emul-320x480/default_R90_p.png Binary files differindex 021e7bd09b..021e7bd09b 100644 --- a/tizen/src/skin/client/skins/emul_320x480/default_R90_p.png +++ b/tizen/src/skin/client/skins/emul-320x480/default_R90_p.png diff --git a/tizen/src/skin/client/skins/emul_480x800/default.dbi b/tizen/src/skin/client/skins/emul-480x800/default.dbi index 5519f5618e..1403fe8628 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default.dbi +++ b/tizen/src/skin/client/skins/emul-480x800/default.dbi @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <dbi version="2.0"/> <rotations> <rotation name="Portrait"> <lcd id="0"> diff --git a/tizen/src/skin/client/skins/emul_480x800/default_0.png b/tizen/src/skin/client/skins/emul-480x800/default_0.png Binary files differindex 6d33f38e8f..6d33f38e8f 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default_0.png +++ b/tizen/src/skin/client/skins/emul-480x800/default_0.png diff --git a/tizen/src/skin/client/skins/emul_480x800/default_0_p.png b/tizen/src/skin/client/skins/emul-480x800/default_0_p.png Binary files differindex 2f1da59f87..2f1da59f87 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default_0_p.png +++ b/tizen/src/skin/client/skins/emul-480x800/default_0_p.png diff --git a/tizen/src/skin/client/skins/emul_480x800/default_180.png b/tizen/src/skin/client/skins/emul-480x800/default_180.png Binary files differindex 5e8d2766ed..5e8d2766ed 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default_180.png +++ b/tizen/src/skin/client/skins/emul-480x800/default_180.png diff --git a/tizen/src/skin/client/skins/emul_480x800/default_180_p.png b/tizen/src/skin/client/skins/emul-480x800/default_180_p.png Binary files differindex 8b50699cdc..8b50699cdc 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default_180_p.png +++ b/tizen/src/skin/client/skins/emul-480x800/default_180_p.png diff --git a/tizen/src/skin/client/skins/emul_480x800/default_L90.png b/tizen/src/skin/client/skins/emul-480x800/default_L90.png Binary files differindex 76d008f51e..76d008f51e 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default_L90.png +++ b/tizen/src/skin/client/skins/emul-480x800/default_L90.png diff --git a/tizen/src/skin/client/skins/emul_480x800/default_L90_p.png b/tizen/src/skin/client/skins/emul-480x800/default_L90_p.png Binary files differindex ca23955550..ca23955550 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default_L90_p.png +++ b/tizen/src/skin/client/skins/emul-480x800/default_L90_p.png diff --git a/tizen/src/skin/client/skins/emul_480x800/default_R90.png b/tizen/src/skin/client/skins/emul-480x800/default_R90.png Binary files differindex 7be72f73f8..7be72f73f8 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default_R90.png +++ b/tizen/src/skin/client/skins/emul-480x800/default_R90.png diff --git a/tizen/src/skin/client/skins/emul_480x800/default_R90_p.png b/tizen/src/skin/client/skins/emul-480x800/default_R90_p.png Binary files differindex 98de699ac3..98de699ac3 100644 --- a/tizen/src/skin/client/skins/emul_480x800/default_R90_p.png +++ b/tizen/src/skin/client/skins/emul-480x800/default_R90_p.png diff --git a/tizen/src/skin/client/skins/emul_600x1024/default.dbi b/tizen/src/skin/client/skins/emul-600x1024/default.dbi index 42b5d6fbf9..ab5ac5efac 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default.dbi +++ b/tizen/src/skin/client/skins/emul-600x1024/default.dbi @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <dbi version="2.0"/> <rotations> <rotation name="Portrait"> <lcd id="0"> diff --git a/tizen/src/skin/client/skins/emul_600x1024/default_0.png b/tizen/src/skin/client/skins/emul-600x1024/default_0.png Binary files differindex bf63d2fc0e..bf63d2fc0e 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default_0.png +++ b/tizen/src/skin/client/skins/emul-600x1024/default_0.png diff --git a/tizen/src/skin/client/skins/emul_600x1024/default_0_p.png b/tizen/src/skin/client/skins/emul-600x1024/default_0_p.png Binary files differindex 7e165904df..7e165904df 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default_0_p.png +++ b/tizen/src/skin/client/skins/emul-600x1024/default_0_p.png diff --git a/tizen/src/skin/client/skins/emul_600x1024/default_180.png b/tizen/src/skin/client/skins/emul-600x1024/default_180.png Binary files differindex 198d4e966c..198d4e966c 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default_180.png +++ b/tizen/src/skin/client/skins/emul-600x1024/default_180.png diff --git a/tizen/src/skin/client/skins/emul_600x1024/default_180_p.png b/tizen/src/skin/client/skins/emul-600x1024/default_180_p.png Binary files differindex c77beafa37..c77beafa37 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default_180_p.png +++ b/tizen/src/skin/client/skins/emul-600x1024/default_180_p.png diff --git a/tizen/src/skin/client/skins/emul_600x1024/default_L90.png b/tizen/src/skin/client/skins/emul-600x1024/default_L90.png Binary files differindex a3a3d40a84..a3a3d40a84 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default_L90.png +++ b/tizen/src/skin/client/skins/emul-600x1024/default_L90.png diff --git a/tizen/src/skin/client/skins/emul_600x1024/default_L90_p.png b/tizen/src/skin/client/skins/emul-600x1024/default_L90_p.png Binary files differindex 3a110eb666..3a110eb666 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default_L90_p.png +++ b/tizen/src/skin/client/skins/emul-600x1024/default_L90_p.png diff --git a/tizen/src/skin/client/skins/emul_600x1024/default_R90.png b/tizen/src/skin/client/skins/emul-600x1024/default_R90.png Binary files differindex 2b94d2183d..2b94d2183d 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default_R90.png +++ b/tizen/src/skin/client/skins/emul-600x1024/default_R90.png diff --git a/tizen/src/skin/client/skins/emul_600x1024/default_R90_p.png b/tizen/src/skin/client/skins/emul-600x1024/default_R90_p.png Binary files differindex ae3b0693d5..ae3b0693d5 100644 --- a/tizen/src/skin/client/skins/emul_600x1024/default_R90_p.png +++ b/tizen/src/skin/client/skins/emul-600x1024/default_R90_p.png diff --git a/tizen/src/skin/client/skins/emul_720x1280/default.dbi b/tizen/src/skin/client/skins/emul-720x1280/default.dbi index 3f4fbb6417..e1392aed2b 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default.dbi +++ b/tizen/src/skin/client/skins/emul-720x1280/default.dbi @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <dbi version="2.0"/> <rotations> <rotation name="Portrait"> <lcd id="0"> diff --git a/tizen/src/skin/client/skins/emul_720x1280/default_0.png b/tizen/src/skin/client/skins/emul-720x1280/default_0.png Binary files differindex b1fd216277..b1fd216277 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default_0.png +++ b/tizen/src/skin/client/skins/emul-720x1280/default_0.png diff --git a/tizen/src/skin/client/skins/emul_720x1280/default_0_p.png b/tizen/src/skin/client/skins/emul-720x1280/default_0_p.png Binary files differindex b3ce60b856..b3ce60b856 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default_0_p.png +++ b/tizen/src/skin/client/skins/emul-720x1280/default_0_p.png diff --git a/tizen/src/skin/client/skins/emul_720x1280/default_180.png b/tizen/src/skin/client/skins/emul-720x1280/default_180.png Binary files differindex def702877d..def702877d 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default_180.png +++ b/tizen/src/skin/client/skins/emul-720x1280/default_180.png diff --git a/tizen/src/skin/client/skins/emul_720x1280/default_180_p.png b/tizen/src/skin/client/skins/emul-720x1280/default_180_p.png Binary files differindex 4b6c5a1e67..4b6c5a1e67 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default_180_p.png +++ b/tizen/src/skin/client/skins/emul-720x1280/default_180_p.png diff --git a/tizen/src/skin/client/skins/emul_720x1280/default_L90.png b/tizen/src/skin/client/skins/emul-720x1280/default_L90.png Binary files differindex 63c2394d92..63c2394d92 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default_L90.png +++ b/tizen/src/skin/client/skins/emul-720x1280/default_L90.png diff --git a/tizen/src/skin/client/skins/emul_720x1280/default_L90_p.png b/tizen/src/skin/client/skins/emul-720x1280/default_L90_p.png Binary files differindex 5ec17eddce..5ec17eddce 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default_L90_p.png +++ b/tizen/src/skin/client/skins/emul-720x1280/default_L90_p.png diff --git a/tizen/src/skin/client/skins/emul_720x1280/default_R90.png b/tizen/src/skin/client/skins/emul-720x1280/default_R90.png Binary files differindex 45e869e302..45e869e302 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default_R90.png +++ b/tizen/src/skin/client/skins/emul-720x1280/default_R90.png diff --git a/tizen/src/skin/client/skins/emul_720x1280/default_R90_p.png b/tizen/src/skin/client/skins/emul-720x1280/default_R90_p.png Binary files differindex 5d2e47dd44..5d2e47dd44 100644 --- a/tizen/src/skin/client/skins/emul_720x1280/default_R90_p.png +++ b/tizen/src/skin/client/skins/emul-720x1280/default_R90_p.png diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default.dbi b/tizen/src/skin/client/skins/emul_3keys_320x480/default.dbi deleted file mode 100644 index 4b77adb04a..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default.dbi +++ /dev/null @@ -1,244 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <rotations> - <rotation name="Portrait"> - <lcd id="0"> - <region left="26" top="70" width="320" height="480"/> - </lcd> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="71" top="552" width="54" height="54"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="159" top="552" width="54" height="54"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="247" top="552" width="54" height="54"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="362" top="487" width="15" height="70"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="362" top="63" width="15" height="70"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="362" top="140" width="15" height="70"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <lcd id="0"> - <region left="70" top="34" width="480" height="320"/> - </lcd> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="552" top="255" width="54" height="54"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="552" top="167" width="54" height="54"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="552" top="79" width="54" height="54"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="486" top="3" width="70" height="15"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="63" top="3" width="70" height="15"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="139" top="3" width="70" height="15"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <lcd id="0"> - <region left="34" top="70" width="320" height="480"/> - </lcd> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="255" top="14" width="54" height="54"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="167" top="14" width="54" height="54"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="79" top="14" width="54" height="54"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="3" top="64" width="15" height="70"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="3" top="488" width="15" height="70"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="3" top="412" width="15" height="70"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <lcd id="0"> - <region left="70" top="26" width="480" height="320"/> - </lcd> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="14" top="71" width="54" height="54"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="14" top="159" width="54" height="54"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="14" top="247" width="54" height="54"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="64" top="362" width="70" height="15"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="488" top="362" width="70" height="15"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="412" top="362" width="70" height="15"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <colors> - <hoverColor B="255" G="255" R="255" /> - </colors> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default_0.png b/tizen/src/skin/client/skins/emul_3keys_320x480/default_0.png Binary files differdeleted file mode 100644 index d97869a9c5..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default_0_p.png b/tizen/src/skin/client/skins/emul_3keys_320x480/default_0_p.png Binary files differdeleted file mode 100644 index 2ee77feb3b..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default_180.png b/tizen/src/skin/client/skins/emul_3keys_320x480/default_180.png Binary files differdeleted file mode 100644 index dcd58a5a33..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default_180_p.png b/tizen/src/skin/client/skins/emul_3keys_320x480/default_180_p.png Binary files differdeleted file mode 100644 index fd36e04010..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default_L90.png b/tizen/src/skin/client/skins/emul_3keys_320x480/default_L90.png Binary files differdeleted file mode 100644 index 803dae2e69..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default_L90_p.png b/tizen/src/skin/client/skins/emul_3keys_320x480/default_L90_p.png Binary files differdeleted file mode 100644 index 3020249c02..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default_R90.png b/tizen/src/skin/client/skins/emul_3keys_320x480/default_R90.png Binary files differdeleted file mode 100644 index c548e13a9e..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_320x480/default_R90_p.png b/tizen/src/skin/client/skins/emul_3keys_320x480/default_R90_p.png Binary files differdeleted file mode 100644 index 4e13502d36..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_320x480/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default.dbi b/tizen/src/skin/client/skins/emul_3keys_480x800/default.dbi deleted file mode 100644 index 317d24ac40..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default.dbi +++ /dev/null @@ -1,244 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <rotations> - <rotation name="Portrait"> - <lcd id="0"> - <region height="800" left="35" top="86" width="480"/> - </lcd> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="118" top="887" width="74" height="74"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region height="74" left="238" top="887" width="74"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="360" top="887" width="74" height="74"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region height="74" left="541" top="819" width="20"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region height="74" left="541" top="81" width="20"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region height="74" left="541" top="167" width="20"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <lcd id="0"> - <region height="480" left="86" top="46" width="800"/> - </lcd> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="887" top="369" width="74" height="74"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region height="74" left="887" top="249" width="74"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="887" top="127" width="74" height="74"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region height="20" left="818" top="2" width="74"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region height="20" left="80" top="2" width="74"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region height="20" left="165" top="2" width="74"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <lcd id="0"> - <region left="46" top="89" width="480" height="800"/> - </lcd> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="368" top="14" width="74" height="74"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="249" top="14" width="74" height="74"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="126" top="14" width="74" height="74"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="2" top="84" width="20" height="74"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="2" top="821" width="20" height="74"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="2" top="735" width="20" height="74"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <lcd id="0"> - <region left="90" top="35" width="800" height="480"/> - </lcd> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="15" top="118" width="74" height="74"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="15" top="239" width="74" height="74"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="15" top="360" width="74" height="74"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="84" top="539" width="74" height="20"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="822" top="539" width="74" height="20"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="735" top="539" width="74" height="20"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <colors> - <hoverColor B="255" G="255" R="255" /> - </colors> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default_0.png b/tizen/src/skin/client/skins/emul_3keys_480x800/default_0.png Binary files differdeleted file mode 100644 index 034fb0d36f..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default_0_p.png b/tizen/src/skin/client/skins/emul_3keys_480x800/default_0_p.png Binary files differdeleted file mode 100644 index 195fa2441a..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default_180.png b/tizen/src/skin/client/skins/emul_3keys_480x800/default_180.png Binary files differdeleted file mode 100644 index b70abd9353..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default_180_p.png b/tizen/src/skin/client/skins/emul_3keys_480x800/default_180_p.png Binary files differdeleted file mode 100644 index a92a0c7f69..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default_L90.png b/tizen/src/skin/client/skins/emul_3keys_480x800/default_L90.png Binary files differdeleted file mode 100644 index 178e55b487..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default_L90_p.png b/tizen/src/skin/client/skins/emul_3keys_480x800/default_L90_p.png Binary files differdeleted file mode 100644 index 8f4d2f8501..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default_R90.png b/tizen/src/skin/client/skins/emul_3keys_480x800/default_R90.png Binary files differdeleted file mode 100644 index b9261b565f..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_480x800/default_R90_p.png b/tizen/src/skin/client/skins/emul_3keys_480x800/default_R90_p.png Binary files differdeleted file mode 100644 index 5c060a48af..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_480x800/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default.dbi b/tizen/src/skin/client/skins/emul_3keys_600x1024/default.dbi deleted file mode 100644 index 889518888d..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default.dbi +++ /dev/null @@ -1,244 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <rotations> - <rotation name="Portrait"> - <lcd id="0"> - <region left="52" top="109" width="600" height="1024" scale="1"/> - </lcd> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="151" top="1139" width="84" height="84"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="310" top="1139" width="84" height="84"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="471" top="1139" width="84" height="84"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="690" top="1055" width="24" height="88"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="690" top="101" width="24" height="88"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="690" top="194" width="24" height="88"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <lcd id="0"> - <region left="109" top="62" width="1024" height="600" scale="1"/> - </lcd> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="1138" top="480" width="84" height="84"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="1138" top="321" width="84" height="84"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="1138" top="161" width="84" height="84"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="1054" top="1" width="88" height="24"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="99" top="1" width="88" height="24"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="194" top="1" width="88" height="24"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <lcd id="0"> - <region left="62" top="113" width="600" height="1024" scale="1"/> - </lcd> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="479" top="24" width="84" height="84"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="320" top="24" width="84" height="84"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="159" top="24" width="84" height="84"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="1" top="106" width="24" height="88"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="1" top="1059" width="24" height="88"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="1" top="964" width="24" height="88"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <lcd id="0"> - <region left="113" top="52" width="1024" height="600" scale="1"/> - </lcd> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="23" top="148" width="84" height="84"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="23" top="310" width="84" height="84"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="23" top="470" width="84" height="84"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="105" top="690" width="88" height="24"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="1058" top="690" width="88" height="24"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="965" top="690" width="88" height="24"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <colors> - <hoverColor B="255" G="255" R="255" /> - </colors> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_0.png b/tizen/src/skin/client/skins/emul_3keys_600x1024/default_0.png Binary files differdeleted file mode 100644 index 31a6fee2aa..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_0_p.png b/tizen/src/skin/client/skins/emul_3keys_600x1024/default_0_p.png Binary files differdeleted file mode 100644 index 4e32200389..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_180.png b/tizen/src/skin/client/skins/emul_3keys_600x1024/default_180.png Binary files differdeleted file mode 100644 index cd9913973d..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_180_p.png b/tizen/src/skin/client/skins/emul_3keys_600x1024/default_180_p.png Binary files differdeleted file mode 100644 index 30f22d4620..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_L90.png b/tizen/src/skin/client/skins/emul_3keys_600x1024/default_L90.png Binary files differdeleted file mode 100644 index c438dd337c..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_L90_p.png b/tizen/src/skin/client/skins/emul_3keys_600x1024/default_L90_p.png Binary files differdeleted file mode 100644 index 665d85877a..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_R90.png b/tizen/src/skin/client/skins/emul_3keys_600x1024/default_R90.png Binary files differdeleted file mode 100644 index 9c786d929e..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_R90_p.png b/tizen/src/skin/client/skins/emul_3keys_600x1024/default_R90_p.png Binary files differdeleted file mode 100644 index 3f7d9f749b..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_600x1024/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default.dbi b/tizen/src/skin/client/skins/emul_3keys_720x1280/default.dbi deleted file mode 100644 index b2ee97fc51..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default.dbi +++ /dev/null @@ -1,244 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<EmulatorUI xmlns="http://www.tizen.org/emulator/dbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <rotations> - <rotation name="Portrait"> - <lcd id="0"> - <region left="67" top="116" width="720" height="1280"/> - </lcd> - <imageList> - <mainImage>default_0.png</mainImage> - <keyPressedImage>default_0_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="210" top="1401" width="84" height="84"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="390" top="1401" width="84" height="84"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="570" top="1401" width="84" height="84"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="841" top="1309" width="24" height="96"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="841" top="108" width="24" height="96"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="841" top="219" width="24" height="96"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Landscape"> - <lcd id="0"> - <region left="116" top="78" width="1280" height="720"/> - </lcd> - <imageList> - <mainImage>default_L90.png</mainImage> - <keyPressedImage>default_L90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="1400" top="570" width="84" height="84"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="1400" top="392" width="84" height="84"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="1400" top="210" width="84" height="84"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="1308" top="2" width="96" height="24"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="108" top="2" width="96" height="24"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="217" top="2" width="96" height="24"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Portrait"> - <lcd id="0"> - <region left="78" top="117" width="720" height="1280"/> - </lcd> - <imageList> - <mainImage>default_180.png</mainImage> - <keyPressedImage>default_180_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="570" top="30" width="84" height="84"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="390" top="30" width="84" height="84"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="210" top="30" width="84" height="84"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="2" top="110" width="24" height="96"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="2" top="1310" width="24" height="96"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="2" top="1200" width="24" height="96"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - <rotation name="Reverse Landscape"> - <lcd id="0"> - <region left="117" top="67" width="1280" height="720"/> - </lcd> - <imageList> - <mainImage>default_R90.png</mainImage> - <keyPressedImage>default_R90_p.png</keyPressedImage> - </imageList> - <keyMapList> - <keyMap> - <region left="28" top="209" width="84" height="84"/> - <eventInfo> - <keyCode>100</keyCode> - <keyName>SEND</keyName> - </eventInfo> - <tooltip>Send</tooltip> - </keyMap> - <keyMap> - <region left="28" top="391" width="84" height="84"/> - <eventInfo> - <keyCode>101</keyCode> - <keyName>HOME</keyName> - </eventInfo> - <tooltip>Home</tooltip> - </keyMap> - <keyMap> - <region left="28" top="568" width="84" height="84"/> - <eventInfo> - <keyCode>102</keyCode> - <keyName>END</keyName> - </eventInfo> - <tooltip>End</tooltip> - </keyMap> - <keyMap> - <region left="109" top="841" width="96" height="24"/> - <eventInfo> - <keyCode>103</keyCode> - <keyName>POWER</keyName> - </eventInfo> - <tooltip>Power</tooltip> - </keyMap> - <keyMap> - <region left="1309" top="841" width="96" height="24"/> - <eventInfo> - <keyCode>115</keyCode> - <keyName>VOLUME_UP</keyName> - </eventInfo> - <tooltip>Volume-up</tooltip> - </keyMap> - <keyMap> - <region left="1199" top="841" width="96" height="24"/> - <eventInfo> - <keyCode>114</keyCode> - <keyName>VOLUME_DOWN</keyName> - </eventInfo> - <tooltip>Volume-down</tooltip> - </keyMap> - </keyMapList> - </rotation> - </rotations> - <colors> - <hoverColor B="255" G="255" R="255" /> - </colors> -</EmulatorUI> diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_0.png b/tizen/src/skin/client/skins/emul_3keys_720x1280/default_0.png Binary files differdeleted file mode 100644 index b0d49cfe3d..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_0.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_0_p.png b/tizen/src/skin/client/skins/emul_3keys_720x1280/default_0_p.png Binary files differdeleted file mode 100644 index 1d3058a787..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_0_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_180.png b/tizen/src/skin/client/skins/emul_3keys_720x1280/default_180.png Binary files differdeleted file mode 100644 index 8b59e00806..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_180.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_180_p.png b/tizen/src/skin/client/skins/emul_3keys_720x1280/default_180_p.png Binary files differdeleted file mode 100644 index 2850db241b..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_180_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_L90.png b/tizen/src/skin/client/skins/emul_3keys_720x1280/default_L90.png Binary files differdeleted file mode 100644 index 15df50d010..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_L90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_L90_p.png b/tizen/src/skin/client/skins/emul_3keys_720x1280/default_L90_p.png Binary files differdeleted file mode 100644 index 35d3c974b6..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_L90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_R90.png b/tizen/src/skin/client/skins/emul_3keys_720x1280/default_R90.png Binary files differdeleted file mode 100644 index f886480412..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_R90.png +++ /dev/null diff --git a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_R90_p.png b/tizen/src/skin/client/skins/emul_3keys_720x1280/default_R90_p.png Binary files differdeleted file mode 100644 index d582bfa9d0..0000000000 --- a/tizen/src/skin/client/skins/emul_3keys_720x1280/default_R90_p.png +++ /dev/null diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSdlSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSdlSkin.java new file mode 100644 index 0000000000..0cfb5b997d --- /dev/null +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSdlSkin.java @@ -0,0 +1,13 @@ +package org.tizen.emulator.skin; + +import org.tizen.emulator.skin.config.EmulatorConfig; + +public class EmulatorSdlSkin extends EmulatorSkin { + /** + * Constructor + */ + public EmulatorSdlSkin(EmulatorConfig config, boolean isOnTop) { + super(config, isOnTop); + } + +} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java new file mode 100644 index 0000000000..d7602b4fc0 --- /dev/null +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java @@ -0,0 +1,150 @@ +package org.tizen.emulator.skin; + +import org.eclipse.swt.events.PaintEvent; +import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.PaletteData; +import org.eclipse.swt.graphics.Transform; +import org.eclipse.swt.widgets.Display; +import org.tizen.emulator.skin.config.EmulatorConfig; + +public class EmulatorShmSkin extends EmulatorSkin { + public static final int RED_MASK = 0x00FF0000; + public static final int GREEN_MASK = 0x0000FF00; + public static final int BLUE_MASK = 0x000000FF; + public static final int COLOR_DEPTH = 32; + + /* define JNI functions */ + public native int shmget(int size); + public native int shmdt(); + public native int getPixels(int[] array); + + PaletteData paletteData; + public PollFBThread pollThread; + + class PollFBThread extends Thread { + private Display display; + private int lcdWidth; + private int lcdHeight; + private int[] array; + private ImageData imageData; + private Image framebuffer; + + private volatile boolean stopRequest; + private Runnable runnable; + + public PollFBThread(int lcdWidth, int lcdHeight) { + this.display = Display.getDefault(); + this.lcdWidth = lcdWidth; + this.lcdHeight = lcdHeight; + this.array = new int[lcdWidth * lcdHeight]; + this.imageData = new ImageData(lcdWidth, lcdHeight, COLOR_DEPTH, paletteData); + this.framebuffer = new Image(Display.getDefault(), imageData); + + this.runnable = new Runnable() { + public void run() { + // logger.info("update lcd framebuffer"); + lcdCanvas.redraw(); + } + }; + } + + public void run() { + stopRequest = false; + + while (!stopRequest) { + synchronized (this) { + try { + this.wait(30); //30ms + } catch (InterruptedException ex) { + break; + } + } + + int result = getPixels(array); //from shared memory + //logger.info("getPixels navtive function returned " + result); + + for (int i = 0; i < lcdHeight; i++) { + imageData.setPixels(0, i, lcdWidth, array, i * lcdWidth); + } + + Image temp = framebuffer; + framebuffer = new Image(display, imageData); + temp.dispose(); + + display.asyncExec(runnable); //redraw canvas + } + } + + public void stopRequest() { + stopRequest = true; + } + } + + /** + * Constructor + */ + public EmulatorShmSkin(EmulatorConfig config, boolean isOnTop) { + super(config, isOnTop); + + this.paletteData = new PaletteData(RED_MASK, GREEN_MASK, BLUE_MASK); + } + + public long compose() { + long ret = super.compose(); + + int result = shmget(currentLcdWidth * currentLcdHeight); //initialize shared memory + //logger.info("shmget navtive function returned " + result); + + pollThread = new PollFBThread(currentLcdWidth, currentLcdHeight); //update lcd thread + + lcdCanvas.addPaintListener(new PaintListener() { + public void paintControl(PaintEvent e) { + /* e.gc.setAdvanced(true); + if (!e.gc.getAdvanced()) { + logger.info("Advanced graphics not supported"); + } */ + + int x = lcdCanvas.getSize().x; + int y = lcdCanvas.getSize().y; + if (currentAngle == 0) { //portrait + e.gc.drawImage(pollThread.framebuffer, + 0, 0, pollThread.lcdWidth, pollThread.lcdHeight, + 0, 0, x, y); + return; + } + + Transform transform = new Transform(lcdCanvas.getDisplay()); + transform.rotate(currentAngle); + + if (currentAngle == 90) { //reverse landscape + int temp; + temp = x; + x = y; + y = temp; + transform.translate(0, y * -1); + } else if (currentAngle == 180) { //reverse portrait + transform.translate(x * -1, y * -1); + } else if (currentAngle == -90) { //landscape + int temp; + temp = x; + x = y; + y = temp; + transform.translate(x * -1, 0); + } + + e.gc.setTransform(transform); + e.gc.drawImage(pollThread.framebuffer, + 0, 0, pollThread.lcdWidth, pollThread.lcdHeight, + 0, 0, x, y); + + transform.dispose(); + } + }); + + pollThread.start(); + + return ret; + } +} diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java index 5820717a17..70fd656789 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java @@ -95,6 +95,7 @@ import org.tizen.emulator.skin.screenshot.ScreenShotDialog; import org.tizen.emulator.skin.util.SkinRegion; import org.tizen.emulator.skin.util.SkinRotation; import org.tizen.emulator.skin.util.SkinUtil; +import org.tizen.emulator.skin.util.SwtUtil; /** * @@ -124,25 +125,26 @@ public class EmulatorSkin { public static final String GTK_OS_CLASS = "org.eclipse.swt.internal.gtk.OS"; public static final String WIN32_OS_CLASS = "org.eclipse.swt.internal.win32.OS"; + public static final String COCOA_OS_CLASS = "org.eclipse.swt.internal.cocoa.OS"; private Logger logger = SkinLogger.getSkinLogger( EmulatorSkin.class ).getLogger(); - private EmulatorConfig config; + protected EmulatorConfig config; private Shell shell; private ImageRegistry imageRegistry; - private Canvas lcdCanvas; + protected Canvas lcdCanvas; private Image currentImage; private Image currentKeyPressedImage; private Color hoverColor; private boolean isDefaultHoverColor; - private int currentScale; - private short currentRotationId; - private int currentAngle; - private int currentLcdWidth; - private int currentLcdHeight; - private SkinRegion currentHoverRegion; - private SkinRegion currentPressedRegion; + protected int currentScale; + protected short currentRotationId; + protected int currentAngle; + protected int currentLcdWidth; + protected int currentLcdHeight; + protected SkinRegion currentHoverRegion; + protected SkinRegion currentPressedRegion; private int pressedMouseX; private int pressedMouseY; @@ -208,6 +210,7 @@ public class EmulatorSkin { short rotationId = EmulatorConfig.DEFAULT_WINDOW_ROTATION; composeInternal( lcdCanvas, x, y, lcdWidth, lcdHeight, scale, rotationId, false ); + logger.info("lcdWidth : " + lcdWidth + ", lcdHeight : " + lcdHeight + ", scale : " + scale); // sdl uses this handle id. windowHandleId = getWindowHandleId(); @@ -230,7 +233,7 @@ public class EmulatorSkin { String emulatorName = SkinUtil.makeEmulatorName( config ); shell.setText( emulatorName ); - if ( SkinUtil.isWindowsPlatform() ) { + if ( SwtUtil.isWindowsPlatform() ) { shell.setImage( imageRegistry.getIcon( IconName.EMULATOR_TITLE_ICO ) ); } else { shell.setImage( imageRegistry.getIcon( IconName.EMULATOR_TITLE ) ); @@ -303,46 +306,63 @@ public class EmulatorSkin { long windowHandleId = 0; - if ( SkinUtil.isLinuxPlatform() ) { + /* org.eclipse.swt.widgets.Widget */ + if (SwtUtil.isLinuxPlatform()) { try { /* * Accessing private fields of other classes via reflection * is VERY BAD, must be fixed ! */ - Field field = lcdCanvas.getClass().getField( "embeddedHandle" ); + Field field = lcdCanvas.getClass().getField("embeddedHandle"); try { windowHandleId = field.getInt( lcdCanvas ); } catch ( Exception e ) { windowHandleId = (int)field.getLong( lcdCanvas ); } - logger.info( "lcdCanvas.embeddedHandle:" + windowHandleId ); - } catch ( IllegalArgumentException e ) { - logger.log( Level.SEVERE, e.getMessage(), e ); + logger.info("lcdCanvas.embeddedHandle:" + windowHandleId); + } catch (IllegalArgumentException e) { + logger.log(Level.SEVERE, e.getMessage(), e); shutdown(); - } catch ( IllegalAccessException e ) { - logger.log( Level.SEVERE, e.getMessage(), e ); + } catch (IllegalAccessException e ) { + logger.log(Level.SEVERE, e.getMessage(), e); shutdown(); - } catch ( SecurityException e ) { - logger.log( Level.SEVERE, e.getMessage(), e ); + } catch (SecurityException e ) { + logger.log(Level.SEVERE, e.getMessage(), e); shutdown(); - } catch ( NoSuchFieldException e ) { - logger.log( Level.SEVERE, e.getMessage(), e ); + } catch (NoSuchFieldException e) { + logger.log(Level.SEVERE, e.getMessage(), e); shutdown(); } - } else if ( SkinUtil.isWindowsPlatform() ) { + } else if (SwtUtil.isWindowsPlatform()) { - logger.info( "lcdCanvas.handle:" + lcdCanvas.handle ); - windowHandleId = lcdCanvas.handle; + try { + Field field = lcdCanvas.getClass().getField("handle"); + windowHandleId = field.getLong(lcdCanvas); + logger.info("lcdCanvas.handle:" + windowHandleId); + } catch (IllegalArgumentException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + shutdown(); + } catch (IllegalAccessException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + shutdown(); + } catch (SecurityException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + shutdown(); + } catch (NoSuchFieldException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + shutdown(); + } - } else if ( SkinUtil.isMacPlatform() ) { + } else if (SwtUtil.isMacPlatform()) { - // TODO + // not supported + windowHandleId = 0; } else { - logger.severe( "Not Supported OS platform:" + SWT.getPlatform() ); - System.exit( -1 ); + logger.severe("Not Supported OS platform:" + SWT.getPlatform()); + System.exit(-1); } return windowHandleId; @@ -841,7 +861,7 @@ public class EmulatorSkin { previous = null; - if( SkinUtil.isWindowsPlatform() && disappearEvent) { + if( SwtUtil.isWindowsPlatform() && disappearEvent) { disappearEvent = false; if (isMetaKey(e) && e.character != '\0') { logger.info( "send previous release : keycode=" + disappearKeycode + @@ -863,7 +883,7 @@ public class EmulatorSkin { public void keyPressed( KeyEvent e ) { int keyCode = e.keyCode | e.stateMask; - if( SkinUtil.isWindowsPlatform() ) { + if( SwtUtil.isWindowsPlatform() ) { if ( null != previous ) { if ( previous.keyCode != e.keyCode ) { @@ -936,10 +956,12 @@ public class EmulatorSkin { private Field getOSField( String field ) { String className = ""; - if ( SkinUtil.isLinuxPlatform() ) { + if (SwtUtil.isLinuxPlatform()) { className = GTK_OS_CLASS; - } else if ( SkinUtil.isWindowsPlatform() ) { + } else if (SwtUtil.isWindowsPlatform()) { className = WIN32_OS_CLASS; + } else if (SwtUtil.isMacPlatform()) { + className = COCOA_OS_CLASS; } Field f = null; @@ -959,10 +981,12 @@ public class EmulatorSkin { private Method getOSMethod( String method, Class<?>... parameterTypes ) { String className = ""; - if ( SkinUtil.isLinuxPlatform() ) { + if (SwtUtil.isLinuxPlatform()) { className = GTK_OS_CLASS; - } else if ( SkinUtil.isWindowsPlatform() ) { + } else if (SwtUtil.isWindowsPlatform()) { className = WIN32_OS_CLASS; + } else if (SwtUtil.isMacPlatform()) { + className = COCOA_OS_CLASS; } Method m = null; @@ -1008,7 +1032,7 @@ public class EmulatorSkin { } private boolean setTopMost32(boolean isOnTop) { - if ( SkinUtil.isLinuxPlatform() ) { + if ( SwtUtil.isLinuxPlatform() ) { // reference : http://wmctrl.sourcearchive.com/documentation/1.07/main_8c-source.html /* if ( !OS.GDK_WINDOWING_X11() ) { @@ -1232,7 +1256,7 @@ public class EmulatorSkin { invokeOSMethod( xSendEvent, xDisplay, rootWin, false, (int) ( 1L << 20 | 1L << 19 ), malloc ); invokeOSMethod( getOSMethod( "g_free", int.class ), malloc ) ; - } else if( SkinUtil.isWindowsPlatform() ) { + } else if( SwtUtil.isWindowsPlatform() ) { Point location = shell.getLocation(); /* int hWndInsertAfter = 0; @@ -1278,8 +1302,28 @@ public class EmulatorSkin { Method m = getOSMethod( "SetWindowPos", int.class, int.class, int.class, int.class, int.class, int.class, int.class ); - invokeOSMethod( m, shell.handle, hWndInsertAfter, location.x, location.y, 0, 0, noSize ); - } else if( SkinUtil.isMacPlatform() ) { + /* org.eclipse.swt.widgets.Shell */ + int shellHandle = 0; + try { + Field field = shell.getClass().getField("handle"); + shellHandle = field.getInt(shell); + logger.info("shell.handle:" + shellHandle); + } catch (IllegalArgumentException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + shutdown(); + } catch (IllegalAccessException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + shutdown(); + } catch (SecurityException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + shutdown(); + } catch (NoSuchFieldException e) { + logger.log(Level.SEVERE, e.getMessage(), e); + shutdown(); + } + + invokeOSMethod( m, shellHandle, hWndInsertAfter, location.x, location.y, 0, 0, noSize ); + } else if( SwtUtil.isMacPlatform() ) { //TODO: } @@ -1288,7 +1332,7 @@ public class EmulatorSkin { private boolean setTopMost64(boolean isOnTop) { - if ( SkinUtil.isLinuxPlatform() ) { + if ( SwtUtil.isLinuxPlatform() ) { Boolean gdkWindowingX11 = (Boolean) invokeOSMethod( getOSMethod( "GDK_WINDOWING_X11" ) ); if (null == gdkWindowingX11) { return false; @@ -1458,9 +1502,9 @@ public class EmulatorSkin { // SubstructureRedirectMask:1L<<20 | SubstructureNotifyMask:1L<<19 invokeOSMethod( xSendEvent, xDisplay, rootWin, false, (long) ( 1L << 20 | 1L << 19 ), malloc ); invokeOSMethod( getOSMethod( "g_free", long.class ), malloc ); - } else if (SkinUtil.isWindowsPlatform()) { + } else if (SwtUtil.isWindowsPlatform()) { //TODO: - } else if( SkinUtil.isMacPlatform() ) { + } else if( SwtUtil.isMacPlatform() ) { //TODO: } @@ -1568,11 +1612,11 @@ public class EmulatorSkin { ProcessBuilder procSdb = new ProcessBuilder(); - if ( SkinUtil.isLinuxPlatform() ) { + if ( SwtUtil.isLinuxPlatform() ) { procSdb.command( "/usr/bin/gnome-terminal", "--disable-factory", "--title=" + SkinUtil.makeEmulatorName( config ), "-x", sdbPath, "-s", "emulator-" + portSdb, "shell" ); - } else if ( SkinUtil.isWindowsPlatform() ) { + } else if ( SwtUtil.isWindowsPlatform() ) { procSdb.command( "cmd.exe", "/c", "start", sdbPath, "-s", "emulator-" + portSdb, "shell" ); } logger.log( Level.INFO, procSdb.command().toString() ); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java index 8510ca3711..b937e8563b 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinMain.java @@ -56,6 +56,7 @@ import org.tizen.emulator.skin.log.SkinLogger.SkinLogLevel; import org.tizen.emulator.skin.util.IOUtil; import org.tizen.emulator.skin.util.JaxbUtil; import org.tizen.emulator.skin.util.StringUtil; +import org.tizen.emulator.skin.util.SwtUtil; /** * @@ -68,7 +69,14 @@ public class EmulatorSkinMain { public static final String DBI_FILE_NAME = "default.dbi"; private static Logger logger; - + + static { + /* shared memory */ + if (SwtUtil.isMacPlatform()) { + System.loadLibrary("shared"); + } + } + /** * @param args */ @@ -148,7 +156,14 @@ public class EmulatorSkinMain { String onTopVal = config.getSkinProperty( SkinPropertiesConstants.WINDOW_ONTOP, Boolean.FALSE.toString() ); boolean isOnTop = Boolean.parseBoolean( onTopVal ); - EmulatorSkin skin = new EmulatorSkin( config, isOnTop ); + /* create skin */ + EmulatorSkin skin; + if (SwtUtil.isMacPlatform()) { + skin = new EmulatorShmSkin(config, isOnTop); + } else { // linux & windows + skin = new EmulatorSdlSkin(config, isOnTop); + } + long windowHandleId = skin.compose(); int uid = config.getArgInt( ArgsConstants.UID ); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java index edc0d2c6e1..ddaeadf844 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/AboutDialog.java @@ -49,8 +49,8 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.tizen.emulator.skin.log.SkinLogger; import org.tizen.emulator.skin.util.IOUtil; -import org.tizen.emulator.skin.util.SkinUtil; import org.tizen.emulator.skin.util.StringUtil; +import org.tizen.emulator.skin.util.SwtUtil; public class AboutDialog extends SkinDialog { @@ -97,7 +97,7 @@ public class AboutDialog extends SkinDialog { Text versionText = new Text( composite, SWT.NONE ); String version = getValue( properties, PROP_KEY_VERSION ); - if (SkinUtil.isWindowsPlatform()) { + if (SwtUtil.isWindowsPlatform()) { versionText.setText("Version" + " : " + version); } else { versionText.setText("Version" + " : " + version); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/DetailInfoDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/DetailInfoDialog.java index b01d402384..811f60e945 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/DetailInfoDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/dialog/DetailInfoDialog.java @@ -57,6 +57,7 @@ import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants; import org.tizen.emulator.skin.log.SkinLogger; import org.tizen.emulator.skin.util.SkinUtil; import org.tizen.emulator.skin.util.StringUtil; +import org.tizen.emulator.skin.util.SwtUtil; /** * @@ -142,11 +143,11 @@ public class DetailInfoDialog extends SkinDialog { String logPath = refinedData.get(logKey); ProcessBuilder procBrowser = new ProcessBuilder(); - if (SkinUtil.isLinuxPlatform()) { + if (SwtUtil.isLinuxPlatform()) { procBrowser.command("nautilus", "--browser", logPath); - } else if (SkinUtil.isWindowsPlatform()) { + } else if (SwtUtil.isWindowsPlatform()) { procBrowser.command("explorer", "\"" + logPath + "\""); - } else if (SkinUtil.isMacPlatform()) { + } else if (SwtUtil.isMacPlatform()) { //TODO: } @@ -168,7 +169,7 @@ public class DetailInfoDialog extends SkinDialog { @Override protected void setShellSize() { - if( SkinUtil.isLinuxPlatform() ) { + if( SwtUtil.isLinuxPlatform() ) { shell.setSize( (int) ( 402 * 1.618 ), 402 ); } else { shell.setSize( (int) ( 372 * 1.618 ), 372 ); @@ -209,9 +210,9 @@ public class DetailInfoDialog extends SkinDialog { String logPath = ""; boolean isHaxError = false; - if ( SkinUtil.isLinuxPlatform() ) { + if ( SwtUtil.isLinuxPlatform() ) { hwVirtualCompare = "-enable-kvm"; - } else if ( SkinUtil.isWindowsPlatform() ) { + } else if ( SwtUtil.isWindowsPlatform() ) { hwVirtualCompare = "-enable-hax"; } @@ -222,7 +223,7 @@ public class DetailInfoDialog extends SkinDialog { if ( 0 == i ) { String exec = split[i].trim().toLowerCase(); - if( SkinUtil.isWindowsPlatform() ) { + if( SwtUtil.isWindowsPlatform() ) { if( 4 <= exec.length() ) { // remove '.exe' in Windows exec = exec.substring( 0, exec.length() - 4 ); @@ -339,7 +340,7 @@ public class DetailInfoDialog extends SkinDialog { result.put( "RAM Size", ram ); - if ( SkinUtil.isLinuxPlatform() ) { + if ( SwtUtil.isLinuxPlatform() ) { if ( StringUtil.isEmpty( sharedPath ) ) { result.put( "File Sharing", "Not Supported" ); result.put( "File Shared Path", "None" ); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java index 82acd19946..e2e3f4843a 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java @@ -79,18 +79,19 @@ import org.tizen.emulator.skin.log.SkinLogger; import org.tizen.emulator.skin.util.IOUtil; import org.tizen.emulator.skin.util.SkinUtil; import org.tizen.emulator.skin.util.StringUtil; +import org.tizen.emulator.skin.util.SwtUtil; public class ScreenShotDialog { public final static String DEFAULT_FILE_EXTENSION = "png"; - public final static int RED_MASK = 0x0000FF00; - public final static int GREEN_MASK = 0x00FF0000; - public final static int BLUE_MASK = 0xFF000000; - public final static int COLOR_DEPTH = 32; + public static final int RED_MASK = 0x0000FF00; + public static final int GREEN_MASK = 0x00FF0000; + public static final int BLUE_MASK = 0xFF000000; + public static final int COLOR_DEPTH = 32; - public final static int CANVAS_MARGIN = 30; - public final static int TOOLITEM_COOLTIME = 200; + public static final int CANVAS_MARGIN = 30; + public static final int TOOLITEM_COOLTIME = 200; private Logger logger = SkinLogger.getSkinLogger( ScreenShotDialog.class ).getLogger(); @@ -498,7 +499,7 @@ public class ScreenShotDialog { ImageData data = null; - if ( SkinUtil.isWindowsPlatform() ) { + if ( SwtUtil.isWindowsPlatform() ) { // change RGB mask ImageData imageData = image.getImageData(); PaletteData paletteData = new PaletteData( BLUE_MASK, GREEN_MASK, RED_MASK ); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java index 155fc91d23..1685c33112 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java @@ -67,24 +67,12 @@ public class SkinUtil { private SkinUtil() { } - public static boolean isLinuxPlatform() { - return "gtk".equalsIgnoreCase( SWT.getPlatform() ); - } - - public static boolean isWindowsPlatform() { - return "win32".equalsIgnoreCase( SWT.getPlatform() ); - } - - public static boolean isMacPlatform() { - return "cocoa".equalsIgnoreCase( SWT.getPlatform() ); - } - public static String getVmName( EmulatorConfig config ) { String vmPath = config.getArg( ArgsConstants.VM_PATH ); String regex = ""; - if ( isWindowsPlatform() ) { + if ( SwtUtil.isWindowsPlatform() ) { regex = "\\" + File.separator; } else { regex = File.separator; @@ -112,7 +100,7 @@ public class SkinUtil { public static String getSdbPath() { String sdbPath = null; - if (SkinUtil.isWindowsPlatform()) { + if (SwtUtil.isWindowsPlatform()) { sdbPath = ".\\..\\..\\sdb.exe"; } else { sdbPath = "./../../sdb"; diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SwtUtil.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SwtUtil.java new file mode 100644 index 0000000000..0435f30f57 --- /dev/null +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/util/SwtUtil.java @@ -0,0 +1,53 @@ +/** + * + * + * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * 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 + * + */ + +package org.tizen.emulator.skin.util; + +import org.eclipse.swt.SWT; + + +/** + * + * + */ +public class SwtUtil { + private SwtUtil() { + } + + public static boolean isLinuxPlatform() { + return "gtk".equalsIgnoreCase( SWT.getPlatform() ); + } + + public static boolean isWindowsPlatform() { + return "win32".equalsIgnoreCase( SWT.getPlatform() ); //win32-win32-x86_64 + } + + public static boolean isMacPlatform() { + return "cocoa".equalsIgnoreCase( SWT.getPlatform() ); + } +} diff --git a/tizen/src/skin/maruskin_client.c b/tizen/src/skin/maruskin_client.c index 50e60c4912..af62a671b9 100644 --- a/tizen/src/skin/maruskin_client.c +++ b/tizen/src/skin/maruskin_client.c @@ -28,6 +28,7 @@ */ +#include "maru_common.h" #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -39,12 +40,12 @@ #include "sdb.h" #include "debug_ch.h" -#ifdef _WIN32 +#ifdef CONFIG_WIN32 #include "maru_err_table.h" #include <windows.h> #endif -MULTI_DEBUG_CHANNEL(qemu, maruskin_client); +MULTI_DEBUG_CHANNEL(qemu, skin_client); #define SKIN_SERVER_READY_TIME 3 // second @@ -62,7 +63,7 @@ static char** skin_argv; static void* run_skin_client(void* arg) { char cmd[JAVA_MAX_COMMAND_LENGTH] = { 0, }; - char argv[256] = {0}; + char argv[JAVA_MAX_COMMAND_LENGTH] = { 0, }; INFO("run skin client\n"); int i; @@ -91,14 +92,14 @@ static void* run_skin_client(void* arg) int len = strlen(JAVA_EXEFILE_PATH) + strlen(JAVA_EXEOPTION) + strlen(JAR_SKINFILE_PATH) + strlen(OPT_SVR_PORT) + strlen(buf_skin_server_port) + strlen(OPT_UID) + strlen(buf_uid) + strlen(OPT_VM_PATH) + strlen(vm_path) + strlen(OPT_NET_BASE_PORT) + strlen(buf_tizen_base_port) + - strlen(argv) + 20; + strlen(argv) + 42; if (len > JAVA_MAX_COMMAND_LENGTH) { INFO("swt command length is too long! (%d)\n", len); len = JAVA_MAX_COMMAND_LENGTH; } - snprintf( cmd, len, "%s %s %s %s=\"%d\" %s=\"%d\" %s=\"%s\" %s=\"%d\" %s", - JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAR_SKINFILE_PATH, + snprintf( cmd, len, "%s %s %s=. %s %s=\"%d\" %s=\"%d\" %s=\"%s\" %s=\"%d\" %s", + JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAVA_LIBRARY_PATH, JAR_SKINFILE_PATH, OPT_SVR_PORT, skin_server_port, OPT_UID, uid, OPT_VM_PATH, vm_path, @@ -106,7 +107,7 @@ static void* run_skin_client(void* arg) argv ); INFO( "command for swt : %s\n", cmd ); -#ifdef _WIN32 +#ifdef CONFIG_WIN32 //WinExec( cmd, SW_SHOW ); { STARTUPINFO sti = { 0 }; @@ -164,7 +165,7 @@ static void* run_skin_client(void* arg) } } -#else //ifndef _WIN32 +#else //ifndef CONFIG_WIN32 int ret = system(cmd); if (ret == 127) { @@ -206,7 +207,7 @@ int start_skin_client(int argc, char* argv[]) } else { count++; INFO( "sleep for ready. count:%d\n", count ); -#ifdef _WIN32 +#ifdef CONFIG_WIN32 Sleep( SKIN_SERVER_SLEEP_TIME ); #else usleep( 1000 * SKIN_SERVER_SLEEP_TIME ); @@ -249,7 +250,7 @@ int start_simple_client(char* msg) { snprintf(cmd, len, "%s %s %s %s=\"%s\"", JAVA_EXEFILE_PATH, JAVA_EXEOPTION, JAR_SKINFILE_PATH, JAVA_SIMPLEMODE_OPTION, msg); INFO("command for swt : %s\n", cmd); -#ifdef __WIN32 +#ifdef CONFIG_WIN32 ret = WinExec(cmd, SW_SHOW); #else ret = system(cmd); diff --git a/tizen/src/skin/maruskin_client.h b/tizen/src/skin/maruskin_client.h index 4ebb900317..fe70768e0c 100644 --- a/tizen/src/skin/maruskin_client.h +++ b/tizen/src/skin/maruskin_client.h @@ -27,14 +27,23 @@ * */ + #ifndef MARUSKIN_CLIENT_H_ #define MARUSKIN_CLIENT_H_ -#define JAVA_MAX_COMMAND_LENGTH 512 +#include "../maru_common.h" + +#define JAVA_MAX_COMMAND_LENGTH 1024 #define JAR_SKINFILE_PATH "emulator-skin.jar" #define JAVA_EXEFILE_PATH "java" +#define JAVA_LIBRARY_PATH "-Djava.library.path" + +#ifndef CONFIG_DARWIN #define JAVA_EXEOPTION "-jar" +#else +#define JAVA_EXEOPTION "-XstartOnFirstThread -jar" // Must start the Java window on the first thread on Mac +#endif #define JAVA_SIMPLEMODE_OPTION "simple.msg" diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index ab109bb2b5..b45e03876c 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -28,12 +28,19 @@ */ +#include "maru_common.h" + +#ifdef CONFIG_DARWIN +//shared memory +#define USE_SHM +#endif + #include <unistd.h> #include <stdio.h> #include <pthread.h> #include "maruskin_operation.h" #include "hw/maru_brightness.h" -#include "maru_sdl.h" +#include "maru_display.h" #include "debug_ch.h" #include "sdb.h" #include "nbd.h" @@ -58,16 +65,16 @@ MULTI_DEBUG_CHANNEL(qemu, skin_operation); static int requested_shutdown_qemu_gracefully = 0; -static void* run_timed_shutdown_thread( void* args ); -static void send_to_emuld( const char* request_type, int request_size, const char* send_buf, int buf_size ); +static void* run_timed_shutdown_thread(void* args); +static void send_to_emuld(const char* request_type, int request_size, const char* send_buf, int buf_size); void start_display(uint64 handle_id, int lcd_size_width, int lcd_size_height, double scale_factor, short rotation_type) { - INFO( "start_display handle_id:%ld, lcd size:%dx%d, scale_factor:%lf, rotation_type:%d\n", - handle_id, lcd_size_width, lcd_size_height, scale_factor, rotation_type ); + INFO("start_display handle_id:%ld, lcd size:%dx%d, scale_factor:%lf, rotation_type:%d\n", + (long)handle_id, lcd_size_width, lcd_size_height, scale_factor, rotation_type); set_emul_win_scale(scale_factor); - maruskin_sdl_init(handle_id, lcd_size_width, lcd_size_height, false); + maruskin_init(handle_id, lcd_size_width, lcd_size_height, false); } void do_mouse_event( int event_type, int origin_x, int origin_y, int x, int y, int z ) @@ -77,23 +84,31 @@ void do_mouse_event( int event_type, int origin_x, int origin_y, int x, int y, i return; } - TRACE( "mouse_event event_type:%d, origin:(%d, %d), x:%d, y:%d, z:%d\n", event_type, origin_x, origin_y, x, y, z ); + TRACE("mouse_event event_type:%d, origin:(%d, %d), x:%d, y:%d, z:%d\n", + event_type, origin_x, origin_y, x, y, z); +#ifndef USE_SHM + /* multi-touch */ if (get_emul_multi_touch_state()->multitouch_enable == 1) { maru_finger_processing_A(event_type, origin_x, origin_y, x, y); + return; } else if (get_emul_multi_touch_state()->multitouch_enable == 2) { maru_finger_processing_B(event_type, origin_x, origin_y, x, y); + return; } - else if ( MOUSE_DOWN == event_type || MOUSE_DRAG == event_type) { //single touch +#endif + + /* single touch */ + if (MOUSE_DOWN == event_type || MOUSE_DRAG == event_type) { kbd_mouse_event(x, y, z, 1); } else if (MOUSE_UP == event_type) { kbd_mouse_event(x, y, z, 0); } else { - ERR( "undefined mouse event type:%d\n", event_type ); + ERR("undefined mouse event type:%d\n", event_type); } #if 0 -#ifdef _WIN32 +#ifdef CONFIG_WIN32 Sleep(1); #else usleep(1000); @@ -105,6 +120,7 @@ void do_key_event( int event_type, int keycode, int key_location ) { TRACE( "key_event event_type:%d, keycode:%d, key_location:%d\n", event_type, keycode, key_location ); +#ifndef USE_SHM //is multi-touch mode ? if (get_emul_max_touch_point() > 1) { if (keycode == JAVA_KEYCODE_BIT_CTRL) { @@ -133,6 +149,7 @@ void do_key_event( int event_type, int keycode, int key_location ) } } } +#endif if (!mloop_evcmd_get_usbkbd_status()) { return; @@ -164,7 +181,7 @@ void do_hardkey_event( int event_type, int keycode ) if ( ( HARD_KEY_HOME == keycode ) || ( HARD_KEY_POWER == keycode ) ) { INFO( "user requests system resume.\n" ); resume(); -#ifdef _WIN32 +#ifdef CONFIG_WIN32 Sleep( RESUME_KEY_SEND_INTERVAL ); #else usleep( RESUME_KEY_SEND_INTERVAL * 1000 ); @@ -285,7 +302,7 @@ DetailInfo* get_detail_info( int qemu_argc, char** qemu_argv ) { total_len += delimiter_len; } -#ifdef _WIN32 +#ifdef CONFIG_WIN32 /* collect HAXM information */ const int HAX_LEN = 32; char hax_error[HAX_LEN]; @@ -329,7 +346,7 @@ DetailInfo* get_detail_info( int qemu_argc, char** qemu_argv ) { total_len += len + delimiter_len; } -#ifdef _WIN32 +#ifdef CONFIG_WIN32 snprintf( info_data + total_len, hax_err_len + 1, "%s#", hax_error ); total_len += hax_err_len; #endif @@ -373,7 +390,7 @@ void request_close( void ) do_hardkey_event( KEY_PRESSED, HARD_KEY_POWER ); -#ifdef _WIN32 +#ifdef CONFIG_WIN32 Sleep( CLOSE_POWER_KEY_INTERVAL ); #else usleep( CLOSE_POWER_KEY_INTERVAL * 1000 ); @@ -407,7 +424,7 @@ static void* run_timed_shutdown_thread( void* args ) { int i; for ( i = 0; i < TIMEOUT_FOR_SHUTDOWN; i++ ) { -#ifdef _WIN32 +#ifdef CONFIG_WIN32 Sleep( sleep_interval_time ); #else usleep( sleep_interval_time * 1000 ); @@ -440,7 +457,7 @@ static void send_to_emuld( const char* request_type, int request_size, const cha INFO( "send to emuld [req_type:%s, send_data:%s, send_size:%d] 127.0.0.1:%d/tcp \n", request_type, send_buf, buf_size, tizen_base_port + SDB_TCP_EMULD_INDEX ); -#ifdef _WIN32 +#ifdef CONFIG_WIN32 closesocket( s ); #else close( s ); diff --git a/tizen/src/skin/maruskin_server.c b/tizen/src/skin/maruskin_server.c index c6c87d9dfd..ff8a53d7ed 100644 --- a/tizen/src/skin/maruskin_server.c +++ b/tizen/src/skin/maruskin_server.c @@ -27,6 +27,14 @@ * */ + +#include "maru_common.h" + +#ifdef CONFIG_DARWIN +//shared memory +#define USE_SHM +#endif + #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -38,11 +46,14 @@ #include "maruskin_operation.h" #include "qemu-thread.h" #include "emul_state.h" -#include "maru_sdl.h" #include "maruskin_client.h" #include "emulator.h" -#include "debug_ch.h" -#ifdef _WIN32 + +#ifndef USE_SHM +#include "maru_sdl.h" +#endif + +#ifdef CONFIG_WIN32 #include <windows.h> #include <winsock2.h> #include <ws2tcpip.h> @@ -52,7 +63,10 @@ #include <sys/socket.h> #endif -MULTI_DEBUG_CHANNEL( qemu, skin_server ); +#include "debug_ch.h" + +MULTI_DEBUG_CHANNEL(qemu, skin_server); + #define MAX_REQ_ID 0x7fffffff #define RECV_BUF_SIZE 32 @@ -195,7 +209,7 @@ void shutdown_skin_server( void ) { INFO( "skin client sent normal shutdown response.\n" ); break; } else { -#ifdef _WIN32 +#ifdef CONFIG_WIN32 Sleep( 1 ); // 1ms #else usleep( 1000 ); // 1ms @@ -209,7 +223,7 @@ void shutdown_skin_server( void ) { is_force_close_client = 1; if ( client_sock ) { -#ifdef _WIN32 +#ifdef CONFIG_WIN32 closesocket( client_sock ); #else close( client_sock ); @@ -219,7 +233,7 @@ void shutdown_skin_server( void ) { if ( close_server_socket ) { INFO( "skin client did not send normal shutdown response.\n" ); if ( server_sock ) { -#ifdef _WIN32 +#ifdef CONFIG_WIN32 closesocket( server_sock ); #else close( server_sock ); @@ -254,7 +268,7 @@ static void parse_skinconfig_prop( void ) { memset( skin_config_path, 0, target_path_len + 32 ); strcpy( skin_config_path, tizen_target_path ); -#ifdef _WIN32 +#ifdef CONFIG_WIN32 strcat( skin_config_path, "\\" ); #else strcat( skin_config_path, "/" ); @@ -362,7 +376,7 @@ static void parse_skin_args( void ) { free( arg ); - }else { + } else { ERR( "fail to strdup." ); } @@ -701,7 +715,9 @@ static void* run_skin_server( void* args ) { do_rotation_event( rotation_type ); } - maruskin_sdl_resize(); //send sdl event +#ifndef USE_SHM + maruskin_sdl_resize(); // send sdl event +#endif break; } case RECV_SCREEN_SHOT: { @@ -800,7 +816,7 @@ static void* run_skin_server( void* args ) { cleanup: if ( server_sock ) { -#ifdef _WIN32 +#ifdef CONFIG_WIN32 closesocket( server_sock ); #else close( server_sock ); @@ -1041,7 +1057,7 @@ static void* do_heart_beat( void* args ) { is_force_close_client = 1; if ( client_sock ) { -#ifdef _WIN32 +#ifdef CONFIG_WIN32 closesocket( client_sock ); #else close( client_sock ); @@ -1064,7 +1080,7 @@ static void* do_heart_beat( void* args ) { is_force_close_client = 1; if ( client_sock ) { -#ifdef _WIN32 +#ifdef CONFIG_WIN32 closesocket( client_sock ); #else close( client_sock ); @@ -1073,7 +1089,7 @@ static void* do_heart_beat( void* args ) { stop_server = 1; if ( server_sock ) { -#ifdef _WIN32 +#ifdef CONFIG_WIN32 closesocket( server_sock ); #else close( server_sock ); @@ -180,7 +180,7 @@ int qemu_main(int argc, char **argv, char **envp); #include "ui/qemu-spice.h" #ifdef CONFIG_MARU -#include "tizen/src/maru_sdl.h" +#include "tizen/src/maru_display.h" #include "tizen/src/option.h" #include "tizen/src/emul_state.h" #include "tizen/src/skin/maruskin_operation.h" @@ -259,10 +259,11 @@ uint8_t qemu_extra_params_fw[2]; //virtio-gl #define VIRTIOGL_DEV_NAME "virtio-gl-pci" +#if defined(CONFIG_MARU) && (!defined(CONFIG_DARWIN)) extern int gl_acceleration_capability_check(void); int enable_gl = 0; int capability_check_gl = 0; - +#endif typedef struct FWBootEntry FWBootEntry; @@ -1892,6 +1893,7 @@ static int device_init_func(QemuOpts *opts, void *opaque) DeviceState *dev; #ifdef CONFIG_VIRTIO_GL +#if defined(CONFIG_MARU) && (!defined(CONFIG_DARWIN)) // virtio-gl pci device if (!enable_gl) { // ignore virtio-gl-pci device, even if users set it in option. @@ -1901,6 +1903,7 @@ static int device_init_func(QemuOpts *opts, void *opaque) } } #endif +#endif dev = qdev_device_add(opts); if (!dev) @@ -2405,7 +2408,9 @@ int main(int argc, char **argv, char **envp) #ifdef CONFIG_MARU #define MIDBUF 128 - char proxy[MIDBUF] ={0}, dns1[MIDBUF] = {0}, dns2[MIDBUF] = {0}; + char http_proxy[MIDBUF] ={0},https_proxy[MIDBUF] = {0,}, + ftp_proxy[MIDBUF] = {0,}, socks_proxy[MIDBUF] = {0,}, + dns1[MIDBUF] = {0}, dns2[MIDBUF] = {0}; #endif atexit(qemu_run_exit_notifiers); @@ -2641,9 +2646,13 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_append: #ifdef CONFIG_MARU - gethostproxy(proxy); + gethostproxy(http_proxy, https_proxy, ftp_proxy, socks_proxy); gethostDNS(dns1, dns2); - tmp_cmdline = g_strdup_printf("%s sdb_port=%d, proxy=%s dns1=%s dns2=%s", optarg, tizen_base_port, proxy, dns1, dns2); + tmp_cmdline = g_strdup_printf("%s sdb_port=%d," + " http_proxy=%s https_proxy=%s ftp_proxy=%s socks_proxy=%s" + " dns1=%s dns2=%s", optarg, tizen_base_port, + http_proxy, https_proxy, ftp_proxy, socks_proxy, + dns1, dns2); qemu_opts_set(qemu_find_opts("machine"), 0, "append", tmp_cmdline); fprintf(stdout, "kernel command : %s\n", tmp_cmdline); @@ -3090,7 +3099,9 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_enable_gl: #ifdef CONFIG_VIRTIO_GL +#if defined(CONFIG_MARU) && (!defined(CONFIG_DARWIN)) enable_gl = 1; +#endif #else fprintf(stderr, "Virtio GL support is disabled, ignoring -enable-gl\n"); #endif @@ -3377,6 +3388,7 @@ int main(int argc, char **argv, char **envp) } #ifdef CONFIG_VIRTIO_GL +#if defined(CONFIG_MARU) && (!defined(CONFIG_DARWIN)) if (enable_gl) { device_opt_finding_t devp = {VIRTIOGL_DEV_NAME, 0}; qemu_opts_foreach(qemu_find_opts("device"), find_device_opt, &devp, 0); @@ -3387,6 +3399,7 @@ int main(int argc, char **argv, char **envp) } } #endif +#endif // To check host gl driver capability and notify to guest. gchar *tmp = tmp_cmdline; tmp_cmdline = g_strdup_printf("%s gles=%d", tmp, enable_gl); @@ -3725,7 +3738,10 @@ int main(int argc, char **argv, char **envp) if (using_spice) display_remote++; if (display_type == DT_DEFAULT && !display_remote) { -#if defined(CONFIG_SDL) || defined(CONFIG_COCOA) +#if defined(CONFIG_MARU) + /* maru display */ + display_type = DT_MARU; +#elif defined(CONFIG_SDL) || defined(CONFIG_COCOA) display_type = DT_SDL; #elif defined(CONFIG_VNC) vnc_display = "localhost:0,to=99"; @@ -3747,25 +3763,23 @@ int main(int argc, char **argv, char **envp) #endif #if defined(CONFIG_SDL) case DT_SDL: -#if defined(CONFIG_MARU) - /* use tizen qemu sdl */ - maruskin_display_init(ds); - - if (skin_disabled == 1) { - //do not start skin client process - set_emul_skin_enable(0); - } else { - set_emul_skin_enable(1); - } -#else - sdl_display_init(ds, full_screen, no_frame); -#endif + sdl_display_init(ds, full_screen, no_frame); break; #elif defined(CONFIG_COCOA) case DT_SDL: cocoa_display_init(ds, full_screen); break; #endif +#if defined(CONFIG_MARU) + case DT_MARU: + maru_display_init(ds); + if (skin_disabled == 1) { + set_emul_skin_enable(0); + } else { + set_emul_skin_enable(1); + } + break; +#endif default: break; } |