[dali_1.2.40] Merge branch 'devel/master' 30/130230/1
authorFrancisco Santos <f1.santos@samsung.com>
Fri, 19 May 2017 12:43:59 +0000 (13:43 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Fri, 19 May 2017 12:43:59 +0000 (13:43 +0100)
Change-Id: Ic31d54afe7e25a14d8711a159dbcabec767d1897

19 files changed:
adaptors/common/application-impl.cpp
adaptors/common/window-impl.h
adaptors/devel-api/adaptor-framework/window-devel.cpp
adaptors/devel-api/adaptor-framework/window-devel.h
adaptors/ecore/wayland/clipboard-impl-ecore-wl.cpp
adaptors/ecore/wayland/imf-manager-impl-ecore-wl.cpp
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/public-api/dali-adaptor-version.cpp
adaptors/tizen/native-image-source-impl-tizen.cpp
adaptors/wayland/clipboard/clipboard-impl-wl.cpp
adaptors/wayland/window-impl-wl.cpp
adaptors/x11/imf-manager-impl-x.cpp
adaptors/x11/window-impl-x.cpp
build/tizen/adaptor-uv/Makefile.am
build/tizen/adaptor/Makefile.am
packaging/dali-adaptor.spec
platform-abstractions/tizen/image-loaders/loader-jpeg-turbo.cpp
platform-abstractions/tizen/image-loaders/loader-png.cpp
text/dali/internal/text-abstraction/font-client-plugin-impl.cpp

index 8dd7597..931ba12 100644 (file)
@@ -102,10 +102,10 @@ Application::~Application()
 {
   mSingletonService.UnregisterAll();
 
-  delete mFramework;
-  delete mCommandLineOptions;
-  delete mAdaptor;
   mWindow.Reset();
+  delete mAdaptor;
+  delete mCommandLineOptions;
+  delete mFramework;
 }
 
 void Application::CreateWindow()
index 0cf251b..09a7541 100644 (file)
@@ -160,37 +160,121 @@ public:
   Dali::Any GetNativeHandle() const;
 
   /**
-   * @brief Sets whether window accepts focus or not.
-   *
-   * @param[in] accept If focus is accepted or not. Default is true.
+   * @copydoc Dali::DevelWindow::SetAcceptFocus()
    */
   void SetAcceptFocus( bool accept );
 
   /**
-   * @brief Returns whether window accepts focus or not.
-   *
-   * @param[in] window The window to accept focus
-   * @return True if the window accept focus, false otherwise
+   * @copydoc Dali::DevelWindow::IsFocusAcceptable()
    */
   bool IsFocusAcceptable();
 
   /**
-   * @brief Shows the window if it is hidden.
+   * @copydoc Dali::DevelWindow::Show()
    */
   void Show();
 
   /**
-   * @brief Hides the window if it is showing.
+   * @copydoc Dali::DevelWindow::Hide()
    */
   void Hide();
 
   /**
-   * @brief Returns whether the window is showing or not.
-   * @return True if the window is showing, false otherwise.
+   * @copydoc Dali::DevelWindow::IsVisible() const
    */
   bool IsVisible() const;
 
   /**
+   * @copydoc Dali::DevelWindow::GetSupportedAuxiliaryHintCount()
+   */
+   unsigned int GetSupportedAuxiliaryHintCount();
+
+   /**
+    * @copydoc Dali::DevelWindow::GetSupportedAuxiliaryHint()
+    */
+  std::string GetSupportedAuxiliaryHint( unsigned int index );
+
+  /**
+   * @copydoc Dali::DevelWindow::AddAuxiliaryHint()
+   */
+  unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value );
+
+  /**
+   * @copydoc Dali::DevelWindow::RemoveAuxiliaryHint()
+   */
+  bool RemoveAuxiliaryHint( unsigned int id );
+
+  /**
+   * @copydoc Dali::DevelWindow::SetAuxiliaryHintValue()
+   */
+  bool SetAuxiliaryHintValue( unsigned int id, const std::string& value );
+
+  /**
+   * @copydoc Dali::DevelWindow::GetAuxiliaryHintValue()
+   */
+  std::string GetAuxiliaryHintValue( unsigned int id ) const;
+
+  /**
+   * @copydoc Dali::DevelWindow::GetAuxiliaryHintId()
+   */
+  unsigned int GetAuxiliaryHintId( const std::string& hint ) const;
+
+  /**
+   * @copydoc Dali::DevelWindow::SetInputRegion()
+   */
+  void SetInputRegion( const Rect< int >& inputRegion );
+
+  /**
+   * @copydoc Dali::DevelWindow::SetType()
+   */
+  void SetType( Dali::DevelWindow::Type type );
+
+  /**
+   * @copydoc Dali::DevelWindow::GetType() const
+   */
+  Dali::DevelWindow::Type GetType() const;
+
+  /**
+   * @copydoc Dali::DevelWindow::SetNotificationLevel()
+   */
+  bool SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level );
+
+  /**
+   * @copydoc Dali::DevelWindow::GetNotificationLevel()
+   */
+  Dali::DevelWindow::NotificationLevel::Type GetNotificationLevel();
+
+  /**
+   * @copydoc Dali::DevelWindow::SetOpaqueState()
+   */
+  void SetOpaqueState( bool opaque );
+
+  /**
+   * @copydoc Dali::DevelWindow::IsOpaqueState()
+   */
+  bool IsOpaqueState();
+
+  /**
+   * @copydoc Dali::DevelWindow::SetScreenMode()
+   */
+  bool SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode );
+
+  /**
+   * @copydoc Dali::DevelWindow::GetScreenMode()
+   */
+  Dali::DevelWindow::ScreenMode::Type GetScreenMode();
+
+  /**
+   * @copydoc Dali::DevelWindow::SetBrightness()
+   */
+  bool SetBrightness( int brightness );
+
+  /**
+   * @copydoc Dali::DevelWindow::GetBrightness()
+   */
+  int GetBrightness();
+
+  /**
    * Called from Orientation after the Change signal has been sent
    */
   void RotationDone( int orientation, int width, int height );
@@ -297,7 +381,7 @@ public: // Signals
 
 private:
 
-  typedef std::vector< IndicatorInterface * > DiscardedIndicators;
+  typedef std::vector< std::pair< std::string, std::string > > AuxiliaryHints;
 
   RenderSurface*                   mSurface;
   Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state
@@ -309,6 +393,7 @@ private:
   bool                             mEcoreEventHander:1;
   bool                             mIsFocusAcceptable:1;
   bool                             mVisible:1;
+  bool                             mOpaqueState:1;
   IndicatorInterface*              mIndicator;
   Dali::Window::WindowOrientation  mIndicatorOrientation;
   Dali::Window::WindowOrientation  mNextIndicatorOrientation;
@@ -316,6 +401,7 @@ private:
   Integration::SystemOverlay*      mOverlay;
   Adaptor*                         mAdaptor;
   Dali::DragAndDropDetector        mDragAndDropDetector;
+  Dali::DevelWindow::Type          mType;
 
   struct EventHandler;
   EventHandler*                    mEventHandler;
@@ -324,6 +410,9 @@ private:
   std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
   Dali::Window::WindowOrientation              mPreferredOrientation;
 
+  std::vector< std::string >        mSupportedAuxiliaryHints;
+  AuxiliaryHints                    mAuxiliaryHints;
+
   // Signals
   IndicatorSignalType mIndicatorVisibilityChangedSignal;
   FocusSignalType     mFocusChangedSignal;
