Added public API to get native window handle from Window 25/30825/2
authorRichard Huang <r.huang@samsung.com>
Tue, 25 Nov 2014 15:20:48 +0000 (15:20 +0000)
committerRichard Huang <r.huang@samsung.com>
Thu, 27 Nov 2014 10:06:25 +0000 (10:06 +0000)
Change-Id: Ib4aca5cd77d84710ce6d7f37f77104e6596ad555

adaptors/common/window-impl.h
adaptors/public-api/adaptor-framework/window.cpp
adaptors/public-api/adaptor-framework/window.h
adaptors/wayland/window-impl-wl.cpp
adaptors/x11/window-impl-x.cpp

index d0ce07b..0ba73f9 100644 (file)
@@ -161,6 +161,11 @@ public:
   Dali::DragAndDropDetector GetDragAndDropDetector() const;
 
   /**
+   * @copydoc Dali::Window::GetNativeHandle() const
+   */
+  Dali::Any GetNativeHandle() const;
+
+  /**
    * Called from Orientation after the Change signal has been sent
    */
   void RotationDone( int orientation, int width, int height );
index 31a271a..97998d0 100644 (file)
@@ -131,6 +131,11 @@ DragAndDropDetector Window::GetDragAndDropDetector() const
   return GetImplementation(*this).GetDragAndDropDetector();
 }
 
+Any Window::GetNativeHandle() const
+{
+  return GetImplementation(*this).GetNativeHandle();
+}
+
 Window::Window( Internal::Adaptor::Window* window )
 : BaseHandle( window )
 {
index 5e24855..94e749e 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/object/any.h>
 
 namespace Dali
 {
@@ -232,6 +233,13 @@ public:
    */
   DragAndDropDetector GetDragAndDropDetector() const;
 
+  /**
+   * @brief Get the native handle of the window.
+   * @return The native handle of the window or an empty handle.
+   */
+
+  Any GetNativeHandle() const;
+
 public: // Not intended for application developers
   /**
    * @brief This constructor is used by Dali::Application::GetWindow().
index 6bc1d56..e4f9f8f 100644 (file)
@@ -358,6 +358,18 @@ Dali::DragAndDropDetector Window::GetDragAndDropDetector() const
   return mDragAndDropDetector;
 }
 
+Dali::Any Window::GetNativeHandle() const
+{
+  if(mEventHandler)
+  {
+    return mEventHandler->mEcoreWindow;
+  }
+  else
+  {
+    return Dali::Any();
+  }
+}
+
 void Window::OnStart()
 {
   DoShowIndicator( mIndicatorOrientation );
index be3bf51..af157e6 100644 (file)
@@ -553,6 +553,18 @@ Dali::DragAndDropDetector Window::GetDragAndDropDetector() const
   return mDragAndDropDetector;
 }
 
+Dali::Any Window::GetNativeHandle() const
+{
+  if(mEventHandler)
+  {
+    return mEventHandler->mEcoreWindow;
+  }
+  else
+  {
+    return Dali::Any();
+  }
+}
+
 void Window::OnStart()
 {
   DoShowIndicator( mIndicatorOrientation );