[Tizen] Add codes for Dali Windows Backend accepted/tizen/unified/20190116.160649 submit/tizen/20190114.061957 submit/tizen/20190116.043322
authorJiyun Yang <ji.yang@samsung.com>
Mon, 14 Jan 2019 05:36:26 +0000 (14:36 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Mon, 14 Jan 2019 05:36:50 +0000 (14:36 +0900)
This reverts commit 0e16b26dbe317545978954a6269a8139dcf8a0b6.

60 files changed:
CMakeLists.txt [new file with mode: 0755]
dali/devel-api/adaptor-framework/input-method-context.h
dali/internal/accessibility/windows/accessibility-adaptor-impl-win.cpp [new file with mode: 0755]
dali/internal/adaptor/common/combined-update-render-controller.cpp [changed mode: 0644->0755]
dali/internal/adaptor/windows/adaptor-impl-win.cpp [new file with mode: 0755]
dali/internal/adaptor/windows/framework-win.cpp [new file with mode: 0755]
dali/internal/clipboard/windows/clipboard-impl-win.cpp [new file with mode: 0755]
dali/internal/graphics/gles/egl-implementation.cpp
dali/internal/graphics/windows-gl/egl-image-extensions.cpp [new file with mode: 0755]
dali/internal/graphics/windows/vsync-monitor-win.cpp [new file with mode: 0755]
dali/internal/imaging/common/file-download.h [changed mode: 0644->0755]
dali/internal/imaging/common/image-loader.cpp
dali/internal/imaging/common/loader-astc.cpp
dali/internal/imaging/common/loader-bmp.cpp
dali/internal/imaging/common/loader-gif.cpp
dali/internal/imaging/common/loader-ico.cpp
dali/internal/imaging/common/loader-jpeg-turbo.cpp
dali/internal/imaging/common/loader-ktx.cpp
dali/internal/imaging/common/loader-png.cpp
dali/internal/imaging/common/loader-wbmp.cpp
dali/internal/imaging/windows/curl-environment-win.cpp [new file with mode: 0755]
dali/internal/imaging/windows/file-download-win.cpp [new file with mode: 0755]
dali/internal/input/windows/input-method-context-factory-win.cpp [new file with mode: 0755]
dali/internal/input/windows/input-method-context-impl-win.cpp [new file with mode: 0755]
dali/internal/input/windows/input-method-context-impl-win.h [new file with mode: 0755]
dali/internal/input/windows/key-mapping-win.cpp [new file with mode: 0755]
dali/internal/input/windows/virtual-keyboard-impl-win.cpp [new file with mode: 0755]
dali/internal/system/common/abort-handler.h [changed mode: 0644->0755]
dali/internal/system/common/file-closer.h [changed mode: 0644->0755]
dali/internal/system/file.list [changed mode: 0644->0755]
dali/internal/system/linux/file-closer-linux.cpp [new file with mode: 0755]
dali/internal/system/windows/callback-manager-win.cpp [new file with mode: 0755]
dali/internal/system/windows/callback-manager-win.h [new file with mode: 0755]
dali/internal/system/windows/file-closer-win.cpp [new file with mode: 0755]
dali/internal/system/windows/timer-impl-win.cpp [new file with mode: 0755]
dali/internal/system/windows/trigger-event.cpp [new file with mode: 0755]
dali/internal/system/windows/widget-application-impl-win.cpp [new file with mode: 0755]
dali/internal/system/windows/widget-application-impl-win.h [new file with mode: 0755]
dali/internal/system/windows/widget-controller-win.cpp [new file with mode: 0755]
dali/internal/system/windows/widget-controller-win.h [new file with mode: 0755]
dali/internal/text/text-abstraction/font-client-plugin-impl.cpp [changed mode: 0644->0755]
dali/internal/window-system/common/event-handler.cpp
dali/internal/window-system/windows/display-connection-factory-win.cpp [new file with mode: 0755]
dali/internal/window-system/windows/display-connection-factory-win.h [new file with mode: 0755]
dali/internal/window-system/windows/display-connection-impl-win.cpp [new file with mode: 0755]
dali/internal/window-system/windows/display-connection-impl-win.h [new file with mode: 0755]
dali/internal/window-system/windows/event-system-win.cpp [new file with mode: 0755]
dali/internal/window-system/windows/event-system-win.h [new file with mode: 0755]
dali/internal/window-system/windows/pixmap-render-surface-win.cpp [new file with mode: 0755]
dali/internal/window-system/windows/pixmap-render-surface-win.h [new file with mode: 0755]
dali/internal/window-system/windows/platform-implement-win.cpp [new file with mode: 0755]
dali/internal/window-system/windows/platform-implement-win.h [new file with mode: 0755]
dali/internal/window-system/windows/render-surface-factory-win.cpp [new file with mode: 0755]
dali/internal/window-system/windows/render-surface-factory-win.h [new file with mode: 0755]
dali/internal/window-system/windows/window-base-win.cpp [new file with mode: 0755]
dali/internal/window-system/windows/window-base-win.h [new file with mode: 0755]
dali/internal/window-system/windows/window-factory-win.cpp [new file with mode: 0755]
dali/internal/window-system/windows/window-factory-win.h [new file with mode: 0755]
dali/internal/window-system/windows/window-system-win.cpp [new file with mode: 0644]
dali/public-api/dali-adaptor-common.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..ef11ba6
--- /dev/null
@@ -0,0 +1,388 @@
+cmake_minimum_required(VERSION 3.11)\r
+\r
+PROJECT (dali-adaptor)\r
+\r
+SET(adaptor_devel_api_dir dali/devel-api)\r
+\r
+SET( devel_api_src_files\r
+  ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/application-devel.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/application-extensions.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/color-controller.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/drag-and-drop-detector.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/environment-variable.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/event-feeder.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/event-thread-callback.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/feedback-player.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/file-loader.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/image-loading.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/gif-loading.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/input-method-context.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/input-method-options.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/orientation.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/performance-logger.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/physical-keyboard.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/pixel-buffer.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/singleton-service.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/sound-player.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/style-monitor.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/tilt-sensor.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/lifecycle-controller.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/video-player.cpp\r
+  ${adaptor_devel_api_dir}/adaptor-framework/virtual-keyboard.cpp\r
+  )\r
+\r
+SET( devel_api_adaptor_framework_header_files\r
+  ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/accessibility-action-handler.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/accessibility-gesture-handler.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/application-devel.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/application-extensions.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/clipboard.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/color-controller.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/drag-and-drop-detector.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/environment-variable.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/event-feeder.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/event-thread-callback.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/feedback-plugin.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/feedback-player.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/file-loader.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/image-loading.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/gif-loading.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/imf-manager.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/input-method-devel.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/input-method-options.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/keyboard.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/lifecycle-controller.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/orientation.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/performance-logger.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/pixel-buffer.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/render-surface.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/singleton-service.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/sound-player.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/style-monitor.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/tilt-sensor.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/video-player.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/video-player-plugin.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/key-extension-plugin.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/virtual-keyboard.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/physical-keyboard.h\r
+  ${adaptor_devel_api_dir}/adaptor-framework/key-devel.h\r
+  )\r
+  \r
+SET ( devel_api_text_abstraction_src_files\r
+   ${adaptor_devel_api_dir}/text-abstraction/bidirectional-support.cpp\r
+   ${adaptor_devel_api_dir}/text-abstraction/font-client.cpp\r
+   ${adaptor_devel_api_dir}/text-abstraction/font-list.cpp\r
+   ${adaptor_devel_api_dir}/text-abstraction/font-metrics.cpp\r
+   ${adaptor_devel_api_dir}/text-abstraction/glyph-info.cpp\r
+   ${adaptor_devel_api_dir}/text-abstraction/script.cpp\r
+   ${adaptor_devel_api_dir}/text-abstraction/segmentation.cpp\r
+   ${adaptor_devel_api_dir}/text-abstraction/shaping.cpp\r
+   )\r
+\r
+SET( text_abstraction_header_files\r
+   ${adaptor_devel_api_dir}/text-abstraction/bidirectional-support.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/font-client.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/font-list.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/font-metrics.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/glyph-info.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/script.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/segmentation.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/shaping.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/text-abstraction.h\r
+   ${adaptor_devel_api_dir}/text-abstraction/text-abstraction-definitions.h\r
+   )\r
+\r
+SET( SOURCES ${SOURCES}\r
+  ${devel_api_src_files}\r
+  ${devel_api_text_abstraction_src_files}\r
+)\r
+\r
+SET( INCLUDE ${INCLUDE}\r
+  ${devel_api_adaptor_framework_header_files}\r
+  ${text_abstraction_header_files}\r
+)\r
+\r
+SET(adaptor_integration_api_dir dali/integration-api)\r
+\r
+SET(adaptor_integration_api_header_files\r
+  ${adaptor_integration_api_dir}/adaptor.h\r
+  ${adaptor_integration_api_dir}/egl-interface.h\r
+  ${adaptor_integration_api_dir}/log-factory-interface.h\r
+  ${adaptor_integration_api_dir}/thread-synchronization-interface.h\r
+  ${adaptor_integration_api_dir}/trigger-event-interface.h\r
+  ${adaptor_integration_api_dir}/trigger-event-factory-interface.h\r
+  ${adaptor_integration_api_dir}/trigger-event-factory.h)\r
+\r
+SET (adaptor_integration_win_api_header_files\r
+  ${adaptor_integration_api_dir}/windows/win-render-surface.h\r
+  ${adaptor_integration_api_dir}/windows/pixmap-render-surface.h\r
+  ${adaptor_integration_api_dir}/windows/imf-manager-impl.h\r
+  ${adaptor_integration_api_dir}/pixmap-render-surface-factory.h)\r
+\r
+SET( INCLUDE ${INCLUDE}\r
+${adaptor_integration_api_header_files}\r
+${adaptor_integration_win_api_header_files}\r
+)\r
+\r
+SET( adaptor_internal_dir dali/internal/ )\r
+\r
+SET( SOURCES ${SOURCES}\r
+  #accessibility\r
+  ${adaptor_internal_dir}/accessibility/common/tts-player-factory.cpp\r
+  ${adaptor_internal_dir}/accessibility/common/tts-player-impl.cpp\r
+  ${adaptor_internal_dir}/accessibility/common/accessibility-adaptor-impl.cpp\r
+  ${adaptor_internal_dir}/accessibility/common/accessibility-gesture-detector.cpp\r
+  ${adaptor_internal_dir}/accessibility/windows/accessibility-adaptor-impl-win.cpp\r
+\r
+  #adaptor\r
+  ${adaptor_internal_dir}/adaptor/common/adaptor.cpp\r
+  ${adaptor_internal_dir}/adaptor/common/lifecycle-controller-impl.cpp\r
+  ${adaptor_internal_dir}/adaptor/common/adaptor-impl.cpp\r
+  ${adaptor_internal_dir}/adaptor/common/adaptor.cpp\r
+  ${adaptor_internal_dir}/adaptor/common/application-impl.cpp\r
+  ${adaptor_internal_dir}/adaptor/common/combined-update-render-controller.cpp\r
+  ${adaptor_internal_dir}/adaptor/windows/adaptor-impl-win.cpp\r
+  ${adaptor_internal_dir}/adaptor/windows/framework-win.cpp\r
+  \r
+  #clipboard\r
+  ${adaptor_internal_dir}/clipboard/common/clipboard-event-notifier-impl.cpp\r
+  ${adaptor_internal_dir}/clipboard/windows/clipboard-impl-win.cpp\r
+  \r
+  #graphics\r
+  ${adaptor_internal_dir}/graphics/common/render-helper.cpp\r
+  ${adaptor_internal_dir}/graphics/gles20/egl-debug.cpp\r
+  ${adaptor_internal_dir}/graphics/gles20/egl-factory.cpp\r
+  ${adaptor_internal_dir}/graphics/gles20/egl-implementation.cpp\r
+  ${adaptor_internal_dir}/graphics/gles20/egl-sync-implementation.cpp\r
+  ${adaptor_internal_dir}/graphics/gles20/gl-extensions.cpp\r
+  ${adaptor_internal_dir}/graphics/gles20/gl-proxy-implementation.cpp\r
+  ${adaptor_internal_dir}/graphics/windows/vsync-monitor-win.cpp\r
+  ${adaptor_internal_dir}/graphics/windows-gl/egl-image-extensions.cpp\r
+  \r
+  #haptics\r
+  ${adaptor_internal_dir}/haptics/common/feedback-player-impl.cpp\r
+  ${adaptor_internal_dir}/haptics/common/feedback-plugin-proxy.cpp\r
+  \r
+  #imaging\r
+  ${adaptor_internal_dir}/imaging/common/native-bitmap-buffer-impl.cpp\r
+  ${adaptor_internal_dir}/imaging/common/native-image-source-factory.cpp\r
+  ${adaptor_internal_dir}/imaging/common/native-image-source-impl.cpp\r
+  ${adaptor_internal_dir}/imaging/common/pixel-buffer-impl.cpp\r
+  ${adaptor_internal_dir}/imaging/common/alpha-mask.cpp\r
+  ${adaptor_internal_dir}/imaging/common/gaussian-blur.cpp\r
+  ${adaptor_internal_dir}/imaging/common/http-utils.cpp\r
+  ${adaptor_internal_dir}/imaging/common/image-loader.cpp\r
+  ${adaptor_internal_dir}/imaging/common/image-operations.cpp\r
+  ${adaptor_internal_dir}/imaging/common/loader-astc.cpp\r
+  ${adaptor_internal_dir}/imaging/common/loader-bmp.cpp\r
+  ${adaptor_internal_dir}/imaging/common/loader-gif.cpp\r
+  ${adaptor_internal_dir}/imaging/common/loader-ico.cpp\r
+  ${adaptor_internal_dir}/imaging/common/loader-jpeg-turbo.cpp\r
+  ${adaptor_internal_dir}/imaging/common/loader-ktx.cpp\r
+  ${adaptor_internal_dir}/imaging/common/loader-png.cpp\r
+  ${adaptor_internal_dir}/imaging/common/loader-wbmp.cpp\r
+  ${adaptor_internal_dir}/imaging/common/pixel-manipulation.cpp\r
+  ${adaptor_internal_dir}/imaging/windows/file-download-win.cpp\r
+  ${adaptor_internal_dir}/imaging/windows/curl-environment-win.cpp\r
+  ${adaptor_internal_dir}/input/common/drag-and-drop-detector-impl.cpp\r
+  ${adaptor_internal_dir}/input/common/gesture-manager.cpp\r
+  ${adaptor_internal_dir}/input/common/input-method-context-impl.cpp\r
+  ${adaptor_internal_dir}/input/common/key-grab.cpp\r
+  ${adaptor_internal_dir}/input/common/key-impl.cpp\r
+  ${adaptor_internal_dir}/input/common/keyboard.cpp\r
+  ${adaptor_internal_dir}/input/common/long-press-gesture-detector.cpp\r
+  ${adaptor_internal_dir}/input/common/pan-gesture-detector-base.cpp\r
+  ${adaptor_internal_dir}/input/common/pan-gesture-detector.cpp\r
+  ${adaptor_internal_dir}/input/common/physical-keyboard-impl.cpp\r
+  ${adaptor_internal_dir}/input/common/pinch-gesture-detector.cpp\r
+  ${adaptor_internal_dir}/input/common/tap-gesture-detector.cpp\r
+  ${adaptor_internal_dir}/input/windows/input-method-context-factory-win.cpp\r
+  ${adaptor_internal_dir}/input/windows/input-method-context-impl-win.cpp\r
+  ${adaptor_internal_dir}/input/windows/key-mapping-win.cpp\r
+  ${adaptor_internal_dir}/input/windows/virtual-keyboard-impl-win.cpp\r
+  \r
+  #legacy\r
+  ${adaptor_internal_dir}/legacy/common/tizen-platform-abstraction.cpp\r
+  ${adaptor_internal_dir}/legacy/tizen/data-compression.cpp\r
+  \r
+  #network\r
+  ${adaptor_internal_dir}/network/common/socket-factory.cpp\r
+  ${adaptor_internal_dir}/network/common/socket-impl.cpp\r
+\r
+  #sensor\r
+  ${adaptor_internal_dir}/sensor/common/tilt-sensor-factory.cpp\r
+  ${adaptor_internal_dir}/sensor/common/tilt-sensor-impl.cpp\r
+  \r
+  #styling\r
+  ${adaptor_internal_dir}/styling/common/style-monitor-impl.cpp\r
+  \r
+  #system\r
+  ${adaptor_internal_dir}/system/common/abort-handler.cpp\r
+  ${adaptor_internal_dir}/system/common/command-line-options.cpp\r
+  ${adaptor_internal_dir}/system/common/environment-options.cpp\r
+  ${adaptor_internal_dir}/system/common/fps-tracker.cpp\r
+  ${adaptor_internal_dir}/system/common/frame-time-stamp.cpp\r
+  ${adaptor_internal_dir}/system/common/frame-time-stats.cpp\r
+  ${adaptor_internal_dir}/system/common/kernel-trace.cpp\r
+  ${adaptor_internal_dir}/system/common/locale-utils.cpp\r
+  ${adaptor_internal_dir}/system/common/object-profiler.cpp\r
+  ${adaptor_internal_dir}/system/common/performance-interface-factory.cpp\r
+  ${adaptor_internal_dir}/system/common/performance-logger-impl.cpp\r
+  ${adaptor_internal_dir}/system/common/performance-marker.cpp\r
+  ${adaptor_internal_dir}/system/common/performance-server.cpp\r
+  ${adaptor_internal_dir}/system/common/singleton-service-impl.cpp\r
+  ${adaptor_internal_dir}/system/common/sound-player-impl.cpp\r
+  ${adaptor_internal_dir}/system/common/stat-context.cpp\r
+  ${adaptor_internal_dir}/system/common/stat-context-manager.cpp\r
+  ${adaptor_internal_dir}/system/common/system-trace.cpp\r
+  ${adaptor_internal_dir}/system/common/thread-controller.cpp\r
+  ${adaptor_internal_dir}/system/common/time-service.cpp\r
+  ${adaptor_internal_dir}/system/common/trigger-event-factory.cpp\r
+  ${adaptor_internal_dir}/system/common/update-status-logger.cpp\r
+  ${adaptor_internal_dir}/system/common/widget-application-impl.cpp\r
+  ${adaptor_internal_dir}/system/common/logging.cpp\r
+  ${adaptor_internal_dir}/system/generic/color-controller-impl.cpp\r
+  ${adaptor_internal_dir}/system/generic/system-settings.cpp\r
+  ${adaptor_internal_dir}/system/windows/callback-manager-win.cpp\r
+  ${adaptor_internal_dir}/system/windows/file-closer-win.cpp\r
+  ${adaptor_internal_dir}/system/windows/timer-impl-win.cpp\r
+  ${adaptor_internal_dir}/system/windows/trigger-event.cpp\r
+  ${adaptor_internal_dir}/system/windows/widget-application-impl-win.cpp\r
+  ${adaptor_internal_dir}/system/windows/widget-controller-win.cpp\r
+  \r
+  #text\r
+  ${adaptor_internal_dir}/text/text-abstraction/bidirectional-support-impl.cpp\r
+  ${adaptor_internal_dir}/text/text-abstraction/font-client-helper.cpp\r
+  ${adaptor_internal_dir}/text/text-abstraction/font-client-impl.cpp\r
+  ${adaptor_internal_dir}/text/text-abstraction/font-client-plugin-impl.cpp\r
+  ${adaptor_internal_dir}/text/text-abstraction/segmentation-impl.cpp\r
+  ${adaptor_internal_dir}/text/text-abstraction/shaping-impl.cpp\r
+\r
+  #trace\r
+  ${adaptor_internal_dir}/trace/common/trace-factory.cpp\r
+  ${adaptor_internal_dir}/trace/common/trace-manager-impl.cpp\r
+  \r
+  #video\r
+  ${adaptor_internal_dir}/video/common/video-player-impl.cpp\r
+  \r
+  #window-system\r
+  ${adaptor_internal_dir}/window-system/common/display-connection.cpp\r
+  ${adaptor_internal_dir}/window-system/common/event-handler.cpp\r
+  ${adaptor_internal_dir}/window-system/common/indicator-buffer.cpp\r
+  ${adaptor_internal_dir}/window-system/common/native-render-surface-factory.cpp\r
+  ${adaptor_internal_dir}/window-system/common/orientation-impl.cpp\r
+  ${adaptor_internal_dir}/window-system/common/window-base.cpp\r
+  ${adaptor_internal_dir}/window-system/common/window-impl.cpp\r
+  ${adaptor_internal_dir}/window-system/common/window-render-surface.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/display-connection-factory-win.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/display-connection-impl-win.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/pixmap-render-surface-win.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/render-surface-factory-win.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/event-system-win.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/platform-implement-win.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/window-base-win.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/window-factory-win.cpp\r
+  ${adaptor_internal_dir}/window-system/windows/window-system-win.cpp\r
+)\r
+\r
+SET( adaptor_public_api_dir dali/public-api )\r
+\r
+SET( SOURCES ${SOURCES}\r
+  ${adaptor_public_api_dir}/adaptor-framework/application.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/key.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/window.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/timer.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/tts-player.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/timer.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/widget.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/timer.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/widget-application.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/timer.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/widget-impl.cpp\r
+  ${adaptor_public_api_dir}/adaptor-framework/native-image-source.cpp\r
+  ${adaptor_public_api_dir}/dali-adaptor-version.cpp\r
+)\r
+\r
+SET( SOURCES ${SOURCES}\r
+  third-party/glyphy/glyphy-arcs.cc\r
+  third-party/glyphy/glyphy-blob-impl.cc\r
+  third-party/glyphy/glyphy-extents.cc\r
+  third-party/glyphy/glyphy-outline.cc\r
+  third-party/glyphy/glyphy-sdf.cc\r
+  third-party/glyphy/vector-font-cache.cpp\r
+  \r
+  third-party/libunibreak/linebreak.c\r
+  third-party/libunibreak/linebreakdata.c\r
+  third-party/libunibreak/linebreakdef.c\r
+  third-party/libunibreak/wordbreak.c\r
+  \r
+  third-party/resampler/resampler.cpp\r
+)\r
+\r
+ADD_DEFINITIONS(\r
+-D "DALI_ADAPTOR_COMPILATION"\r
+-D "_NSIG=65"\r
+-D "FT_FACE_FLAG_COLOR=16384"\r
+-D "NON_POWER_OF_TWO_TEXTURES"\r
+-D "HAVE_STRUCT_TIMESPEC"\r
+-D "CURL_STATICLIB=0"\r
+-D "LC_MESSAGES=0"\r
+/DBUILDING_DALI_ADAPTOR\r
+/FI"../windows-dependencies/ExInclude/PreprocessorDefinitions.h"\r
+/FI"../windows-dependencies/ExInclude/AdaptorPreDefine.h"\r
+/NODEFAULTLIB:"libcmt.lib"\r
+/vmg\r
+/MP\r
+/Gz\r
+)\r
+\r
+link_directories(\r
+../windows-dependencies/ExLib\r
+../bin\r
+)\r
+\r
+#head file path  \r
+INCLUDE_DIRECTORIES(  \r
+./\r
+../dali-core\r
+../windows-dependencies/ExInclude\r
+../windows-dependencies/ExInclude/OpenGL/Include\r
+)\r
+\r
+set(LIBRARY_OUTPUT_PATH ../../../bin)\r
+\r
+#set(BUILD_SHARED_LIBS "On")\r
+\r
+#SET_TARGET_PROPERTIES (dali-core123_static PROPERTIES LINKER_LANGUAGE C++)\r
+\r
+ADD_LIBRARY(dali-adaptor SHARED ${SOURCES})\r
+\r
+target_link_libraries(dali-adaptor dali-core.lib)\r
+target_link_libraries(dali-adaptor libjpeg.lib)\r
+target_link_libraries(dali-adaptor libcurl_a.lib)\r
+target_link_libraries(dali-adaptor turbojpeg.lib)\r
+target_link_libraries(dali-adaptor getopt.lib)\r
+target_link_libraries(dali-adaptor giflib.lib)\r
+target_link_libraries(dali-adaptor libEGL.lib)\r
+target_link_libraries(dali-adaptor libexif.lib)\r
+target_link_libraries(dali-adaptor libGLESv2.lib)\r
+target_link_libraries(dali-adaptor pthread.lib)\r
+target_link_libraries(dali-adaptor libpng.lib)\r
+target_link_libraries(dali-adaptor zlibstat.lib)\r
+target_link_libraries(dali-adaptor freetype.lib)\r
+target_link_libraries(dali-adaptor FontConfig.lib)\r
+target_link_libraries(dali-adaptor libexpat.lib)\r
+target_link_libraries(dali-adaptor fribidi.lib)\r
+target_link_libraries(dali-adaptor harfbuzz-1.4.7.lib)\r
+target_link_libraries(dali-adaptor dlfcn.lib)\r
+target_link_libraries(dali-adaptor Win32File.lib)\r
+target_link_libraries(dali-adaptor WindowsPlatform.lib)\r
+\r
+add_dependencies(dali-adaptor dali-core)\r
index 6775ef2..be9c81e 100755 (executable)
@@ -42,7 +42,6 @@ class InputMethodContext;
  *
  * Specifically manages the ecore input method framework which enables the virtual or hardware keyboards.
  */
-
 class DALI_ADAPTOR_API InputMethodContext : public BaseHandle
 {
 public:
diff --git a/dali/internal/accessibility/windows/accessibility-adaptor-impl-win.cpp b/dali/internal/accessibility/windows/accessibility-adaptor-impl-win.cpp
new file mode 100755 (executable)
index 0000000..f9e8a9d
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/type-registry.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/singleton-service-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
+{
+  Dali::AccessibilityAdaptor adaptor;
+
+  Dali::SingletonService service( SingletonService::Get() );
+  if ( service )
+  {
+    // Check whether the singleton is already created
+    Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
+    if(handle)
+    {
+      // If so, downcast the handle
+      adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
+    }
+    else
+    {
+      adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptor() );
+      service.Register( typeid( adaptor ), adaptor );
+    }
+  }
+
+  return adaptor;
+}
+
+void AccessibilityAdaptor::OnDestroy()
+{
+  // Nothing to do here
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 4c7b79f..5ae0ecc
@@ -28,7 +28,9 @@
 #include <dali/internal/system/common/environment-options.h>
 #include <dali/internal/system/common/time-service.h>
 #include <dali/internal/adaptor/common/adaptor-internal-services.h>
+#if defined(__GNUC__)
 #include <dali/devel-api/adaptor-framework/thread-settings.h>
+#endif
 
 namespace Dali
 {
@@ -397,7 +399,9 @@ void CombinedUpdateRenderController::ProcessSleepRequest()
 
 void CombinedUpdateRenderController::UpdateRenderThread()
 {
+#if defined(__GNUC__)
   SetThreadName("RenderThread\0");
+#endif
 
   // Install a function for logging
   mEnvironmentOptions.InstallLogFunction();
diff --git a/dali/internal/adaptor/windows/adaptor-impl-win.cpp b/dali/internal/adaptor/windows/adaptor-impl-win.cpp
new file mode 100755 (executable)
index 0000000..993082d
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+void Adaptor::GetDataStoragePath( std::string& path)
+{
+  //path = DALI_SHADERBIN_DIR;
+}
+
+void Adaptor::GetAppId( std::string& appId )
+{
+  appId = "";
+}
+
+void Adaptor::SurfaceInitialized()
+{
+}
+
+void Adaptor::SetupSystemInformation()
+{
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/adaptor/windows/framework-win.cpp b/dali/internal/adaptor/windows/framework-win.cpp
new file mode 100755 (executable)
index 0000000..03a75a1
--- /dev/null
@@ -0,0 +1,313 @@
+/*\r
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// CLASS HEADER\r
+#include <dali/internal/adaptor/common/framework.h>\r
+\r
+// EXTERNAL INCLUDES\r
+#include <dali/integration-api/debug.h>\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/internal/window-system/windows/platform-implement-win.h>\r
+#include <dali/internal/system/common/callback-manager.h>\r
+\r
+int64_t counter = 0;\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+\r
+namespace\r
+{\r
+\r
+/// Application Status Enum\r
+enum\r
+{\r
+  APP_CREATE,\r
+  APP_TERMINATE,\r
+  APP_PAUSE,\r
+  APP_RESUME,\r
+  APP_RESET,\r
+  APP_LANGUAGE_CHANGE,\r
+};\r
+\r
+} // Unnamed namespace\r
+/**\r
+ * Impl to hide WindowsSystem data members\r
+ */\r
+struct Framework::Impl\r
+{\r
+  // Constructor\r
+\r
+  Impl(void* data)\r
+  : mAbortCallBack( NULL ),\r
+    mCallbackManager( CallbackManager::New() ),\r
+    mLanguage( "NOT_SUPPORTED" ),\r
+    mRegion( "NOT_SUPPORTED" )\r
+  {\r
+  }\r
+\r
+  ~Impl()\r
+  {\r
+    delete mAbortCallBack;\r
+\r
+    // we're quiting the main loop so\r
+    // mCallbackManager->RemoveAllCallBacks() does not need to be called\r
+    // to delete our abort handler\r
+    delete mCallbackManager;\r
+  }\r
+\r
+  std::string GetLanguage() const\r
+  {\r
+    return mLanguage;\r
+  }\r
+\r
+  std::string GetRegion() const\r
+  {\r
+    return mRegion;\r
+  }\r
+\r
+  // Data\r
+  CallbackBase* mAbortCallBack;\r
+  CallbackManager *mCallbackManager;\r
+  std::string mLanguage;\r
+  std::string mRegion;\r
+\r
+  // Static methods\r
+\r
+  /**\r
+   * Called by AppCore on application creation.\r
+   */\r
+  static bool AppCreate(void *data)\r
+  {\r
+    return static_cast<Framework*>(data)->AppStatusHandler(APP_CREATE, NULL);\r
+  }\r
+\r
+  /**\r
+   * Called by AppCore when the application should terminate.\r
+   */\r
+  static void AppTerminate(void *data)\r
+  {\r
+    static_cast<Framework*>(data)->AppStatusHandler(APP_TERMINATE, NULL);\r
+  }\r
+\r
+  /**\r
+   * Called by AppCore when the application is paused.\r
+   */\r
+  static void AppPause(void *data)\r
+  {\r
+    static_cast<Framework*>(data)->AppStatusHandler(APP_PAUSE, NULL);\r
+  }\r
+\r
+  /**\r
+   * Called by AppCore when the application is resumed.\r
+   */\r
+  static void AppResume(void *data)\r
+  {\r
+    static_cast<Framework*>(data)->AppStatusHandler(APP_RESUME, NULL);\r
+  }\r
+\r
+  /**\r
+   * Called by AppCore when the language changes on the device.\r
+   */\r
+  static void AppLanguageChange(void* data)\r
+  {\r
+    static_cast<Framework*>(data)->AppStatusHandler(APP_LANGUAGE_CHANGE, NULL);\r
+  }\r
+\r
+  void Run()\r
+  {\r
+    WindowsPlatformImplement::RunLoop();\r
+  }\r
+\r
+  void Quit()\r
+  {\r
+      int temp = 0;\r
+    //uv_stop( mMainLoop );\r
+  }\r
+\r
+\r
+private:\r
+  // Undefined\r
+  Impl( const Impl& impl );\r
+\r
+  // Undefined\r
+  Impl& operator=( const Impl& impl );\r
+};\r
+\r
+Framework::Framework( Framework::Observer& observer, int *argc, char ***argv, Type type )\r
+: mObserver(observer),\r
+  mInitialised(false),\r
+  mRunning(false),\r
+  mArgc(argc),\r
+  mArgv(argv),\r
+  mBundleName(""),\r
+  mBundleId(""),\r
+  mAbortHandler( MakeCallback( this, &Framework::AbortCallback ) ),\r
+  mImpl(NULL)\r
+{\r
+    InitThreads();\r
+    mImpl = new Impl(this);\r
+}\r
+\r
+Framework::~Framework()\r
+{\r
+  if (mRunning)\r
+  {\r
+    Quit();\r
+  }\r
+\r
+  delete mImpl;\r
+}\r
+\r
+void Framework::Run()\r
+{\r
+    mRunning = true;\r
+\r
+    Impl::AppCreate(this);\r
+    mImpl->Run();\r
+    mRunning = false;\r
+}\r
+\r
+void Framework::Quit()\r
+{\r
+  Impl::AppTerminate(this);\r
+//  mImpl->Quit();\r
+}\r
+\r
+bool Framework::IsMainLoopRunning()\r
+{\r
+  return mRunning;\r
+}\r
+\r
+void Framework::AddAbortCallback( CallbackBase* callback )\r
+{\r
+  mImpl->mAbortCallBack = callback;\r
+}\r
+\r
+std::string Framework::GetBundleName() const\r
+{\r
+  return mBundleName;\r
+}\r
+\r
+void Framework::SetBundleName(const std::string& name)\r
+{\r
+  mBundleName = name;\r
+}\r
+\r
+std::string Framework::GetBundleId() const\r
+{\r
+  return mBundleId;\r
+}\r
+\r
+std::string Framework::GetResourcePath()\r
+{\r
+  // "DALI_APPLICATION_PACKAGE" is used by Ubuntu specifically to get the already configured Application package path.\r
+  const char* ubuntuEnvironmentVariable = "DALI_APPLICATION_PACKAGE";\r
+  char* value = getenv( ubuntuEnvironmentVariable );\r
+  printf( "DALI_APPLICATION_PACKAGE is %s\n", value );\r
+  std::string resourcePath;\r
+  if ( value != NULL )\r
+  {\r
+    resourcePath = value;\r
+  }\r
+\r
+  return resourcePath;\r
+}\r
+\r
+void Framework::SetBundleId(const std::string& id)\r
+{\r
+  mBundleId = id;\r
+}\r
+\r
+void Framework::AbortCallback( )\r
+{\r
+  // if an abort call back has been installed run it.\r
+  if (mImpl->mAbortCallBack)\r
+  {\r
+    CallbackBase::Execute( *mImpl->mAbortCallBack );\r
+  }\r
+  else\r
+  {\r
+    Quit();\r
+  }\r
+}\r
+\r
+bool Framework::AppStatusHandler(int type, void *bundleData)\r
+{\r
+  switch (type)\r
+  {\r
+    case APP_CREATE:\r
+    {\r
+      mInitialised = true;\r
+\r
+      mObserver.OnInit();\r
+      break;\r
+    }\r
+\r
+    case APP_RESET:\r
+      mObserver.OnReset();\r
+      break;\r
+\r
+    case APP_RESUME:\r
+      mObserver.OnResume();\r
+      break;\r
+\r
+    case APP_TERMINATE:\r
+      mObserver.OnTerminate();\r
+      break;\r
+\r
+    case APP_PAUSE:\r
+      mObserver.OnPause();\r
+      break;\r
+\r
+    case APP_LANGUAGE_CHANGE:\r
+      mObserver.OnLanguageChanged();\r
+      break;\r
+\r
+    default:\r
+      break;\r
+  }\r
+\r
+  return true;\r
+}\r
+\r
+void Framework::InitThreads()\r
+{\r
+//  XInitThreads();\r
+}\r
+\r
+std::string Framework::GetLanguage() const\r
+{\r
+  return mImpl->GetLanguage();\r
+}\r
+\r
+std::string Framework::GetRegion() const\r
+{\r
+  return mImpl->GetRegion();\r
+}\r
+\r
+} // namespace Adaptor\r
+\r
+} // namespace Internal\r
+\r
+} // namespace Dali\r
diff --git a/dali/internal/clipboard/windows/clipboard-impl-win.cpp b/dali/internal/clipboard/windows/clipboard-impl-win.cpp
new file mode 100755 (executable)
index 0000000..806af79
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/clipboard/common/clipboard-impl.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/type-registry.h>
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/singleton-service-impl.h>
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Clipboard
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+struct Clipboard::Impl
+{
+  Impl()
+  {
+  }
+
+  // Put implementation here.
+};
+
+Clipboard::Clipboard(Impl* impl)
+: mImpl(impl)
+{
+}
+
+Clipboard::~Clipboard()
+{
+}
+
+Dali::Clipboard Clipboard::Get()
+{
+  Dali::Clipboard clipboard;
+
+  Dali::SingletonService service( SingletonService::Get() );
+  if ( service )
+  {
+    // Check whether the singleton is already created
+    Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::Clipboard ) );
+    if(handle)
+    {
+      // If so, downcast the handle
+      clipboard = Dali::Clipboard( dynamic_cast< Clipboard* >( handle.GetObjectPtr() ) );
+    }
+    else
+    {
+      Clipboard::Impl* impl( new Clipboard::Impl() );
+      clipboard = Dali::Clipboard( new Clipboard(impl) );
+      service.Register( typeid(Dali::Clipboard), clipboard );
+    }
+  }
+
+  return clipboard;
+}
+bool Clipboard::SetItem(const std::string &itemData )
+{
+  return true;
+}
+
+/*
+ * Request clipboard service to retrieve an item
+ */
+void Clipboard::RequestItem()
+{
+}
+
+/*
+ * Get number of items in clipboard
+ */
+unsigned int Clipboard::NumberOfItems()
+{
+  return -1;
+}
+
+/**
+ * Show clipboard window
+ * Function to send message to show the Clipboard (cbhm) as no direct API available
+ * Reference elementary/src/modules/ctxpopup_copypasteUI/cbhm_helper.c
+ */
+void Clipboard::ShowClipboard()
+{
+}
+
+void Clipboard::HideClipboard(bool skipFirstHide)
+{
+}
+
+bool Clipboard::IsVisible() const
+{
+  return false;
+}
+
+char* Clipboard::ExcuteBuffered( bool type, void *event )
+{
+  return NULL;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
index 783c06a..479d19d 100755 (executable)
@@ -21,7 +21,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
-
 #include <dali/public-api/common/dali-vector.h>
 
 // INTERNAL INCLUDES
diff --git a/dali/internal/graphics/windows-gl/egl-image-extensions.cpp b/dali/internal/graphics/windows-gl/egl-image-extensions.cpp
new file mode 100755 (executable)
index 0000000..7d390c9
--- /dev/null
@@ -0,0 +1,242 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+// CLASS HEADER
+#include <dali/internal/graphics/common/egl-image-extensions.h>
+
+// EXTERNAL INCLUDES
+#if DALI_GLES_VERSION >= 30
+#include <GLES3/gl3.h>
+#include <GLES3/gl3ext.h>
+
+#else
+#include <GLES2/gl2.h>
+#endif // DALI_GLES_VERSION >= 30
+
+#include <GLES2/gl2ext.h>
+
+#include <EGL/eglext.h>
+
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/gles20/egl-implementation.h>
+
+
+namespace
+{
+// function pointers assigned in InitializeEglImageKHR
+PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHRProc = 0;
+PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHRProc = 0;
+PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOESProc = 0;
+} // unnamed namespace
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+EglImageExtensions::EglImageExtensions(EglImplementation* eglImpl)
+: mEglImplementation(eglImpl),
+  mImageKHRInitialized(false),
+  mImageKHRInitializeFailed(false)
+{
+  DALI_ASSERT_ALWAYS( eglImpl && "EGL Implementation not instantiated" );
+}
+
+EglImageExtensions::~EglImageExtensions()
+{
+}
+
+void* EglImageExtensions::CreateImageKHR(EGLClientBuffer clientBuffer)
+{
+  if (mImageKHRInitialized == false)
+  {
+    InitializeEglImageKHR();
+  }
+
+  if (mImageKHRInitialized == false)
+  {
+    return NULL;
+  }
+
+  // Use the EGL image extension
+  const EGLint attribs[] =
+  {
+    EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
+    EGL_NONE
+  };
+
+// EGL constants use C casts
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+  EGLImageKHR eglImage  = eglCreateImageKHRProc( mEglImplementation->GetDisplay(),
+                                             EGL_NO_CONTEXT,
+                                             EGL_NATIVE_PIXMAP_KHR,
+                                             clientBuffer,
+                                             attribs );
+
+  DALI_ASSERT_DEBUG( EGL_NO_IMAGE_KHR != eglImage && "WindowsImage::GlExtensionCreate eglCreateImageKHR failed!\n");
+  if( EGL_NO_IMAGE_KHR == eglImage )
+  {
+    switch( eglGetError() )
+    {
+      case EGL_SUCCESS :
+      {
+        break;
+      }
+      case EGL_BAD_DISPLAY:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_DISPLAY: Invalid EGLDisplay object\n" );
+        break;
+      }
+      case EGL_BAD_CONTEXT:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_CONTEXT: Invalid EGLContext object\n" );
+        break;
+      }
+      case EGL_BAD_PARAMETER:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_PARAMETER: Invalid target parameter or attribute in attrib_list\n" );
+        break;
+      }
+      case EGL_BAD_MATCH:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_MATCH: attrib_list does not match target\n" );
+        break;
+      }
+      case EGL_BAD_ACCESS:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_ACCESS: Previously bound off-screen, or EGLImage sibling error\n" );
+        break;
+      }
+      case EGL_BAD_ALLOC:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_ALLOC: Insufficient memory is available\n" );
+        break;
+      }
+      default:
+      {
+        break;
+      }
+    }
+  }
+#pragma GCC diagnostic pop
+
+  return eglImage;
+}
+
+void EglImageExtensions::DestroyImageKHR(void* eglImageKHR)
+{
+  DALI_ASSERT_DEBUG( mImageKHRInitialized );
+
+  if( ! mImageKHRInitialized )
+  {
+    return;
+  }
+
+  if( eglImageKHR == NULL )
+  {
+    return;
+  }
+
+  EGLImageKHR eglImage = static_cast<EGLImageKHR>(eglImageKHR);
+
+  EGLBoolean result = eglDestroyImageKHRProc(mEglImplementation->GetDisplay(), eglImage);
+
+  if( EGL_FALSE == result )
+  {
+    switch( eglGetError() )
+    {
+      case EGL_BAD_DISPLAY:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_DISPLAY: Invalid EGLDisplay object\n" );
+        break;
+      }
+      case EGL_BAD_PARAMETER:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_PARAMETER: eglImage is not a valid EGLImageKHR object created with respect to EGLDisplay\n" );
+        break;
+      }
+      case EGL_BAD_ACCESS:
+      {
+        DALI_LOG_ERROR( "EGL_BAD_ACCESS: EGLImage sibling error\n" );
+        break;
+      }
+      default:
+      {
+        break;
+      }
+    }
+  }
+}
+
+void EglImageExtensions::TargetTextureKHR(void* eglImageKHR)
+{
+  DALI_ASSERT_DEBUG( mImageKHRInitialized );
+
+  if( eglImageKHR != NULL )
+  {
+    EGLImageKHR eglImage = static_cast<EGLImageKHR>(eglImageKHR);
+
+#ifdef EGL_ERROR_CHECKING
+    GLint glError = glGetError();
+#endif
+
+    glEGLImageTargetTexture2DOESProc(GL_TEXTURE_2D, reinterpret_cast< GLeglImageOES >( eglImage ) );
+
+#ifdef EGL_ERROR_CHECKING
+    glError = glGetError();
+    if( GL_NO_ERROR != glError )
+    {
+      DALI_LOG_ERROR(" glEGLImageTargetTexture2DOES returned error %0x04x\n", glError );
+    }
+#endif
+  }
+}
+
+void EglImageExtensions::InitializeEglImageKHR()
+{
+  // avoid trying to reload extended KHR functions, if it fails the first time
+  if( ! mImageKHRInitializeFailed )
+  {
+    eglCreateImageKHRProc  = reinterpret_cast< PFNEGLCREATEIMAGEKHRPROC >( eglGetProcAddress("eglCreateImageKHR") );
+    eglDestroyImageKHRProc = reinterpret_cast< PFNEGLDESTROYIMAGEKHRPROC >( eglGetProcAddress("eglDestroyImageKHR") );
+    glEGLImageTargetTexture2DOESProc = reinterpret_cast< PFNGLEGLIMAGETARGETTEXTURE2DOESPROC >( eglGetProcAddress("glEGLImageTargetTexture2DOES") );
+  }
+
+  if (eglCreateImageKHRProc && eglDestroyImageKHRProc && glEGLImageTargetTexture2DOESProc)
+  {
+    mImageKHRInitialized = true;
+  }
+  else
+  {
+    mImageKHRInitializeFailed = true;
+  }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/graphics/windows/vsync-monitor-win.cpp b/dali/internal/graphics/windows/vsync-monitor-win.cpp
new file mode 100755 (executable)
index 0000000..b92844f
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/graphics/common/vsync-monitor.h>
+
+// EXTERNAL INCLUDES
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace
+{
+// constants to keep code readability with unsigned int has to be used as boolean (due to multithreading)
+const unsigned int TRUE = 1u;
+const unsigned int FALSE = 0u;
+
+const int FD_NONE( -1 );
+
+} // unnamed namespace
+
+VSyncMonitor::VSyncMonitor()
+: mFileDescriptor( FD_NONE ),
+  mUseHardwareVSync( FALSE ),
+  mHardwareVSyncAvailable( FALSE )
+{
+}
+
+VSyncMonitor::~VSyncMonitor()
+{
+  Terminate();
+}
+
+void VSyncMonitor::SetUseHardwareVSync( bool useHardware )
+{
+  mUseHardwareVSync = useHardware;
+}
+
+void VSyncMonitor::SetHardwareVSyncAvailable( bool hardwareVSyncAvailable )
+{
+  mHardwareVSyncAvailable = hardwareVSyncAvailable;
+}
+
+void VSyncMonitor::Initialize()
+{
+  DALI_ASSERT_DEBUG( mFileDescriptor == FD_NONE && "VSyncMonitor::Initialize() called twice" );
+
+  // setup vblank request - block and wait for next vblank
+  mVBlankInfo.request.type = DRM_VBLANK_NEXTONMISS;
+  mVBlankInfo.request.sequence = 0;
+  mVBlankInfo.request.signal = 0;
+
+  // setup vblank reply - block and wait for next vblank
+  mVBlankInfo.reply.type = DRM_VBLANK_NEXTONMISS;
+  mVBlankInfo.reply.sequence = 0;
+  mVBlankInfo.reply.tval_sec = 0;
+  mVBlankInfo.reply.tval_usec = 0;
+}
+
+void VSyncMonitor::Terminate()
+{
+}
+
+bool VSyncMonitor::UseHardware()
+{
+  return mUseHardwareVSync && mHardwareVSyncAvailable && (FD_NONE != mFileDescriptor );
+}
+
+
+bool VSyncMonitor::DoSync( unsigned int& frameNumber, unsigned int& seconds, unsigned int& microseconds )
+{
+  DALI_ASSERT_DEBUG( mFileDescriptor != FD_NONE && "ECoreX::VSyncMonitor is not initialized" );
+  return false;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index c7fb345..9c6d419
@@ -69,6 +69,10 @@ public:
    */
   static unsigned long GetThreadId();
 
+  static void ConfigureCurlOptions( void* curlHandle, const std::string& url );
+
+  static void InitWriteFunction( void* curlHandle );
+
 private:
 
   void SetLockingFunction();
index b83878e..e8b3b79 100755 (executable)
@@ -33,6 +33,7 @@
 #include <dali/internal/system/common/file-reader.h>
 
 using namespace Dali::Integration;
+using namespace Dali::Internal::Platform;
 
 namespace Dali
 {
@@ -147,10 +148,10 @@ bool GetBitmapLoaderFunctions( FILE *fp,
                                const std::string& filename )
 {
   unsigned char magic[MAGIC_LENGTH];
-  size_t read = fread(magic, sizeof(unsigned char), MAGIC_LENGTH, fp);
+  size_t read = InternalFile::fread(magic, sizeof(unsigned char), MAGIC_LENGTH, fp);
 
   // Reset to the start of the file.
-  if( fseek(fp, 0, SEEK_SET) )
+  if( InternalFile::fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking to start of file\n");
   }
@@ -235,7 +236,7 @@ bool GetBitmapLoaderFunctions( FILE *fp,
   }
 
   // Reset to the start of the file.
-  if( fseek(fp, 0, SEEK_SET) )
+  if( InternalFile::fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking to start of file\n");
   }
index 4765bf9..6720082 100755 (executable)
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <dali/internal/imaging/common/pixel-buffer-impl.h>
 
+#include <dali/internal/system/common/file-closer.h>
+
+using namespace Dali::Internal::Platform;
+
 namespace Dali
 {
 namespace TizenPlatform
@@ -120,7 +124,7 @@ bool LoadAstcHeader( FILE * const filePointer, unsigned int& width, unsigned int
 {
   // Pull the bytes of the file header in as a block:
   const unsigned int readLength = sizeof( AstcFileHeader );
-  if( fread( &fileHeader, 1, readLength, filePointer ) != readLength )
+  if( InternalFile::fread( &fileHeader, 1, readLength, filePointer ) != readLength )
   {
     return false;
   }
@@ -196,20 +200,20 @@ bool LoadBitmapFromAstc( const Dali::ImageLoader::Input& input, Dali::Devel::Pix
   }
 
   // Retrieve the file size.
-  if( fseek( filePointer, 0L, SEEK_END ) )
+  if( InternalFile::fseek( filePointer, 0L, SEEK_END ) )
   {
     DALI_LOG_ERROR( "Could not seek through file.\n" );
     return false;
   }
 
-  off_t fileSize = ftell( filePointer );
+  off_t fileSize = InternalFile::ftell( filePointer );
   if( fileSize == -1L )
   {
     DALI_LOG_ERROR( "Could not determine ASTC file size.\n" );
     return false;
   }
 
-  if( fseek( filePointer, sizeof( AstcFileHeader ), SEEK_SET ) )
+  if( InternalFile::fseek( filePointer, sizeof( AstcFileHeader ), SEEK_SET ) )
   {
     DALI_LOG_ERROR( "Could not seek through file.\n" );
     return false;
@@ -239,7 +243,7 @@ bool LoadBitmapFromAstc( const Dali::ImageLoader::Input& input, Dali::Devel::Pix
   }
 
   // Load the image data.
-  const size_t bytesRead = fread( pixels, 1, imageByteCount, filePointer );
+  const size_t bytesRead = InternalFile::fread( pixels, 1, imageByteCount, filePointer );
 
   // Check the size of loaded data is what we expected.
   if( bytesRead != imageByteCount )
index 65120f2..faf35ab 100755 (executable)
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <dali/integration-api/debug.h>
 
+#include <dali/internal/system/common/file-closer.h>
+
+using namespace Dali::Internal::Platform;
+
 namespace Dali
 {
 
@@ -84,7 +88,7 @@ inline bool ReadHeader(FILE* fp, T& header)
   const unsigned int readLength = sizeof(T);
 
   // Load the information directly into our structure
-  if ( fread( &header, 1, readLength, fp ) != readLength )
+  if ( InternalFile::fread( &header, 1, readLength, fp ) != readLength )
   {
     return false;
   }
@@ -140,7 +144,7 @@ bool DecodeRGB24V5(FILE *fp,
     DALI_LOG_ERROR("Error decoding BMP_RGB24V5 format\n");
     return false;
   }
-  if ( fseek(fp, offset, SEEK_SET) )
+  if ( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_RGB24V5 data\n");
     return false;
@@ -157,7 +161,7 @@ bool DecodeRGB24V5(FILE *fp,
     {
       pixelsPtr = pixels + (((height-1)-yPos) * rowStride);
     }
-    if (fread(pixelsPtr, 1, rowStride, fp) != rowStride)
+    if (InternalFile::fread(pixelsPtr, 1, rowStride, fp) != rowStride)
     {
       DALI_LOG_ERROR("Error reading the BMP image\n");
       return false;
@@ -172,7 +176,7 @@ bool DecodeRGB24V5(FILE *fp,
     if (padding)
     {
       // move past the padding.
-      if( fseek(fp, padding, SEEK_CUR) )
+      if( InternalFile::fseek(fp, padding, SEEK_CUR) )
       {
         DALI_LOG_ERROR("Error moving past BMP_RGB24V5 padding\n");
       }
@@ -207,7 +211,7 @@ bool DecodeBF32V4(FILE *fp,
     DALI_LOG_ERROR("Error decoding BMP_BITFIELDS32V4 format\n");
     return false;
   }
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_BITFIELDS32V4 data\n");
     return false;
@@ -224,7 +228,7 @@ bool DecodeBF32V4(FILE *fp,
     {
       pixelsPtr = pixels + (((height-1)-yPos) * rowStride);
     }
-    if (fread(pixelsPtr, 1, rowStride, fp) != rowStride)
+    if (InternalFile::fread(pixelsPtr, 1, rowStride, fp) != rowStride)
     {
       DALI_LOG_ERROR("Error reading the BMP image\n");
       return false;
@@ -238,7 +242,7 @@ bool DecodeBF32V4(FILE *fp,
     if (padding)
     {
       // move past the padding.
-      if( fseek(fp, padding, SEEK_CUR) )
+      if( InternalFile::fseek(fp, padding, SEEK_CUR) )
       {
         DALI_LOG_ERROR("Error moving past BMP_BITFIELDS32V4 padding\n");
       }
@@ -274,7 +278,7 @@ bool DecodeBF32(FILE *fp,
     DALI_LOG_ERROR("Error decoding BMP_BITFIELDS32 format\n");
     return false;
   }
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_BITFIELDS32 data\n");
     return false;
@@ -294,7 +298,7 @@ bool DecodeBF32(FILE *fp,
       pixelsPtr = pixels + (((height-1)-yPos) * rowStride);
     }
 
-    if (fread(pixelsPtr, 1, rowStride, fp) != rowStride)
+    if (InternalFile::fread(pixelsPtr, 1, rowStride, fp) != rowStride)
     {
       DALI_LOG_ERROR("Error reading the BMP image\n");
       return false;
@@ -309,7 +313,7 @@ bool DecodeBF32(FILE *fp,
     if (padding)
     {
       // move past the padding.
-      if( fseek(fp, padding, SEEK_CUR) )
+      if( InternalFile::fseek(fp, padding, SEEK_CUR) )
       {
         DALI_LOG_ERROR("Error moving past BMP_BITFIELDS32 padding\n");
       }
@@ -340,7 +344,7 @@ bool DecodeBF565(FILE *fp,
     DALI_LOG_ERROR("Error decoding RGB565 format\n");
     return false;
   }
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking RGB565 data\n");
     return false;
@@ -362,7 +366,7 @@ bool DecodeBF565(FILE *fp,
       // the data in the file is bottom up, and we store the data top down
       pixelsPtr = pixels + (((height - 1) - i) * rowStride);
     }
-    if(fread(pixelsPtr, 1, rowStride, fp) != rowStride)
+    if(InternalFile::fread(pixelsPtr, 1, rowStride, fp) != rowStride)
     {
       return false;
     }
@@ -394,7 +398,7 @@ bool DecodeBF555(FILE *fp,
     return false;
   }
 
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_BITFIELDS555 data\n");
     return false;
@@ -410,7 +414,7 @@ bool DecodeBF555(FILE *fp,
   for(unsigned int j = 0; j <  height; j ++)
   {
     rawPtr = &raw[0] + ( j * rawStride);
-    if(fread(rawPtr, 1, rawStride, fp) != rawStride)
+    if(InternalFile::fread(rawPtr, 1, rawStride, fp) != rawStride)
     {
       return false;
     }
@@ -463,7 +467,7 @@ bool DecodeRGB555(FILE *fp,
     DALI_LOG_ERROR("Error decoding BMP_RGB555 format\n");
     return false;
   }
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_RGB555 data\n");
     return false;
@@ -478,7 +482,7 @@ bool DecodeRGB555(FILE *fp,
   for(unsigned int j = 0; j <  height; j ++)
   {
     rawPtr = &raw[0] + ( j * rawStride);
-    if(fread(rawPtr, 1, rawStride, fp) != rawStride)
+    if(InternalFile::fread(rawPtr, 1, rawStride, fp) != rawStride)
     {
       return false;
     }
@@ -530,7 +534,7 @@ bool DecodeRGB1(FILE *fp,
     DALI_LOG_ERROR("Error decoding BMP_RGB1 format\n");
     return false;
   }
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_RGB1 data\n");
     return false;
@@ -543,14 +547,14 @@ bool DecodeRGB1(FILE *fp,
   unsigned int rowStride = fillw * 3; // RGB
 
 
-  if(fread(colorTable, 1, 8, fp) != 8)
+  if(InternalFile::fread(colorTable, 1, 8, fp) != 8)
   {
     return false;
   }
 
   for(unsigned int i = 0; i < fillw * height; i += 8)
   {
-    if(fread(&cmd, 1, 1, fp) != 1)
+    if(InternalFile::fread(&cmd, 1, 1, fp) != 1)
     {
       return false;
     }
@@ -623,7 +627,7 @@ bool DecodeRGB4(FILE *fp,
     DALI_LOG_ERROR("Error decoding BMP_RGB4 format\n");
     return false;
   }
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_RGB4 data\n");
     return false;
@@ -635,14 +639,14 @@ bool DecodeRGB4(FILE *fp,
   std::vector<char> colorIndex(fillw * height);
   unsigned int rowStride = fillw  * 3;
 
-  if(fread(colorTable, 1, 64, fp) != 64)
+  if(InternalFile::fread(colorTable, 1, 64, fp) != 64)
   {
     return false;
   }
 
   for(unsigned int i = 0; i < fillw * height; i += 2)
   {
-    if (fread(&cmd, 1, 1, fp) != 1)
+    if (InternalFile::fread(&cmd, 1, 1, fp) != 1)
     {
       return false;
     }
@@ -699,7 +703,7 @@ bool DecodeRGB8(FILE *fp,
     DALI_LOG_ERROR("Error decoding BMP_RGB8 format\n");
     return false;
   }
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_RGB8 data\n");
     return false;
@@ -711,13 +715,13 @@ bool DecodeRGB8(FILE *fp,
   std::vector<char> colorIndex(width * height);
   unsigned int rowStride = width * 3;//RGB8->RGB24
 
-  if(fread(&colorTable[0], 1, 1024, fp) != 1024)
+  if(InternalFile::fread(&colorTable[0], 1, 1024, fp) != 1024)
   {
     return false;
   }
   for(unsigned int i = 0; i < width * height; i ++)
   {
-    if (fread(&cmd, 1, 1, fp) != 1)
+    if (InternalFile::fread(&cmd, 1, 1, fp) != 1)
     {
       return false;
     }
@@ -787,13 +791,13 @@ bool DecodeRLE4(FILE *fp,
 
   bool finish = false;
 
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_RLE4 data\n");
     return false;
   }
 
-  if (fread(colorTable, 1, 64, fp) != 64)
+  if (InternalFile::fread(colorTable, 1, 64, fp) != 64)
   {
     return false;
   }
@@ -804,7 +808,7 @@ bool DecodeRLE4(FILE *fp,
     {
       break;
     }
-    if (fread(cmd, 1, cmdStride, fp) != cmdStride)
+    if (InternalFile::fread(cmd, 1, cmdStride, fp) != cmdStride)
     {
       return false;
     }
@@ -820,7 +824,7 @@ bool DecodeRLE4(FILE *fp,
           y ++;
           break;
         case 2: // delta
-          if (fread(cmd, 1, cmdStride, fp) != cmdStride)
+          if (InternalFile::fread(cmd, 1, cmdStride, fp) != cmdStride)
           {
             DALI_LOG_ERROR("Error reading the BMP image\n");
             return false;
@@ -839,7 +843,7 @@ bool DecodeRLE4(FILE *fp,
           bytesize >>= 1;
           bytesize += (bytesize & 1);
           run.resize(bytesize);
-          if(fread(&run[0], 1, bytesize, fp) != bytesize)
+          if(InternalFile::fread(&run[0], 1, bytesize, fp) != bytesize)
           {
             DALI_LOG_ERROR("Error reading the BMP image\n");
             return false;
@@ -949,13 +953,13 @@ bool DecodeRLE8(FILE *fp,
   char cmd[2];
   std::vector<char> colorIndex(width * height);
 
-  if( fseek(fp, offset, SEEK_SET) )
+  if( InternalFile::fseek(fp, offset, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking BMP_RLE8 data\n");
     return false;
   }
 
-  if (fread(&colorTable[0], 1, 1024, fp) != 1024)
+  if (InternalFile::fread(&colorTable[0], 1, 1024, fp) != 1024)
   {
     return false;
   }
@@ -972,7 +976,7 @@ bool DecodeRLE8(FILE *fp,
     {
       break;
     }
-    if (fread(cmd, 1, cmdStride, fp) != cmdStride)
+    if (InternalFile::fread(cmd, 1, cmdStride, fp) != cmdStride)
     {
       return false;
     }
@@ -989,7 +993,7 @@ bool DecodeRLE8(FILE *fp,
           y ++;
           break;
         case 2: // delta
-          if (fread(cmd, 1, cmdStride, fp) != cmdStride)
+          if (InternalFile::fread(cmd, 1, cmdStride, fp) != cmdStride)
           {
             DALI_LOG_ERROR("Error reading the BMP image\n");
             return false;
@@ -1006,7 +1010,7 @@ bool DecodeRLE8(FILE *fp,
           //absolute mode must be word-aligned
           length += (length & 1);
           run.resize(length);
-          if(fread(&run[0], 1, length, fp) != length)
+          if(InternalFile::fread(&run[0], 1, length, fp) != length)
           {
             DALI_LOG_ERROR("Error reading the BMP image\n");
             return false;
@@ -1135,13 +1139,13 @@ bool LoadBitmapFromBmp( const Dali::ImageLoader::Input& input, Dali::Devel::Pixe
     {
       if(infoHeader.bitsPerPixel == 16)
       {
-        if( fseek(fp, 14 + infoHeader.infoHeaderSize + 1, SEEK_SET) )
+        if( InternalFile::fseek(fp, 14 + infoHeader.infoHeaderSize + 1, SEEK_SET) )
         {
           return false;
         }
 
         char mask;
-        if(fread(&mask, 1, 1, fp) != 1)
+        if(InternalFile::fread(&mask, 1, 1, fp) != 1)
         {
           return false;
         }
@@ -1330,7 +1334,7 @@ bool LoadBitmapFromBmp( const Dali::ImageLoader::Input& input, Dali::Devel::Pixe
             pixelsIterator = pixels + (((height-1)-yPos) * rowStride);
           }
 
-          if (fread(pixelsIterator, 1, rowStride, fp) != rowStride)
+          if (InternalFile::fread(pixelsIterator, 1, rowStride, fp) != rowStride)
           {
             DALI_LOG_ERROR("Error reading the BMP image\n");
             break;
@@ -1350,7 +1354,7 @@ bool LoadBitmapFromBmp( const Dali::ImageLoader::Input& input, Dali::Devel::Pixe
 
           if (padding)
           {
-            if( fseek(fp, padding, SEEK_CUR) )  // move past the padding.
+            if( InternalFile::fseek(fp, padding, SEEK_CUR) )  // move past the padding.
             {
               DALI_LOG_ERROR("Error moving past BMP padding\n");
             }
index cf9b010..e292318 100755 (executable)
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <memory>
 
+#include <dali/internal/system/common/file-closer.h>
+
+using namespace Dali::Internal::Platform;
+
 // We need to check if giflib has the new open and close API (including error parameter).
 #ifdef GIFLIB_MAJOR
 #define LIBGIF_VERSION_5_1_OR_ABOVE
@@ -89,7 +93,7 @@ const unsigned int INTERLACE_PAIR_TABLE_SIZE( sizeof( INTERLACE_PAIR_TABLE ) / s
 int ReadDataFromGif(GifFileType *gifInfo, GifByteType *data, int length)
 {
   FILE *fp = reinterpret_cast<FILE*>(gifInfo->UserData);
-  return fread( data, sizeof( GifByteType ), length, fp);
+  return InternalFile::fread( data, sizeof( GifByteType ), length, fp);
 }
 
 /// Loads the GIF Header.
index dc99750..acb74f4 100755 (executable)
 #include <dali/integration-api/debug.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 
+#include <dali/internal/system/common/file-closer.h>
+
+using namespace Dali::Internal::Platform;
+
 namespace Dali
 {
 
@@ -174,13 +178,13 @@ bool LoadIcoHeaderHelper( FILE* fp,
   unsigned short word;
   unsigned char byte;
 
-  if( fseek(fp,0,SEEK_END) )
+  if( InternalFile::fseek(fp,0,SEEK_END) )
   {
     DALI_LOG_ERROR("Error seeking ICO data\n");
     return false;
   }
 
-  long positionIndicator = ftell(fp);
+  long positionIndicator = InternalFile::ftell(fp);
   fsize = 0u;
 
   if( positionIndicator > -1L )
@@ -193,7 +197,7 @@ bool LoadIcoHeaderHelper( FILE* fp,
     return false;
   }
 
-  if( fseek(fp, 0, SEEK_SET) )
+  if( InternalFile::fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking ICO data\n");
     return false;
@@ -205,7 +209,7 @@ bool LoadIcoHeaderHelper( FILE* fp,
   }
   map.Resize(fsize);
 
-  if(fread(&map[0], 1, fsize, fp) != fsize)
+  if(InternalFile::fread(&map[0], 1, fsize, fp) != fsize)
   {
     DALI_LOG_WARNING("image file read opeation error!\n");
     return false;
index b507693..01a735e 100755 (executable)
 #include <dali/devel-api/adaptor-framework/image-loading.h>
 #include <dali/internal/imaging/common/pixel-buffer-impl.h>
 
+#include <dali/internal/system/common/file-closer.h>
+
+using namespace Dali::Internal::Platform;
+
 namespace
 {
 using Dali::Vector;
@@ -533,13 +537,13 @@ bool LoadBitmapFromJpeg( const Dali::ImageLoader::Input& input, Dali::Devel::Pix
   const int flags= 0;
   FILE* const fp = input.file;
 
-  if( fseek(fp,0,SEEK_END) )
+  if( InternalFile::fseek(fp,0,SEEK_END) )
   {
     DALI_LOG_ERROR("Error seeking to end of file\n");
     return false;
   }
 
-  long positionIndicator = ftell(fp);
+  long positionIndicator = InternalFile::ftell(fp);
   unsigned int jpegBufferSize = 0u;
   if( positionIndicator > -1L )
   {
@@ -551,7 +555,7 @@ bool LoadBitmapFromJpeg( const Dali::ImageLoader::Input& input, Dali::Devel::Pix
     return false;
   }
 
-  if( fseek(fp, 0, SEEK_SET) )
+  if( InternalFile::fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking to start of file\n");
     return false;
@@ -570,13 +574,13 @@ bool LoadBitmapFromJpeg( const Dali::ImageLoader::Input& input, Dali::Devel::Pix
   unsigned char * const jpegBufferPtr = jpegBuffer.Begin();
 
   // Pull the compressed JPEG image bytes out of a file and into memory:
-  if( fread( jpegBufferPtr, 1, jpegBufferSize, fp ) != jpegBufferSize )
+  if( InternalFile::fread( jpegBufferPtr, 1, jpegBufferSize, fp ) != jpegBufferSize )
   {
     DALI_LOG_WARNING("Error on image file read.\n");
     return false;
   }
 
-  if( fseek(fp, 0, SEEK_SET) )
+  if( InternalFile::fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking to start of file\n");
   }
@@ -1086,7 +1090,7 @@ ExifHandle LoadExifData( FILE* fp )
   auto exifData = MakeNullExifData();
   unsigned char dataBuffer[1024];
 
-  if( fseek( fp, 0, SEEK_SET ) )
+  if( InternalFile::fseek( fp, 0, SEEK_SET ) )
   {
     DALI_LOG_ERROR("Error seeking to start of file\n");
   }
@@ -1095,9 +1099,9 @@ ExifHandle LoadExifData( FILE* fp )
     auto exifLoader = std::unique_ptr<ExifLoader, decltype(exif_loader_unref)*>{
         exif_loader_new(), exif_loader_unref };
 
-    while( !feof(fp) )
+    while( !InternalFile::feof(fp) )
     {
-      int size = fread( dataBuffer, 1, sizeof( dataBuffer ), fp );
+      int size = InternalFile::fread( dataBuffer, 1, sizeof( dataBuffer ), fp );
       if( size <= 0 )
       {
         break;
index e431239..0e0881b 100755 (executable)
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <dali/internal/imaging/common/pixel-buffer-impl.h>
 
+#include <dali/internal/system/common/file-closer.h>
+
+using namespace Dali::Internal::Platform;
+
 namespace Dali
 {
 
@@ -194,7 +198,7 @@ inline bool ReadHeader( FILE* filePointer, KtxFileHeader& header )
   const unsigned int readLength = sizeof( KtxFileHeader );
 
   // Load the information directly into our structure
-  if( fread( &header, 1, readLength, filePointer ) != readLength )
+  if( InternalFile::fread( &header, 1, readLength, filePointer ) != readLength )
   {
     return false;
   }
@@ -556,7 +560,7 @@ bool LoadBitmapFromKtx( const Dali::ImageLoader::Input& input, Dali::Devel::Pixe
 
   // Skip the key-values:
   const long int imageSizeOffset = sizeof(KtxFileHeader) + fileHeader.bytesOfKeyValueData;
-  if(fseek(fp, imageSizeOffset, SEEK_SET))
+  if(InternalFile::fseek(fp, imageSizeOffset, SEEK_SET))
   {
     DALI_LOG_ERROR( "Seek past key/vals in KTX compressed bitmap file failed.\n" );
     return false;
@@ -564,7 +568,7 @@ bool LoadBitmapFromKtx( const Dali::ImageLoader::Input& input, Dali::Devel::Pixe
 
   // Load the size of the image data:
   uint32_t imageByteCount = 0;
-  if ( fread( &imageByteCount, 1, 4, fp ) != 4 )
+  if ( InternalFile::fread( &imageByteCount, 1, 4, fp ) != 4 )
   {
     DALI_LOG_ERROR( "Read of image size failed.\n" );
     return false;
@@ -605,7 +609,7 @@ bool LoadBitmapFromKtx( const Dali::ImageLoader::Input& input, Dali::Devel::Pixe
     return false;
   }
 
-  const size_t bytesRead = fread(pixels, 1, imageByteCount, fp);
+  const size_t bytesRead = InternalFile::fread(pixels, 1, imageByteCount, fp);
   if(bytesRead != imageByteCount)
   {
     DALI_LOG_ERROR( "Read of image pixel data failed.\n" );
index 4b51af3..4806fcb 100755 (executable)
 #include <dali/internal/legacy/tizen/platform-capabilities.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 
+#include <dali/internal/system/common/file-closer.h>
+
+using namespace Dali::Internal::Platform;
+
 namespace Dali
 {
 namespace TizenPlatform
@@ -61,7 +65,7 @@ bool LoadPngHeader(FILE *fp, unsigned int &width, unsigned int &height, png_stru
   png_byte header[8] = { 0 };
 
   // Check header to see if it is a PNG file
-  size_t size = fread(header, 1, 8, fp);
+  size_t size = InternalFile::fread(header, 1, 8, fp);
   if(size != 8)
   {
     return false;
index 6942442..05d7aa0 100755 (executable)
 #include <dali/integration-api/debug.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 
+#include <dali/internal/system/common/file-closer.h>
+
+using namespace Dali::Internal::Platform;
+
 namespace Dali
 {
 
@@ -108,12 +112,12 @@ bool LoadBitmapFromWbmp( const Dali::ImageLoader::Input& input, Dali::Devel::Pix
   unsigned char *line = NULL;
   unsigned int cur = 0, x, y;
 
-  if( fseek(fp,0,SEEK_END) )
+  if( InternalFile::fseek(fp,0,SEEK_END) )
   {
     DALI_LOG_ERROR("Error seeking WBMP data\n");
     return false;
   }
-  long positionIndicator = ftell(fp);
+  long positionIndicator = InternalFile::ftell(fp);
 
   unsigned int fsize( 0u );
   if( positionIndicator > -1L )
@@ -127,7 +131,7 @@ bool LoadBitmapFromWbmp( const Dali::ImageLoader::Input& input, Dali::Devel::Pix
     return false;
   }
 
-  if( fseek(fp, 0, SEEK_SET) )
+  if( InternalFile::fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking WBMP data\n");
     return false;
@@ -144,7 +148,7 @@ bool LoadBitmapFromWbmp( const Dali::ImageLoader::Input& input, Dali::Devel::Pix
   }
   map.Resize(fsize);
 
-  if(fread(&map[0], 1, fsize, fp) != fsize)
+  if( InternalFile::fread(&map[0], 1, fsize, fp) != fsize)
   {
     DALI_LOG_WARNING("image file read opeation error!\n");
     return false;
@@ -224,12 +228,12 @@ bool LoadWbmpHeader( const Dali::ImageLoader::Input& input, unsigned int& width,
 
   unsigned int  w, h;
   unsigned int type;
-  if( fseek(fp,0,SEEK_END) )
+  if( InternalFile::fseek(fp,0,SEEK_END) )
   {
     DALI_LOG_ERROR("Error seeking WBMP data\n");
     return false;
   }
-  long positionIndicator = ftell(fp);
+  long positionIndicator = InternalFile::ftell(fp);
 
   unsigned int fsize( 0u );
   if( positionIndicator > -1L )
@@ -242,7 +246,7 @@ bool LoadWbmpHeader( const Dali::ImageLoader::Input& input, unsigned int& width,
     return false;
   }
 
-  if( fseek(fp, 0, SEEK_SET) )
+  if( InternalFile::fseek(fp, 0, SEEK_SET) )
   {
     DALI_LOG_ERROR("Error seeking WBMP data\n");
     return false;
@@ -258,7 +262,7 @@ bool LoadWbmpHeader( const Dali::ImageLoader::Input& input, unsigned int& width,
   headerSize = std::min(headerSize, fsize);
 
   map.Resize(headerSize);
-  if(fread(&map[0], 1, headerSize, fp) != headerSize)
+  if( InternalFile::fread(&map[0], 1, headerSize, fp) != headerSize)
   {
     DALI_LOG_WARNING("image file read opeation error!\n");
     return false;
diff --git a/dali/internal/imaging/windows/curl-environment-win.cpp b/dali/internal/imaging/windows/curl-environment-win.cpp
new file mode 100755 (executable)
index 0000000..8a294d1
--- /dev/null
@@ -0,0 +1,76 @@
+/*\r
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// EXTERNAL INCLUDES\r
+#include <string>\r
+#include <curl/curl.h>\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/internal/imaging/common/file-download.h>\r
+#include <dali/integration-api/debug.h>\r
+#include <dali/internal/system/common/file-closer.h>\r
+#include <dali/internal/window-system/windows/platform-implement-win.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace TizenPlatform\r
+{\r
+\r
+const int CONNECTION_TIMEOUT_SECONDS( 30L );\r
+const long VERBOSE_MODE = 0L;                // 0 == off, 1 == on\r
+const long CLOSE_CONNECTION_ON_ERROR = 1L;   // 0 == off, 1 == on\r
+const long EXCLUDE_HEADER = 0L;\r
+const long INCLUDE_HEADER = 1L;\r
+const long INCLUDE_BODY = 0L;\r
+const long EXCLUDE_BODY = 1L;\r
+\r
+namespace Network\r
+{\r
+\r
+unsigned long CurlEnvironment::GetThreadId()\r
+{\r
+  // If dali uses c++ thread, we may replace pthread_self() to this_thread::get_id()\r
+  return Internal::Adaptor::WindowsPlatformImplement::GetCurrentThreadId();\r
+}\r
+\r
+void CurlEnvironment::ConfigureCurlOptions( void* curlHandle, const std::string& url )\r
+{\r
+  curl_easy_setopt( curlHandle, CURLOPT_URL, url.c_str() );\r
+  //curl_easy_setopt( curlHandle, CURLOPT_VERBOSE, VERBOSE_MODE );\r
+  curl_easy_setopt( curlHandle, CURLOPT_PROXY, "109.123.100.31:3128" );\r
+\r
+  // CURLOPT_FAILONERROR is not fail-safe especially when authentication is involved ( see manual )\r
+  // Removed CURLOPT_FAILONERROR option\r
+  curl_easy_setopt( curlHandle, CURLOPT_CONNECTTIMEOUT, CONNECTION_TIMEOUT_SECONDS );\r
+  curl_easy_setopt( curlHandle, CURLOPT_HEADER, INCLUDE_HEADER );\r
+  curl_easy_setopt( curlHandle, CURLOPT_NOBODY, EXCLUDE_BODY );\r
+}\r
+\r
+static size_t WriteFunction( void *input, size_t uSize, size_t uCount, void *avg )\r
+{\r
+  Internal::Platform::InternalFile::fwrite( input, uSize, uCount, (FILE*)avg );\r
+  return uSize * uCount;\r
+}\r
+\r
+void CurlEnvironment::InitWriteFunction( void* curlHandle )\r
+{\r
+  curl_easy_setopt( curlHandle, CURLOPT_WRITEFUNCTION, WriteFunction );\r
+}\r
+}\r
+}\r
+}
\ No newline at end of file
diff --git a/dali/internal/imaging/windows/file-download-win.cpp b/dali/internal/imaging/windows/file-download-win.cpp
new file mode 100755 (executable)
index 0000000..c96a272
--- /dev/null
@@ -0,0 +1,291 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// HEADER
+#include <dali/internal/imaging/common/file-download.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+#include <pthread.h>
+#include <openssl/crypto.h>
+#include <cstring>
+#include <curl/curl.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/file-writer.h>
+
+#ifdef TPK_CURL_ENABLED
+#include <tpkp_curl.h>
+#endif // TPK_CURL_ENABLED
+
+using namespace Dali::Integration;
+
+namespace Dali
+{
+
+namespace TizenPlatform
+{
+
+namespace // unnamed namespace
+{
+const long EXCLUDE_HEADER = 0L;
+const long INCLUDE_BODY = 0L;
+
+/**
+ * Curl library environment. Direct initialize ensures it's constructed before adaptor
+ * or application creates any threads.
+ */
+static Dali::TizenPlatform::Network::CurlEnvironment gCurlEnvironment;
+
+// Without a write function or a buffer (file descriptor) to write to, curl will pump out
+// header/body contents to stdout
+size_t __cdecl DummyWrite(char *ptr, size_t size, size_t nmemb, void *userdata)
+{
+  return size * nmemb;
+}
+
+struct ChunkData
+{
+  std::vector< uint8_t > data;
+};
+
+size_t __cdecl ChunkLoader(char *ptr, size_t size, size_t nmemb, void *userdata)
+{
+  std::vector<ChunkData>* chunks = static_cast<std::vector<ChunkData>*>( userdata );
+  int numBytes = size*nmemb;
+  chunks->push_back( ChunkData() );
+  ChunkData& chunkData = (*chunks)[chunks->size()-1];
+  chunkData.data.reserve( numBytes );
+  memcpy( chunkData.data.data(), ptr, numBytes );
+  return numBytes;
+}
+
+
+CURLcode DownloadFileDataWithSize( CURL* curlHandle, Dali::Vector<uint8_t>& dataBuffer, size_t dataSize )
+{
+  CURLcode result( CURLE_OK );
+
+  // create
+  Dali::Internal::Platform::FileWriter fileWriter( dataBuffer, dataSize );
+  FILE* dataBufferFilePointer = fileWriter.GetFile();
+  if( NULL != dataBufferFilePointer )
+  {
+    // we only want the body which contains the file data
+    curl_easy_setopt( curlHandle, CURLOPT_HEADER, EXCLUDE_HEADER );
+    curl_easy_setopt( curlHandle, CURLOPT_NOBODY, INCLUDE_BODY );
+
+    // disable the write callback, and get curl to write directly into our data buffer
+    Network::CurlEnvironment::InitWriteFunction( curlHandle );
+
+    curl_easy_setopt( curlHandle, CURLOPT_WRITEDATA, dataBufferFilePointer );
+
+    // synchronous request of the body data
+    result = curl_easy_perform( curlHandle );
+  }
+  return result;
+}
+
+CURLcode DownloadFileDataByChunk( CURL* curlHandle, Dali::Vector<uint8_t>& dataBuffer, size_t& dataSize )
+{
+  // create
+  std::vector< ChunkData > chunks;
+
+  // we only want the body which contains the file data
+  curl_easy_setopt( curlHandle, CURLOPT_HEADER, EXCLUDE_HEADER );
+  curl_easy_setopt( curlHandle, CURLOPT_NOBODY, INCLUDE_BODY );
+
+  // Enable the write callback.
+  curl_easy_setopt( curlHandle, CURLOPT_WRITEFUNCTION, ChunkLoader );
+  curl_easy_setopt( curlHandle, CURLOPT_WRITEDATA, &chunks );
+
+  // synchronous request of the body data
+  CURLcode result = curl_easy_perform( curlHandle );
+
+  // chunks should now contain all of the chunked data. Reassemble into a single vector
+  dataSize = 0;
+  for( size_t i=0; i<chunks.size() ; ++i )
+  {
+    dataSize += chunks[i].data.capacity();
+  }
+  dataBuffer.Resize(dataSize);
+
+  size_t offset = 0;
+  for( size_t i=0; i<chunks.size() ; ++i )
+  {
+    memcpy( &dataBuffer[offset], chunks[i].data.data(), chunks[i].data.capacity() ); 
+    offset += chunks[i].data.capacity();
+  }
+
+  return result;
+}
+
+bool DownloadFile( CURL* curlHandle,
+                   const std::string& url,
+                   Dali::Vector<uint8_t>& dataBuffer,
+                   size_t& dataSize,
+                   size_t maximumAllowedSizeBytes )
+{
+  CURLcode result( CURLE_OK );
+  double size(0);
+
+  // setup curl to download just the header so we can extract the content length
+  Network::CurlEnvironment::ConfigureCurlOptions( curlHandle, url );
+
+  curl_easy_setopt( curlHandle, CURLOPT_WRITEFUNCTION, DummyWrite);
+
+  // perform the request to get the header
+  result = curl_easy_perform( curlHandle );
+
+  if( result != CURLE_OK)
+  {
+    DALI_LOG_ERROR( "Failed to download http header for \"%s\" with error code %d\n", url.c_str(), result );
+    return false;
+  }
+
+  // get the content length, -1 == size is not known
+  curl_easy_getinfo( curlHandle,CURLINFO_CONTENT_LENGTH_DOWNLOAD , &size );
+
+
+  if( size >= maximumAllowedSizeBytes )
+  {
+    DALI_LOG_ERROR( "File content length %f > max allowed %zu \"%s\" \n", size, maximumAllowedSizeBytes, url.c_str() );
+    return false;
+  }
+  else if( size > 0 )
+  {
+    // If we know the size up front, allocate once and avoid chunk copies.
+    dataSize = static_cast<size_t>( size );
+    result = DownloadFileDataWithSize( curlHandle, dataBuffer, dataSize );
+  }
+  else
+  {
+    result = DownloadFileDataByChunk( curlHandle, dataBuffer, dataSize );
+  }
+
+  if( result != CURLE_OK )
+  {
+    DALI_LOG_ERROR( "Failed to download image file \"%s\" with error code %d\n", url.c_str(), result );
+    return false;
+  }
+  return true;
+}
+
+
+} // unnamed namespace
+
+
+namespace Network
+{
+
+std::mutex* CurlEnvironment::mMutexs = NULL;
+
+CurlEnvironment::CurlEnvironment()
+{
+  // Must be called before we attempt any loads. e.g. by using curl_easy_init()
+  // and before we start any threads.
+  curl_global_init(CURL_GLOBAL_ALL);
+
+ // libcurl with openssl needs locking_function and thread id for threadsafe
+ // https://curl.haxx.se/libcurl/c/threadsafe.html
+ // https://www.openssl.org/docs/man1.0.2/crypto/threads.html#DESCRIPTION
+ // SetLockingFunction sets locking_function and get thread id by the guide.
+  SetLockingFunction();
+}
+
+CurlEnvironment::~CurlEnvironment()
+{
+  UnsetLockingFunction();
+
+  curl_global_cleanup();
+}
+
+// libcurl with openssl needs locking_function and thread id for threadsafe
+// https://curl.haxx.se/libcurl/c/threadsafe.html
+// https://www.openssl.org/docs/man1.0.2/crypto/threads.html#DESCRIPTION
+void CurlEnvironment::OnOpenSSLLocking( int mode, int n, const char* file, int line )
+{
+  if( mode & CRYPTO_LOCK )
+  {
+    mMutexs[n].lock();
+  }
+  else
+  {
+    mMutexs[n].unlock();
+  }
+}
+
+void CurlEnvironment::SetLockingFunction()
+{
+  if( mMutexs != NULL )
+  {
+    return;
+  }
+
+  mMutexs = new std::mutex[ CRYPTO_num_locks() ];
+
+  CRYPTO_set_id_callback( &CurlEnvironment::GetThreadId );
+  CRYPTO_set_locking_callback( &CurlEnvironment::OnOpenSSLLocking );
+}
+
+void CurlEnvironment::UnsetLockingFunction()
+{
+  if( mMutexs == NULL )
+  {
+    return;
+  }
+
+  CRYPTO_set_id_callback( NULL );
+  CRYPTO_set_locking_callback( NULL );
+
+  delete [] mMutexs;
+  mMutexs = NULL;
+}
+
+bool DownloadRemoteFileIntoMemory( const std::string& url,
+                                   Dali::Vector<uint8_t>& dataBuffer,
+                                   size_t& dataSize,
+                                   size_t maximumAllowedSizeBytes )
+{
+  if( url.empty() )
+  {
+    DALI_LOG_WARNING("empty url requested \n");
+    return false;
+  }
+
+  // start a libcurl easy session, this internally calls curl_global_init, if we ever have more than one download
+  // thread we need to explicity call curl_global_init() on startup from a single thread.
+
+  CURL* curlHandle = curl_easy_init();
+
+  bool result = DownloadFile( curlHandle, url, dataBuffer,  dataSize, maximumAllowedSizeBytes);
+
+  // clean up session
+  curl_easy_cleanup( curlHandle );
+
+#ifdef TPK_CURL_ENABLED
+  // Clean up tpkp(the module for certificate pinning) resources on Tizen
+  tpkp_curl_cleanup();
+#endif // TPK_CURL_ENABLED
+
+  return result;
+}
+
+} // namespace Network
+
+} // namespace TizenPlatform
+
+} // namespace Dali
diff --git a/dali/internal/input/windows/input-method-context-factory-win.cpp b/dali/internal/input/windows/input-method-context-factory-win.cpp
new file mode 100755 (executable)
index 0000000..817dacb
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <memory>
+#include <dali/internal/input/common/input-method-context-factory.h>
+#include <dali/internal/input/windows/input-method-context-impl-win.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+class InputMethodContext;
+
+namespace InputMethodContextFactory
+{
+
+// InputMethodContext Factory to be implemented by the platform
+InputMethodContextPtr CreateInputMethodContext()
+{
+  return Dali::Internal::Adaptor::InputMethodContextWin::New();
+}
+
+}
+
+}
+
+
+
+}
+}
\ No newline at end of file
diff --git a/dali/internal/input/windows/input-method-context-impl-win.cpp b/dali/internal/input/windows/input-method-context-impl-win.cpp
new file mode 100755 (executable)
index 0000000..7c09270
--- /dev/null
@@ -0,0 +1,865 @@
+/*\r
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// CLASS HEADER\r
+#include <dali/internal/input/windows/input-method-context-impl-win.h>\r
+\r
+// EXTERNAL INCLUDES\r
+//#include <Ecore_IMF.h>\r
+//#include <Ecore_Input.h>\r
+#include <dali/public-api/events/key-event.h>\r
+#include <dali/public-api/adaptor-framework/key.h>\r
+#include <dali/public-api/object/type-registry.h>\r
+#include <dali/integration-api/debug.h>\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/integration-api/adaptor.h>\r
+#include <dali/internal/adaptor/common/adaptor-impl.h>\r
+#include <dali/internal/system/common/locale-utils.h>\r
+#include <dali/internal/system/common/singleton-service-impl.h>\r
+#include <dali/internal/input/common/virtual-keyboard-impl.h>\r
+#include <dali/internal/input/common/key-impl.h>\r
+// Ecore is littered with C style cast\r
+#pragma GCC diagnostic push\r
+#pragma GCC diagnostic ignored "-Wold-style-cast"\r
+//#include <dali/internal/input/tizen-wayland/ecore-virtual-keyboard.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+\r
+namespace\r
+{\r
+#if defined(DEBUG_ENABLED)\r
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_INPUT_METHOD_CONTEXT");\r
+#endif\r
+\r
+// Currently this code is internal to dali/dali/internal/event/text/utf8.h but should be made Public and used from there instead.\r
+size_t Utf8SequenceLength(const unsigned char leadByte)\r
+{\r
+  size_t length = 0;\r
+\r
+  if ((leadByte & 0x80) == 0 )          //ASCII character (lead bit zero)\r
+  {\r
+    length = 1;\r
+  }\r
+  else if (( leadByte & 0xe0 ) == 0xc0 ) //110x xxxx\r
+  {\r
+    length = 2;\r
+  }\r
+  else if (( leadByte & 0xf0 ) == 0xe0 ) //1110 xxxx\r
+  {\r
+    length = 3;\r
+  }\r
+  else if (( leadByte & 0xf8 ) == 0xf0 ) //1111 0xxx\r
+  {\r
+    length = 4;\r
+  }\r
+\r
+  return length;\r
+}\r
+//\r
+//// Static function calls used by ecore 'c' style callback registration\r
+//void Commit( void *data, Ecore_IMF_Context *imfContext, void *event_info )\r
+//{\r
+//  if ( data )\r
+//  {\r
+//    InputMethodContextWin* inputMethodContext = reinterpret_cast< InputMethodContextWin* > ( data );\r
+//    inputMethodContext->CommitReceived( data, imfContext, event_info );\r
+//  }\r
+//}\r
+//\r
+//void PreEdit( void *data, Ecore_IMF_Context *imfContext, void *event_info )\r
+//{\r
+//  if ( data )\r
+//  {\r
+//    InputMethodContextWin* inputMethodContext = reinterpret_cast< InputMethodContextWin* > ( data );\r
+//    inputMethodContext->PreEditChanged( data, imfContext, event_info );\r
+//  }\r
+//}\r
+//\r
+//Eina_Bool ImfRetrieveSurrounding(void *data, Ecore_IMF_Context *imfContext, char** text, int* cursorPosition )\r
+//{\r
+//  if ( data )\r
+//  {\r
+//    InputMethodContextWin* inputMethodContext = reinterpret_cast< InputMethodContextWin* > ( data );\r
+//    return inputMethodContext->RetrieveSurrounding( data, imfContext, text, cursorPosition );\r
+//  }\r
+//  else\r
+//  {\r
+//    return false;\r
+//  }\r
+//}\r
+//\r
+///**\r
+// * Called when an InputMethodContext delete surrounding event is received.\r
+// * Here we tell the application that it should delete a certain range.\r
+// */\r
+//void ImfDeleteSurrounding( void *data, Ecore_IMF_Context *imfContext, void *event_info )\r
+//{\r
+//  if ( data )\r
+//  {\r
+//    InputMethodContextWin* inputMethodContext = reinterpret_cast< InputMethodContextWin* > ( data );\r
+//    inputMethodContext->DeleteSurrounding( data, imfContext, event_info );\r
+//  }\r
+//}\r
+\r
+} // unnamed namespace\r
+\r
+InputMethodContextPtr InputMethodContextWin::New()\r
+{\r
+  InputMethodContextPtr manager;\r
+\r
+  if ( Adaptor::IsAvailable() )\r
+  {\r
+    // Create instance and register singleton only if the adaptor is available\r
+    Adaptor& adaptorImpl( Adaptor::GetImplementation( Adaptor::Get() ) );\r
+    Any nativeWindow = adaptorImpl.GetNativeWindowHandle();\r
+\r
+    // The Win_Window_Handle needs to use the InputMethodContext.\r
+    // Only when the render surface is window, we can get the Win_Window_Handle.\r
+    Win_Window_Handle winWindow( AnyCast<Win_Window_Handle>(nativeWindow) );\r
+    if ( winWindow )\r
+    {\r
+      // If we fail to get Win_Window_Handle, we can't use the InputMethodContext correctly.\r
+      // Thus you have to call "ecore_imf_context_client_window_set" somewhere.\r
+      // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent().\r
+\r
+      manager = new InputMethodContextWin( winWindow );\r
+    }\r
+    else\r
+    {\r
+      DALI_LOG_ERROR("Failed to get native window handle\n");\r
+    }\r
+  }\r
+\r
+  return manager;\r
+}\r
+\r
+void InputMethodContextWin::Finalize()\r
+{\r
+  //DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::Finalize\n" );\r
+  //VirtualKeyboard::DisconnectCallbacks( mIMFContext );\r
+  //DisconnectCallbacks();\r
+  //DeleteContext();\r
+}\r
+\r
+InputMethodContextWin::InputMethodContextWin( Win_Window_Handle winWindow )\r
+: mWin32Window( winWindow ),\r
+  mIMFCursorPosition( 0 ),\r
+  mSurroundingText(),\r
+  mRestoreAfterFocusLost( false ),\r
+  mIdleCallbackConnected( false )\r
+{\r
+  //ecore_imf_init();\r
+}\r
+\r
+InputMethodContextWin::~InputMethodContextWin()\r
+{\r
+  Finalize();\r
+  //ecore_imf_shutdown();\r
+}\r
+\r
+void InputMethodContextWin::Initialize()\r
+{\r
+  CreateContext( mWin32Window );\r
+  ConnectCallbacks();\r
+  //VirtualKeyboard::ConnectCallbacks( mIMFContext );\r
+}\r
+\r
+void InputMethodContextWin::CreateContext( Win_Window_Handle ecoreXwin )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::CreateContext\n" );\r
+\r
+  //const char *contextId = ecore_imf_context_default_id_get();\r
+  //if( contextId )\r
+  //{\r
+  //  mIMFContext = ecore_imf_context_add( contextId );\r
+\r
+  //  if( mIMFContext )\r
+  //  {\r
+  //    if( ecoreXwin )\r
+  //    {\r
+  //      ecore_imf_context_client_window_set( mIMFContext, reinterpret_cast<void*>( ecoreXwin ) );\r
+  //    }\r
+  //  }\r
+  //  else\r
+  //  {\r
+  //    DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContext Unable to get IMFContext\n");\r
+  //  }\r
+  //}\r
+  //else\r
+  //{\r
+  //  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContext Unable to get IMFContext\n");\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::DeleteContext()\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::DeleteContext\n" );\r
+\r
+  //if ( mIMFContext )\r
+  //{\r
+  //  ecore_imf_context_del( mIMFContext );\r
+  //  mIMFContext = NULL;\r
+  //}\r
+}\r
+\r
+// Callbacks for predicitive text support.\r
+void InputMethodContextWin::ConnectCallbacks()\r
+{\r
+  //if ( mIMFContext )\r
+  //{\r
+  //  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::ConnectCallbacks\n" );\r
+\r
+  //  ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_PREEDIT_CHANGED,    PreEdit,    this );\r
+  //  ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_COMMIT,             Commit,     this );\r
+  //  ecore_imf_context_event_callback_add( mIMFContext, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, ImfDeleteSurrounding, this );\r
+\r
+  //  ecore_imf_context_retrieve_surrounding_callback_set( mIMFContext, ImfRetrieveSurrounding, this);\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::DisconnectCallbacks()\r
+{\r
+  //if ( mIMFContext )\r
+  //{\r
+  //  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::DisconnectCallbacks\n" );\r
+\r
+  //  ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_PREEDIT_CHANGED,    PreEdit );\r
+  //  ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_COMMIT,             Commit );\r
+  //  ecore_imf_context_event_callback_del( mIMFContext, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, ImfDeleteSurrounding );\r
+\r
+  //  // We do not need to unset the retrieve surrounding callback.\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::Activate()\r
+{\r
+  // Reset mIdleCallbackConnected\r
+  mIdleCallbackConnected = false;\r
+\r
+  //if ( mIMFContext )\r
+  //{\r
+  //  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::Activate\n" );\r
+\r
+  //  ecore_imf_context_focus_in( mIMFContext );\r
+\r
+  //  // emit keyboard activated signal\r
+  //  Dali::InputMethodContext handle( this );\r
+  //  mActivatedSignal.Emit( handle );\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::Deactivate()\r
+{\r
+  //if( mIMFContext )\r
+  //{\r
+  //  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::Deactivate\n" );\r
+\r
+  //  Reset();\r
+  //  ecore_imf_context_focus_out( mIMFContext );\r
+  //}\r
+\r
+  // Reset mIdleCallbackConnected\r
+  mIdleCallbackConnected = false;\r
+}\r
+\r
+void InputMethodContextWin::Reset()\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::Reset\n" );\r
+\r
+  //if ( mIMFContext )\r
+  //{\r
+  //  ecore_imf_context_reset( mIMFContext );\r
+  //}\r
+}\r
+\r
+ImfContext* InputMethodContextWin::GetContext()\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetContext\n" );\r
+\r
+  //return mIMFContext;\r
+  return NULL;\r
+}\r
+\r
+bool InputMethodContextWin::RestoreAfterFocusLost() const\r
+{\r
+  return mRestoreAfterFocusLost;\r
+}\r
+\r
+void InputMethodContextWin::SetRestoreAfterFocusLost( bool toggle )\r
+{\r
+  mRestoreAfterFocusLost = toggle;\r
+}\r
+\r
+/**\r
+ * Called when an InputMethodContext Pre-Edit changed event is received.\r
+ * We are still predicting what the user is typing.  The latest string is what the InputMethodContext module thinks\r
+ * the user wants to type.\r
+ */\r
+void InputMethodContextWin::PreEditChanged( void*, ImfContext* imfContext, void* event_info )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::PreEditChanged\n" );\r
+//  auto context = reinterpret_cast<Ecore_IMF_Context*>(imfContext);\r
+//\r
+//  char* preEditString( NULL );\r
+//  int cursorPosition( 0 );\r
+//  Eina_List* attrs = NULL;\r
+//  Eina_List* l = NULL;\r
+//\r
+//  Ecore_IMF_Preedit_Attr* attr;\r
+//\r
+//  // Retrieves attributes as well as the string the cursor position offset from start of pre-edit string.\r
+//  // the attributes (attrs) is used in languages that use the soft arrows keys to insert characters into a current pre-edit string.\r
+//  ecore_imf_context_preedit_string_with_attributes_get( context, &preEditString, &attrs, &cursorPosition );\r
+//\r
+//  if ( attrs )\r
+//  {\r
+//    // iterate through the list of attributes getting the type, start and end position.\r
+//    for ( l = attrs, (attr =  static_cast<Ecore_IMF_Preedit_Attr*>( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( attr = static_cast<Ecore_IMF_Preedit_Attr*>( eina_list_data_get(l) ) ))\r
+//    {\r
+//#ifdef DALI_PROFILE_UBUNTU\r
+//      if ( attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3 ) // (Ecore_IMF)\r
+//#else // DALI_PROFILE_UBUNTU\r
+//      if ( attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB4 ) // (Ecore_IMF)\r
+//#endif // DALI_PROFILE_UBUNTU\r
+//      {\r
+//        // check first byte so know how many bytes a character is represented by as keyboard returns cursor position in bytes. Which is different for some languages.\r
+//\r
+//        size_t visualCharacterIndex = 0;\r
+//        size_t byteIndex = 0;\r
+//\r
+//        // iterate through null terminated string checking each character's position against the given byte position ( attr->end_index ).\r
+//        const char leadByte = preEditString[byteIndex];\r
+//        while( leadByte != '\0' )\r
+//        {\r
+//          // attr->end_index is provided as a byte position not character and we need to know the character position.\r
+//          const size_t currentSequenceLength = Utf8SequenceLength( leadByte ); // returns number of bytes used to represent character.\r
+//          if ( byteIndex == attr->end_index )\r
+//          {\r
+//            cursorPosition = visualCharacterIndex;\r
+//            break;\r
+//            // end loop as found cursor position that matches byte position\r
+//          }\r
+//          else\r
+//          {\r
+//            byteIndex += currentSequenceLength; // jump to next character\r
+//            visualCharacterIndex++;  // increment character count so we know our position for when we get a match\r
+//          }\r
+//\r
+//          DALI_ASSERT_DEBUG( visualCharacterIndex < strlen( preEditString ));\r
+//        }\r
+//      }\r
+//    }\r
+//  }\r
+\r
+  //if ( Dali::Adaptor::IsAvailable() )\r
+  //{\r
+  //  Dali::InputMethodContext handle( this );\r
+  //  Dali::InputMethodContext::EventData eventData( Dali::InputMethodContext::PRE_EDIT, preEditString, cursorPosition, 0 );\r
+  //  Dali::InputMethodContext::CallbackData callbackData = mEventSignal.Emit( handle, eventData );\r
+\r
+  //  if( callbackData.update )\r
+  //  {\r
+  //    mIMFCursorPosition = static_cast<int>( callbackData.cursorPosition );\r
+\r
+  //    NotifyCursorPosition();\r
+  //  }\r
+\r
+  //  if( callbackData.preeditResetRequired )\r
+  //  {\r
+  //    Reset();\r
+  //  }\r
+  //}\r
+  //free( preEditString );\r
+}\r
+\r
+void InputMethodContextWin::CommitReceived( void*, ImfContext* imfContext, void* event_info )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::CommitReceived\n" );\r
+\r
+  if ( Dali::Adaptor::IsAvailable() )\r
+  {\r
+    const std::string keyString( static_cast<char*>( event_info ) );\r
+\r
+    Dali::InputMethodContext handle( this );\r
+    Dali::InputMethodContext::EventData eventData( Dali::InputMethodContext::COMMIT, keyString, 0, 0 );\r
+    Dali::InputMethodContext::CallbackData callbackData = mEventSignal.Emit( handle, eventData );\r
+\r
+    if( callbackData.update )\r
+    {\r
+      mIMFCursorPosition = static_cast<int>( callbackData.cursorPosition );\r
+\r
+      NotifyCursorPosition();\r
+    }\r
+  }\r
+}\r
+\r
+/**\r
+ * Called when an InputMethodContext retrieve surround event is received.\r
+ * Here the InputMethodContext module wishes to know the string we are working with and where within the string the cursor is\r
+ * We need to signal the application to tell us this information.\r
+ */\r
+bool InputMethodContextWin::RetrieveSurrounding( void* data, ImfContext* imfContext, char** text, int* cursorPosition )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::RetrieveSurrounding\n" );\r
+\r
+  Dali::InputMethodContext::EventData imfData( Dali::InputMethodContext::GET_SURROUNDING, std::string(), 0, 0 );\r
+  Dali::InputMethodContext handle( this );\r
+  Dali::InputMethodContext::CallbackData callbackData = mEventSignal.Emit( handle, imfData );\r
+\r
+  if( callbackData.update )\r
+  {\r
+    if( text )\r
+    {\r
+      *text = strdup( callbackData.currentText.c_str() );\r
+    }\r
+\r
+    if( cursorPosition )\r
+    {\r
+      mIMFCursorPosition = static_cast<int>( callbackData.cursorPosition );\r
+      *cursorPosition = mIMFCursorPosition;\r
+    }\r
+  }\r
+\r
+  //return EINA_TRUE;\r
+  return true;\r
+}\r
+\r
+/**\r
+ * Called when an InputMethodContext delete surrounding event is received.\r
+ * Here we tell the application that it should delete a certain range.\r
+ */\r
+void InputMethodContextWin::DeleteSurrounding( void* data, ImfContext* imfContext, void* event_info )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::DeleteSurrounding\n" );\r
+\r
+  //if( Dali::Adaptor::IsAvailable() )\r
+  //{\r
+  //  Ecore_IMF_Event_Delete_Surrounding* deleteSurroundingEvent = static_cast<Ecore_IMF_Event_Delete_Surrounding*>( event_info );\r
+\r
+  //  Dali::InputMethodContext::EventData imfData( Dali::InputMethodContext::DELETE_SURROUNDING, std::string(), deleteSurroundingEvent->offset, deleteSurroundingEvent->n_chars );\r
+  //  Dali::InputMethodContext handle( this );\r
+  //  Dali::InputMethodContext::CallbackData callbackData = mEventSignal.Emit( handle, imfData );\r
+\r
+  //  if( callbackData.update )\r
+  //  {\r
+  //    mIMFCursorPosition = static_cast<int>( callbackData.cursorPosition );\r
+\r
+  //    NotifyCursorPosition();\r
+  //  }\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::NotifyCursorPosition()\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::NotifyCursorPosition\n" );\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  ecore_imf_context_cursor_position_set( mIMFContext, mIMFCursorPosition );\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::SetCursorPosition( unsigned int cursorPosition )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::SetCursorPosition\n" );\r
+\r
+  mIMFCursorPosition = static_cast<int>( cursorPosition );\r
+}\r
+\r
+unsigned int InputMethodContextWin::GetCursorPosition() const\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetCursorPosition\n" );\r
+\r
+  return static_cast<unsigned int>( mIMFCursorPosition );\r
+}\r
+\r
+void InputMethodContextWin::SetSurroundingText( const std::string& text )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::SetSurroundingText\n" );\r
+\r
+  mSurroundingText = text;\r
+}\r
+\r
+const std::string& InputMethodContextWin::GetSurroundingText() const\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetSurroundingText\n" );\r
+\r
+  return mSurroundingText;\r
+}\r
+\r
+void InputMethodContextWin::NotifyTextInputMultiLine( bool multiLine )\r
+{\r
+}\r
+\r
+Dali::InputMethodContext::TextDirection InputMethodContextWin::GetTextDirection()\r
+{\r
+  Dali::InputMethodContext::TextDirection direction ( Dali::InputMethodContext::LeftToRight );\r
+\r
+    //if ( mIMFContext )\r
+    //{\r
+    //  char* locale( NULL );\r
+    //  ecore_imf_context_input_panel_language_locale_get( mIMFContext, &locale );\r
+\r
+    //  if ( locale )\r
+    //  {\r
+    //    direction = static_cast< Dali::InputMethodContext::TextDirection >( Locale::GetDirection( std::string( locale ) ) );\r
+    //    free( locale );\r
+    //  }\r
+    //}\r
+\r
+  return direction;\r
+}\r
+\r
+Rect<int> InputMethodContextWin::GetInputMethodArea()\r
+{\r
+  int xPos, yPos, width, height;\r
+\r
+  width = height = xPos = yPos = 0;\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  ecore_imf_context_input_panel_geometry_get( mIMFContext, &xPos, &yPos, &width, &height );\r
+  //}\r
+  //else\r
+  //{\r
+  //  DALI_LOG_WARNING("VKB Unable to get InputMethodContext Context so GetSize unavailable\n");\r
+  //}\r
+\r
+  return Rect<int>(xPos,yPos,width,height);\r
+}\r
+\r
+void InputMethodContextWin::ApplyOptions( const InputMethodOptions& options )\r
+{\r
+  using namespace Dali::InputMethod::Category;\r
+\r
+  int index;\r
+\r
+  //if (mIMFContext == NULL)\r
+  //{\r
+  //  DALI_LOG_WARNING("VKB Unable to excute ApplyOptions with Null ImfContext\n");\r
+  //  return;\r
+  //}\r
+\r
+  if ( mOptions.CompareAndSet(PANEL_LAYOUT, options, index) )\r
+  {\r
+  }\r
+  if ( mOptions.CompareAndSet(BUTTON_ACTION, options, index) )\r
+  {\r
+  }\r
+  if ( mOptions.CompareAndSet(AUTO_CAPITALIZE, options, index) )\r
+  {\r
+  }\r
+  if ( mOptions.CompareAndSet(VARIATION, options, index) )\r
+  {\r
+  }\r
+}\r
+\r
+void InputMethodContextWin::SetInputPanelData( const std::string& data )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::SetInputPanelData\n" );\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  int length = data.length();\r
+  //  ecore_imf_context_input_panel_imdata_set( mIMFContext, data.c_str(), length );\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::GetInputPanelData( std::string& data )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetInputPanelData\n" );\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  int length = 4096; // The max length is 4096 bytes\r
+  //  Dali::Vector< char > buffer;\r
+  //  buffer.Resize( length );\r
+  //  ecore_imf_context_input_panel_imdata_get( mIMFContext, &buffer[0], &length );\r
+  //  data = std::string( buffer.Begin(), buffer.End() );\r
+  //}\r
+}\r
+\r
+Dali::InputMethodContext::State InputMethodContextWin::GetInputPanelState()\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetInputPanelState\n" );\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  int value;\r
+  //  value = ecore_imf_context_input_panel_state_get( mIMFContext );\r
+\r
+  //  switch (value)\r
+  //  {\r
+  //    case ECORE_IMF_INPUT_PANEL_STATE_SHOW:\r
+  //    {\r
+  //      return Dali::InputMethodContext::SHOW;\r
+  //      break;\r
+  //    }\r
+\r
+  //    case ECORE_IMF_INPUT_PANEL_STATE_HIDE:\r
+  //    {\r
+  //      return Dali::InputMethodContext::HIDE;\r
+  //      break;\r
+  //    }\r
+\r
+  //    case ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW:\r
+  //    {\r
+  //      return Dali::InputMethodContext::WILL_SHOW;\r
+  //      break;\r
+  //    }\r
+\r
+  //    default:\r
+  //    {\r
+  //      return Dali::InputMethodContext::DEFAULT;\r
+  //    }\r
+  //  }\r
+  //}\r
+  return Dali::InputMethodContext::DEFAULT;\r
+}\r
+\r
+void InputMethodContextWin::SetReturnKeyState( bool visible )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::SetReturnKeyState\n" );\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  ecore_imf_context_input_panel_return_key_disabled_set( mIMFContext, !visible );\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::AutoEnableInputPanel( bool enabled )\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::AutoEnableInputPanel\n" );\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  ecore_imf_context_input_panel_enabled_set( mIMFContext, enabled );\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::ShowInputPanel()\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::ShowInputPanel\n" );\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  ecore_imf_context_input_panel_show( mIMFContext );\r
+  //}\r
+}\r
+\r
+void InputMethodContextWin::HideInputPanel()\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::HideInputPanel\n" );\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  ecore_imf_context_input_panel_hide( mIMFContext );\r
+  //}\r
+}\r
+\r
+Dali::InputMethodContext::KeyboardType InputMethodContextWin::GetKeyboardType()\r
+{\r
+  return Dali::InputMethodContext::KeyboardType::SOFTWARE_KEYBOARD;\r
+}\r
+\r
+std::string InputMethodContextWin::GetInputPanelLocale()\r
+{\r
+  DALI_LOG_INFO( gLogFilter, Debug::General, "InputMethodContextWin::GetInputPanelLocale\n" );\r
+\r
+  std::string locale = "";\r
+\r
+  //if( mIMFContext )\r
+  //{\r
+  //  char* value = NULL;\r
+  //  ecore_imf_context_input_panel_language_locale_get( mIMFContext, &value );\r
+\r
+  //  if( value )\r
+  //  {\r
+  //    std::string valueCopy( value );\r
+  //    locale = valueCopy;\r
+\r
+  //    // The locale string retrieved must be freed with free().\r
+  //    free( value );\r
+  //  }\r
+  //}\r
+  return locale;\r
+}\r
+\r
+bool InputMethodContextWin::FilterEventKey( const Dali::KeyEvent& keyEvent )\r
+{\r
+  bool eventHandled( false );\r
+\r
+  // If a device key then skip ecore_imf_context_filter_event.\r
+  if ( ! KeyLookup::IsDeviceButton( keyEvent.keyPressedName.c_str() ))\r
+  {\r
+    //check whether it's key down or key up event\r
+    if ( keyEvent.state == KeyEvent::Down )\r
+    {\r
+      eventHandled = ProcessEventKeyDown( keyEvent );\r
+    }\r
+    else if ( keyEvent.state == KeyEvent::Up )\r
+    {\r
+      eventHandled = ProcessEventKeyUp( keyEvent );\r
+    }\r
+  }\r
+\r
+  return eventHandled;\r
+}\r
+\r
+bool InputMethodContextWin::ProcessEventKeyDown( const KeyEvent& keyEvent )\r
+{\r
+  bool eventHandled( false );\r
+//  if ( mIMFContext )\r
+//  {\r
+//    // We're consuming key down event so we have to pass to InputMethodContext so that it can parse it as well.\r
+//    Ecore_IMF_Event_Key_Down ecoreKeyDownEvent;\r
+//    ecoreKeyDownEvent.keyname = keyEvent.keyPressedName.c_str();\r
+//    ecoreKeyDownEvent.key = keyEvent.keyPressedName.c_str();\r
+//    ecoreKeyDownEvent.string = keyEvent.keyPressed.c_str();\r
+//    ecoreKeyDownEvent.compose = keyEvent.GetCompose().c_str();\r
+//    ecoreKeyDownEvent.timestamp = keyEvent.time;\r
+//    ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( keyEvent.keyModifier );\r
+//    ecoreKeyDownEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent.keyModifier );\r
+//#ifdef ECORE_IMF_1_13\r
+//    ecoreKeyDownEvent.dev_name  = "";\r
+//    ecoreKeyDownEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;\r
+//    ecoreKeyDownEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;\r
+//#endif // ECORE_IMF_1_13\r
+//\r
+//    // If the device is IME and the focused key is the direction keys, then we should send a key event to move a key cursor.\r
+//    if ((keyEvent.GetDeviceName() == "ime") && ((!strncmp(keyEvent.keyPressedName.c_str(), "Left", 4)) ||\r
+//                                   (!strncmp(keyEvent.keyPressedName.c_str(), "Right", 5)) ||\r
+//                                   (!strncmp(keyEvent.keyPressedName.c_str(), "Up", 2)) ||\r
+//                                   (!strncmp(keyEvent.keyPressedName.c_str(), "Down", 4))))\r
+//    {\r
+//      eventHandled = 0;\r
+//    }\r
+//    else\r
+//    {\r
+//      eventHandled = ecore_imf_context_filter_event(mIMFContext,\r
+//                                                    ECORE_IMF_EVENT_KEY_DOWN,\r
+//                                                    (Ecore_IMF_Event *) &ecoreKeyDownEvent);\r
+//    }\r
+//\r
+//    // If the event has not been handled by InputMethodContext then check if we should reset our IMFcontext\r
+//    if (!eventHandled)\r
+//    {\r
+//      if (!strcmp(keyEvent.keyPressedName.c_str(), "Escape") ||\r
+//          !strcmp(keyEvent.keyPressedName.c_str(), "Return") ||\r
+//          !strcmp(keyEvent.keyPressedName.c_str(), "KP_Enter"))\r
+//      {\r
+//        ecore_imf_context_reset(mIMFContext);\r
+//      }\r
+//    }\r
+//  }\r
+  return eventHandled;\r
+}\r
+\r
+bool InputMethodContextWin::ProcessEventKeyUp( const KeyEvent& keyEvent )\r
+{\r
+  bool eventHandled( false );\r
+//  if( mIMFContext )\r
+//  {\r
+//    // We're consuming key up event so we have to pass to InputMethodContext so that it can parse it as well.\r
+//    Ecore_IMF_Event_Key_Up ecoreKeyUpEvent;\r
+//    ecoreKeyUpEvent.keyname = keyEvent.keyPressedName.c_str();\r
+//    ecoreKeyUpEvent.key = keyEvent.keyPressedName.c_str();\r
+//    ecoreKeyUpEvent.string = keyEvent.keyPressed.c_str();\r
+//    ecoreKeyUpEvent.compose = keyEvent.GetCompose().c_str();\r
+//    ecoreKeyUpEvent.timestamp = keyEvent.time;\r
+//    ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier( keyEvent.keyModifier );\r
+//    ecoreKeyUpEvent.locks = EcoreInputModifierToEcoreIMFLock( keyEvent.keyModifier );\r
+//#ifdef ECORE_IMF_1_13\r
+//    ecoreKeyUpEvent.dev_name  = "";\r
+//#endif // ECORE_IMF_1_13\r
+//\r
+//    eventHandled = ecore_imf_context_filter_event(mIMFContext,\r
+//                                                  ECORE_IMF_EVENT_KEY_UP,\r
+//                                                  (Ecore_IMF_Event *) &ecoreKeyUpEvent);\r
+//  }\r
+  return eventHandled;\r
+}\r
+\r
+//Ecore_IMF_Keyboard_Modifiers InputMethodContextWin::EcoreInputModifierToEcoreIMFModifier( unsigned int ecoreModifier )\r
+//{\r
+//  unsigned int modifier( ECORE_IMF_KEYBOARD_MODIFIER_NONE );  // If no other matches returns NONE.\r
+//\r
+//  if ( ecoreModifier & ECORE_EVENT_MODIFIER_SHIFT )  // enums from ecore_input/Ecore_Input.h\r
+//  {\r
+//    modifier |= ECORE_IMF_KEYBOARD_MODIFIER_SHIFT;  // enums from ecore_imf/ecore_imf.h\r
+//  }\r
+//\r
+//  if ( ecoreModifier & ECORE_EVENT_MODIFIER_ALT )\r
+//  {\r
+//    modifier |= ECORE_IMF_KEYBOARD_MODIFIER_ALT;\r
+//  }\r
+//\r
+//  if ( ecoreModifier & ECORE_EVENT_MODIFIER_CTRL )\r
+//  {\r
+//    modifier |= ECORE_IMF_KEYBOARD_MODIFIER_CTRL;\r
+//  }\r
+//\r
+//  if ( ecoreModifier & ECORE_EVENT_MODIFIER_WIN )\r
+//  {\r
+//    modifier |= ECORE_IMF_KEYBOARD_MODIFIER_WIN;\r
+//  }\r
+//\r
+//  if ( ecoreModifier & ECORE_EVENT_MODIFIER_ALTGR )\r
+//  {\r
+//    modifier |= ECORE_IMF_KEYBOARD_MODIFIER_ALTGR;\r
+//  }\r
+//\r
+//  return static_cast<Ecore_IMF_Keyboard_Modifiers>( modifier );\r
+//}\r
+//\r
+//Ecore_IMF_Keyboard_Locks InputMethodContextWin::EcoreInputModifierToEcoreIMFLock( unsigned int modifier )\r
+//{\r
+//    unsigned int lock( ECORE_IMF_KEYBOARD_LOCK_NONE ); // If no other matches, returns NONE.\r
+//\r
+//    if( modifier & ECORE_EVENT_LOCK_NUM )\r
+//    {\r
+//      lock |= ECORE_IMF_KEYBOARD_LOCK_NUM; // Num lock is active.\r
+//    }\r
+//\r
+//    if( modifier & ECORE_EVENT_LOCK_CAPS )\r
+//    {\r
+//      lock |= ECORE_IMF_KEYBOARD_LOCK_CAPS; // Caps lock is active.\r
+//    }\r
+//\r
+//    if( modifier & ECORE_EVENT_LOCK_SCROLL )\r
+//    {\r
+//      lock |= ECORE_IMF_KEYBOARD_LOCK_SCROLL; // Scroll lock is active.\r
+//    }\r
+//\r
+//    return static_cast<Ecore_IMF_Keyboard_Locks>( lock );\r
+//}\r
+\r
+} // Adaptor\r
+\r
+} // Internal\r
+\r
+} // Dali\r
+\r
+#pragma GCC diagnostic pop\r
diff --git a/dali/internal/input/windows/input-method-context-impl-win.h b/dali/internal/input/windows/input-method-context-impl-win.h
new file mode 100755 (executable)
index 0000000..3d0d395
--- /dev/null
@@ -0,0 +1,293 @@
+#ifndef DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_WIN_H\r
+#define DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_WIN_H\r
+\r
+/*\r
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// EXTERNAL INCLUDES\r
+#include <dali/public-api/object/base-object.h>\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/devel-api/adaptor-framework/input-method-context.h>\r
+#include <dali/internal/input/common/input-method-context-impl.h>\r
+#include <dali/internal/window-system/windows/platform-implement-win.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+class RenderSurface;\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+\r
+class InputMethodContextWin : public Dali::Internal::Adaptor::InputMethodContext\r
+{\r
+public:\r
+  /**\r
+   * @brief Creates a new InputMethodContext handle\r
+   *\r
+   * @return InputMethodContext pointer\r
+   */\r
+  static InputMethodContextPtr New();\r
+\r
+  /**\r
+   * Constructor\r
+   * @param[in] win32Window, The window is created by application.\r
+   */\r
+  explicit InputMethodContextWin( Win_Window_Handle win32Window );\r
+\r
+public:\r
+\r
+  /**\r
+   * @brief Initializes member data.\r
+   */\r
+  void Initialize() override;\r
+\r
+  /**\r
+   * Connect Callbacks required for InputMethodContext.\r
+   * If you don't connect InputMethodContext callbacks, you can't get the key events.\r
+   * The events are PreeditChanged, Commit and DeleteSurrounding.\r
+   */\r
+  void ConnectCallbacks() override;\r
+\r
+  /**\r
+   * Disconnect Callbacks attached to input method context.\r
+   */\r
+  void DisconnectCallbacks() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::Finalize()\r
+   */\r
+  void Finalize() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::Activate()\r
+   */\r
+  void Activate() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::Deactivate()\r
+   */\r
+  void Deactivate() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::Reset()\r
+   */\r
+  void Reset() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::GetContext()\r
+   */\r
+  ImfContext* GetContext() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::RestoreAfterFocusLost()\r
+   */\r
+  bool RestoreAfterFocusLost() const override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::SetRestoreAfterFocusLost()\r
+   */\r
+  void SetRestoreAfterFocusLost( bool toggle ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::PreEditChanged()\r
+   */\r
+  void PreEditChanged( void* data, ImfContext* imfContext, void* event_info ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::NotifyCursorPosition()\r
+   */\r
+  void CommitReceived( void* data, ImfContext* imfContext, void* event_info ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::NotifyCursorPosition()\r
+   */\r
+  bool RetrieveSurrounding( void* data, ImfContext* imfContext, char** text, int* cursorPosition ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::DeleteSurrounding()\r
+   */\r
+  void DeleteSurrounding( void* data, ImfContext* imfContext, void* event_info ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::SendPrivateCommand()\r
+   */\r
+  void SendPrivateCommand( void* data, ImfContext* imfContext, void* event_info ) override\r
+  {}\r
+\r
+  // Cursor related\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::NotifyCursorPosition()\r
+   */\r
+  void NotifyCursorPosition() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::SetCursorPosition()\r
+   */\r
+  void SetCursorPosition( unsigned int cursorPosition ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::GetCursorPosition()\r
+   */\r
+  unsigned int GetCursorPosition() const override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::SetSurroundingText()\r
+   */\r
+  void SetSurroundingText( const std::string& text ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::GetSurroundingText()\r
+   */\r
+  const std::string& GetSurroundingText() const override;\r
+\r
+  /**\r
+  * @copydoc Dali::InputMethodContext::NotifyTextInputMultiLine()\r
+  */\r
+  void NotifyTextInputMultiLine( bool multiLine ) override;\r
+\r
+  /**\r
+  * @copydoc Dali::InputMethodContext::GetTextDirection()\r
+  */\r
+  Dali::InputMethodContext::TextDirection GetTextDirection() override;\r
+\r
+  /**\r
+  * @copydoc Dali::InputMethodContext::GetInputMethodArea()\r
+  */\r
+  Dali::Rect<int> GetInputMethodArea() override;\r
+\r
+  /**\r
+  * @copydoc Dali::InputMethodContext::ApplyOptions()\r
+  */\r
+  void ApplyOptions( const InputMethodOptions& options ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::SetInputPanelData()\r
+   */\r
+  void SetInputPanelData( const std::string& data ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::GetInputPanelData()\r
+   */\r
+  void GetInputPanelData( std::string& data ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::GetInputPanelState()\r
+   */\r
+  Dali::InputMethodContext::State GetInputPanelState() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::SetReturnKeyState()\r
+   */\r
+  void SetReturnKeyState( bool visible ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::AutoEnableInputPanel()\r
+   */\r
+  void AutoEnableInputPanel( bool enabled ) override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::ShowInputPanel()\r
+   */\r
+  void ShowInputPanel() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::HideInputPanel()\r
+   */\r
+  void HideInputPanel() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::GetKeyboardType()\r
+   */\r
+  Dali::InputMethodContext::KeyboardType GetKeyboardType() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::GetInputPanelLocale()\r
+   */\r
+  std::string GetInputPanelLocale() override;\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::FilterEventKey()\r
+   */\r
+  bool FilterEventKey( const Dali::KeyEvent& keyEvent ) override;\r
+\r
+private:\r
+  /**\r
+   * Context created the first time and kept until deleted.\r
+   * @param[in] win32Window, The window is created by application.\r
+   */\r
+  void CreateContext( Win_Window_Handle win32Window );\r
+\r
+  /**\r
+   * @copydoc Dali::InputMethodContext::DeleteContext()\r
+   */\r
+  void DeleteContext();\r
+\r
+private:\r
+\r
+  /**\r
+   * @brief Process event key down, whether filter a key to isf.\r
+   *\r
+   * @param[in] keyEvent The event key to be handled.\r
+   * @return Whether the event key is handled.\r
+   */\r
+  bool ProcessEventKeyDown( const KeyEvent& keyEvent );\r
+\r
+  /**\r
+   * @brief Process event key up, whether filter a key to isf.\r
+   *\r
+   * @param[in] keyEvent The event key to be handled.\r
+   * @return Whether the event key is handled.\r
+   */\r
+  bool ProcessEventKeyUp( const KeyEvent& keyEvent );\r
+\r
+public:\r
+\r
+  /**\r
+   * Destructor.\r
+   */\r
+  virtual ~InputMethodContextWin();\r
+\r
+private:\r
+\r
+  // Undefined copy constructor\r
+  InputMethodContextWin( const InputMethodContextWin& inputMethodContext) = delete;\r
+\r
+  // Undefined assignment operator\r
+  InputMethodContextWin& operator=( const InputMethodContextWin& inputMethodContext ) = delete;\r
+\r
+private:\r
+  Win_Window_Handle mWin32Window;\r
+  int mIMFCursorPosition;\r
+  std::string mSurroundingText;\r
+\r
+  bool mRestoreAfterFocusLost:1;             ///< Whether the keyboard needs to be restored (activated ) after focus regained.\r
+  bool mIdleCallbackConnected:1;             ///< Whether the idle callback is already connected.\r
+  InputMethodOptions        mOptions;\r
+};\r
+\r
+} // namespace Adaptor\r
+\r
+} // namespace Internal\r
+\r
+} // namespace Dali\r
+\r
+#endif // DALI_INTERNAL_INPUT_METHOD_CONTEXT_IMPL_WIN_H\r
diff --git a/dali/internal/input/windows/key-mapping-win.cpp b/dali/internal/input/windows/key-mapping-win.cpp
new file mode 100755 (executable)
index 0000000..46a32a3
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/input/common/key-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace KeyLookup
+{
+
+// matches a DALI_KEY enum, to key name
+KeyLookup KeyLookupTable[]=
+{
+  // more than one key name can be assigned to a single dali-key code
+  // e.g. "Menu" and "XF86Menu" are both assigned to  DALI_KEY_MENU
+
+  { "Escape",                DALI_KEY_ESCAPE,                                            false },
+  { "Menu",                  DALI_KEY_MENU,                                              false },
+
+  // Now literal strings are used as key names instead of defined symbols in utilX,
+  // since these definition in utilX.h is deprecated
+  { "XF86Camera",            DALI_KEY_CAMERA,                                            false },
+  { "XF86Camera_Full",       DALI_KEY_CONFIG,                                            false },
+  { "XF86PowerOff",          DALI_KEY_POWER,                                             true  },
+  { "XF86Standby",           DALI_KEY_PAUSE,                                             false },
+  { "Cancel",                DALI_KEY_CANCEL,                                            false },
+  { "XF86AudioPlay",         DALI_KEY_PLAY_CD,                                           false },
+  { "XF86AudioStop",         DALI_KEY_STOP_CD,                                           false },
+  { "XF86AudioPause",        DALI_KEY_PAUSE_CD,                                          false },
+  { "XF86AudioNext",         DALI_KEY_NEXT_SONG,                                         false },
+  { "XF86AudioPrev",         DALI_KEY_PREVIOUS_SONG,                                     false },
+  { "XF86AudioRewind",       DALI_KEY_REWIND,                                            false },
+  { "XF86AudioForward",      DALI_KEY_FASTFORWARD,                                       false },
+  { "XF86AudioMedia",        DALI_KEY_MEDIA,                                             false },
+  { "XF86AudioPlayPause",    DALI_KEY_PLAY_PAUSE,                                        false },
+  { "XF86AudioMute",         DALI_KEY_MUTE,                                              false },
+  { "XF86Menu",              DALI_KEY_MENU,                                              true  },
+  { "XF86Home",              DALI_KEY_HOME,                                              true  },
+  { "XF86Back",              DALI_KEY_BACK,                                              true  },
+  { "XF86Send",              DALI_KEY_MENU,                                              true  },
+  { "XF86Phone",             DALI_KEY_HOME,                                              true  },
+  { "XF86Stop",              DALI_KEY_BACK,                                              true  },
+  { "XF86HomePage",          DALI_KEY_HOMEPAGE,                                          false },
+  { "XF86WWW",               DALI_KEY_WEBPAGE,                                           false },
+  { "XF86Mail",              DALI_KEY_MAIL,                                              false },
+  { "XF86ScreenSaver",       DALI_KEY_SCREENSAVER,                                       false },
+  { "XF86MonBrightnessUp",   DALI_KEY_BRIGHTNESS_UP,                                     false },
+  { "XF86MonBrightnessDown", DALI_KEY_BRIGHTNESS_DOWN,                                   false },
+  { "XF86SoftKBD",           DALI_KEY_SOFT_KBD,                                          false },
+  { "XF86QuickPanel",        DALI_KEY_QUICK_PANEL,                                       false },
+  { "XF86TaskPane",          DALI_KEY_TASK_SWITCH,                                       false },
+  { "XF86Apps",              DALI_KEY_APPS,                                              false },
+  { "XF86Search",            DALI_KEY_SEARCH,                                            false },
+  { "XF86Voice",             DALI_KEY_VOICE,                                             false },
+  { "Hangul",                DALI_KEY_LANGUAGE,                                          false },
+  { "XF86AudioRaiseVolume",  DALI_KEY_VOLUME_UP,                                         true  },
+  { "XF86AudioLowerVolume",  DALI_KEY_VOLUME_DOWN,                                       true  },
+
+  { "BackSpace",             DALI_KEY_BACKSPACE,                                         false },
+  { "Up",                    DALI_KEY_CURSOR_UP,                                         false }, // To be removed after the key name is fixed in the platform
+  { "Left",                  DALI_KEY_CURSOR_LEFT,                                       false },
+  { "Right",                 DALI_KEY_CURSOR_RIGHT,                                      false },
+  { "Down",                  DALI_KEY_CURSOR_DOWN,                                       false }, // To be removed after the key name is fixed in the platform
+  { "Shift_L",               DALI_KEY_SHIFT_LEFT,                                        false },
+  { "Shift_R",               DALI_KEY_SHIFT_RIGHT,                                       false },
+  { "Delete",                static_cast<Dali::KEY>( DevelKey::DALI_KEY_DELETE ),        false },
+  { "Control_L",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_LEFT ),  false },
+  { "Control_R",             static_cast<Dali::KEY>( DevelKey::DALI_KEY_CONTROL_RIGHT ), false }
+};
+
+const std::size_t KEY_LOOKUP_COUNT = (sizeof( KeyLookupTable ))/ (sizeof( KeyLookup ));
+
+} // namespace KeyLookup
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/input/windows/virtual-keyboard-impl-win.cpp b/dali/internal/input/windows/virtual-keyboard-impl-win.cpp
new file mode 100755 (executable)
index 0000000..da9d5c1
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/input/common/virtual-keyboard-impl.h>
+
+// EXTERNAL INCLUDES
+//#include <X11/Xlib.h>
+//#include <Ecore_X.h>
+#include <algorithm>
+
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/adaptor.h>
+#include <dali/internal/system/common/locale-utils.h>
+#include <dali/internal/input/windows/input-method-context-impl-win.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace VirtualKeyboard
+{
+void Show()
+{
+}
+
+void Hide()
+{
+
+}
+
+bool IsVisible()
+{
+  return false;
+}
+
+void ApplySettings( const Property::Map& settingsMap )
+{
+
+}
+
+void EnablePrediction( const bool enable )
+{
+
+}
+
+bool IsPredictionEnabled()
+{
+  return false;
+}
+
+Rect<int> GetSizeAndPosition()
+{
+  Rect<int> ret;
+  return ret;
+}
+
+Dali::VirtualKeyboard::StatusSignalType& StatusChangedSignal()
+{
+  Dali::VirtualKeyboard::StatusSignalType ret;
+  return ret;
+}
+
+Dali::VirtualKeyboard::KeyboardResizedSignalType& ResizedSignal()
+{
+  Dali::VirtualKeyboard::KeyboardResizedSignalType ret;
+  return ret;
+}
+
+Dali::VirtualKeyboard::LanguageChangedSignalType& LanguageChangedSignal()
+{
+  Dali::VirtualKeyboard::LanguageChangedSignalType ret;
+  return ret;
+}
+
+Dali::VirtualKeyboard::TextDirection GetTextDirection()
+{
+  return Dali::VirtualKeyboard::LeftToRight;
+}
+
+Dali::InputMethod::ActionButton gActionButtonFunction = Dali::InputMethod::ACTION_DEFAULT;
+
+//Ecore_IMF_Input_Panel_Return_Key_Type buttonActionMapping(Dali::InputMethod::ButtonAction::Type buttonAction )
+//{
+//  switch( buttonAction )
+//  {
+//    case InputMethod::ButtonAction::DEFAULT:     return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+//    case InputMethod::ButtonAction::DONE:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE;
+//    case InputMethod::ButtonAction::GO:          return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO;
+//    case InputMethod::ButtonAction::JOIN:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN;
+//    case InputMethod::ButtonAction::LOGIN:       return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN;
+//    case InputMethod::ButtonAction::NEXT:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT;
+//    case InputMethod::ButtonAction::PREVIOUS:    return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+//    case InputMethod::ButtonAction::SEARCH:      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH;
+//    case InputMethod::ButtonAction::SEND:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND;
+//    case InputMethod::ButtonAction::SIGNIN:      return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+//    case InputMethod::ButtonAction::UNSPECIFIED: return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+//    case InputMethod::ButtonAction::NONE:        return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+//    default:                                     return ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
+//  }
+//}
+
+void RotateTo(int angle)
+{
+  // Get focus window used by Keyboard and rotate it
+  //Display* display = XOpenDisplay(0);
+  //if (display)
+  //{
+  //  ::Window focusWindow;
+  //  int revert;
+  //  // Get Focus window
+  //  XGetInputFocus(display, &focusWindow, &revert);
+
+  //  ecore_x_window_prop_property_set( focusWindow,
+  //                                    ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE,
+  //                                    ECORE_X_ATOM_CARDINAL, 32, &angle, 1 );
+  //  XCloseDisplay(display);
+  //}
+}
+
+void SetReturnKeyType( const InputMethod::ButtonAction::Type type )
+{
+  //Dali::ImfManager imfManager = ImfManager::Get(); // Create ImfManager instance (if required) when setting values
+  //Ecore_IMF_Context* imfContext = reinterpret_cast<Ecore_IMF_Context*>(ImfManager::GetImplementation( imfManager ).GetContext());
+
+  //if( imfContext )
+  //{
+  //  gActionButtonFunction = type;
+  //  ecore_imf_context_input_panel_return_key_type_set( imfContext, actionButtonMapping( type ) );
+  //}
+}
+
+Dali::InputMethod::ButtonAction::Type GetReturnKeyType()
+{
+  return Dali::InputMethod::ButtonAction::DEFAULT;
+}
+
+} // namespace VirtualKeyboard
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 90b8aef..44475fa
@@ -86,7 +86,7 @@ private:
   AbortHandler& operator=(const AbortHandler& rhs);
 
 private:
-  typedef void (*SignalHandlerFuncPtr )( int );
+  typedef void ( *SignalHandlerFuncPtr )( int );
 
   // _NSIG comes from the signal.h linux system header, defining the number of signals.
   SignalHandlerFuncPtr        mSignalOldHandlers[_NSIG-1];
old mode 100644 (file)
new mode 100755 (executable)
index 78f6e5a..8a8a37d
@@ -28,7 +28,23 @@ namespace Internal
 {
 namespace Platform
 {
+namespace InternalFile
+{
+  FILE *fmemopen( void *__s, size_t __len, const char *__modes );
+
+  size_t fread( void*  _Buffer, size_t _ElementSize, size_t _ElementCount, FILE*  _Stream );
+  int fclose( FILE *__stream );
+
+  size_t fread( void* buf, size_t eleSize, size_t count, const FILE *fp );
+
+  void fwrite( void *buf, int size, int count, FILE *fp );
 
+  int fseek( FILE *fp, int offset, int origin );
+
+  int ftell( FILE *fp );
+
+  bool feof( FILE *fp );
+};
 /**
  * Opens files and closes them later even if an exception is thrown.
  */
@@ -55,7 +71,7 @@ protected: // prevent this class being directly instantiated
    * @brief Construct a FileCloser guarding a FILE* for reading out of the memory buffer passed in.
    */
   FileCloser( uint8_t* buffer, size_t dataSize, const char * const mode )
-  : mFile( fmemopen( buffer, dataSize, mode) )
+  : mFile( InternalFile::fmemopen( buffer, dataSize, mode) )
   {
   }
 
@@ -71,7 +87,7 @@ protected: // prevent this class being directly instantiated
     vector.Resize( bufferSize );
 
     void * const buffer = &vector[0];
-    mFile = fmemopen( buffer, bufferSize, mode );
+    mFile = InternalFile::fmemopen( buffer, bufferSize, mode );
 
     DALI_ASSERT_DEBUG( buffer != 0 && "Cant open file on null buffer." );
     DALI_ASSERT_DEBUG( dataSize > 0 && "Pointless to open file on empty buffer." );
@@ -90,7 +106,7 @@ protected: // prevent this class being directly instantiated
   {
     if( mFile != 0 )
     {
-      const int closeFailed = fclose( mFile );
+      const int closeFailed = InternalFile::fclose( mFile );
 
       if ( closeFailed )
       {
old mode 100644 (file)
new mode 100755 (executable)
index 62798c8..1fac295
@@ -33,7 +33,8 @@ adaptor_system_common_src_files=\
 adaptor_system_linux_src_files=\
     ${adaptor_system_dir}/linux/callback-manager-ecore.cpp \
     ${adaptor_system_dir}/linux/file-descriptor-monitor-ecore.cpp \
-    ${adaptor_system_dir}/linux/timer-impl-ecore.cpp
+    ${adaptor_system_dir}/linux/timer-impl-ecore.cpp \
+    ${adaptor_system_dir}/linux/file-closer-linux.cpp
 
 # module: system, backend: tizen-wayland
 adaptor_system_tizen_wayland_src_files=\
diff --git a/dali/internal/system/linux/file-closer-linux.cpp b/dali/internal/system/linux/file-closer-linux.cpp
new file mode 100755 (executable)
index 0000000..1c23b8e
--- /dev/null
@@ -0,0 +1,52 @@
+#include <dali/integration-api/debug.h>\r
+#include <dali/public-api/common/dali-vector.h>\r
+#include <dali/internal/system/common/file-closer.h>\r
+\r
+#include <string>\r
+\r
+namespace Dali\r
+{\r
+namespace Internal\r
+{\r
+namespace Platform\r
+{\r
+namespace InternalFile\r
+{\r
+FILE *fmemopen( void *__s, size_t __len, const char *__modes )\r
+{\r
+  return ::fmemopen( __s, __len, __modes );\r
+}\r
+\r
+size_t fread( void*  _Buffer, size_t _ElementSize, size_t _ElementCount, FILE*  _Stream )\r
+{\r
+  return ::fread( _Buffer, _ElementSize, _ElementCount, _Stream );\r
+}\r
+\r
+int fclose( FILE *__stream )\r
+{\r
+  return ::fclose( __stream );\r
+}\r
+\r
+void fwrite( void *buf, int size, int count, FILE *fp )\r
+{\r
+  ::fwrite( buf, size, count, fp );\r
+}\r
+\r
+int fseek( FILE *fp, int offset, int origin )\r
+{\r
+  return ::fseek( fp, offset, origin );\r
+}\r
+\r
+int ftell( FILE *fp )\r
+{\r
+  return ::ftell( fp );\r
+}\r
+\r
+bool feof( FILE *fp )\r
+{\r
+  return ::feof( fp );\r
+}\r
+} //InternalFile\r
+} //Platform\r
+} //Internal\r
+} //Dali\r
diff --git a/dali/internal/system/windows/callback-manager-win.cpp b/dali/internal/system/windows/callback-manager-win.cpp
new file mode 100755 (executable)
index 0000000..7651c6e
--- /dev/null
@@ -0,0 +1,96 @@
+/*\r
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// CLASS HEADER\r
+#include <dali/internal/system/windows/callback-manager-win.h>\r
+\r
+// EXTERNAL INCLUDES\r
+#include <dali/integration-api/debug.h>\r
+\r
+// INTERNAL INCLUDES\r
+#include <Windows.h>\r
+#include <dali/internal/window-system/windows/platform-implement-win.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+\r
+WinCallbackManager::WinCallbackManager()\r
+:mRunning(false)\r
+{\r
+}\r
+\r
+void WinCallbackManager::Start()\r
+{\r
+  DALI_ASSERT_DEBUG( mRunning == false );\r
+  mRunning = true;\r
+}\r
+\r
+void WinCallbackManager::Stop()\r
+{\r
+  // make sure we're not called twice\r
+  DALI_ASSERT_DEBUG( mRunning == true );\r
+\r
+  mRunning = false;\r
+}\r
+\r
+#define WIN_CALLBACK_EVENT    9999\r
+\r
+bool WinCallbackManager::AddIdleCallback( CallbackBase* callback, bool hasReturnValue)\r
+{\r
+  if( !mRunning )\r
+  {\r
+    return false;\r
+  }\r
+\r
+  WindowsPlatformImplement::AddListener( WIN_CALLBACK_EVENT, callback );\r
+  WindowsPlatformImplement::PostWinMessage( WIN_CALLBACK_EVENT, (long)callback, 0 );\r
+  return true;\r
+}\r
+\r
+void WinCallbackManager::RemoveIdleCallback( CallbackBase* callback )\r
+{\r
+  //Wait for deal\r
+}\r
+\r
+bool WinCallbackManager::AddIdleEntererCallback(CallbackBase* callback)\r
+{\r
+  return true;\r
+}\r
+\r
+void WinCallbackManager::RemoveIdleEntererCallback(CallbackBase* callback)\r
+{\r
+\r
+}\r
+\r
+\r
+// Creates a concrete interface for CallbackManager\r
+CallbackManager* CallbackManager::New()\r
+{\r
+  return new WinCallbackManager;\r
+}\r
+\r
+} // namespace Adaptor\r
+\r
+} // namespace Internal\r
+\r
+} // namespace Dali\r
diff --git a/dali/internal/system/windows/callback-manager-win.h b/dali/internal/system/windows/callback-manager-win.h
new file mode 100755 (executable)
index 0000000..57c738b
--- /dev/null
@@ -0,0 +1,95 @@
+#ifndef DALI_WIN_CALLBACK_MANAGER_H
+#define DALI_WIN_CALLBACK_MANAGER_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <list>
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/callback-manager.h>
+
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+/**
+ * @brief LibUV callback manager used to install call backs in the applications main loop.
+ * The manager keeps track of all callbacks, so that if Stop() is called it can remove them.
+ */
+class WinCallbackManager : public CallbackManager
+{
+
+public:
+
+     /**
+     * @brief constructor
+     */
+    WinCallbackManager();
+
+    /**
+     * @brief destructor
+     */
+    ~WinCallbackManager(){}
+
+    /**
+     * @copydoc CallbackManager::AddIdleCallback()
+     */
+    virtual bool AddIdleCallback( CallbackBase* callback, bool hasReturnValue );
+
+    /**
+     * @copydoc CallbackManager::RemoveIdleCallback()
+     */
+    virtual void RemoveIdleCallback( CallbackBase* callback );
+
+    /**
+     * @copydoc CallbackManager::AddIdleEntererCallback()
+     */
+    virtual bool AddIdleEntererCallback(CallbackBase* callback);
+
+    /**
+     * @copydoc CallbackManager::RemoveIdleEntererCallback()
+     */
+    virtual void RemoveIdleEntererCallback(CallbackBase* callback);
+
+    /**
+     * @copydoc CallbackManager::Start()
+     */
+    virtual void Start();
+
+    /**
+     * @copydoc CallbackManager::Stop()
+     */
+    virtual void Stop();
+
+private:
+    bool                           mRunning;            ///< flag is set to true if when running
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // __DALI_UV_CALLBACK_MANAGER_H__
diff --git a/dali/internal/system/windows/file-closer-win.cpp b/dali/internal/system/windows/file-closer-win.cpp
new file mode 100755 (executable)
index 0000000..b8abd82
--- /dev/null
@@ -0,0 +1,70 @@
+/*\r
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+#include <dali/integration-api/debug.h>\r
+#include <dali/public-api/common/dali-vector.h>\r
+#include <dali/internal/system/common/file-closer.h>\r
+\r
+#include <CustomFile.h>\r
+\r
+namespace Dali\r
+{\r
+namespace Internal\r
+{\r
+namespace Platform\r
+{\r
+namespace InternalFile\r
+{\r
+FILE *fmemopen( void *__s, size_t __len, const char *__modes )\r
+{\r
+  FILE *ret = (FILE*)CustomFile::fmemopen( __s, __len, __modes );\r
+  return ret;\r
+}\r
+\r
+size_t fread( void*  _Buffer, size_t _ElementSize, size_t _ElementCount, FILE*  _Stream )\r
+{\r
+  return CustomFile::fread( _Buffer, _ElementSize, _ElementCount, _Stream );\r
+}\r
+\r
+int fclose( FILE *__stream )\r
+{\r
+  return CustomFile::fclose( __stream );\r
+}\r
+\r
+void fwrite( void *buf, int size, int count, FILE *fp )\r
+{\r
+  CustomFile::fwrite( buf, size * count, fp );\r
+}\r
+\r
+int fseek( FILE *fp, int offset, int origin )\r
+{\r
+  return CustomFile::fseek( fp, offset, origin );\r
+}\r
+\r
+int ftell( FILE *fp )\r
+{\r
+  return CustomFile::ftell( fp );\r
+}\r
+\r
+bool feof( FILE *fp )\r
+{\r
+  return CustomFile::feof( fp );\r
+}\r
+} //InternalFile\r
+} //Platform\r
+} //Internal\r
+} //Dali\r
diff --git a/dali/internal/system/windows/timer-impl-win.cpp b/dali/internal/system/windows/timer-impl-win.cpp
new file mode 100755 (executable)
index 0000000..e7e4438
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/system/common/timer-impl.h>
+
+// Ecore is littered with C style cast
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/windows/platform-implement-win.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+// LOCAL STUFF
+namespace
+{
+void TimerSourceFunc (void *data)
+{
+  Timer* timer = static_cast<Timer*>(data);
+
+  bool keepRunning = timer->Tick();
+}
+}
+
+/**
+ * Struct to hide away Ecore implementation details
+ */
+struct Timer::Impl
+{
+  Impl( unsigned int milliSec ) :
+    mId(-1),
+    mInterval(milliSec)
+  {
+  }
+
+  int mId;
+
+  unsigned int mInterval;
+};
+
+TimerPtr Timer::New( unsigned int milliSec )
+{
+  TimerPtr timer( new Timer( milliSec ) );
+  return timer;
+}
+
+Timer::Timer( unsigned int milliSec )
+: mImpl(new Impl(milliSec))
+{
+}
+
+Timer::~Timer()
+{
+  // stop timers
+  Stop();
+
+  delete mImpl;
+  mImpl = NULL;
+}
+
+void Timer::Start()
+{
+  if( 0 > mImpl->mId )
+  {
+    mImpl->mId = WindowsPlatformImplement::SetTimer( mImpl->mInterval, TimerSourceFunc, this );
+  }
+}
+
+void Timer::Stop()
+{
+  if( 0 <= mImpl->mId )
+  {
+    WindowsPlatformImplement::KillTimer( mImpl->mId );
+    mImpl->mId = -1;
+  }
+}
+
+void Timer::SetInterval( unsigned int interval )
+{
+  // stop existing timer
+  Stop();
+  mImpl->mInterval = interval;
+  // start new tick
+  Start();
+}
+
+unsigned int Timer::GetInterval() const
+{
+  return mImpl->mInterval;
+}
+
+bool Timer::Tick()
+{
+  // Guard against destruction during signal emission
+  Dali::Timer handle( this );
+
+  bool retVal( false );
+
+  // Override with new signal if used
+  if( !mTickSignal.Empty() )
+  {
+    retVal = mTickSignal.Emit();
+
+    // Timer stops if return value is false
+    if (retVal == false)
+    {
+      Stop();
+    }
+    else
+    {
+      retVal = true;   // continue emission
+    }
+  }
+  else // no callbacks registered
+  {
+    // periodic timer is started but nobody listens, continue
+    retVal = true;
+  }
+
+  return retVal;
+}
+
+Dali::Timer::TimerSignalType& Timer::TickSignal()
+{
+  return mTickSignal;
+}
+
+bool Timer::IsRunning() const
+{
+  return 0 <= mImpl->mId;
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#pragma GCC diagnostic pop
diff --git a/dali/internal/system/windows/trigger-event.cpp b/dali/internal/system/windows/trigger-event.cpp
new file mode 100755 (executable)
index 0000000..88643a3
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/system/common/trigger-event.h>
+
+// EXTERNAL INCLUDES
+#include <unistd.h>
+
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/file-descriptor-monitor.h>
+#include <dali/internal/window-system/windows/platform-implement-win.h>
+
+#define MESSAGE_TYPE_OFFSET     10000
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+TriggerEvent* triggerEventArray[10000] = { 0 };
+
+int SetTriggerEvent(TriggerEvent *event)
+{
+    for (size_t i = 0; i < 10000; i++)
+    {
+        if (NULL == triggerEventArray[i])
+        {
+            triggerEventArray[i] = event;
+            return i;
+        }
+    }
+
+    return -1;
+}
+
+TriggerEvent::TriggerEvent( CallbackBase* callback, TriggerEventInterface::Options options )
+: mCallback( callback ),
+  mFileDescriptor( -1 ),
+  mOptions( options )
+{
+  // Create accompanying file descriptor.
+  mFileDescriptor = SetTriggerEvent( this );
+  WindowsPlatformImplement::AddListener( mFileDescriptor + MESSAGE_TYPE_OFFSET, mCallback );
+
+  if (mFileDescriptor >= 0)
+  {
+    // Now Monitor the created event file descriptor
+  }
+  else
+  {
+    DALI_LOG_ERROR("Unable to create TriggerEvent File descriptor\n");
+  }
+}
+
+TriggerEvent::~TriggerEvent()
+{
+  delete mCallback;
+
+  if (mFileDescriptor >= 0)
+  {
+    mFileDescriptor = 0;
+  }
+}
+
+void TriggerEvent::Trigger()
+{
+  if (mFileDescriptor >= 0)
+  {
+    // Increment event counter by 1.
+    // Writing to the file descriptor triggers the Dispatch() method in the other thread
+    // (if in multi-threaded environment).
+
+    WindowsPlatformImplement::PostWinMessage( mFileDescriptor + MESSAGE_TYPE_OFFSET, 0, 0 );
+  }
+  else
+  {
+    DALI_LOG_WARNING("Attempting to write to an invalid file descriptor\n");
+  }
+}
+
+void TriggerEvent::Triggered( FileDescriptorMonitor::EventType eventBitMask )
+{
+  if( !( eventBitMask & FileDescriptorMonitor::FD_READABLE ) )
+  {
+    DALI_ASSERT_ALWAYS( 0 && "Trigger event file descriptor error");
+    return;
+  }
+
+  // Reading from the file descriptor resets the event counter, we can ignore the count.
+  uint64_t receivedData;
+  size_t size;
+  size = read(mFileDescriptor, &receivedData, sizeof(uint64_t));
+  if (size != sizeof(uint64_t))
+  {
+    DALI_LOG_WARNING("Unable to read to UpdateEvent File descriptor\n");
+  }
+
+  // Call the connected callback
+  CallbackBase::Execute( *mCallback );
+
+  //check if we should delete ourselves after the trigger
+  if( mOptions == TriggerEventInterface::DELETE_AFTER_TRIGGER )
+  {
+    delete this;
+  }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/system/windows/widget-application-impl-win.cpp b/dali/internal/system/windows/widget-application-impl-win.cpp
new file mode 100755 (executable)
index 0000000..57c38ee
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/system/windows/widget-application-impl-win.h>
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+WidgetApplicationPtr WidgetApplicationWin::New(
+  int* argc,
+  char **argv[],
+  const std::string& stylesheet)
+{
+  return new WidgetApplicationWin(argc, argv, stylesheet );
+}
+
+WidgetApplicationWin::WidgetApplicationWin( int* argc, char** argv[], const std::string& stylesheet )
+: WidgetApplication(argc, argv, stylesheet)
+{
+  DALI_LOG_ERROR("WidgetApplication is not implemented in UBUNTU profile.\n");
+}
+
+WidgetApplicationWin::~WidgetApplicationWin()
+{
+}
+
+
+void WidgetApplicationWin::RegisterWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction )
+{
+}
+
+// factory function, must be implemented
+namespace WidgetApplicationFactory
+{
+/**
+ * Create a new widget application
+ * @param[in]  argc         A pointer to the number of arguments
+ * @param[in]  argv         A pointer to the argument list
+ * @param[in]  stylesheet   The path to user defined theme file
+ */
+WidgetApplicationPtr Create( int* argc, char **argv[], const std::string& stylesheet )
+{
+  return WidgetApplicationWin::New( argc, argv, stylesheet );
+}
+
+} // namespace Factory
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/system/windows/widget-application-impl-win.h b/dali/internal/system/windows/widget-application-impl-win.h
new file mode 100755 (executable)
index 0000000..fd3b1ab
--- /dev/null
@@ -0,0 +1,86 @@
+#ifndef DALI_INTERNAL_WIDGET_APPLICATION_IMPL_WIN_H
+#define DALI_INTERNAL_WIDGET_APPLICATION_IMPL_WIN_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/adaptor/common/application-impl.h>
+#include <dali/internal/system/common//widget-application-impl.h>
+#include <dali/public-api/adaptor-framework/widget-application.h>
+
+namespace Dali
+{
+class Widget;
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+/**
+ * Implementation of the WidgetApplicationWin class.
+ */
+class WidgetApplicationWin : public WidgetApplication
+{
+public:
+
+  typedef std::pair<const std::string, Dali::WidgetApplication::CreateWidgetFunction >  CreateWidgetFunctionPair;
+  typedef std::vector< CreateWidgetFunctionPair >   CreateWidgetFunctionContainer;
+
+  /**
+   * Create a new widget application
+   * @param[in]  argc         A pointer to the number of arguments
+   * @param[in]  argv         A pointer to the argument list
+   * @param[in]  stylesheet   The path to user defined theme file
+   */
+  static WidgetApplicationPtr New( int* argc, char **argv[], const std::string& stylesheet );
+
+public:
+
+  /**
+   * @copydoc Dali::WidgetApplication::RegisterWidgetCreator()
+   */
+  void RegisterWidgetCreatingFunction( const std::string& widgetName, Dali::WidgetApplication::CreateWidgetFunction createFunction ) override;
+
+protected:
+
+  /**
+   * Private Constructor
+   * @param[in]  argc         A pointer to the number of arguments
+   * @param[in]  argv         A pointer to the argument list
+   * @param[in]  stylesheet   The path to user defined theme file
+   */
+  WidgetApplicationWin( int* argc, char **argv[], const std::string& stylesheet );
+
+  /**
+   * Destructor
+   */
+  virtual ~WidgetApplicationWin();
+
+  WidgetApplicationWin(const Application&) = delete;
+  WidgetApplicationWin& operator=(Application&) = delete;
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WIDGET_APPLICATION_IMPL_UBUNTU_H
diff --git a/dali/internal/system/windows/widget-controller-win.cpp b/dali/internal/system/windows/widget-controller-win.cpp
new file mode 100755 (executable)
index 0000000..e98e29c
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/system/windows/widget-controller-win.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+WidgetImplWin::WidgetImplWin()
+{
+}
+
+WidgetImplWin::~WidgetImplWin()
+{
+}
+
+void WidgetImplWin::SetContentInfo( const std::string& contentInfo )
+{
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/system/windows/widget-controller-win.h b/dali/internal/system/windows/widget-controller-win.h
new file mode 100755 (executable)
index 0000000..c19de62
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef DALI_WIDGET_CONTROLLER_WIN_H
+#define DALI_WIDGET_CONTROLLER_WIN_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/signals/connection-tracker.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/widget-controller.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+/**
+ * @brief Holds the Implementation for the internal WidgetImpl class
+ */
+class WidgetImplWin : public Widget::Impl
+{
+public:
+
+  /**
+   * Constructor
+   */
+  WidgetImplWin();
+
+  /**
+   * Destructor
+   */
+  ~WidgetImplWin() override;
+
+public:
+
+  /**
+   * Set content information to widget framework
+   */
+  void SetContentInfo( const std::string& contentInfo ) override;
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_WIDGET_CONTROLLER_UBUNTU_H
old mode 100644 (file)
new mode 100755 (executable)
index 1d157c9..9079396
@@ -1095,7 +1095,7 @@ void FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, boo
     if( FT_Err_Ok == error )
     {
       FT_Glyph glyph;
-
+#if defined(__GNUC__)
       if( softwareBold )
       {
         FT_GlyphSlot_Embolden(ftFace->glyph);
@@ -1107,7 +1107,7 @@ void FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, boo
         FT_Matrix transform = {0x10000, FONT_SLANT_TANGENT, 0x00000, 0x10000};
         FT_Outline_Transform(&ftFace->glyph->outline, &transform);
       }
-
+#endif
       error = FT_Get_Glyph( ftFace->glyph, &glyph );
 
       // Convert to bitmap if necessary
index a52915f..c9eaa31 100755 (executable)
@@ -119,8 +119,8 @@ EventHandler::EventHandler( RenderSurface* surface, CoreEventInterface& coreEven
     WindowBase* windowBase = windowRenderSurface->GetWindowBase();
 
     // Connect signals
-    windowBase->FocusChangedSignal().Connect( this, &EventHandler::OnFocusChanged );
     windowBase->WindowDamagedSignal().Connect( this, &EventHandler::OnWindowDamaged );
+    windowBase->FocusChangedSignal().Connect( this, &EventHandler::OnFocusChanged );
     windowBase->RotationSignal().Connect( this, &EventHandler::SendRotationPrepareEvent );
     windowBase->TouchEventSignal().Connect( this, &EventHandler::OnTouchEvent );
     windowBase->WheelEventSignal().Connect( this, &EventHandler::OnWheelEvent );
diff --git a/dali/internal/window-system/windows/display-connection-factory-win.cpp b/dali/internal/window-system/windows/display-connection-factory-win.cpp
new file mode 100755 (executable)
index 0000000..f37afb7
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/internal/window-system/windows/display-connection-factory-win.h>
+#include <dali/internal/window-system/windows/display-connection-impl-win.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+
+
+std::unique_ptr<Dali::Internal::Adaptor::DisplayConnection> DisplayConnectionFactoryWin::CreateDisplayConnection()
+{
+  return Utils::MakeUnique<DisplayConnectionWin>();
+}
+
+// this should be created from somewhere
+std::unique_ptr<DisplayConnectionFactory> GetDisplayConnectionFactory()
+{
+  // returns windows display factory
+  return Utils::MakeUnique<DisplayConnectionFactoryWin>();
+}
+
+}
+}
+}
\ No newline at end of file
diff --git a/dali/internal/window-system/windows/display-connection-factory-win.h b/dali/internal/window-system/windows/display-connection-factory-win.h
new file mode 100755 (executable)
index 0000000..72b73ab
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_WIN_DISPLAY_CONNECTION_FACTORY_WIN_H
+#define DALI_INTERNAL_WINDOWSYSTEM_WIN_DISPLAY_CONNECTION_FACTORY_WIN_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/internal/window-system/common/display-connection-factory.h>
+#include <dali/internal/window-system/common/display-utils.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+class DisplayConnectionFactoryWin : public DisplayConnectionFactory
+{
+public:
+  std::unique_ptr<Dali::Internal::Adaptor::DisplayConnection> CreateDisplayConnection() override;
+};
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_WIN_DISPLAY_CONNECTION_FACTORY_WIN_H
diff --git a/dali/internal/window-system/windows/display-connection-impl-win.cpp b/dali/internal/window-system/windows/display-connection-impl-win.cpp
new file mode 100755 (executable)
index 0000000..f989b08
--- /dev/null
@@ -0,0 +1,107 @@
+/*\r
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// CLASS HEADER\r
+#include <dali/internal/window-system/windows/display-connection-impl-win.h>\r
+\r
+// EXTERNAL_HEADERS\r
+#include <dali/integration-api/debug.h>\r
+\r
+// INTERNAL HEADERS\r
+#include <dali/internal/window-system/windows/pixmap-render-surface-win.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+\r
+DisplayConnection* DisplayConnectionWin::New()\r
+{\r
+  DisplayConnection* pDisplayConnection(new DisplayConnectionWin());\r
+\r
+  return pDisplayConnection;\r
+}\r
+\r
+DisplayConnectionWin::DisplayConnectionWin()\r
+: mDisplay(NULL)\r
+{\r
+}\r
+\r
+DisplayConnectionWin::~DisplayConnectionWin()\r
+{\r
+  if(mDisplay)\r
+  {\r
+    //XCloseDisplay(mDisplay);\r
+  }\r
+}\r
+\r
+Any DisplayConnectionWin::GetDisplay()\r
+{\r
+  return Any(mDisplay);\r
+}\r
+\r
+void DisplayConnectionWin::ConsumeEvents()\r
+{\r
+  // check events so that we can flush the queue and avoid any potential memory leaks in X\r
+  // looping if events remain\r
+  int events(0);\r
+  do\r
+  {\r
+    // Check if there are any events in the queue\r
+    //events = XEventsQueued(mDisplay, QueuedAfterFlush);\r
+\r
+    //if (events > 0)\r
+    //{\r
+    //  // Just flush event to prevent memory leak from event queue as the events get built up in\r
+    //  // memory but are only deleted when we retrieve them\r
+    //  XEvent ev;\r
+    //  XNextEvent(mDisplay, &ev);\r
+    //}\r
+  }\r
+  while (events > 0);\r
+}\r
+\r
+bool DisplayConnectionWin::InitializeEgl(EglInterface& egl)\r
+{\r
+  EglImplementation& eglImpl = static_cast<EglImplementation&>( egl );\r
+\r
+  if( !eglImpl.InitializeGles( reinterpret_cast<EGLNativeDisplayType>( mDisplay ) ) )\r
+  {\r
+    DALI_LOG_ERROR( "Failed to initialize GLES.\n" );\r
+    return false;\r
+  }\r
+\r
+  return true;\r
+}\r
+\r
+void DisplayConnectionWin::SetSurfaceType( RenderSurface::Type type )\r
+{\r
+  if( type == RenderSurface::WINDOW_RENDER_SURFACE )\r
+  {\r
+     mDisplay = GetDC( GetForegroundWindow() );\r
+  }\r
+}\r
+\r
+} // namespace Adaptor\r
+\r
+} // namespace Internal\r
+\r
+} // namespace Dali\r
diff --git a/dali/internal/window-system/windows/display-connection-impl-win.h b/dali/internal/window-system/windows/display-connection-impl-win.h
new file mode 100755 (executable)
index 0000000..ef07ee7
--- /dev/null
@@ -0,0 +1,101 @@
+#ifndef DALI_INTERNAL_WIN_DIPLAY_CONNECTION_H\r
+#define DALI_INTERNAL_WIN_DIPLAY_CONNECTION_H\r
+\r
+/*\r
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ *\r
+ */\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/internal/window-system/common/display-connection-impl.h>\r
+#include <dali/public-api/object/base-object.h>\r
+#include <dali/internal/graphics/gles20/egl-implementation.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+class RenderSurface;\r
+class DisplayConnection;\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+\r
+/**\r
+ * DisplayConnection implementation\r
+ */\r
+class DisplayConnectionWin : public Dali::Internal::Adaptor::DisplayConnection\r
+{\r
+public:\r
+\r
+  /**\r
+   * @brief Default constructor\r
+   */\r
+  DisplayConnectionWin();\r
+\r
+  /**\r
+   * @brief Create an initialized DisplayConnection.\r
+   *\r
+   * @return A handle to a newly allocated DisplayConnection resource.\r
+   */\r
+  static DisplayConnection* New();\r
+\r
+public:\r
+\r
+  /**\r
+   * @copydoc Dali::DisplayConnection::GetDisplay\r
+   */\r
+  Any GetDisplay();\r
+\r
+  /**\r
+   * @copydoc Dali::DisplayConnection::ConsumeEvents\r
+   */\r
+  void ConsumeEvents();\r
+\r
+  /**\r
+   * @copydoc Dali::DisplayConnection::InitializeEgl\r
+   */\r
+  bool InitializeEgl(EglInterface& egl);\r
+\r
+  void SetSurfaceType( RenderSurface::Type type );\r
+\r
+public:\r
+\r
+  /**\r
+   * Destructor\r
+   */\r
+  virtual ~DisplayConnectionWin();\r
+\r
+protected:\r
+\r
+  // Undefined\r
+  DisplayConnectionWin(const DisplayConnectionWin&) = delete;\r
+\r
+  // Undefined\r
+  DisplayConnectionWin& operator=(const DisplayConnectionWin& rhs) = delete;\r
+\r
+private:\r
+    HDC mDisplay;\r
+};\r
+\r
+} // namespace Adaptor\r
+\r
+} // namespace internal\r
+\r
+} // namespace Dali\r
+\r
+#endif // DALI_INTERNAL_WIN_DIPLAY_CONNECTION_H\r
diff --git a/dali/internal/window-system/windows/event-system-win.cpp b/dali/internal/window-system/windows/event-system-win.cpp
new file mode 100755 (executable)
index 0000000..7fab045
--- /dev/null
@@ -0,0 +1,78 @@
+#include <dali/internal/window-system/windows/event-system-win.h>\r
+#include <map>\r
+\r
+using namespace std;\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+\r
+struct TCallbackInfo\r
+{\r
+    TCallbackInfo(EventCallback callback, void* handler)\r
+    {\r
+        this->callback = callback;\r
+        this->handler = handler;\r
+    }\r
+\r
+    EventCallback callback;\r
+    void* handler;\r
+};\r
+\r
+map<int, TCallbackInfo*> eventTypeToCallbackInfo;\r
+\r
+Event_Handler event_handler_add(int eventType, EventCallback callback, void* handler)\r
+{\r
+    eventTypeToCallbackInfo.insert(make_pair(eventType, new TCallbackInfo(callback, handler)));\r
+    return eventType;\r
+}\r
+\r
+void event_handler_del(Event_Handler handler)\r
+{\r
+    map<int, TCallbackInfo*>::iterator x = eventTypeToCallbackInfo.find(handler);\r
+\r
+    if (eventTypeToCallbackInfo.end() != x)\r
+    {\r
+        delete x->second;\r
+        eventTypeToCallbackInfo.erase( handler );\r
+    }\r
+}\r
+\r
+void* GetEventHandler(int eventType)\r
+{\r
+    map<int, TCallbackInfo*>::iterator x = eventTypeToCallbackInfo.find(eventType);\r
+\r
+    if (eventTypeToCallbackInfo.end() != x)\r
+    {\r
+        return x->second->handler; \r
+    }\r
+    else\r
+    {\r
+        return NULL;\r
+    }\r
+}\r
+\r
+EventCallback GetCallback(int eventType)\r
+{\r
+    map<int, TCallbackInfo*>::iterator x = eventTypeToCallbackInfo.find(eventType);\r
+\r
+    if (eventTypeToCallbackInfo.end() != x)\r
+    {\r
+        return x->second->callback;\r
+    }\r
+    else\r
+    {\r
+        return NULL;\r
+    }\r
+}\r
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
\ No newline at end of file
diff --git a/dali/internal/window-system/windows/event-system-win.h b/dali/internal/window-system/windows/event-system-win.h
new file mode 100755 (executable)
index 0000000..d46a403
--- /dev/null
@@ -0,0 +1,284 @@
+#pragma once\r
+#ifndef _WINDOWEVENTSYSTEM_H_\r
+#define _WINDOWEVENTSYSTEM_H_\r
+\r
+#define EVENT_MOUSE_BUTTON_DOWN   WM_LBUTTONDOWN\r
+#define EVENT_MOUSE_BUTTON_UP     WM_LBUTTONUP\r
+#define EVENT_MOUSE_MOVE          WM_MOUSEMOVE\r
+#define EVENT_MOUSE_OUT           WM_MOUSELEAVE\r
+#define EVENT_MOUSE_WHEEL         WM_MOUSEWHEEL\r
+\r
+#define EVENT_KEY_DOWN            WM_KEYDOWN\r
+#define EVENT_KEY_UP              WM_KEYUP\r
+\r
+#define WIN_EVENT_WINDOW_FOCUS_IN   WM_SETFOCUS\r
+#define WIN_EVENT_WINDOW_FOCUS_OUT  WM_KILLFOCUS\r
+\r
+#define WIN_EVENT_WINDOW_DAMAGE     WM_PAINT\r
+\r
+#define WIN_EVENT_XDND_ENTER        0\r
+#define WIN_EVENT_XDND_POSITION     0\r
+#define WIN_EVENT_XDND_LEAVE        0\r
+#define WIN_EVENT_XDND_DROP         0\r
+\r
+#define WIN_EVENT_XDND_FINISHED     0\r
+#define WIN_EVENT_XDND_STATUS       0\r
+\r
+#define WIN_EVENT_CLIENT_MESSAGE    0\r
+#define WIN_EVENT_SELECTION_CLEAR   0\r
+#define WIN_EVENT_SELECTION_NOTIFY  0\r
+\r
+#define CALLBACK_PASS_ON true;\r
+\r
+#define EVENT_MODIFIER_SHIFT      0x0001\r
+#define EVENT_MODIFIER_CTRL       0x0002\r
+#define EVENT_MODIFIER_ALT        0x0004\r
+#define EVENT_MODIFIER_WIN        0x0008\r
+#define EVENT_MODIFIER_SCROLL     0x0010\r
+#define EVENT_MODIFIER_NUM        0x0020\r
+#define EVENT_MODIFIER_CAPS       0x0040\r
+#define EVENT_LOCK_SCROLL         0x0080\r
+#define EVENT_LOCK_NUM            0x0100\r
+#define EVENT_LOCK_CAPS           0x0200\r
+#define EVENT_LOCK_SHIFT          0x0300\r
+#define EVENT_MODIFIER_ALTGR      0x0400 /**< @since 1.7 */\r
+\r
+#define DEVICE_MOUSE                    0\r
+\r
+// INTERNAL INCLUDES\r
+#include <dali/internal/window-system/windows/platform-implement-win.h>\r
+\r
+namespace Dali\r
+{\r
+\r
+namespace Internal\r
+{\r
+\r
+namespace Adaptor\r
+{\r
+\r
+typedef enum\r
+{\r
+    IMF_KEYBOARD_MODIFIER_NONE = 0,      /**< No active modifiers */\r
+    IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */\r
+    IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */\r
+    IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */\r
+    IMF_KEYBOARD_MODIFIER_WIN = 1 << 3, /**< "Win" (between "Ctrl" and "Alt") is pressed */\r
+    IMF_KEYBOARD_MODIFIER_ALTGR = 1 << 4  /**< "AltGr" is pressed @since 1.7 */\r
+} IMF_Keyboard_Modifiers;\r
+\r
+struct _Event_Key\r
+{\r
+    const char      *keyname; /**< The key name */\r
+    const char      *key; /**< The key symbol */\r
+    const char      *string;\r
+    const char      *compose; /**< final string corresponding to the key symbol composed */\r
+    winWindow       window; /**< The main window where event happened */\r
+    winWindow       root_window; /**< The root window where event happened */\r
+    winWindow       event_window; /**< The child window where event happened */\r
+\r
+    unsigned int    timestamp; /**< Time when the event occurred */\r
+\r
+    unsigned int    keycode; /**< Key scan code numeric value @since 1.10 */\r
+\r
+    void            *data; /**< User data associated with an Event_Key @since 1.10 */\r
+};\r
+\r
+/**\r
+* @struct _Event_Mouse_Button\r
+* Contains information about an Ecore mouse button event.\r
+*/\r
+\r
+struct _Event_Mouse_Button\r
+{\r
+    winWindow     window; /**< The main window where event happened */\r
+\r
+    unsigned int     timestamp; /**< Time when the event occurred */\r
+    unsigned int     buttons; /**< The button that was used */\r
+\r
+    int              x; /**< x coordinate relative to window where event happened */\r
+    int              y; /**< y coordinate relative to window where event happened */\r
+\r
+    struct\r
+    {\r
+        int           device; /**< 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers) */\r
+        double        radius, radius_x, radius_y; /**< radius of press point - radius_x and y if its an ellipse (radius is the average of the 2) */\r
+        double        pressure; /**< pressure - 1.0 == normal, > 1.0 == more, 0.0 == none */\r
+        double        angle; /**< angle relative to perpendicular (0.0 == perpendicular), in degrees */\r
+        double        x, y; /**< same as x, y, but with sub-pixel precision, if available */\r
+        struct\r
+        {\r
+            double     x, y;\r
+        } root; /**< same as root.x, root.y, but with sub-pixel precision, if available */\r
+    } multi;\r
+};\r
+\r
+/**\r
+* @struct _Event_Mouse_Wheel\r
+* Contains information about an Ecore mouse wheel event.\r
+*/\r
+struct _Event_Mouse_Wheel\r
+{\r
+    winWindow     window; /**< The main window where event happened */\r
+    winWindow     root_window; /**< The root window where event happened */\r
+    winWindow     event_window; /**< The child window where event happened */\r
+\r
+    unsigned int     timestamp; /**< Time when the event occurred */\r
+    unsigned int     modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/\r
+\r
+    int              direction; /**< Orientation of the wheel (horizontal/vertical) */\r
+    int              z; /**< Value of the wheel event (+1/-1) */\r
+\r
+    int              x; /**< x coordinate relative to window where event happened */\r
+    int              y; /**< y coordinate relative to window where event happened */\r
+    struct\r
+    {\r
+        int           x;\r
+        int           y;\r
+    } root; /**< Coordinates relative to root window */\r
+};\r
+\r
+/**\r
+* @struct _Event_Mouse_Move\r
+* Contains information about an Ecore mouse move event.\r
+*/\r
+struct _Event_Mouse_Move\r
+{\r
+    winWindow     window; /**< The main window where event happened */\r
+    winWindow     root_window; /**< The root window where event happened */\r
+    winWindow     event_window; /**< The child window where event happened */\r
+\r
+    unsigned int     timestamp; /**< Time when the event occurred */\r
+    unsigned int     modifiers; /**< The combination of modifiers key (SHIFT,CTRL,ALT,..)*/\r
+\r
+    int              x; /**< x coordinate relative to window where event happened */\r
+    int              y; /**< y coordinate relative to window where event happened */\r
+    struct\r
+    {\r
+        int           x;\r
+        int           y;\r
+    } root; /**< Coordinates relative to root window */\r
+\r
+    struct\r
+    {\r
+        int           device; /**< 0 if normal mouse, 1+ for other mouse-devices (eg multi-touch - other fingers) */\r
+        double        radius, radius_x, radius_y; /**< radius of press point - radius_x and y if its an ellipse (radius is the average of the 2) */\r
+        double        pressure; /**< pressure - 1.0 == normal, > 1.0 == more, 0.0 == none */\r
+        double        angle; /**< angle relative to perpendicular (0.0 == perpendicular), in degrees */\r
+        double        x, y; /**< same as x, y root.x, root.y, but with sub-pixel precision, if available */\r
+        struct\r
+        {\r
+            double     x, y;\r
+        } root;\r
+    } multi;\r
+};\r
+\r
+typedef enum _Win_Event_Mode\r
+{\r
+    WIN_EVENT_MODE_NORMAL,\r
+    WIN_EVENT_MODE_WHILE_GRABBED,\r
+    WIN_EVENT_MODE_GRAB,\r
+    WIN_EVENT_MODE_UNGRAB\r
+} Win_Event_Mode;\r
+\r
+typedef enum _Win_Event_Detail\r
+{\r
+    WIN_EVENT_DETAIL_ANCESTOR,\r
+    WIN_EVENT_DETAIL_VIRTUAL,\r
+    WIN_EVENT_DETAIL_INFERIOR,\r
+    WIN_EVENT_DETAIL_NON_LINEAR,\r
+    WIN_EVENT_DETAIL_NON_LINEAR_VIRTUAL,\r
+    WIN_EVENT_DETAIL_POINTER,\r
+    WIN_EVENT_DETAIL_POINTER_ROOT,\r
+    WIN_EVENT_DETAIL_DETAIL_NONE\r
+} Win_Event_Detail;\r
+\r
+typedef unsigned int Win_Time;\r
+\r
+struct _Win_Event_Mouse_In\r
+{\r
+    int                  modifiers;\r
+    int                  x, y;\r
+\r
+    struct\r
+    {\r
+        int x, y;\r
+    } root;\r
+    winWindow       win;\r
+    winWindow       event_win;\r
+    winWindow       root_win;\r
+    Win_Event_Mode   mode;\r
+    Win_Event_Detail detail;\r
+    Win_Time         time;\r
+};\r
+\r
+struct _Win_Event_Mouse_Out\r
+{\r
+    int                  modifiers;\r
+    int                  x, y;\r
+\r
+    struct\r
+    {\r
+        int x, y;\r
+    } root;\r
+    winWindow       win;\r
+    winWindow       event_win;\r
+    winWindow       root_win;\r
+    Win_Event_Mode   mode;\r
+    Win_Event_Detail detail;\r
+    Win_Time         time;\r
+};\r
+\r
+struct _Win_Event_Window_Focus_In\r
+{\r
+    winWindow       win;\r
+};\r
+\r
+struct _Win_Event_Window_Focus_Out\r
+{\r
+    winWindow       win;\r
+};\r
+\r
+typedef struct _Event_Key          Event_Key;\r
+typedef struct _Event_Mouse_Button Event_Mouse_Button;\r
+typedef struct _Event_Mouse_Wheel  Event_Mouse_Wheel;\r
+typedef struct _Event_Mouse_Move   Event_Mouse_Move;\r
+typedef struct _Win_Event_Mouse_In                     Win_Event_Mouse_In;\r
+typedef struct _Win_Event_Mouse_Out                    Win_Event_Mouse_Out;\r
+typedef struct _Win_Event_Window_Focus_In              Win_Event_Window_Focus_In;\r
+typedef struct _Win_Event_Window_Focus_Out             Win_Event_Window_Focus_Out;\r
+\r
+typedef int Event_Handler;\r
+\r
+struct TWinEventInfo\r
+{\r
+    TWinEventInfo(long hWnd, unsigned int uMsg, long wParam, long lParam)\r
+    {\r
+        this->mWindow = (winWindow)hWnd;\r
+        this->uMsg = uMsg;\r
+        this->wParam = wParam;\r
+        this->lParam = lParam;\r
+    }\r
+\r
+    winWindow mWindow;\r
+    unsigned int uMsg;\r
+    long wParam;\r
+    long lParam;\r
+};\r
+\r
+typedef bool(*EventCallback)(void* data, int type, TWinEventInfo* event);\r
+\r
+Event_Handler event_handler_add(int eventType, EventCallback callback, void* handler);\r
+\r
+void event_handler_del(Event_Handler handler);\r
+\r
+void* GetEventHandler(int eventType);\r
+EventCallback GetCallback(int eventType);\r
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali\r
+\r
+#endif\r
diff --git a/dali/internal/window-system/windows/pixmap-render-surface-win.cpp b/dali/internal/window-system/windows/pixmap-render-surface-win.cpp
new file mode 100755 (executable)
index 0000000..ca9ff4b
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/windows/pixmap-render-surface-win.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/gl-abstraction.h>
+#include <dali/integration-api/debug.h>
+#include <dali/devel-api/threading/mutex.h>
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/thread-synchronization-interface.h>
+#include <dali/internal/system/common/trigger-event.h>
+#include <dali/internal/window-system/common/display-connection.h>
+#include <dali/internal/window-system/windows/platform-implement-win.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gPixmapRenderSurfaceLogFilter = Debug::Filter::New(Debug::Verbose, false, "LOG_PIXMAP_RENDER_SURFACE_WIN");
+#endif
+
+namespace
+{
+static const int INITIAL_PRODUCE_BUFFER_INDEX = 0;
+static const int INITIAL_CONSUME_BUFFER_INDEX = 1;
+}
+
+PixmapRenderSurfaceEcoreWin::PixmapRenderSurfaceEcoreWin( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+: mPosition( positionSize ),
+  mRenderNotification( NULL ),
+  mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
+  mOwnSurface( false ),
+  mProduceBufferIndex( INITIAL_PRODUCE_BUFFER_INDEX ),
+  mConsumeBufferIndex( INITIAL_CONSUME_BUFFER_INDEX ),
+  mThreadSynchronization(NULL)
+{
+  for( int i = 0; i != BUFFER_COUNT; ++i )
+  {
+    mWinPixmaps[i] = 0;
+    mEglSurfaces[i] = 0;
+  }
+
+  Initialize( surface );
+}
+
+PixmapRenderSurfaceEcoreWin::~PixmapRenderSurfaceEcoreWin()
+{
+  // release the surface if we own one
+  //if( mOwnSurface )
+  //{
+  //  for (int i = 0; i < BUFFER_COUNT; ++i)
+  //  {
+  //    Ecore_X_Pixmap pixmap = mWinPixmaps[i];
+
+  //    // if we did create the pixmap, delete the pixmap
+  //    DALI_LOG_INFO( gPixmapRenderSurfaceLogFilter, Debug::General, "Own pixmap (%x) freed\n", pixmap );
+  //    ecore_x_pixmap_free( pixmap );
+  //  }
+  //}
+}
+
+void PixmapRenderSurfaceEcoreWin::Initialize( Any surface )
+{
+  // see if there is a surface in Any surface
+  unsigned int surfaceId  = GetSurfaceId( surface );
+
+  // if the surface is empty, create a new one.
+  if ( surfaceId == 0 )
+  {
+    // we own the surface about to created
+    mOwnSurface = true;
+    CreateRenderable();
+  }
+  else
+  {
+    // XLib should already be initialized so no point in calling XInitThreads
+    UseExistingRenderable( surfaceId );
+  }
+}
+
+Any PixmapRenderSurfaceEcoreWin::GetSurface()
+{
+  //Ecore_X_Pixmap pixmap = 0;
+  //{
+  //  ConditionalWait::ScopedLock lock( mPixmapCondition );
+  //  pixmap = mWinPixmaps[mProduceBufferIndex];
+  //}
+
+  return Any( 0 );
+}
+
+void PixmapRenderSurfaceEcoreWin::SetRenderNotification(TriggerEventInterface* renderNotification)
+{
+  mRenderNotification = renderNotification;
+}
+
+PositionSize PixmapRenderSurfaceEcoreWin::GetPositionSize() const
+{
+  return mPosition;
+}
+
+void PixmapRenderSurfaceEcoreWin::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
+{
+  // calculate DPI 
+  float xres, yres;
+
+  //// 1 inch = 25.4 millimeters
+  WindowsPlatformImplement::GetDPI( xres, yres );
+
+  xres *= 1.5;
+  yres *= 1.5;
+
+  dpiHorizontal = int( xres + 0.5f );  // rounding
+  dpiVertical = int( yres + 0.5f );
+}
+
+void PixmapRenderSurfaceEcoreWin::InitializeEgl( EglInterface& egl )
+{
+  DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+  eglImpl.ChooseConfig(false, mColorDepth);
+}
+
+void PixmapRenderSurfaceEcoreWin::CreateEglSurface( EglInterface& egl )
+{
+  DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+  for (int i = 0; i < BUFFER_COUNT; ++i)
+  {
+    // create the EGL surface
+    // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
+    WinPixmap pixmap = static_cast<WinPixmap>( mWinPixmaps[i] );
+    mEglSurfaces[i] = eglImpl.CreateSurfacePixmap( EGLNativePixmapType( pixmap ), mColorDepth ); // reinterpret_cast does not compile
+  }
+}
+
+void PixmapRenderSurfaceEcoreWin::DestroyEglSurface( EglInterface& egl )
+{
+  DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+  for (int i = 0; i < BUFFER_COUNT; ++i)
+  {
+    // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
+    WinPixmap pixmap = static_cast<WinPixmap>( mWinPixmaps[i] );
+    eglImpl.MakeCurrent( EGLNativePixmapType( pixmap ), mEglSurfaces[i] );
+    eglImpl.DestroySurface();
+  }
+}
+
+bool PixmapRenderSurfaceEcoreWin::ReplaceEGLSurface( EglInterface& egl )
+{
+  DALI_LOG_TRACE_METHOD( gPixmapRenderSurfaceLogFilter );
+
+  bool contextLost = false;
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
+
+  for (int i = 0; i < BUFFER_COUNT; ++i)
+  {
+    // a new surface for the new pixmap
+    // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
+    WinPixmap pixmap = static_cast<WinPixmap>( mWinPixmaps[i] );
+    contextLost = eglImpl.ReplaceSurfacePixmap( EGLNativePixmapType( pixmap ), mEglSurfaces[i] ); // reinterpret_cast does not compile
+  }
+
+  // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
+  WinPixmap pixmap = static_cast<WinPixmap>( mWinPixmaps[mProduceBufferIndex] );
+  eglImpl.MakeCurrent( EGLNativePixmapType( pixmap ), mEglSurfaces[mProduceBufferIndex] );
+
+  return contextLost;
+}
+
+void PixmapRenderSurfaceEcoreWin::StartRender()
+{
+}
+
+bool PixmapRenderSurfaceEcoreWin::PreRender( EglInterface& egl, Integration::GlAbstraction&, bool )
+{
+  // Nothing to do for pixmaps
+  return true;
+}
+
+void PixmapRenderSurfaceEcoreWin::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, Dali::DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface )
+{
+}
+
+void PixmapRenderSurfaceEcoreWin::StopRender()
+{
+  ReleaseLock();
+}
+
+void PixmapRenderSurfaceEcoreWin::SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )
+{
+  mThreadSynchronization = &threadSynchronization;
+}
+
+void PixmapRenderSurfaceEcoreWin::ReleaseLock()
+{
+  if( mThreadSynchronization )
+  {
+    mThreadSynchronization->PostRenderComplete();
+  }
+}
+
+RenderSurface::Type PixmapRenderSurfaceEcoreWin::GetSurfaceType()
+{
+  return RenderSurface::PIXMAP_RENDER_SURFACE;
+}
+
+void PixmapRenderSurfaceEcoreWin::CreateRenderable()
+{
+}
+
+void PixmapRenderSurfaceEcoreWin::UseExistingRenderable( unsigned int surfaceId )
+{
+}
+
+unsigned int PixmapRenderSurfaceEcoreWin::GetSurfaceId( Any surface ) const
+{
+  return 0;
+}
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
diff --git a/dali/internal/window-system/windows/pixmap-render-surface-win.h b/dali/internal/window-system/windows/pixmap-render-surface-win.h
new file mode 100755 (executable)
index 0000000..4ede5a4
--- /dev/null
@@ -0,0 +1,197 @@
+#ifndef DALI_WIN_PIXMAP_RENDER_SURFACE_H
+#define DALI_WIN_PIXMAP_RENDER_SURFACE_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/egl-interface.h>
+#include <dali/internal/graphics/gles20/egl-implementation.h>
+#include <dali/internal/window-system/common/pixmap-render-surface.h>
+#include <dali/internal/window-system/windows/platform-implement-win.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+#include <dali/devel-api/threading/conditional-wait.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+/**
+ * Windows Pixmap implementation of render surface.
+ */
+class PixmapRenderSurfaceEcoreWin : public PixmapRenderSurface
+{
+public:
+
+  /**
+    * Uses an Windows surface to render to.
+    * @param [in] positionSize the position and size of the surface
+    * @param [in] surface can be a Win32-window or Win32-pixmap (type must be unsigned int).
+    * @param [in] name optional name of surface passed in
+    * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
+    */
+  PixmapRenderSurfaceEcoreWin( Dali::PositionSize positionSize, Any surface, bool isTransparent = false );
+
+  /**
+   * @brief Destructor
+   */
+  virtual ~PixmapRenderSurfaceEcoreWin();
+
+public: // from WindowRenderSurface
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::GetSurface()
+   */
+  virtual Any GetSurface() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::SetRenderNotification()
+   */
+  virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
+
+public: // from Dali::RenderSurface
+
+  /**
+   * @copydoc Dali::RenderSurface::GetPositionSize()
+   */
+  virtual PositionSize GetPositionSize() const override;
+
+  /**
+   * @copydoc Dali::RenderSurface::GetDpi()
+   */
+  virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+
+  /**
+   * @copydoc Dali::RenderSurface::InitializeEgl()
+   */
+  virtual void InitializeEgl( EglInterface& egl ) override;
+
+  /**
+   * @copydoc Dali::RenderSurface::CreateEglSurface()
+   */
+  virtual void CreateEglSurface( EglInterface& egl ) override;
+
+  /**
+   * @copydoc Dali::RenderSurface::DestroyEglSurface()
+   */
+  virtual void DestroyEglSurface( EglInterface& egl ) override;
+
+  /**
+   * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
+   */
+  virtual bool ReplaceEGLSurface( EglInterface& egl ) override;
+
+  /**
+   * @copydoc Dali::RenderSurface::MoveResize()
+   */
+  virtual void MoveResize( Dali::PositionSize positionSize) override {}
+
+  /**
+   * @copydoc Dali::RenderSurface::SetViewMode()
+   */
+  void SetViewMode( ViewMode viewMode ) override {}
+
+  /**
+   * @copydoc Dali::RenderSurface::StartRender()
+   */
+  virtual void StartRender() override;
+
+  /**
+   * @copydoc Dali::RenderSurface::PreRender()
+   */
+  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface ) override;
+
+  /**
+   * @copydoc Dali::RenderSurface::PostRender()
+   */
+  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
+
+  /**
+   * @copydoc Dali::RenderSurface::StopRender()
+   */
+  virtual void StopRender() override;
+
+  /**
+   * @copydoc Dali::RenderSurface::SetThreadSynchronization
+   */
+  virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
+
+  /**
+   * @copydoc Dali::RenderSurface::GetSurfaceType()
+   */
+  virtual RenderSurface::Type GetSurfaceType() override;
+
+private: // from PixmapRenderSurface
+
+  /**
+   * @copydoc Dali::RenderSurface::ReleaseLock()
+   */
+  virtual void ReleaseLock() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
+   */
+  virtual void Initialize( Any surface ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
+   */
+  virtual void CreateRenderable() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::PixmapRenderSurface::Initialize()
+   */
+  virtual void UseExistingRenderable( unsigned int surfaceId ) override;
+
+private:
+
+  /**
+   * Get the surface id if the surface parameter is not empty
+   * @param surface Any containing a surface id, or can be empty
+   * @return surface id, or zero if surface is empty
+   */
+  unsigned int GetSurfaceId( Any surface ) const;
+
+private: // Data
+
+  static const int BUFFER_COUNT = 2;
+
+  PositionSize                    mPosition;               ///< Position
+  TriggerEventInterface*          mRenderNotification;     ///< Render notification trigger
+  ColorDepth                      mColorDepth;             ///< Color depth of surface (32 bit or 24 bit)
+  bool                            mOwnSurface;             ///< Whether we own the surface (responsible for deleting it)
+
+  int                             mProduceBufferIndex;
+  int                             mConsumeBufferIndex;
+  WinPixmap                       mWinPixmaps[BUFFER_COUNT];  ///< Win-Pixmap
+  EGLSurface                      mEglSurfaces[BUFFER_COUNT];
+  ThreadSynchronizationInterface* mThreadSynchronization;     ///< A pointer to the thread-synchronization
+  ConditionalWait                 mPixmapCondition;           ///< condition to share pixmap
+};
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
+
+#endif // DALI_WIN_PIXMAP_RENDER_SURFACE_H
diff --git a/dali/internal/window-system/windows/platform-implement-win.cpp b/dali/internal/window-system/windows/platform-implement-win.cpp
new file mode 100755 (executable)
index 0000000..f122a43
--- /dev/null
@@ -0,0 +1,398 @@
+// CLASS HEADER\r
+#include <dali/internal/window-system/windows/platform-implement-win.h>\r
+\r
+// EXTERNAL_HEADERS\r
+#include <windows.h>\r
+#include <map>\r
+#include <set>\r
+\r
+using namespace std;\r
+\r
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+\r
+namespace WindowsPlatformImplement\r
+{\r
+\r
+HWND roothWnd = NULL;\r
+\r
+void RunLoop()\r
+{\r
+  MSG nMsg = { 0 };\r
+\r
+  while( GetMessage( &nMsg, 0, NULL, NULL ) )\r
+  {\r
+    TranslateMessage( &nMsg );\r
+    DispatchMessage( &nMsg );\r
+\r
+#ifdef _WIN32\r
+    //::Sleep( 20 );\r
+#endif\r
+\r
+    if( WM_CLOSE == nMsg.message )\r
+    {\r
+      break;\r
+    }\r
+  }\r
+}\r
+\r
+void SetParent(long child, long parent)\r
+{\r
+    if (roothWnd == (HWND)child && NULL != (HWND)parent)\r
+    {\r
+        roothWnd = (HWND)parent;\r
+    }\r
+\r
+    ::SetParent((HWND)child, (HWND)parent);\r
+}\r
+\r
+#define INCH 25.4\r
+\r
+void GetDPI(float &xDpi, float &yDpi)\r
+{\r
+  HDC hdcScreen = GetDC(roothWnd);\r
+\r
+  int iX = GetDeviceCaps( hdcScreen, HORZRES );    // pixel\r
+  int iY = GetDeviceCaps( hdcScreen, VERTRES );    // pixel\r
+  int iPhsX = GetDeviceCaps( hdcScreen, HORZSIZE );    // mm\r
+  int iPhsY = GetDeviceCaps( hdcScreen, VERTSIZE );    // mm\r
+\r
+  xDpi = (float)iX / (float)iPhsX * INCH;\r
+  yDpi = (float)iY / (float)iPhsY * INCH;\r
+}\r
+\r
+map<int, set<Dali::CallbackBase*>> callbackMap;\r
+set<winEventCallback> listenerSet;\r
+\r
+LRESULT CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
+{\r
+  for( set<winEventCallback>::iterator x = listenerSet.begin(); x != listenerSet.end(); ++x )\r
+  {\r
+    ( *x )( (long)hWnd, (long)uMsg, (long)wParam, (long)lParam );\r
+  }\r
+\r
+  {\r
+  map<int, set<Dali::CallbackBase*>>::iterator x = callbackMap.find( uMsg );\r
+\r
+  if( callbackMap.end() != x )\r
+  {\r
+    set<Dali::CallbackBase*> &cbSet = x->second;\r
+    for( set<Dali::CallbackBase*>::iterator y = cbSet.begin(); cbSet.end() != y; ++y )\r
+    {\r
+      Dali::CallbackBase::Execute(**y);\r
+    }\r
+  }\r
+  }\r
+\r
+  LRESULT ret = DefWindowProc( hWnd, uMsg, wParam, lParam );\r
+  return ret;\r
+}\r
+\r
+DWORD windowStyle = WS_OVERLAPPED;\r
+\r
+int GetEdgeWidth()\r
+{\r
+  switch( windowStyle )\r
+  {\r
+  case WS_OVERLAPPED:\r
+    return 8;\r
+    break;\r
+\r
+  default:\r
+    return 0;\r
+    break;\r
+  }\r
+}\r
+\r
+int GetEdgeHeight()\r
+{\r
+  switch( windowStyle )\r
+  {\r
+  case WS_OVERLAPPED:\r
+    return 18;\r
+    break;\r
+\r
+  default:\r
+    return 0;\r
+    break;\r
+  }\r
+}\r
+\r
+long CreateHwnd(\r
+    _In_opt_ const char *lpClassName,\r
+    _In_opt_ const char *lpWindowName,\r
+    _In_ int X,\r
+    _In_ int Y,\r
+    _In_ int nWidth,\r
+    _In_ int nHeight,\r
+    _In_opt_ long parent)\r
+{\r
+  WNDCLASS cs = { 0 };\r
+  cs.cbClsExtra = 0;\r
+  cs.cbWndExtra = 0;\r
+  cs.hbrBackground = (HBRUSH)( COLOR_WINDOW + 2 );\r
+  cs.hCursor = NULL;\r
+  cs.hIcon = NULL;\r
+  cs.hInstance = GetModuleHandle( NULL );\r
+  cs.lpfnWndProc = (WNDPROC)WinProc;\r
+  cs.lpszClassName = lpClassName;\r
+  cs.lpszMenuName = NULL;\r
+  cs.style = CS_VREDRAW | CS_HREDRAW;\r
+  RegisterClass( &cs );//ʵÏÖ×¢²á´°¿Ú\r
+\r
+  HWND hWnd = CreateWindow( lpClassName, lpWindowName, windowStyle, X, Y, nWidth + 2 * GetEdgeWidth(), nHeight + 2 * GetEdgeHeight(), NULL, NULL, cs.hInstance, NULL );\r
+  ShowWindow( hWnd, SW_SHOW );\r
+\r
+  if( hWnd != roothWnd )\r
+  {\r
+    roothWnd = hWnd;\r
+  }\r
+\r
+  return (long)hWnd;\r
+}\r
+\r
+void AddListener(winEventCallback callback)\r
+{\r
+  listenerSet.insert(callback);\r
+}\r
+\r
+void AddListener( int msgType, Dali::CallbackBase *callback )\r
+{\r
+  map<int, set<Dali::CallbackBase*>>::iterator x = callbackMap.find( msgType );\r
+  if( callbackMap.end() == x )\r
+  {\r
+    set<Dali::CallbackBase*> callbackSet;\r
+    callbackSet.insert( callback );\r
+\r
+    callbackMap.insert( make_pair( msgType, callbackSet ) );\r
+  }\r
+  else\r
+  {\r
+    set<Dali::CallbackBase*> &callbackSet = x->second;\r
+    set<Dali::CallbackBase*>::iterator y = callbackSet.find( callback );\r
+    if( callbackSet.end() == y )\r
+    {\r
+      callbackSet.insert( callback );\r
+    }\r
+  }\r
+}\r
+\r
+void RemoveListener(int msgType)\r
+{\r
+  callbackMap.erase(msgType);\r
+}\r
+\r
+bool PostWinMessage(\r
+    _In_ unsigned int Msg,\r
+    _In_ long wParam,\r
+    _In_ long lParam,\r
+    _In_ long hWnd/* = 0*/)\r
+{\r
+  if( 0 == hWnd )\r
+  {\r
+    return (bool)PostMessage( roothWnd, Msg, wParam, lParam );\r
+  }\r
+  else\r
+  {\r
+    return (bool)PostMessage( (HWND)hWnd, Msg, wParam, lParam );\r
+  }\r
+}\r
+\r
+void ShowWindow(long hWnd)\r
+{\r
+  ::ShowWindow((HWND)hWnd, SW_SHOW);\r
+}\r
+\r
+void HideWindow(long hWnd)\r
+{\r
+  ::ShowWindow((HWND)hWnd, SW_HIDE);\r
+}\r
+\r
+long CreateWinSemaphore(_In_ long lInitialCount, _In_ long lMaximumCount)\r
+{\r
+  return (long)::CreateSemaphore(NULL, lInitialCount, lMaximumCount, NULL);\r
+}\r
+\r
+unsigned long WaitForSingleObject(_In_ long hHandle, _In_ unsigned long dwMilliseconds)\r
+{\r
+  return ::WaitForSingleObject((HWND)hHandle, dwMilliseconds);\r
+}\r
+\r
+bool ReleaseSemaphore(_In_ long hSemaphore, _In_ long lReleaseCount, _Out_opt_ long *lpPreviousCount)\r
+{\r
+  return ::ReleaseSemaphore((HWND)hSemaphore, lReleaseCount, lpPreviousCount);\r
+}\r
+\r
+struct TTimerCallbackInfo\r
+{\r
+  void *data;\r
+  timerCallback callback;\r
+};\r
+\r
+map<int, TTimerCallbackInfo> mapTimerIDToData;\r
+\r
+void CALLBACK TimerProc(HWND hWnd, UINT nMsg, UINT_PTR nTimerid, DWORD dwTime)\r
+{\r
+  map<int, TTimerCallbackInfo>::iterator x = mapTimerIDToData.find( nTimerid );\r
+\r
+  if( mapTimerIDToData.end() == x )\r
+  {\r
+    return;\r
+  }\r
+\r
+  TTimerCallbackInfo &info = x->second;\r
+\r
+  info.callback( info.data );\r
+}\r
+\r
+int SetTimer(int interval, timerCallback callback, void *data)\r
+{\r
+  int timerID = 0;\r
+\r
+  for( map<int, TTimerCallbackInfo>::iterator x = mapTimerIDToData.begin(); mapTimerIDToData.end() != x; ++x )\r
+  {\r
+    int id = x->first;\r
+\r
+    if( timerID < id )\r
+    {\r
+      break;\r
+    }\r
+    else\r
+    {\r
+      timerID++;\r
+    }\r
+  }\r
+\r
+  TTimerCallbackInfo callbackInfo;\r
+  callbackInfo.data = data;\r
+  callbackInfo.callback = callback;\r
+\r
+  mapTimerIDToData.insert( make_pair( timerID, callbackInfo ) );\r
+\r
+  ::SetTimer( roothWnd, timerID, interval, TimerProc );\r
+\r
+  return timerID;\r
+}\r
+\r
+void KillTimer(int id)\r
+{\r
+  mapTimerIDToData.erase(id);\r
+  ::KillTimer(roothWnd, id);\r
+}\r
+\r
+const char* GetKeyName( int keyCode )\r
+{\r
+  switch( keyCode )\r
+  {\r
+  case VK_BACK:\r
+    return "Backspace";\r
+\r
+  case VK_TAB:\r
+    return "Tab";\r
+\r
+  case VK_RETURN:\r
+    return "Return";\r
+\r
+  case VK_ESCAPE:\r
+    return "Escape";\r
+\r
+  case VK_SPACE:\r
+    return "space";\r
+\r
+  case VK_LEFT:\r
+    return "Left";\r
+\r
+  case VK_UP:\r
+    return "Up";\r
+\r
+  case VK_RIGHT:\r
+    return "Right";\r
+\r
+  case VK_DOWN:\r
+    return "Down";\r
+\r
+  case 48:\r
+    return "0";\r
+\r
+  case 49:\r
+    return "1";\r
+\r
+  case 50:\r
+    return "2";\r
+\r
+  case 51:\r
+    return "3";\r
+\r
+  case 52:\r
+    return "4";\r
+\r
+  case 53:\r
+    return "5";\r
+\r
+  case 54:\r
+    return "6";\r
+\r
+  case 55:\r
+    return "7";\r
+\r
+  case 56:\r
+    return "8";\r
+\r
+  case 57:\r
+    return "9";\r
+\r
+    break;\r
+  }\r
+\r
+  return "";\r
+}\r
+
+static LARGE_INTEGER _cpuFrequency;\r
+static LARGE_INTEGER *_pCpuFrequency = NULL;\r
+\r
+long GetCurrentThreadId()\r
+{\r
+  return ::GetCurrentThreadId();\r
+}\r
+\r
+void GetNanoseconds( uint64_t& timeInNanoseconds )\r
+{\r
+  if( NULL == _pCpuFrequency )\r
+  {\r
+    _pCpuFrequency = &_cpuFrequency;\r
+    QueryPerformanceFrequency( _pCpuFrequency );\r
+  }\r
+\r
+  LARGE_INTEGER curTime;\r
+  QueryPerformanceCounter( &curTime );\r
+\r
+  timeInNanoseconds = (double)curTime.QuadPart / (double)_pCpuFrequency->QuadPart * 1000000000;\r
+}\r
+\r
+unsigned int GetCurrentMilliSeconds( void )\r
+{\r
+  if( NULL == _pCpuFrequency )\r
+  {\r
+    _pCpuFrequency = &_cpuFrequency;\r
+    QueryPerformanceFrequency( _pCpuFrequency );\r
+  }\r
+\r
+  LARGE_INTEGER curTime;\r
+  QueryPerformanceCounter( &curTime );\r
+\r
+  return curTime.QuadPart * 1000 / _pCpuFrequency->QuadPart;\r
+}\r
+
+} // namespace WindowsPlatformImplement
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali\r
diff --git a/dali/internal/window-system/windows/platform-implement-win.h b/dali/internal/window-system/windows/platform-implement-win.h
new file mode 100755 (executable)
index 0000000..383d9a2
--- /dev/null
@@ -0,0 +1,104 @@
+#ifndef PLATFORM_IMPLEMENT_WIN_INCLUDE\r
+#define PLATFORM_IMPLEMENT_WIN_INCLUDE\r
+\r
+/*
+* Copyright (c) 2018 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/\r
+\r
+// EXTERNAL_HEADERS\r
+#include <stdint.h>\r
+#include <dali/public-api/signals/callback.h>\r
+\r
+typedef bool Eina_Bool;\r
+\r
+typedef unsigned int   winWindow;\r
+typedef unsigned int   Win_Window_Handle;\r
+typedef unsigned int   WinPixmap;\r
+\r
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+\r
+namespace WindowsPlatformImplement\r
+{\r
+\r
+void RunLoop();\r
+\r
+void SetParent(long child, long parent);\r
+\r
+int GetEdgeHeight();\r
+\r
+long CreateHwnd(\r
+    _In_opt_ const char *lpClassName,\r
+    _In_opt_ const char *lpWindowName,\r
+    _In_ int X,\r
+    _In_ int Y,\r
+    _In_ int nWidth,\r
+    _In_ int nHeight,\r
+    _In_opt_ long parent);\r
+\r
+typedef void (*winEventCallback)(long hWnd, unsigned int uMsg, long wParam, long lParam);\r
+\r
+void RemoveListener(int msgType);\r
+\r
+void AddListener( winEventCallback callback );\r
+void AddListener( int msgType, Dali::CallbackBase *callback );\r
+\r
+bool PostWinMessage(\r
+    _In_ unsigned int Msg,\r
+    _In_ long wParam,\r
+    _In_ long lParam,\r
+    _In_ long hWnd = 0);\r
+\r
+void ShowWindow(long hWnd);\r
+void HideWindow(long hWnd);\r
+\r
+long CreateWinSemaphore(_In_ long lInitialCount, _In_ long lMaximumCount);\r
+\r
+unsigned long WaitForSingleObject(_In_ long hHandle, _In_ unsigned long dwMilliseconds);\r
+\r
+bool ReleaseSemaphore(_In_ long hSemaphore, _In_ long lReleaseCount, _Out_opt_ long *lpPreviousCount);\r
+\r
+typedef void(*timerCallback)(void *data);\r
+\r
+int SetTimer(int interval, timerCallback callback, void *data);\r
+\r
+void KillTimer(int id);\r
+\r
+void GetDPI( float &xDpi, float &yDpi );\r
+\r
+const char* GetKeyName( int keyCode );\r
+\r
+long GetCurrentThreadId();\r
+\r
+void GetNanoseconds( uint64_t& timeInNanoseconds );\r
+\r
+unsigned int GetCurrentMilliSeconds( void );\r
+\r
+} // namespace WindowsPlatformImplement
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
+
+#endif // WIN32_WINDOWS_SYSTEM_INCLUDE\r
diff --git a/dali/internal/window-system/windows/render-surface-factory-win.cpp b/dali/internal/window-system/windows/render-surface-factory-win.cpp
new file mode 100755 (executable)
index 0000000..0936c09
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/windows/render-surface-factory-win.h>
+
+// INTERNAL HEADERS
+#include <dali/internal/window-system/common/window-render-surface.h>
+#include <dali/internal/window-system/windows/pixmap-render-surface-win.h>
+#include <dali/internal/window-system/common/display-utils.h>
+#include <dali/integration-api/native-render-surface.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+std::unique_ptr< WindowRenderSurface > RenderSurfaceFactoryWin::CreateWindowRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+{
+  return Utils::MakeUnique< WindowRenderSurface >( positionSize, surface, isTransparent );
+}
+
+std::unique_ptr< PixmapRenderSurface > RenderSurfaceFactoryWin::CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+{
+  return Utils::MakeUnique< PixmapRenderSurfaceEcoreWin >( positionSize, surface, isTransparent );
+}
+
+std::unique_ptr< NativeRenderSurface > RenderSurfaceFactoryWin::CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent )
+{
+  return std::unique_ptr< NativeRenderSurface >( nullptr );
+}
+
+// this should be created from somewhere
+std::unique_ptr< RenderSurfaceFactory > GetRenderSurfaceFactory()
+{
+  // returns Window factory
+  return Utils::MakeUnique< RenderSurfaceFactoryWin >();
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
diff --git a/dali/internal/window-system/windows/render-surface-factory-win.h b/dali/internal/window-system/windows/render-surface-factory-win.h
new file mode 100755 (executable)
index 0000000..969f2b5
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_WIN_RENDER_SURFACE_FACTORY_WIN_H
+#define DALI_INTERNAL_WINDOWSYSTEM_WIN_RENDER_SURFACE_FACTORY_ECORE_
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/internal/window-system/common/render-surface-factory.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+class RenderSurfaceFactoryWin : public RenderSurfaceFactory
+{
+public:
+  std::unique_ptr< WindowRenderSurface > CreateWindowRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override;
+
+  std::unique_ptr< PixmapRenderSurface > CreatePixmapRenderSurface( Dali::PositionSize positionSize, Any surface, bool isTransparent = false ) override;
+
+  std::unique_ptr< NativeRenderSurface > CreateNativeRenderSurface( Dali::PositionSize positionSize, bool isTransparent = false ) override;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_WIN_RENDER_SURFACE_FACTORY_WIN_H
diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp
new file mode 100755 (executable)
index 0000000..98926f1
--- /dev/null
@@ -0,0 +1,904 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/windows/window-base-win.h>
+
+// INTERNAL HEADERS
+#include <dali/internal/window-system/common/window-impl.h>
+#include <dali/internal/window-system/common/window-render-surface.h>
+
+// EXTERNAL_HEADERS
+#include <dali/public-api/object/any.h>
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace
+{
+
+const std::string DEFAULT_DEVICE_NAME = "";
+const Device::Class::Type DEFAULT_DEVICE_CLASS = Device::Class::NONE;
+const Device::Subclass::Type DEFAULT_DEVICE_SUBCLASS = Device::Subclass::NONE;
+
+const unsigned int PRIMARY_TOUCH_BUTTON_ID( 1 );
+
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW_BASE" );
+#endif
+
+static bool EcoreEventWindowPropertyChanged( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    return windowBase->OnWindowPropertyChanged( data, type, event );
+  }
+
+  return true;
+}
+
+/**
+ * Called when the window gains focus.
+ */
+static bool EcoreEventWindowFocusIn( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnFocusIn( data, type, event );
+  }
+  return true;
+}
+
+/**
+ * Called when the window loses focus.
+ */
+static bool EcoreEventWindowFocusOut( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnFocusOut( data, type, event );
+  }
+  return true;
+}
+
+/**
+ * Called when the window is damaged.
+ */
+static bool EcoreEventWindowDamaged( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnWindowDamaged( data, type, event );
+  }
+
+  return true;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// Selection Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Called when the source window notifies us the content in clipboard is selected.
+ */
+static bool EcoreEventSelectionClear( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnSelectionClear( data, type, event );
+  }
+  return true;
+}
+
+/**
+ * Called when the source window sends us about the selected content.
+ * For example, when dragged items are dragged INTO our window or when items are selected in the clipboard.
+ */
+static bool EcoreEventSelectionNotify( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnSelectionNotify( data, type, event );
+  }
+  return true;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// Touch Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Called when a touch down is received.
+ */
+static bool EcoreEventMouseButtonDown( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnMouseButtonDown( data, type, event );
+  }
+  return true;
+}
+
+/**
+ * Called when a touch up is received.
+ */
+static bool EcoreEventMouseButtonUp( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnMouseButtonUp( data, type, event );
+  }
+  return true;
+}
+
+/**
+ * Called when a touch motion is received.
+ */
+static bool EcoreEventMouseButtonMove( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnMouseButtonMove( data, type, event );
+  }
+  return true;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// Wheel Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Called when a mouse wheel is received.
+ */
+static bool EcoreEventMouseWheel( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnMouseWheel( data, type, event );
+  }
+  return true;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
+// Key Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Called when a key down is received.
+ */
+static bool EcoreEventKeyDown( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnKeyDown( data, type, event );
+  }
+  return true;
+}
+
+/**
+ * Called when a key up is received.
+ */
+static bool EcoreEventKeyUp( void* data, int type, TWinEventInfo *event )
+{
+  WindowBaseWin* windowBase = static_cast< WindowBaseWin* >( data );
+  if( windowBase )
+  {
+    windowBase->OnKeyUp( data, type, event );
+  }
+  return true;
+}
+} // unnamed namespace
+
+WindowBaseWin::WindowBaseWin( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+: mEventHandler(),
+  mWin32Window( 0 ),
+  mOwnSurface( false ),
+  mIsTransparent( false ), // Should only be set to true once we actually create a transparent window regardless of what isTransparent is.
+  mRotationAppSet( false )
+{
+  Initialize( positionSize, surface, isTransparent );
+}
+
+WindowBaseWin::~WindowBaseWin()
+{
+  for( Dali::Vector< Event_Handler >::Iterator iter = mEventHandler.Begin(), endIter = mEventHandler.End(); iter != endIter; ++iter )
+  {
+    event_handler_del( *iter );
+  }
+  mEventHandler.Clear();
+
+  WindowsPlatformImplement::PostWinMessage( WM_CLOSE, 0, 0, mWin32Window );
+}
+
+static void EventEntry( long hWnd, unsigned int uMsg, long wParam, long lParam )\r
+{\r
+  EventCallback callback = GetCallback( uMsg );\r
+  EventHandler *handler = (EventHandler*)GetEventHandler( uMsg );\r
+\r
+  if( NULL != callback )\r
+  {\r
+    //EventHandler *handler = new EventHandler();\r
+    TWinEventInfo eventInfo( hWnd, uMsg, wParam, lParam );\r
+    callback( handler, uMsg, &eventInfo );\r
+  }\r
+}
+
+void WindowBaseWin::Initialize( PositionSize positionSize, Any surface, bool isTransparent )
+{
+  // see if there is a surface in Any surface
+  unsigned int surfaceId = GetSurfaceId( surface );
+
+  // if the surface is empty, create a new one.
+  if( surfaceId == 0 )
+  {
+    // we own the surface about to created
+    mOwnSurface = true;
+    CreateWinWindow( positionSize, isTransparent );
+  }
+  else
+  {
+    // XLib should already be initialized so no point in calling XInitThreads
+    mWin32Window = static_cast< Win_Window_Handle >( surfaceId );
+  }
+
+  // Register window focus events
+  mEventHandler.PushBack( event_handler_add( WIN_EVENT_WINDOW_FOCUS_IN,       EcoreEventWindowFocusIn,   this ) );
+  mEventHandler.PushBack( event_handler_add( WIN_EVENT_WINDOW_FOCUS_OUT,      EcoreEventWindowFocusOut,  this ) );
+
+  // Register Window damage events
+  mEventHandler.PushBack( event_handler_add( WIN_EVENT_WINDOW_DAMAGE,         EcoreEventWindowDamaged,   this ) );
+
+  // Register Touch events
+  mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_BUTTON_DOWN,       EcoreEventMouseButtonDown, this ) );
+  mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_BUTTON_UP,         EcoreEventMouseButtonUp,   this ) );
+  mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_MOVE,              EcoreEventMouseButtonMove, this ) );
+  mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_OUT,               EcoreEventMouseButtonUp,   this ) ); // process mouse out event like up event
+
+  // Register Mouse wheel events
+  mEventHandler.PushBack( event_handler_add( EVENT_MOUSE_WHEEL,             EcoreEventMouseWheel,      this ) );
+
+  // Register Key events
+  mEventHandler.PushBack( event_handler_add( EVENT_KEY_DOWN,                EcoreEventKeyDown,         this ) );
+  mEventHandler.PushBack( event_handler_add( EVENT_KEY_UP,                  EcoreEventKeyUp,           this ) );
+
+  // Register Selection event
+  mEventHandler.PushBack( event_handler_add( WIN_EVENT_SELECTION_CLEAR,       EcoreEventSelectionClear,  this ) );
+  mEventHandler.PushBack( event_handler_add( WIN_EVENT_SELECTION_NOTIFY,      EcoreEventSelectionNotify, this ) );
+
+  WindowsPlatformImplement::AddListener( EventEntry );
+}
+
+bool WindowBaseWin::OnWindowPropertyChanged( void* data, int type, TWinEventInfo *event )
+{
+  //Ecore_X_Event_Window_Property* propertyChangedEvent = static_cast< Ecore_X_Event_Window_Property* >( event );
+  //bool handled( true );
+
+  //if( propertyChangedEvent->win == mWin32Window )
+  //{
+  //  Ecore_X_Window_State_Hint state( ecore_x_icccm_state_get( propertyChangedEvent->win ) );
+
+  //  switch( state )
+  //  {
+  //    case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
+  //    {
+  //      // Window was hidden.
+  //      mWindow->OnIconifyChanged( true );
+  //      DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%d) Withdrawn\n", mWindow );
+  //      handled = ECORE_CALLBACK_DONE;
+  //      break;
+  //    }
+  //    case ECORE_X_WINDOW_STATE_HINT_ICONIC:
+  //    {
+  //      // Window was iconified (minimised).
+  //      mWindow->OnIconifyChanged( true );
+  //      DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%d) Iconfied\n", mWindow );
+  //      handled = ECORE_CALLBACK_DONE;
+  //      break;
+  //    }
+  //    case ECORE_X_WINDOW_STATE_HINT_NORMAL:
+  //    {
+  //      // Window was shown.
+  //      mWindow->OnIconifyChanged( false );
+  //      DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%d) Shown\n", mWindow );
+  //      handled = ECORE_CALLBACK_DONE;
+  //      break;
+  //    }
+  //    default:
+  //    {
+  //      // Ignore
+  //      break;
+  //    }
+  //  }
+  //}
+
+  //return handled;
+  return true;
+}
+
+void WindowBaseWin::OnDeleteRequest()
+{
+  mDeleteRequestSignal.Emit();
+}
+
+void WindowBaseWin::OnFocusIn( void* data, int type, TWinEventInfo *event )
+{
+  //Ecore_X_Event_Window_Focus_In* focusInEvent = static_cast< Ecore_X_Event_Window_Focus_In* >( event );
+
+  //if( focusInEvent->win == mWin32Window )
+  //{
+  //  DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n" );
+
+  //  mFocusChangedSignal.Emit( true );
+  //}
+}
+
+void WindowBaseWin::OnFocusOut( void* data, int type, TWinEventInfo *event )
+{
+  //Ecore_X_Event_Window_Focus_Out* focusOutEvent = static_cast< Ecore_X_Event_Window_Focus_Out* >( event );
+
+  //// If the window loses focus then hide the keyboard.
+  //if( focusOutEvent->win == mWin32Window )
+  //{
+  //  DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n" );
+
+  //  mFocusChangedSignal.Emit( false );
+  //}
+}
+
+void WindowBaseWin::OnWindowDamaged( void* data, int type, TWinEventInfo *event )
+{
+  Event_Mouse_Button* windowDamagedEvent( (Event_Mouse_Button*)event );\r
+  EventHandler* handler( (EventHandler*)data );\r
+\r
+  if( windowDamagedEvent->window == mWin32Window )\r
+  {\r
+    DamageArea area;\r
+    area.x = 0;\r
+    area.y = 0;\r
+    area.width = 480;\r
+    area.height = 800;\r
+\r
+    //handler->SendEvent( area );\r
+    mWindowDamagedSignal.Emit( area );\r
+  }\r
+}
+
+void WindowBaseWin::OnMouseButtonDown( void* data, int type, TWinEventInfo *event )
+{
+  Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);
+  touchEvent.x = LOWORD( event->lParam );\r
+  touchEvent.y = HIWORD( event->lParam );\r
+  touchEvent.multi.device = DEVICE_MOUSE;
+
+  if( touchEvent.window == mWin32Window )
+  {
+    PointState::Type state ( PointState::DOWN );
+
+    // Check if the buttons field is set and ensure it's the primary touch button.
+    // If this event was triggered by buttons other than the primary button (used for touch), then
+    // just send an interrupted event to Core.
+    if( touchEvent.buttons && ( touchEvent.buttons != PRIMARY_TOUCH_BUTTON_ID ) )
+    {
+      state = PointState::INTERRUPTED;
+    }
+
+    Integration::Point point;
+    point.SetDeviceId( touchEvent.multi.device );
+    point.SetState( state );
+    point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplement::GetEdgeHeight() ) );
+    point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );
+    point.SetPressure( touchEvent.multi.pressure );
+    point.SetAngle( Degree( touchEvent.multi.angle ) );
+
+    mTouchEventSignal.Emit( point, touchEvent.timestamp );
+  }
+}
+
+void WindowBaseWin::OnMouseButtonUp( void* data, int type, TWinEventInfo *event )
+{
+  Event_Mouse_Button touchEvent = *( (Event_Mouse_Button*)event );
+  touchEvent.x = LOWORD( event->lParam );\r
+  touchEvent.y = HIWORD( event->lParam );\r
+  touchEvent.multi.device = DEVICE_MOUSE;
+
+  if( touchEvent.window == mWin32Window )
+  {
+    PointState::Type state( PointState::UP );
+
+    // Check if the buttons field is set and ensure it's the primary touch button.
+    // If this event was triggered by buttons other than the primary button (used for touch), then
+    // just send an interrupted event to Core.
+    if( touchEvent.buttons && ( touchEvent.buttons != PRIMARY_TOUCH_BUTTON_ID ) )
+    {
+      state = PointState::INTERRUPTED;
+    }
+
+    Integration::Point point;
+    point.SetDeviceId( touchEvent.multi.device );
+    point.SetState( state );
+    point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplement::GetEdgeHeight() ) );
+    point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );
+    point.SetPressure( touchEvent.multi.pressure );
+    point.SetAngle( Degree( touchEvent.multi.angle ) );
+
+    mTouchEventSignal.Emit( point, touchEvent.timestamp );
+  }
+}
+
+void WindowBaseWin::OnMouseButtonMove( void* data, int type, TWinEventInfo *event )
+{
+  Event_Mouse_Button touchEvent = *((Event_Mouse_Button*)event);
+  touchEvent.timestamp = GetTickCount();
+  touchEvent.x = LOWORD( event->lParam );\r
+  touchEvent.y = HIWORD( event->lParam );\r
+  touchEvent.multi.device = DEVICE_MOUSE;
+
+  if( touchEvent.window == mWin32Window )
+  {
+    PointState::Type state( PointState::MOTION );
+
+    // Check if the buttons field is set and ensure it's the primary touch button.
+    // If this event was triggered by buttons other than the primary button (used for touch), then
+    // just send an interrupted event to Core.
+    if( touchEvent.buttons && ( touchEvent.buttons != PRIMARY_TOUCH_BUTTON_ID ) )
+    {
+      state = PointState::INTERRUPTED;
+    }
+
+    Integration::Point point;
+    point.SetDeviceId( touchEvent.multi.device );
+    point.SetState( state );
+    point.SetScreenPosition( Vector2( touchEvent.x, touchEvent.y + WindowsPlatformImplement::GetEdgeHeight() ) );
+    point.SetRadius( touchEvent.multi.radius, Vector2( touchEvent.multi.radius_x, touchEvent.multi.radius_y ) );
+    point.SetPressure( touchEvent.multi.pressure );
+    point.SetAngle( Degree( touchEvent.multi.angle ) );
+
+    mTouchEventSignal.Emit( point, touchEvent.timestamp );
+  }
+}
+
+void WindowBaseWin::OnMouseWheel( void* data, int type, TWinEventInfo *event )
+{
+  Event_Mouse_Wheel mouseWheelEvent = *((Event_Mouse_Wheel*)( event ));
+
+  if( mouseWheelEvent.window == mWin32Window )
+  {
+    DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent.direction, mouseWheelEvent.modifiers, mouseWheelEvent.x, mouseWheelEvent.y, mouseWheelEvent.z );
+
+    WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent.direction, mouseWheelEvent.modifiers, Vector2( mouseWheelEvent.x, mouseWheelEvent.y ), mouseWheelEvent.z, mouseWheelEvent.timestamp );
+
+    mWheelEventSignal.Emit( wheelEvent );
+  }
+}
+
+void WindowBaseWin::OnKeyDown( void* data, int type, TWinEventInfo *event )
+{
+  if( event->mWindow == mWin32Window )
+  {
+    DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );
+
+    int keyCode = event->wParam;
+    std::string keyName( WindowsPlatformImplement::GetKeyName( keyCode ) );
+    std::string keyString( "" );
+    std::string compose( "" );
+
+    int modifier( 0 );
+    unsigned long time( 0 );
+
+    // Ensure key event string is not NULL as keys like SHIFT have a null string.
+    keyString.push_back( event->wParam );
+
+    Integration::KeyEvent keyEvent( keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS );
+
+    mKeyEventSignal.Emit( keyEvent );
+  }
+}
+
+void WindowBaseWin::OnKeyUp( void* data, int type, TWinEventInfo *event )
+{
+  if( event->mWindow == mWin32Window )
+  {
+    DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseWin::OnKeyDown\n" );
+
+    int keyCode = event->wParam;
+    std::string keyName( WindowsPlatformImplement::GetKeyName( keyCode ) );
+    std::string keyString( "" );
+    std::string compose( "" );
+
+    int modifier( 0 );
+    unsigned long time( 0 );
+
+    // Ensure key event string is not NULL as keys like SHIFT have a null string.
+    keyString.push_back( event->wParam );
+
+    Integration::KeyEvent keyEvent( keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, compose, DEFAULT_DEVICE_NAME, DEFAULT_DEVICE_CLASS, DEFAULT_DEVICE_SUBCLASS );
+
+    mKeyEventSignal.Emit( keyEvent );
+  }
+}
+
+void WindowBaseWin::OnSelectionClear( void* data, int type, TWinEventInfo *event )
+{
+  //Ecore_X_Event_Selection_Clear* selectionClearEvent = static_cast< Ecore_X_Event_Selection_Clear* >( event );
+
+  //if( selectionClearEvent->win == mWin32Window )
+  //{
+  //  DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, " WindowBaseWin::OnSelectionClear\n" );
+
+  //  if( selectionClearEvent->selection == ECORE_X_SELECTION_SECONDARY )
+  //  {
+  //    // Request to get the content from Ecore.
+  //    ecore_x_selection_secondary_request( selectionClearEvent->win, ECORE_X_SELECTION_TARGET_TEXT );
+  //  }
+  //}
+}
+
+void WindowBaseWin::OnSelectionNotify( void* data, int type, TWinEventInfo *event )
+{
+  //Ecore_X_Event_Selection_Notify* selectionNotifyEvent = static_cast< Ecore_X_Event_Selection_Notify* >( event );
+
+  //if( selectionNotifyEvent->win == mWin32Window )
+  //{
+  //  DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, " WindowBaseWin::OnSelectionNotify\n" );
+
+  //  Ecore_X_Selection_Data* selectionData = static_cast< Ecore_X_Selection_Data* >( selectionNotifyEvent->data );
+  //  if( selectionData->data )
+  //  {
+  //    if( selectionNotifyEvent->selection == ECORE_X_SELECTION_SECONDARY )
+  //    {
+  //      mSelectionDataReceivedSignal.Emit( event  );
+  //    }
+  //  }
+  //}
+}
+
+Any WindowBaseWin::GetNativeWindow()
+{
+  return mWin32Window;
+}
+
+int WindowBaseWin::GetNativeWindowId()
+{
+  return mWin32Window;
+}
+
+EGLNativeWindowType WindowBaseWin::CreateEglWindow( int width, int height )
+{
+  return reinterpret_cast< EGLNativeWindowType >( mWin32Window );
+}
+
+void WindowBaseWin::DestroyEglWindow()
+{
+}
+
+void WindowBaseWin::SetEglWindowRotation( int angle )
+{
+}
+
+void WindowBaseWin::SetEglWindowBufferTransform( int angle )
+{
+}
+
+void WindowBaseWin::SetEglWindowTransform( int angle )
+{
+}
+
+void WindowBaseWin::ResizeEglWindow( PositionSize positionSize )
+{
+}
+
+bool WindowBaseWin::IsEglWindowRotationSupported()
+{
+  return false;
+}
+
+void WindowBaseWin::Move( PositionSize positionSize )
+{
+  //ecore_x_window_move( mWin32Window, positionSize.x, positionSize.y );
+}
+
+void WindowBaseWin::Resize( PositionSize positionSize )
+{
+  //ecore_x_window_resize( mWin32Window, positionSize.width, positionSize.height );
+}
+
+void WindowBaseWin::MoveResize( PositionSize positionSize )
+{
+  //ecore_x_window_move_resize( mWin32Window, positionSize.x, positionSize.y, positionSize.width, positionSize.height );
+}
+
+void WindowBaseWin::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode )
+{
+//  DALI_LOG_TRACE_METHOD_FMT( gWindowBaseLogFilter, "visible : %d\n", visibleMode );
+//
+//  if( visibleMode == Dali::Window::VISIBLE )
+//  {
+//    // when the indicator is visible, set proper mode for indicator server according to bg mode
+//    if( opacityMode == Dali::Window::OPAQUE )
+//    {
+//      ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_OPAQUE );
+//    }
+//    else if( opacityMode == Dali::Window::TRANSLUCENT )
+//    {
+//      ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_TRANSLUCENT );
+//    }
+//#if defined (DALI_PROFILE_MOBILE)
+//    else if( opacityMode == Dali::Window::TRANSPARENT )
+//    {
+//      ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_OPAQUE );
+//    }
+//#endif
+//  }
+//  else
+//  {
+//    // when the indicator is not visible, set TRANSPARENT mode for indicator server
+//    ecore_x_e_illume_indicator_opacity_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_TRANSPARENT ); // it means hidden indicator
+//  }
+}
+
+void WindowBaseWin::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
+{
+  /*int show_state = static_cast< int >( isShow );
+  ecore_x_window_prop_property_set( mWin32Window, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
+                                    ECORE_X_ATOM_CARDINAL, 32, &show_state, 1 );
+
+  if( isShow )
+  {
+    ecore_x_e_illume_indicator_state_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_STATE_ON );
+  }
+  else
+  {
+    ecore_x_e_illume_indicator_state_set( mWin32Window, ECORE_X_ILLUME_INDICATOR_STATE_OFF );
+  }*/
+}
+
+void WindowBaseWin::IndicatorTypeChanged( IndicatorInterface::Type type )
+{
+}
+
+void WindowBaseWin::SetClass( const std::string& name, const std::string& className )
+{
+  //ecore_x_icccm_name_class_set( mWin32Window, name.c_str(), className.c_str() );
+}
+
+void WindowBaseWin::Raise()
+{
+  //ecore_x_window_raise( mWin32Window );
+}
+
+void WindowBaseWin::Lower()
+{
+  //ecore_x_window_lower( mWin32Window );
+}
+
+void WindowBaseWin::Activate()
+{
+  //ecore_x_netwm_client_active_request( ecore_x_window_root_get( mWin32Window ), mWin32Window, 1 /* request type, 1:application, 2:pager */, 0 );
+}
+
+void WindowBaseWin::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
+{
+}
+
+void WindowBaseWin::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
+{
+}
+
+void WindowBaseWin::SetAcceptFocus( bool accept )
+{
+}
+
+void WindowBaseWin::Show()
+{
+  //ecore_x_window_show( mWin32Window );
+}
+
+void WindowBaseWin::Hide()
+{
+  //ecore_x_window_hide( mWin32Window );
+}
+
+unsigned int WindowBaseWin::GetSupportedAuxiliaryHintCount() const
+{
+  return 0;
+}
+
+std::string WindowBaseWin::GetSupportedAuxiliaryHint( unsigned int index ) const
+{
+  return std::string();
+}
+
+unsigned int WindowBaseWin::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+  return 0;
+}
+
+bool WindowBaseWin::RemoveAuxiliaryHint( unsigned int id )
+{
+  return false;
+}
+
+bool WindowBaseWin::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+  return false;
+}
+
+std::string WindowBaseWin::GetAuxiliaryHintValue( unsigned int id ) const
+{
+  return std::string();
+}
+
+unsigned int WindowBaseWin::GetAuxiliaryHintId( const std::string& hint ) const
+{
+  return 0;
+}
+
+void WindowBaseWin::SetInputRegion( const Rect< int >& inputRegion )
+{
+}
+
+void WindowBaseWin::SetType( Dali::Window::Type type )
+{
+}
+
+bool WindowBaseWin::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
+{
+  return false;
+}
+
+Dali::Window::NotificationLevel::Type WindowBaseWin::GetNotificationLevel() const
+{
+  return Dali::Window::NotificationLevel::NONE;
+}
+
+void WindowBaseWin::SetOpaqueState( bool opaque )
+{
+}
+
+bool WindowBaseWin::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
+{
+  return false;
+}
+
+Dali::Window::ScreenOffMode::Type WindowBaseWin::GetScreenOffMode() const
+{
+  return Dali::Window::ScreenOffMode::TIMEOUT;
+}
+
+bool WindowBaseWin::SetBrightness( int brightness )
+{
+  return false;
+}
+
+int WindowBaseWin::GetBrightness() const
+{
+  return 0;
+}
+
+bool WindowBaseWin::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
+{
+  return false;
+}
+
+bool WindowBaseWin::UngrabKey( Dali::KEY key )
+{
+  return false;
+}
+
+bool WindowBaseWin::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
+{
+  return false;
+}
+
+bool WindowBaseWin::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
+{
+  return false;
+}
+
+void WindowBaseWin::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
+{
+  // calculate DPI 
+  float xres, yres;
+
+  //// 1 inch = 25.4 millimeters
+  WindowsPlatformImplement::GetDPI( xres, yres );
+
+  xres *= 1.5;
+  yres *= 1.5;
+
+  dpiHorizontal = int( xres + 0.5f );  // rounding
+  dpiVertical = int( yres + 0.5f );
+}
+
+void WindowBaseWin::SetViewMode( ViewMode viewMode )
+{
+}
+
+int WindowBaseWin::GetScreenRotationAngle()
+{
+  return 0;
+}
+
+void WindowBaseWin::SetWindowRotationAngle( int degree )
+{
+}
+
+void WindowBaseWin::WindowRotationCompleted( int degree, int width, int height )
+{
+}
+
+void WindowBaseWin::SetTransparency( bool transparent )
+{
+}
+
+unsigned int WindowBaseWin::GetSurfaceId( Any surface ) const
+{
+  unsigned int surfaceId = 0;
+
+  if ( surface.Empty() == false )
+  {
+    // check we have a valid type
+    DALI_ASSERT_ALWAYS( ( (surface.GetType() == typeid ( winWindow ) ) || (surface.GetType() == typeid ( Win_Window_Handle ) ) )
+                        && "Surface type is invalid" );
+
+    if ( surface.GetType() == typeid ( Win_Window_Handle ) )
+    {
+      surfaceId = AnyCast< Win_Window_Handle >( surface );
+    }
+    else
+    {
+      surfaceId = AnyCast< winWindow >( surface );
+    }
+  }
+  return surfaceId;
+}
+
+void WindowBaseWin::CreateWinWindow( PositionSize positionSize, bool isTransparent )
+{
+  long hWnd = WindowsPlatformImplement::CreateHwnd( "Demo", "Demo", positionSize.x, positionSize.y, positionSize.width, positionSize.height, NULL );\r
+\r
+  WindowsPlatformImplement::ShowWindow( hWnd );\r
+\r
+  mWin32Window = (Win_Window_Handle)hWnd;\r
+  DALI_ASSERT_ALWAYS( mWin32Window != 0 && "There is no EcoreWin window" );
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#pragma GCC diagnostic pop
diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h
new file mode 100755 (executable)
index 0000000..381def3
--- /dev/null
@@ -0,0 +1,415 @@
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_WINDOW_BASE_WIN_H
+#define DALI_INTERNAL_WINDOWSYSTEM_WINDOW_BASE_WIN_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/window-base.h>
+#include <dali/internal/window-system/windows/platform-implement-win.h>
+#include <dali/internal/window-system/windows/event-system-win.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+class Window;
+class WindowRenderSurface;
+class WindowRenderSurfaceWin;
+
+/**
+ * WindowBaseWin class provides an WindowBase Win32 implementation.
+ */
+class WindowBaseWin : public WindowBase
+{
+public:
+
+  /**
+   * @brief Constructor
+   */
+  WindowBaseWin( PositionSize positionSize, Any surface, bool isTransparent );
+
+  /**
+   * @brief Destructor
+   */
+  virtual ~WindowBaseWin();
+
+public:
+
+  /**
+   * @brief Called when the window property is changed.
+   */
+  bool OnWindowPropertyChanged( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * Called when the window receives a delete request
+   */
+  void OnDeleteRequest();
+
+  /**
+   * @brief Called when the window gains focus.
+   */
+  void OnFocusIn( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when the window loses focus.
+   */
+  void OnFocusOut( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when the window is damaged.
+   */
+  void OnWindowDamaged( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when a touch down is received.
+   */
+  void OnMouseButtonDown( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when a touch up is received.
+   */
+  void OnMouseButtonUp( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when a touch motion is received.
+   */
+  void OnMouseButtonMove( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when a mouse wheel is received.
+   */
+  void OnMouseWheel( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when a key down is received.
+   */
+  void OnKeyDown( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when a key up is received.
+   */
+  void OnKeyUp( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when the source window notifies us the content in clipboard is selected.
+   */
+  void OnSelectionClear( void* data, int type, TWinEventInfo *event );
+
+  /**
+   * @brief Called when the source window sends us about the selected content.
+   */
+  void OnSelectionNotify( void* data, int type, TWinEventInfo *event );
+
+public:
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
+   */
+  virtual Any GetNativeWindow() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
+   */
+  virtual int GetNativeWindowId() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
+   */
+  virtual EGLNativeWindowType CreateEglWindow( int width, int height ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
+   */
+  virtual void DestroyEglWindow() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
+   */
+  virtual void SetEglWindowRotation( int angle ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
+   */
+  virtual void SetEglWindowBufferTransform( int angle ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
+   */
+  virtual void SetEglWindowTransform( int angle ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
+   */
+  virtual void ResizeEglWindow( PositionSize positionSize ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
+   */
+  virtual bool IsEglWindowRotationSupported() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::Move()
+   */
+  virtual void Move( PositionSize positionSize ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
+   */
+  virtual void Resize( PositionSize positionSize ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
+   */
+  virtual void MoveResize( PositionSize positionSize ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::ShowIndicator()
+   */
+  virtual void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetIndicatorProperties()
+   */
+  virtual void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::IndicatorTypeChanged()
+   */
+  virtual void IndicatorTypeChanged( IndicatorInterface::Type type ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
+   */
+  virtual void SetClass( const std::string& name, const std::string& className ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
+   */
+  virtual void Raise() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
+   */
+  virtual void Lower() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
+   */
+  virtual void Activate() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableOrientations()
+   */
+  virtual void SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredOrientation()
+   */
+  virtual void SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
+   */
+  virtual void SetAcceptFocus( bool accept ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::Show()
+   */
+  virtual void Show() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
+   */
+  virtual void Hide() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
+   */
+  virtual unsigned int GetSupportedAuxiliaryHintCount() const override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
+   */
+  virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
+   */
+  virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
+   */
+  virtual bool RemoveAuxiliaryHint( unsigned int id ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
+   */
+  virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
+   */
+  virtual std::string GetAuxiliaryHintValue( unsigned int id ) const override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
+   */
+  virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
+   */
+  virtual void SetInputRegion( const Rect< int >& inputRegion ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
+   */
+  virtual void SetType( Dali::Window::Type type ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
+   */
+  virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
+   */
+  virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
+   */
+  virtual void SetOpaqueState( bool opaque ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
+   */
+  virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
+   */
+  virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
+   */
+  virtual bool SetBrightness( int brightness ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
+   */
+  virtual int GetBrightness() const override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
+   */
+  virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
+   */
+  virtual bool UngrabKey( Dali::KEY key ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
+   */
+  virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
+   */
+  virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
+   */
+  virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetViewMode()
+   */
+  virtual void SetViewMode( ViewMode viewMode ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
+   */
+  virtual int GetScreenRotationAngle() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
+   */
+  virtual void SetWindowRotationAngle( int degree ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
+   */
+  virtual void WindowRotationCompleted( int degree, int width, int height ) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
+   */
+  virtual void SetTransparency( bool transparent ) override;
+
+private:
+
+  /**
+   * Second stage initialization
+   */
+  void Initialize( PositionSize positionSize, Any surface, bool isTransparent );
+
+  /**
+   * @brief Get the surface id if the surface parameter is not empty
+   * @param surface Any containing a surface id, or can be empty
+   * @return surface id, or zero if surface is empty
+   */
+  unsigned int GetSurfaceId( Any surface ) const;
+
+  /**
+   * @brief Create window
+   */
+  void CreateWinWindow( PositionSize positionSize, bool isTransparent );
+
+protected:
+
+  // Undefined
+  WindowBaseWin(const WindowBaseWin&) = delete;
+
+  // Undefined
+  WindowBaseWin& operator=(const WindowBaseWin& rhs) = delete;
+
+private:
+
+  Dali::Vector< Event_Handler >        mEventHandler;
+  Win_Window_Handle                    mWin32Window;        ///< Native window handle
+  bool                                 mOwnSurface:1;       ///< Whether we own the surface (responsible for deleting it)
+  bool                                 mIsTransparent;      ///< Whether the window is transparent (32 bit or 24 bit)
+  bool                                 mRotationAppSet:1;
+};
+
+} // namespace Adaptor
+
+} // namespace internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_WINDOW_BASE_WIN_H
diff --git a/dali/internal/window-system/windows/window-factory-win.cpp b/dali/internal/window-system/windows/window-factory-win.cpp
new file mode 100755 (executable)
index 0000000..7359548
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/windows/window-factory-win.h>
+
+// INTERNAL HEADERS
+#include <dali/internal/window-system/windows/window-base-win.h>
+#include <dali/internal/window-system/common/display-utils.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+std::unique_ptr< WindowBase > WindowFactoryWin::CreateWindowBase( Dali::PositionSize positionSize, Any surface, bool isTransparent )
+{
+  return Utils::MakeUnique< WindowBaseWin >( positionSize, surface, isTransparent );
+}
+
+std::unique_ptr< IndicatorInterface > WindowFactoryWin::CreateIndicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientation, IndicatorInterface::Observer* observer )
+{
+  return std::unique_ptr< IndicatorInterface >( nullptr );
+}
+
+// this should be created from Window impl
+std::unique_ptr< WindowFactory > GetWindowFactory()
+{
+  // returns Window factory
+  return Utils::MakeUnique< WindowFactoryWin >();
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
diff --git a/dali/internal/window-system/windows/window-factory-win.h b/dali/internal/window-system/windows/window-factory-win.h
new file mode 100755 (executable)
index 0000000..ca88e1d
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_WINDOW_FACTORY_WIN_H
+#define DALI_INTERNAL_WINDOWSYSTEM_WINDOW_FACTORY_WIN_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/internal/window-system/common/window-factory.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+
+class WindowFactoryWin : public WindowFactory
+{
+public:
+  std::unique_ptr< WindowBase > CreateWindowBase( Dali::PositionSize positionSize, Any surface, bool isTransparent ) override;
+
+  std::unique_ptr< IndicatorInterface > CreateIndicator( Adaptor* adaptor, Dali::Window::WindowOrientation orientation, IndicatorInterface::Observer* observer ) override;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_WINDOW_FACTORY_WIN_H
diff --git a/dali/internal/window-system/windows/window-system-win.cpp b/dali/internal/window-system/windows/window-system-win.cpp
new file mode 100644 (file)
index 0000000..929a26d
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL HEADERS
+#include <dali/internal/window-system/common/window-system.h>
+#include <dali/devel-api/adaptor-framework/keyboard.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace WindowSystem
+{
+
+void Initialize()
+{
+}
+
+
+void GetScreenSize( int& width, int& height )
+{
+  const char* widthValue = std::getenv( "DALI_WINDOW_WIDTH" );
+  width = widthValue ? std::atoi( widthValue ) : 720;
+
+  const char* heightValue = std::getenv( "DALI_WINDOW_WIDTH" );
+  height = heightValue ? std::atoi( heightValue ) : 480;
+}
+
+bool SetKeyboardRepeatInfo( float rate, float delay )
+{
+  return false;
+}
+
+bool GetKeyboardRepeatInfo( float& rate, float& delay )
+{
+  return false;
+}
+
+} // namespace WindowSystem
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
index c0a5651..fddd3aa 100755 (executable)
@@ -52,4 +52,4 @@
 #endif
 #endif
 
-#endif // DALI_ADAPTOR_COMMON_H
+#endif //DALI_ADAPTOR_COMMON_H