index 70ad18e..b6f977c 100644 (file)
@@ -55,6 +55,96 @@ bool IsVisible( Window window )
   return GetImplementation( window ).IsVisible();
 }
 
+unsigned int GetSupportedAuxiliaryHintCount( Window window )
+{
+  return GetImplementation( window ).GetSupportedAuxiliaryHintCount();
+}
+
+std::string GetSupportedAuxiliaryHint( Window window, unsigned int index )
+{
+  return GetImplementation( window ).GetSupportedAuxiliaryHint( index );
+}
+
+unsigned int AddAuxiliaryHint( Window window, const std::string& hint, const std::string& value )
+{
+  return GetImplementation( window ).AddAuxiliaryHint( hint, value );
+}
+
+bool RemoveAuxiliaryHint( Window window, unsigned int id )
+{
+  return GetImplementation( window ).RemoveAuxiliaryHint( id );
+}
+
+bool SetAuxiliaryHintValue( Window window, unsigned int id, const std::string& value )
+{
+  return GetImplementation( window ).SetAuxiliaryHintValue( id, value );
+}
+
+std::string GetAuxiliaryHintValue( Window window, unsigned int id )
+{
+  return GetImplementation( window ).GetAuxiliaryHintValue( id );
+}
+
+unsigned int GetAuxiliaryHintId( Window window, const std::string& hint )
+{
+  return GetImplementation( window ).GetAuxiliaryHintId( hint );
+}
+
+void SetInputRegion( Window window, const Rect< int >& inputRegion )
+{
+  return GetImplementation( window ).SetInputRegion( inputRegion );
+}
+
+void SetType( Window window, Type type )
+{
+  GetImplementation( window ).SetType( type );
+}
+
+Type GetType( Window window )
+{
+  return GetImplementation( window ).GetType();
+}
+
+bool SetNotificationLevel( Window window, NotificationLevel::Type level )
+{
+  return GetImplementation( window ).SetNotificationLevel( level );
+}
+
+NotificationLevel::Type GetNotificationLevel( Window window )
+{
+  return GetImplementation( window ).GetNotificationLevel();
+}
+
+void SetOpaqueState( Window window, bool opaque )
+{
+  GetImplementation( window ).SetOpaqueState( opaque );
+}
+
+bool IsOpaqueState( Window window )
+{
+  return GetImplementation( window ).IsOpaqueState();
+}
+
+bool SetScreenMode( Window window, ScreenMode::Type screenMode )
+{
+  return GetImplementation( window ).SetScreenMode( screenMode );
+}
+
+ScreenMode::Type GetScreenMode( Window window )
+{
+  return GetImplementation( window ).GetScreenMode();
+}
+
+bool SetBrightness( Window window, int brightness )
+{
+  return GetImplementation( window ).SetBrightness( brightness );
+}
+
+int GetBrightness( Window window )
+{
+  return GetImplementation( window ).GetBrightness();
+}
+
 } // namespace DevelWindow
 
 } // namespace Dali
index db6c6ac..6d07c71 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <string>
+#include <dali/public-api/math/rect.h>
+
 // INTERNAL INCLUDES
 #ifdef DALI_ADAPTOR_COMPILATION  // full path doesn't exist until adaptor is installed so we have to use relative
 #include <window.h>
@@ -31,6 +35,48 @@ namespace Dali
 namespace DevelWindow
 {
 
+namespace NotificationLevel
+{
+
+/**
+ * @brief An enum of notification window's priority level.
+ */
+enum Type
+{
+  NONE    = -1,    ///< No notification level. Default level. This value makes the notification window place in the layer of the normal window.
+  BASE    = 10,    ///< Base notification level.
+  MEDIUM  = 20,    ///< Higher notification level than base.
+  HIGH    = 30,    ///< Higher notification level than medium.
+  TOP     = 40     ///< The highest notification level.
+};
+
+} // namespace NotificationLevel
+
+namespace ScreenMode
+{
+
+/**
+ * @brief An enum of screen mode.
+ */
+enum Type
+{
+  DEFAULT,      ///< The mode which turns the screen off after a timeout.
+  ALWAYS_ON     ///< The mode which keeps the screen turned on.
+};
+
+} // namespace ScreenMode
+
+/**
+ * @brief An enum of Window types.
+ */
+enum Type
+{
+  NORMAL,           ///< A default window type. Indicates a normal, top-level window. Almost every window will be created with this type.
+  NOTIFICATION,     ///< A notification window, like a warning about battery life or a new E-Mail received.
+  UTILITY,          ///< A persistent utility window, like a toolbox or palette.
+  DIALOG            ///< Used for simple dialog windows.
+};
+
 typedef Signal< void (bool) > FocusSignalType;      ///< Window focus signal type
 
 /**
@@ -82,6 +128,171 @@ DALI_IMPORT_API void Hide( Window window );
  */
 DALI_IMPORT_API bool IsVisible( Window window );
 
+/**
+ * @brief Gets the count of supported auxiliary hints of the window.
+ * @param[in] window The window to get the hint count
+ * @return The number of supported auxiliary hints.
+ *
+ * @note The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager.
+ * If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.
+ */
+DALI_IMPORT_API unsigned int GetSupportedAuxiliaryHintCount( Window window );
+
+/**
+ * @brief Gets the supported auxiliary hint string of the window.
+ * @param[in] window The window to get the hint
+ * @param[in] index The index of the supported auxiliary hint lists
+ * @return The auxiliary hint string of the index.
+ *
+ * @note The window auxiliary hint is the value which is used to decide which actions should be made available to the user by the window manager.
+ * If you want to set specific hint to your window, then you should check whether it exists in the supported auxiliary hints.
+ */
+DALI_IMPORT_API std::string GetSupportedAuxiliaryHint( Window window, unsigned int index );
+
+/**
+ * @brief Creates an auxiliary hint of the window.
+ * @param[in] window The window to create a hint
+ * @param[in] hint The auxiliary hint string.
+ * @param[in] value The value string.
+ * @return The ID of created auxiliary hint, or @c 0 on failure.
+ */
+DALI_IMPORT_API unsigned int AddAuxiliaryHint( Window window, const std::string& hint, const std::string& value );
+
+/**
+ * @brief Removes an auxiliary hint of the window.
+ * @param[in] window The window to remove a hint
+ * @param[in] id The ID of the auxiliary hint.
+ * @return True if no error occurred, false otherwise.
+ */
+DALI_IMPORT_API bool RemoveAuxiliaryHint( Window window, unsigned int id );
+
+/**
+ * @brief Changes a value of the auxiliary hint.
+ * @param[in] window The window to set a value
+ * @param[in] id The auxiliary hint ID.
+ * @param[in] value The value string to be set.
+ * @return True if no error occurred, false otherwise.
+ */
+DALI_IMPORT_API bool SetAuxiliaryHintValue( Window window, unsigned int id, const std::string& value );
+
+/**
+ * @brief Gets a value of the auxiliary hint.
+ * @param[in] window The window to get a value
+ * @param[in] id The auxiliary hint ID.
+ * @return The string value of the auxiliary hint ID, or an empty string if none exists.
+ */
+DALI_IMPORT_API std::string GetAuxiliaryHintValue( Window window, unsigned int id );
+
+/**
+ * @brief Gets a ID of the auxiliary hint string.
+ * @param[in] window The window to get an ID
+ * @param[in] hint The auxiliary hint string.
+ * @return The ID of the auxiliary hint string, or @c 0 if none exists.
+ */
+DALI_IMPORT_API unsigned int GetAuxiliaryHintId( Window window, const std::string& hint );
+
+/**
+ * @brief Sets a region to accept input events.
+ * @param[in] window The window to set a region
+ * @param[in] inputRegion The region to accept input events.
+ */
+DALI_IMPORT_API void SetInputRegion( Window window, const Rect< int >& inputRegion );
+
+/**
+ * @brief Sets a window type.
+ * @param[in] window The window to set a type
+ * @param[in] type The window type.
+ * @remarks The default window type is NORMAL.
+ */
+DALI_IMPORT_API void SetType( Window window, Type type );
+
+/**
+ * @brief Gets a window type.
+ * @param[in] window The window to get a type
+ * @return A window type.
+ */
+DALI_IMPORT_API Type GetType( Window window );
+
+/**
+ * @brief Sets a priority level for the specified notification window.
+ * @param[in] window The window to set a notification level
+ * @param[in] level The notification window level.
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_WINDOW_PRIORITY
+ * @remarks This can be used for a notification type window only. The default level is NotificationLevel::NONE.
+ */
+DALI_IMPORT_API bool SetNotificationLevel( Window window, NotificationLevel::Type level );
+
+/**
+ * @brief Gets a priority level for the specified notification window.
+ * @param[in] window The window to get a notification level
+ * @return The notification window level.
+ * @remarks This can be used for a notification type window only.
+ */
+DALI_IMPORT_API NotificationLevel::Type GetNotificationLevel( Window window );
+
+/**
+ * @brief Sets a transparent window's visual state to opaque.
+ * @details If a visual state of a transparent window is opaque,
+ * then the window manager could handle it as an opaque window when calculating visibility.
+ * @param[in] window The window to set a state
+ * @param[in] opaque Whether the window's visual state is opaque.
+ * @remarks This will have no effect on an opaque window.
+ * It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
+ */
+DALI_IMPORT_API void SetOpaqueState( Window window, bool opaque );
+
+/**
+ * @brief Returns whether a transparent window's visual state is opaque or not.
+ * @param[in] window The window to get a state
+ * @return True if the window's visual state is opaque, false otherwise.
+ * @remarks The return value has no meaning on an opaque window.
+ */
+DALI_IMPORT_API bool IsOpaqueState( Window window );
+
+/**
+ * @brief Sets a window's screen mode.
+ * @details This API is useful when the application needs to keep the display turned on.
+ * If the application sets the screen mode to #ScreenMode::ALWAYS_ON to its window and the window is shown,
+ * the window manager requests the display system to keep the display on as long as the window is shown.
+ * If the window is no longer shown, then the window manager requests the display system to go back to normal operation.
+ * @param[in] window The window to set a screen mode
+ * @param[in] screenMode The screen mode.
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
+ */
+DALI_IMPORT_API bool SetScreenMode( Window window, ScreenMode::Type screenMode );
+
+/**
+ * @brief Gets a screen mode of the window.
+ * @param[in] window The window to get a screen mode
+ * @return The screen mode.
+ */
+DALI_IMPORT_API ScreenMode::Type GetScreenMode( Window window );
+
+/**
+ * @brief Sets preferred brightness of the window.
+ * @details This API is useful when the application needs to change the brightness of the screen when it is appeared on the screen.
+ * If the brightness has been set and the window is shown, the window manager requests the display system to change the brightness to the provided value.
+ * If the window is no longer shown, then the window manager requests the display system to go back to default brightness.
+ * A value less than 0 results in default brightness and a value greater than 100 results in maximum brightness.
+ * @param[in] window The window to set a brightness
+ * @param[in] brightness The preferred brightness (0 to 100).
+ * @return True if no error occurred, false otherwise.
+ * @PRIVLEVEL_PUBLIC
+ * @PRIVILEGE_DISPLAY
+ */
+DALI_IMPORT_API bool SetBrightness( Window window, int brightness );
+
+/**
+ * @brief Gets preffered brightness of the window.
+ * @param[in] window The window to get brightness
+ * @return The preffered brightness.
+ */
+DALI_IMPORT_API int GetBrightness( Window window );
+
 } // namespace DevelWindow
 
 } // namespace Dali
index 19e040b..b19af9b 100644 (file)
@@ -218,6 +218,7 @@ Clipboard::Clipboard(Impl* impl)
 
 Clipboard::~Clipboard()
 {
+  delete mImpl;
 }
 
 Dali::Clipboard Clipboard::Get()
index fa67134..038f6c7 100644 (file)
@@ -411,7 +411,6 @@ void ImfManager::Deactivate()
 
     Reset();
     ecore_imf_context_focus_out( mIMFContext );
-    ecore_imf_context_input_panel_hide( mIMFContext );
   }
 
   // Reset mIdleCallbackConnected
@@ -822,7 +821,6 @@ void ImfManager::HideInputPanel()
 
   if( mIMFContext )
   {
-    ecore_imf_context_focus_out( mIMFContext );
     ecore_imf_context_input_panel_hide( mIMFContext );
   }
 }
index 5c0523c..51cb650 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL HEADERS
 #include <Ecore.h>
 #include <Ecore_Wayland.h>
+#include <tizen-extension-client-protocol.h>
 
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/system-overlay.h>
@@ -48,8 +49,9 @@ namespace Internal
 {
 namespace Adaptor
 {
+
 #if defined(DEBUG_ENABLED)
-Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::Concise, false, "LOG_WINDOW");
+Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
 #endif
 
 /**
@@ -67,7 +69,20 @@ struct Window::EventHandler
     mWindowIconifyStateHandler( NULL ),
     mWindowFocusInHandler( NULL ),
     mWindowFocusOutHandler( NULL ),
-    mEcoreWindow( 0 )
+    mEcoreWindow( 0 ),
+    mDisplay( NULL ),
+    mEventQueue( NULL ),
+    mTizenPolicy( NULL ),
+    mTizenDisplayPolicy( NULL ),
+    mNotificationLevel( -1 ),
+    mNotificationChangeState( 0 ),
+    mNotificationLevelChangeDone( true ),
+    mScreenMode( 0 ),
+    mScreenModeChangeState( 0 ),
+    mScreenModeChangeDone( true ),
+    mBrightness( 0 ),
+    mBrightnessChangeState( 0 ),
+    mBrightnessChangeDone( true )
   {
     // store ecore window handle
     ECore::WindowRenderSurface* wlWindow( dynamic_cast< ECore::WindowRenderSurface * >( mWindow->mSurface ) );
@@ -83,6 +98,23 @@ struct Window::EventHandler
       mWindowFocusInHandler = ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this );
       mWindowFocusOutHandler = ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this );
     }
+
+    mDisplay = ecore_wl_display_get();
+
+    wl_display* displayWrapper = static_cast< wl_display* >( wl_proxy_create_wrapper( mDisplay ) );
+    if( displayWrapper )
+    {
+      mEventQueue = wl_display_create_queue( mDisplay );
+      if( mEventQueue )
+      {
+        wl_proxy_set_queue( reinterpret_cast< wl_proxy* >( displayWrapper ), mEventQueue );
+
+        wl_registry* registry = wl_display_get_registry( displayWrapper );
+        wl_registry_add_listener( registry, &mRegistryListener, this );
+      }
+
+      wl_proxy_wrapper_destroy( displayWrapper );
+    }
   }
 
   /**
@@ -106,6 +138,10 @@ struct Window::EventHandler
     {
       ecore_event_handler_del( mWindowFocusOutHandler );
     }
+    if( mEventQueue )
+    {
+      wl_event_queue_destroy( mEventQueue );
+    }
   }
 
   // Static methods
@@ -177,6 +213,102 @@ struct Window::EventHandler
     return ECORE_CALLBACK_PASS_ON;
   }
 
+  static void RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version )
+  {
+    Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
+
+    if( strcmp( interface, tizen_policy_interface.name ) == 0 )
+    {
+      eventHandler->mTizenPolicy = static_cast< tizen_policy* >( wl_registry_bind( registry, name, &tizen_policy_interface, version ) );
+      if( !eventHandler->mTizenPolicy )
+      {
+        DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: wl_registry_bind(tizen_policy_interface) is failed.\n" );
+        return;
+      }
+
+      tizen_policy_add_listener( eventHandler->mTizenPolicy, &eventHandler->mTizenPolicyListener, data );
+
+      DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: tizen_policy_add_listener is called.\n" );
+    }
+    else if( strcmp( interface, tizen_display_policy_interface.name ) == 0 )
+    {
+      eventHandler->mTizenDisplayPolicy = static_cast< tizen_display_policy* >( wl_registry_bind( registry, name, &tizen_display_policy_interface, version ) );
+      if( !eventHandler->mTizenDisplayPolicy )
+      {
+        DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: wl_registry_bind(tizen_display_policy_interface) is failed.\n" );
+        return;
+      }
+
+      tizen_display_policy_add_listener( eventHandler->mTizenDisplayPolicy, &eventHandler->mTizenDisplayPolicyListener, data );
+
+      DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: tizen_display_policy_add_listener is called.\n" );
+    }
+  }
+
+  static void RegistryGlobalCallbackRemove( void* data, struct wl_registry* registry, uint32_t id )
+  {
+    Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
+    eventHandler->mTizenPolicy = NULL;
+    eventHandler->mTizenDisplayPolicy = NULL;
+  }
+
+  static void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state )
+  {
+    Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
+
+    eventHandler->mNotificationLevel = level;
+    eventHandler->mNotificationChangeState = state;
+    eventHandler->mNotificationLevelChangeDone = true;
+
+    DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::TizenPolicyNotificationChangeDone: level = %d, state = %d\n", level, state );
+  }
+
+  static void TizenPolicyScreenModeChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state )
+  {
+    Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
+
+    eventHandler->mScreenMode = mode;
+    eventHandler->mScreenModeChangeState = state;
+    eventHandler->mScreenModeChangeDone = true;
+
+    DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::TizenPolicyScreenModeChangeDone: mode = %d, state = %d\n", mode, state );
+  }
+
+  static void DisplayPolicyBrightnessChangeDone(void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state )
+  {
+    Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
+
+    eventHandler->mBrightness = brightness;
+    eventHandler->mBrightnessChangeState = state;
+    eventHandler->mBrightnessChangeDone = true;
+
+    DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::DisplayPolicyBrightnessChangeDone: brightness = %d, state = %d\n", brightness, state );
+  }
+
+  const struct wl_registry_listener mRegistryListener =
+  {
+     RegistryGlobalCallback,
+     RegistryGlobalCallbackRemove
+  };
+
+  const struct tizen_policy_listener mTizenPolicyListener =
+  {
+     NULL,
+     NULL,
+     TizenPolicyNotificationChangeDone,
+     NULL,
+     TizenPolicyScreenModeChangeDone,
+     NULL,
+     NULL,
+     NULL,
+     NULL
+  };
+
+  const struct tizen_display_policy_listener mTizenDisplayPolicyListener =
+  {
+    DisplayPolicyBrightnessChangeDone
+  };
+
   // Data
   Window* mWindow;
   Ecore_Event_Handler* mWindowPropertyHandler;
@@ -184,6 +316,23 @@ struct Window::EventHandler
   Ecore_Event_Handler* mWindowFocusInHandler;
   Ecore_Event_Handler* mWindowFocusOutHandler;
   Ecore_Wl_Window* mEcoreWindow;
+
+  wl_display* mDisplay;
+  wl_event_queue* mEventQueue;
+  tizen_policy* mTizenPolicy;
+  tizen_display_policy* mTizenDisplayPolicy;
+
+  int mNotificationLevel;
+  uint32_t mNotificationChangeState;
+  bool mNotificationLevelChangeDone;
+
+  int mScreenMode;
+  uint32_t mScreenModeChangeState;
+  bool mScreenModeChangeDone;
+
+  int mBrightness;
+  uint32_t mBrightnessChangeState;
+  bool mBrightnessChangeDone;
 };
 
 Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
@@ -237,31 +386,35 @@ void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
 
   ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
   DALI_ASSERT_DEBUG(wlSurface);
-  Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
 
-  mIndicatorVisible = visibleMode;
-
-  if ( mIndicatorVisible == Dali::Window::VISIBLE )
+  if( wlSurface )
   {
-    // when the indicator is visible, set proper mode for indicator server according to bg mode
-    if ( mIndicatorOpacityMode == Dali::Window::OPAQUE )
-    {
-      ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
-    }
-    else if ( mIndicatorOpacityMode == Dali::Window::TRANSLUCENT )
+    Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+
+    mIndicatorVisible = visibleMode;
+
+    if ( mIndicatorVisible == Dali::Window::VISIBLE )
     {
-      ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSLUCENT);
+      // when the indicator is visible, set proper mode for indicator server according to bg mode
+      if ( mIndicatorOpacityMode == Dali::Window::OPAQUE )
+      {
+        ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
+      }
+      else if ( mIndicatorOpacityMode == Dali::Window::TRANSLUCENT )
+      {
+        ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSLUCENT);
+      }
+      else if ( mIndicatorOpacityMode == Dali::Window::TRANSPARENT )
+      {
+        ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
+      }
     }
-    else if ( mIndicatorOpacityMode == Dali::Window::TRANSPARENT )
+    else
     {
-      ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
+      // when the indicator is not visible, set TRANSPARENT mode for indicator server
+      ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSPARENT); // it means hidden indicator
     }
   }
-  else
-  {
-    // when the indicator is not visible, set TRANSPARENT mode for indicator server
-    ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSPARENT); // it means hidden indicator
-  }
 
   DoShowIndicator( mIndicatorOrientation );
 }
@@ -310,14 +463,18 @@ Window::Window()
   mEcoreEventHander( true ),
   mIsFocusAcceptable( true ),
   mVisible( true ),
+  mOpaqueState( false ),
   mIndicator( NULL ),
   mIndicatorOrientation( Dali::Window::PORTRAIT ),
   mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
   mIndicatorOpacityMode( Dali::Window::OPAQUE ),
   mOverlay( NULL ),
   mAdaptor( NULL ),
+  mType( Dali::DevelWindow::NORMAL ),
   mEventHandler( NULL ),
-  mPreferredOrientation( Dali::Window::PORTRAIT )
+  mPreferredOrientation( Dali::Window::PORTRAIT ),
+  mSupportedAuxiliaryHints(),
+  mAuxiliaryHints()
 {
 }
 
@@ -339,6 +496,9 @@ Window::~Window()
   }
 
   delete mSurface;
+
+  mSupportedAuxiliaryHints.clear();
+  mAuxiliaryHints.clear();
 }
 
 void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
@@ -355,6 +515,21 @@ void Window::Initialize(const PositionSize& windowPosition, const std::string& n
 
   // create event handler for Wayland window
   mEventHandler = new EventHandler( this );
+
+  // get auxiliary hint
+  Eina_List* hints = ecore_wl_window_aux_hints_supported_get( mEventHandler->mEcoreWindow );
+  if( hints )
+  {
+    Eina_List* l = NULL;
+    char* hint = NULL;
+
+    for( l = hints, ( hint =  static_cast< char* >( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( hint = static_cast< char* >( eina_list_data_get(l) ) ) )
+    {
+      mSupportedAuxiliaryHints.push_back( hint );
+
+      DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::Initialize: %s\n", hint );
+    }
+  }
 }
 
 void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
@@ -676,6 +851,518 @@ void Window::RotationDone( int orientation, int width, int height )
   ecore_wl_window_rotation_change_done_send( mEventHandler->mEcoreWindow );
 }
 
+unsigned int Window::GetSupportedAuxiliaryHintCount()
+{
+  return mSupportedAuxiliaryHints.size();
+}
+
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+{
+  if( index >= GetSupportedAuxiliaryHintCount() )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetSupportedAuxiliaryHint: Invalid index! [%d]\n", index );
+  }
+
+  return mSupportedAuxiliaryHints[index];
+}
+
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+  bool supported = false;
+
+  // Check if the hint is suppported
+  for( std::vector< std::string >::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter )
+  {
+    if( *iter == hint )
+    {
+      supported = true;
+      break;
+    }
+  }
+
+  if( !supported )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str() );
+    return 0;
+  }
+
+  // Check if the hint is already added
+  for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
+  {
+    if( mAuxiliaryHints[i].first == hint )
+    {
+      // Just change the value
+      mAuxiliaryHints[i].second = value;
+
+      DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1 );
+
+      return i + 1;   // id is index + 1
+    }
+  }
+
+  // Add the hint
+  mAuxiliaryHints.push_back( std::pair< std::string, std::string >( hint, value ) );
+
+  unsigned int id = mAuxiliaryHints.size();
+
+  ecore_wl_window_aux_hint_add( mEventHandler->mEcoreWindow, static_cast< int >( id ), hint.c_str(), value.c_str() );
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id );
+
+  return id;
+}
+
+bool Window::RemoveAuxiliaryHint( unsigned int id )
+{
+  if( id == 0 || id > mAuxiliaryHints.size() )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::RemoveAuxiliaryHint: Invalid id [%d]\n", id );
+    return false;
+  }
+
+  mAuxiliaryHints[id - 1].second = std::string();
+
+  ecore_wl_window_aux_hint_del( mEventHandler->mEcoreWindow, static_cast< int >( id ) );
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::RemoveAuxiliaryHint: id = %d, hint = %s\n", id, mAuxiliaryHints[id - 1].first.c_str() );
+
+  return true;
+}
+
+bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+  if( id == 0 || id > mAuxiliaryHints.size() )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::SetAuxiliaryHintValue: Invalid id [%d]\n", id );
+    return false;
+  }
+
+  mAuxiliaryHints[id - 1].second = value;
+
+  ecore_wl_window_aux_hint_change( mEventHandler->mEcoreWindow, static_cast< int >( id ), value.c_str() );
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
+
+  return true;
+}
+
+std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
+{
+  if( id == 0 || id > mAuxiliaryHints.size() )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::GetAuxiliaryHintValue: Invalid id [%d]\n", id );
+    return std::string();
+  }
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
+
+  return mAuxiliaryHints[id - 1].second;
+}
+
+unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
+{
+  for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
+  {
+    if( mAuxiliaryHints[i].first == hint )
+    {
+      DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintId: hint = %s, id = %d\n", hint.c_str(), i + 1 );
+      return i + 1;
+    }
+  }
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintId: Invalid hint! [%s]\n", hint.c_str() );
+
+  return 0;
+}
+
+void Window::SetInputRegion( const Rect< int >& inputRegion )
+{
+  ecore_wl_window_input_region_set( mEventHandler->mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
+}
+
+void Window::SetType( Dali::DevelWindow::Type type )
+{
+  Ecore_Wl_Window_Type windowType;
+
+  if( type != mType )
+  {
+    switch( type )
+    {
+      case Dali::DevelWindow::NORMAL:
+      {
+        windowType = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+        break;
+      }
+      case Dali::DevelWindow::NOTIFICATION:
+      {
+        windowType = ECORE_WL_WINDOW_TYPE_NOTIFICATION;
+        break;
+      }
+      case Dali::DevelWindow::UTILITY:
+      {
+        windowType = ECORE_WL_WINDOW_TYPE_UTILITY;
+        break;
+      }
+      case Dali::DevelWindow::DIALOG:
+      {
+        windowType = ECORE_WL_WINDOW_TYPE_DIALOG;
+        break;
+      }
+      default:
+      {
+        windowType = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+        break;
+      }
+    }
+
+    ecore_wl_window_type_set( mEventHandler->mEcoreWindow, windowType );
+  }
+
+  mType = type;
+}
+
+Dali::DevelWindow::Type Window::GetType() const
+{
+  return mType;
+}
+
+bool Window::SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level )
+{
+  if( mType != Dali::DevelWindow::NOTIFICATION )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
+    return false;
+  }
+
+  while( !mEventHandler->mTizenPolicy )
+  {
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+  }
+
+  int notificationLevel;
+
+  switch( level )
+  {
+    case Dali::DevelWindow::NotificationLevel::NONE:
+    {
+      notificationLevel = TIZEN_POLICY_LEVEL_NONE;
+      break;
+    }
+    case Dali::DevelWindow::NotificationLevel::BASE:
+    {
+      notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
+      break;
+    }
+    case Dali::DevelWindow::NotificationLevel::MEDIUM:
+    {
+      notificationLevel = TIZEN_POLICY_LEVEL_MEDIUM;
+      break;
+    }
+    case Dali::DevelWindow::NotificationLevel::HIGH:
+    {
+      notificationLevel = TIZEN_POLICY_LEVEL_HIGH;
+      break;
+    }
+    case Dali::DevelWindow::NotificationLevel::TOP:
+    {
+      notificationLevel = TIZEN_POLICY_LEVEL_TOP;
+      break;
+    }
+    default:
+    {
+      DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: invalid level [%d]\n", level );
+      notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
+      break;
+    }
+  }
+
+  mEventHandler->mNotificationLevelChangeDone = false;
+  mEventHandler->mNotificationChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
+
+  tizen_policy_set_notification_level( mEventHandler->mTizenPolicy, ecore_wl_window_surface_get( mEventHandler->mEcoreWindow ), notificationLevel );
+
+  int count = 0;
+
+  while( !mEventHandler->mNotificationLevelChangeDone && count < 3 )
+  {
+    ecore_wl_flush();
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+    count++;
+  }
+
+  if( !mEventHandler->mNotificationLevelChangeDone )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mEventHandler->mNotificationChangeState );
+    return false;
+  }
+  else if( mEventHandler->mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Permission denied! [%d]\n", level );
+    return false;
+  }
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Level is changed [%d]\n", mEventHandler->mNotificationLevel );
+
+  return true;
+}
+
+Dali::DevelWindow::NotificationLevel::Type Window::GetNotificationLevel()
+{
+  if( mType != Dali::DevelWindow::NOTIFICATION )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
+    return Dali::DevelWindow::NotificationLevel::NONE;
+  }
+
+  while( !mEventHandler->mTizenPolicy )
+  {
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+  }
+
+  int count = 0;
+
+  while( !mEventHandler->mNotificationLevelChangeDone && count < 3 )
+  {
+    ecore_wl_flush();
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+    count++;
+  }
+
+  if( !mEventHandler->mNotificationLevelChangeDone )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Error! [%d]\n", mEventHandler->mNotificationChangeState );
+    return Dali::DevelWindow::NotificationLevel::NONE;
+  }
+
+  Dali::DevelWindow::NotificationLevel::Type level;
+
+  switch( mEventHandler->mNotificationLevel )
+  {
+    case TIZEN_POLICY_LEVEL_NONE:
+    {
+      level = Dali::DevelWindow::NotificationLevel::NONE;
+      break;
+    }
+    case TIZEN_POLICY_LEVEL_DEFAULT:
+    {
+      level = Dali::DevelWindow::NotificationLevel::BASE;
+      break;
+    }
+    case TIZEN_POLICY_LEVEL_MEDIUM:
+    {
+      level = Dali::DevelWindow::NotificationLevel::MEDIUM;
+      break;
+    }
+    case TIZEN_POLICY_LEVEL_HIGH:
+    {
+      level = Dali::DevelWindow::NotificationLevel::HIGH;
+      break;
+    }
+    case TIZEN_POLICY_LEVEL_TOP:
+    {
+      level = Dali::DevelWindow::NotificationLevel::TOP;
+      break;
+    }
+    default:
+    {
+      DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: invalid level [%d]\n", mEventHandler->mNotificationLevel );
+      level = Dali::DevelWindow::NotificationLevel::NONE;
+      break;
+    }
+  }
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: level [%d]\n", mEventHandler->mNotificationLevel );
+
+  return level;
+}
+
+void Window::SetOpaqueState( bool opaque )
+{
+  while( !mEventHandler->mTizenPolicy )
+  {
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+  }
+
+  tizen_policy_set_opaque_state( mEventHandler->mTizenPolicy, ecore_wl_window_surface_get( mEventHandler->mEcoreWindow ), ( opaque ? 1 : 0 ) );
+
+  mOpaqueState = opaque;
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetOpaqueState: opaque = %d\n", opaque );
+}
+
+bool Window::IsOpaqueState()
+{
+  return mOpaqueState;
+}
+
+bool Window::SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode )
+{
+  while( !mEventHandler->mTizenPolicy )
+  {
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+  }
+
+  mEventHandler->mScreenModeChangeDone = false;
+  mEventHandler->mScreenModeChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
+
+  unsigned int mode = 0;
+
+  switch( screenMode )
+  {
+    case Dali::DevelWindow::ScreenMode::DEFAULT:
+    {
+      mode = 0;
+      break;
+    }
+    case Dali::DevelWindow::ScreenMode::ALWAYS_ON:
+    {
+      mode = 1;
+      break;
+    }
+  }
+
+  tizen_policy_set_window_screen_mode( mEventHandler->mTizenPolicy, ecore_wl_window_surface_get( mEventHandler->mEcoreWindow ), mode );
+
+  int count = 0;
+
+  while( !mEventHandler->mScreenModeChangeDone && count < 3 )
+  {
+    ecore_wl_flush();
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+    count++;
+  }
+
+  if( !mEventHandler->mScreenModeChangeDone )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenMode: Screen mode change is failed [%d, %d]\n", screenMode, mEventHandler->mScreenModeChangeState );
+    return false;
+  }
+  else if( mEventHandler->mScreenModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenMode: Permission denied! [%d]\n", screenMode );
+    return false;
+  }
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenMode: Screen mode is changed [%d]\n", mEventHandler->mScreenMode );
+
+  return true;
+}
+
+Dali::DevelWindow::ScreenMode::Type Window::GetScreenMode()
+{
+  while( !mEventHandler->mTizenPolicy )
+  {
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+  }
+
+  int count = 0;
+
+  while( !mEventHandler->mScreenModeChangeDone && count < 3 )
+  {
+    ecore_wl_flush();
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+    count++;
+  }
+
+  if( !mEventHandler->mScreenModeChangeDone )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetScreenMode: Error! [%d]\n", mEventHandler->mScreenModeChangeState );
+    return Dali::DevelWindow::ScreenMode::DEFAULT;
+  }
+
+  Dali::DevelWindow::ScreenMode::Type screenMode = Dali::DevelWindow::ScreenMode::DEFAULT;
+
+  switch( mEventHandler->mScreenMode )
+  {
+    case 0:
+    {
+      screenMode = Dali::DevelWindow::ScreenMode::DEFAULT;
+      break;
+    }
+    case 1:
+    {
+      screenMode = Dali::DevelWindow::ScreenMode::ALWAYS_ON;
+      break;
+    }
+  }
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetScreenMode: screen mode [%d]\n", mEventHandler->mScreenMode );
+
+  return screenMode;
+}
+
+bool Window::SetBrightness( int brightness )
+{
+  if( brightness < 0 || brightness > 100 )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Invalid brightness value [%d]\n", brightness );
+    return false;
+  }
+
+  while( !mEventHandler->mTizenDisplayPolicy )
+  {
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+  }
+
+  mEventHandler->mBrightnessChangeDone = false;
+  mEventHandler->mBrightnessChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
+
+  tizen_display_policy_set_window_brightness( mEventHandler->mTizenDisplayPolicy, ecore_wl_window_surface_get( mEventHandler->mEcoreWindow ), brightness );
+
+  int count = 0;
+
+  while( !mEventHandler->mBrightnessChangeDone && count < 3 )
+  {
+    ecore_wl_flush();
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+    count++;
+  }
+
+  if( !mEventHandler->mBrightnessChangeDone )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mEventHandler->mBrightnessChangeState );
+    return false;
+  }
+  else if( mEventHandler->mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Permission denied! [%d]\n", brightness );
+    return false;
+  }
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Brightness is changed [%d]\n", mEventHandler->mBrightness );
+
+  return true;
+}
+
+int Window::GetBrightness()
+{
+  while( !mEventHandler->mTizenDisplayPolicy )
+  {
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+  }
+
+  int count = 0;
+
+  while( !mEventHandler->mBrightnessChangeDone && count < 3 )
+  {
+    ecore_wl_flush();
+    wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
+    count++;
+  }
+
+  if( !mEventHandler->mBrightnessChangeDone )
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetBrightness: Error! [%d]\n", mEventHandler->mBrightnessChangeState );
+    return 0;
+  }
+
+  DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetBrightness: Brightness [%d]\n", mEventHandler->mBrightness );
+
+  return mEventHandler->mBrightness;
+}
+
 } // Adaptor
 } // Internal
 } // Dali
index 2ad2cd5..7ddc8c6 100644 (file)
@@ -28,7 +28,7 @@ namespace Dali
 
 const unsigned int ADAPTOR_MAJOR_VERSION = 1;
 const unsigned int ADAPTOR_MINOR_VERSION = 2;
-const unsigned int ADAPTOR_MICRO_VERSION = 39;
+const unsigned int ADAPTOR_MICRO_VERSION = 40;
 const char * const ADAPTOR_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index c0e5da5..8b24177 100755 (executable)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/gl-defines.h>
 #include <cstring>
+#include <tbm_surface_internal.h>
 
 // INTERNAL INCLUDES
 #include <gl/egl-image-extensions.h>
@@ -99,6 +100,7 @@ NativeImageSource::NativeImageSource( unsigned int width, unsigned int height, D
 
   if( mTbmSurface != NULL )
   {
+    tbm_surface_internal_ref( mTbmSurface );
     mBlendingRequired = CheckBlending( tbm_surface_get_format( mTbmSurface ) );
     mWidth = tbm_surface_get_width( mTbmSurface );
     mHeight = tbm_surface_get_height( mTbmSurface );
@@ -184,13 +186,20 @@ tbm_surface_h NativeImageSource::GetSurfaceFromAny( Any source ) const
 
 NativeImageSource::~NativeImageSource()
 {
-  if( mOwnTbmSurface && mTbmSurface != NULL )
+  if( mOwnTbmSurface )
   {
-    if( tbm_surface_destroy( mTbmSurface ) != TBM_SURFACE_ERROR_NONE )
+    if( mTbmSurface != NULL && tbm_surface_destroy( mTbmSurface ) != TBM_SURFACE_ERROR_NONE )
     {
       DALI_LOG_ERROR( "Failed to destroy tbm_surface\n" );
     }
   }
+  else
+  {
+    if( mTbmSurface != NULL )
+    {
+      tbm_surface_internal_unref( mTbmSurface );
+    }
+  }
 }
 
 Any NativeImageSource::GetNativeImageSource() const
@@ -239,7 +248,7 @@ bool NativeImageSource::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
           {
             cOffset = c*3;
             offset = cOffset + r*stride;
-            *(bufptr) = ptr[offset+2];
+            *(bufptr+cOffset) = ptr[offset+2];
             *(bufptr+cOffset+1) = ptr[offset+1];
             *(bufptr+cOffset+2) = ptr[offset];
           }
@@ -259,7 +268,7 @@ bool NativeImageSource::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
           {
             cOffset = c*4;
             offset = cOffset + r*stride;
-            *(bufptr) = ptr[offset+3];
+            *(bufptr+cOffset) = ptr[offset+3];
             *(bufptr+cOffset+1) = ptr[offset+2];
             *(bufptr+cOffset+2) = ptr[offset+1];
             *(bufptr+cOffset+3) = ptr[offset];
@@ -269,11 +278,7 @@ bool NativeImageSource::GetPixels(std::vector<unsigned char>& pixbuf, unsigned&
       }
       default:
       {
-        DALI_LOG_WARNING( "Tbm surface has unsupported pixel format.\n" );
-
-        pixbuf.resize( 0 );
-        width = 0;
-        height = 0;
+        DALI_ASSERT_ALWAYS( 0 && "Tbm surface has unsupported pixel format.\n" );
 
         return false;
       }
@@ -310,9 +315,9 @@ bool NativeImageSource::EncodeToFile(const std::string& filename) const
 
 void NativeImageSource::SetSource( Any source )
 {
-  if( mOwnTbmSurface && mTbmSurface != NULL )
+  if( mOwnTbmSurface )
   {
-    if( tbm_surface_destroy( mTbmSurface ) != TBM_SURFACE_ERROR_NONE )
+    if( mTbmSurface != NULL && tbm_surface_destroy( mTbmSurface ) != TBM_SURFACE_ERROR_NONE )
     {
       DALI_LOG_ERROR( "Failed to destroy tbm_surface\n" );
     }
@@ -320,12 +325,21 @@ void NativeImageSource::SetSource( Any source )
     mTbmSurface = NULL;
     mOwnTbmSurface = false;
   }
+  else
+  {
+    if( mTbmSurface != NULL )
+    {
+      tbm_surface_internal_unref( mTbmSurface );
+      mTbmSurface = NULL;
+    }
+  }
 
   mTbmSurface = GetSurfaceFromAny( source );
-  mSetSource = true;
 
   if( mTbmSurface != NULL )
   {
+    mSetSource = true;
+    tbm_surface_internal_ref( mTbmSurface );
     mBlendingRequired = CheckBlending( tbm_surface_get_format( mTbmSurface ) );
     mWidth = tbm_surface_get_width( mTbmSurface );
     mHeight = tbm_surface_get_height( mTbmSurface );
index 611ddf3..63588a4 100644 (file)
@@ -55,6 +55,7 @@ Clipboard::Clipboard(Impl* impl)
 
 Clipboard::~Clipboard()
 {
+  delete mImpl;
 }
 
 Dali::Clipboard Clipboard::Get()
index e9ec667..631681f 100644 (file)
@@ -111,13 +111,17 @@ Window::Window()
   mWMRotationAppSet( false ),
   mIsFocusAcceptable( true ),
   mVisible( true ),
+  mOpaqueState( false ),
   mIndicator( NULL ),
   mIndicatorOrientation( Dali::Window::PORTRAIT ),
   mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
   mIndicatorOpacityMode( Dali::Window::OPAQUE ),
   mOverlay( NULL ),
   mAdaptor( NULL ),
-  mPreferredOrientation( Dali::Window::PORTRAIT )
+  mType( Dali::DevelWindow::NORMAL ),
+  mPreferredOrientation( Dali::Window::PORTRAIT ),
+  mSupportedAuxiliaryHints(),
+  mAuxiliaryHints()
 {
   mEventHandler = NULL;
 }
@@ -310,6 +314,95 @@ void Window::RotationDone( int orientation, int width, int height )
 {
 }
 
+unsigned int Window::GetSupportedAuxiliaryHintCount()
+{
+  return 0;
+}
+
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+{
+  return std::string();
+}
+
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+  return -1;
+}
+
+bool Window::RemoveAuxiliaryHint( unsigned int id )
+{
+  return false;
+}
+
+bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+  return false;
+}
+
+std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
+{
+  return std::string();
+}
+
+unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
+{
+  return -1;
+}
+
+void Window::SetInputRegion( const Rect< int >& inputRegion )
+{
+}
+
+void Window::SetType( Dali::DevelWindow::Type type )
+{
+  mType = type;
+}
+
+Dali::DevelWindow::Type Window::GetType() const
+{
+  return mType;
+}
+
+bool Window::SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level )
+{
+  return false;
+}
+
+Dali::DevelWindow::NotificationLevel::Type Window::GetNotificationLevel()
+{
+  return Dali::DevelWindow::NotificationLevel::NONE;
+}
+
+void Window::SetOpaqueState( bool opaque )
+{
+  mOpaqueState = opaque;
+}
+
+bool Window::IsOpaqueState()
+{
+  return mOpaqueState;
+}
+
+bool Window::SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode )
+{
+  return false;
+}
+
+Dali::DevelWindow::ScreenMode::Type Window::GetScreenMode()
+{
+  return Dali::DevelWindow::ScreenMode::DEFAULT;
+}
+
+bool Window::SetBrightness( int brightness )
+{
+  return false;
+}
+
+int Window::GetBrightness()
+{
+  return 0;
+}
+
 } // Adaptor
 } // Internal
 } // Dali
index f97e687..de01b3c 100644 (file)
@@ -683,7 +683,6 @@ void ImfManager::HideInputPanel()
 
   if( mIMFContext )
   {
-    ecore_imf_context_focus_out( mIMFContext );
     ecore_imf_context_input_panel_hide( mIMFContext );
   }
 }
index 63069b2..357cafe 100644 (file)
@@ -345,14 +345,18 @@ Window::Window()
   mEcoreEventHander( true ),
   mIsFocusAcceptable( true ),
   mVisible( true ),
+  mOpaqueState( false ),
   mIndicator( NULL ),
   mIndicatorOrientation( Dali::Window::PORTRAIT ),
   mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
   mIndicatorOpacityMode( Dali::Window::OPAQUE ),
   mOverlay( NULL ),
   mAdaptor( NULL ),
+  mType( Dali::DevelWindow::NORMAL ),
   mEventHandler( NULL ),
-  mPreferredOrientation( Dali::Window::PORTRAIT )
+  mPreferredOrientation( Dali::Window::PORTRAIT ),
+  mSupportedAuxiliaryHints(),
+  mAuxiliaryHints()
 {
 
   // Detect if we're not running in a ecore main loop (e.g. libuv).
@@ -811,6 +815,94 @@ void Window::RotationDone( int orientation, int width, int height )
   }
 }
 
+unsigned int Window::GetSupportedAuxiliaryHintCount()
+{
+  return 0;
+}
+
+std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
+{
+  return std::string();
+}
+
+unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
+{
+  return -1;
+}
+
+bool Window::RemoveAuxiliaryHint( unsigned int id )
+{
+  return false;
+}
+
+bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
+{
+  return false;
+}
+
+std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
+{
+  return std::string();
+}
+
+unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
+{
+  return -1;
+}
+
+void Window::SetInputRegion( const Rect< int >& inputRegion )
+{
+}
+
+void Window::SetType( Dali::DevelWindow::Type type )
+{
+  mType = type;
+}
+
+Dali::DevelWindow::Type Window::GetType() const
+{
+  return mType;
+}
+
+bool Window::SetNotificationLevel( Dali::DevelWindow::NotificationLevel::Type level )
+{
+  return false;
+}
+
+Dali::DevelWindow::NotificationLevel::Type Window::GetNotificationLevel()
+{
+  return Dali::DevelWindow::NotificationLevel::NONE;
+}
+
+void Window::SetOpaqueState( bool opaque )
+{
+  mOpaqueState = opaque;
+}
+
+bool Window::IsOpaqueState()
+{
+  return mOpaqueState;
+}
+
+bool Window::SetScreenMode( Dali::DevelWindow::ScreenMode::Type screenMode )
+{
+  return false;
+}
+
+Dali::DevelWindow::ScreenMode::Type Window::GetScreenMode()
+{
+  return Dali::DevelWindow::ScreenMode::DEFAULT;
+}
+
+bool Window::SetBrightness( int brightness )
+{
+  return false;
+}
+
+int Window::GetBrightness()
+{
+  return 0;
+}
 
 } // Adaptor
 } // Internal
index 7747336..07d093f 100644 (file)
@@ -387,7 +387,10 @@ if !COMMON_PROFILE
 libdali_adaptor_uv_la_CXXFLAGS += -DWAYLAND_EXTENSIONS_SUPPORTED
 endif
 
-libdali_adaptor_uv_la_CFLAGS = $(libdali_adaptor_uv_la_CXXFLAGS)
+libdali_adaptor_uv_la_CFLAGS = \
+                      -Werror -Wall \
+                      -DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
+                      $(DALI_ADAPTOR_CFLAGS)
 
 libdali_adaptor_uv_la_LIBADD = \
                       $(DALICORE_LIBS) \
index 244146b..5e87579 100644 (file)
@@ -404,7 +404,10 @@ if !COMMON_PROFILE
 libdali_adaptor_la_CXXFLAGS += -DWAYLAND_EXTENSIONS_SUPPORTED
 endif
 
-libdali_adaptor_la_CFLAGS = $(libdali_adaptor_la_CXXFLAGS)
+libdali_adaptor_la_CFLAGS = \
+                      -Werror -Wall \
+                      -DDALI_COMPILATION -DDALI_ADAPTOR_COMPILATION \
+                      $(DALI_ADAPTOR_CFLAGS)
 
 libdali_adaptor_la_LIBADD = \
                       $(DALICORE_LIBS) \
index 5d006e0..18bafc7 100644 (file)
@@ -14,7 +14,7 @@
 
 Name:       dali-adaptor
 Summary:    The DALi Tizen Adaptor
-Version:    1.2.39
+Version:    1.2.40
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
index 455d1f7..067f1e2 100755 (executable)
@@ -258,7 +258,7 @@ bool LoadBitmapFromJpeg( const ResourceLoadingClient& client, const ImageLoader:
   Vector<unsigned char> jpegBuffer;
   try
   {
-    jpegBuffer.Reserve( jpegBufferSize );
+    jpegBuffer.Resize( jpegBufferSize );
   }
   catch(...)
   {
@@ -415,7 +415,7 @@ bool JpegRotate90(unsigned char *buffer, int width, int height, int bpp)
   iw = width;
   ih = height;
   Vector<unsigned char> data;
-  data.Reserve(width * height * bpp);
+  data.Resize(width * height * bpp);
   unsigned char *dataPtr = data.Begin();
   memcpy(dataPtr, buffer, width * height * bpp);
   w = ih;
@@ -492,7 +492,7 @@ bool JpegRotate270(unsigned char *buffer, int width, int height, int bpp)
   iw = width;
   ih = height;
   Vector<unsigned char> data;
-  data.Reserve(width * height * bpp);
+  data.Resize(width * height * bpp);
   unsigned char *dataPtr = data.Begin();
   memcpy(dataPtr, buffer, width * height * bpp);
   w = ih;
@@ -533,6 +533,7 @@ bool JpegRotate270(unsigned char *buffer, int width, int height, int bpp)
 bool EncodeToJpeg( const unsigned char* const pixelBuffer, Vector< unsigned char >& encodedPixels,
                    const std::size_t width, const std::size_t height, const Pixel::Format pixelFormat, unsigned quality )
 {
+
   if( !pixelBuffer )
   {
     DALI_LOG_ERROR("Null input buffer\n");
@@ -604,7 +605,7 @@ bool EncodeToJpeg( const unsigned char* const pixelBuffer, Vector< unsigned char
     // save the pixels to a persistent buffer that we own and let our cleaner
     // class clean up the buffer as it goes out of scope:
     AutoJpgMem cleaner( dstBuffer );
-    encodedPixels.Reserve( dstBufferSize );
+    encodedPixels.Resize( dstBufferSize );
     memcpy( encodedPixels.Begin(), dstBuffer, dstBufferSize );
   }
   return true;
index 47c1bf1..7d19b56 100644 (file)
@@ -366,7 +366,7 @@ namespace
       if(encoded_img)
       {
         const Vector<unsigned char>::SizeType bufferSize = encoded_img->Count();
-        encoded_img->Reserve( bufferSize + length ); //< Can throw OOM.
+        encoded_img->Resize( bufferSize + length ); //< Can throw OOM.
         unsigned char* const bufferBack = encoded_img->Begin() + bufferSize;
         memcpy(bufferBack, data, length);
       }
index 68399fc..dc09c0e 100644 (file)
@@ -1107,6 +1107,11 @@ FcPattern* FontClient::Plugin::CreateFontFamilyPattern( const FontDescription& f
   // a pattern holds a set of names, each name refers to a property of the font
   FcPattern* fontFamilyPattern = FcPatternCreate();
 
+  if( !fontFamilyPattern )
+  {
+    return NULL;
+  }
+
   // add a property to the pattern for the font family
   FcPatternAddString( fontFamilyPattern, FC_FAMILY, reinterpret_cast<const FcChar8*>( fontDescription.family.c_str() ) );