From 66419859f01d346acac7c90877ee553a3435d972 Mon Sep 17 00:00:00 2001 From: Jiyun Yang Date: Wed, 12 May 2021 15:40:13 +0900 Subject: [PATCH] Window operations return detail result Change-Id: I849cb5349a093142e45edf12599588634f354233 Signed-off-by: Jiyun Yang --- .../window-system/android/window-base-android.cpp | 12 +++++------ .../window-system/android/window-base-android.h | 6 +++--- dali/internal/window-system/common/window-base.h | 6 +++--- dali/internal/window-system/common/window-impl.cpp | 10 ++++----- dali/internal/window-system/common/window-impl.h | 6 +++--- .../internal/window-system/macos/window-base-mac.h | 6 +++--- .../window-system/macos/window-base-mac.mm | 14 ++++++------- .../ecore-wl/window-base-ecore-wl.cpp | 24 +++++++++++----------- .../tizen-wayland/ecore-wl/window-base-ecore-wl.h | 6 +++--- .../ecore-wl2/window-base-ecore-wl2.cpp | 24 +++++++++++----------- .../ecore-wl2/window-base-ecore-wl2.h | 6 +++--- .../ubuntu-x11/window-base-ecore-x.cpp | 12 +++++------ .../window-system/ubuntu-x11/window-base-ecore-x.h | 6 +++--- .../window-system/windows/window-base-win.cpp | 12 +++++------ .../window-system/windows/window-base-win.h | 6 +++--- .../adaptor-framework/window-enumerations.h | 12 +++++++++++ dali/public-api/adaptor-framework/window.cpp | 8 ++++---- dali/public-api/adaptor-framework/window.h | 12 +++++------ 18 files changed, 100 insertions(+), 88 deletions(-) diff --git a/dali/internal/window-system/android/window-base-android.cpp b/dali/internal/window-system/android/window-base-android.cpp index 8ce440b..352e8c1 100644 --- a/dali/internal/window-system/android/window-base-android.cpp +++ b/dali/internal/window-system/android/window-base-android.cpp @@ -250,9 +250,9 @@ void WindowBaseAndroid::SetType(Dali::WindowType type) { } -bool WindowBaseAndroid::SetNotificationLevel(Dali::WindowNotificationLevel level) +Dali::WindowOperationResult WindowBaseAndroid::SetNotificationLevel(Dali::WindowNotificationLevel level) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } Dali::WindowNotificationLevel WindowBaseAndroid::GetNotificationLevel() const @@ -264,9 +264,9 @@ void WindowBaseAndroid::SetOpaqueState(bool opaque) { } -bool WindowBaseAndroid::SetScreenOffMode(WindowScreenOffMode screenOffMode) +Dali::WindowOperationResult WindowBaseAndroid::SetScreenOffMode(WindowScreenOffMode screenOffMode) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } WindowScreenOffMode WindowBaseAndroid::GetScreenOffMode() const @@ -274,9 +274,9 @@ WindowScreenOffMode WindowBaseAndroid::GetScreenOffMode() const return WindowScreenOffMode::TIMEOUT; } -bool WindowBaseAndroid::SetBrightness(int brightness) +Dali::WindowOperationResult WindowBaseAndroid::SetBrightness(int brightness) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } int WindowBaseAndroid::GetBrightness() const diff --git a/dali/internal/window-system/android/window-base-android.h b/dali/internal/window-system/android/window-base-android.h index 1dd4cd6..7cabb85 100644 --- a/dali/internal/window-system/android/window-base-android.h +++ b/dali/internal/window-system/android/window-base-android.h @@ -266,7 +266,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel() */ - bool SetNotificationLevel(Dali::WindowNotificationLevel level) override; + Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel() @@ -281,7 +281,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode() */ - bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override; + Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode() @@ -291,7 +291,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness() */ - bool SetBrightness(int brightness) override; + Dali::WindowOperationResult SetBrightness(int brightness) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness() diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 62a70ed..88c6d9d 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -251,7 +251,7 @@ public: /** * @copydoc Dali::Window::SetNotificationLevel() */ - virtual bool SetNotificationLevel(Dali::WindowNotificationLevel level) = 0; + virtual Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) = 0; /** * @copydoc Dali::Window::GetNotificationLevel() @@ -266,7 +266,7 @@ public: /** * @copydoc Dali::Window::SetScreenOffMode() */ - virtual bool SetScreenOffMode(WindowScreenOffMode screenOffMode) = 0; + virtual Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) = 0; /** * @copydoc Dali::Window::GetScreenOffMode() @@ -276,7 +276,7 @@ public: /** * @copydoc Dali::Window::SetBrightness() */ - virtual bool SetBrightness(int brightness) = 0; + virtual Dali::WindowOperationResult SetBrightness(int brightness) = 0; /** * @copydoc Dali::Window::GetBrightness() diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index fe37203..1c8e669 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -515,12 +515,12 @@ WindowType Window::GetType() const return mType; } -bool Window::SetNotificationLevel(WindowNotificationLevel level) +WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level) { if(mType != WindowType::NOTIFICATION) { DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType); - return false; + return WindowOperationResult::INVALID_OPERATION; } return mWindowBase->SetNotificationLevel(level); @@ -551,7 +551,7 @@ bool Window::IsOpaqueState() const return mOpaqueState; } -bool Window::SetScreenOffMode(WindowScreenOffMode screenOffMode) +WindowOperationResult Window::SetScreenOffMode(WindowScreenOffMode screenOffMode) { return mWindowBase->SetScreenOffMode(screenOffMode); } @@ -561,12 +561,12 @@ WindowScreenOffMode Window::GetScreenOffMode() const return mWindowBase->GetScreenOffMode(); } -bool Window::SetBrightness(int brightness) +WindowOperationResult 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; + return WindowOperationResult::INVALID_OPERATION; } return mWindowBase->SetBrightness(brightness); diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index cb27eb1..b162574 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -221,7 +221,7 @@ public: /** * @copydoc Dali::Window::SetNotificationLevel() */ - bool SetNotificationLevel(WindowNotificationLevel level); + WindowOperationResult SetNotificationLevel(WindowNotificationLevel level); /** * @copydoc Dali::Window::GetNotificationLevel() @@ -241,7 +241,7 @@ public: /** * @copydoc Dali::Window::SetScreenOffMode() */ - bool SetScreenOffMode(WindowScreenOffMode screenOffMode); + WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode); /** * @copydoc Dali::Window::GetScreenOffMode() @@ -251,7 +251,7 @@ public: /** * @copydoc Dali::Window::SetBrightness() */ - bool SetBrightness(int brightness); + WindowOperationResult SetBrightness(int brightness); /** * @copydoc Dali::Window::GetBrightness() diff --git a/dali/internal/window-system/macos/window-base-mac.h b/dali/internal/window-system/macos/window-base-mac.h index dc0ee59..1637f36 100644 --- a/dali/internal/window-system/macos/window-base-mac.h +++ b/dali/internal/window-system/macos/window-base-mac.h @@ -195,7 +195,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel() */ - bool SetNotificationLevel(WindowNotificationLevel level) override; + WindowOperationResult SetNotificationLevel(WindowNotificationLevel level) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel() @@ -210,7 +210,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode() */ - bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override; + WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode() @@ -220,7 +220,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness() */ - bool SetBrightness(int brightness) override; + WindowOperationResult SetBrightness(int brightness) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness() diff --git a/dali/internal/window-system/macos/window-base-mac.mm b/dali/internal/window-system/macos/window-base-mac.mm index b98f8a6..7015c2b 100644 --- a/dali/internal/window-system/macos/window-base-mac.mm +++ b/dali/internal/window-system/macos/window-base-mac.mm @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -535,9 +535,9 @@ void WindowBaseCocoa::SetType( Dali::WindowType type ) { } -bool WindowBaseCocoa::SetNotificationLevel( WindowNotificationLevel level ) +WindowOperationResult WindowBaseCocoa::SetNotificationLevel( WindowNotificationLevel level ) { - return false; + return WindowOperationResult::NOT_SUPPORTED; } WindowNotificationLevel WindowBaseCocoa::GetNotificationLevel() const @@ -549,9 +549,9 @@ void WindowBaseCocoa::SetOpaqueState( bool opaque ) { } -bool WindowBaseCocoa::SetScreenOffMode(WindowScreenOffMode screenOffMode) +WindowOperationResult WindowBaseCocoa::SetScreenOffMode(WindowScreenOffMode screenOffMode) { - return false; + return WindowOperationResult::NOT_SUPPORTED; } WindowScreenOffMode WindowBaseCocoa::GetScreenOffMode() const @@ -559,9 +559,9 @@ WindowScreenOffMode WindowBaseCocoa::GetScreenOffMode() const return WindowScreenOffMode::TIMEOUT; } -bool WindowBaseCocoa::SetBrightness( int brightness ) +WindowOperationResult WindowBaseCocoa::SetBrightness( int brightness ) { - return false; + return WindowOperationResult::NOT_SUPPORTED; } int WindowBaseCocoa::GetBrightness() const diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp index 3a07b04..c177432 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.cpp @@ -1565,7 +1565,7 @@ void WindowBaseEcoreWl::SetType(Dali::WindowType type) ecore_wl_window_type_set(mEcoreWindow, windowType); } -bool WindowBaseEcoreWl::SetNotificationLevel(Dali::WindowNotificationLevel level) +Dali::WindowOperationResult WindowBaseEcoreWl::SetNotificationLevel(Dali::WindowNotificationLevel level) { while(!mTizenPolicy) { @@ -1626,17 +1626,17 @@ bool WindowBaseEcoreWl::SetNotificationLevel(Dali::WindowNotificationLevel level if(!mNotificationLevelChangeDone) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState); - return false; + return Dali::WindowOperationResult::UNKNOWN_ERROR; } else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Permission denied! [%d]\n", level); - return false; + return Dali::WindowOperationResult::PERMISSION_DENIED; } DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel); - return true; + return Dali::WindowOperationResult::SUCCEED; } Dali::WindowNotificationLevel WindowBaseEcoreWl::GetNotificationLevel() const @@ -1713,7 +1713,7 @@ void WindowBaseEcoreWl::SetOpaqueState(bool opaque) tizen_policy_set_opaque_state(mTizenPolicy, ecore_wl_window_surface_get(mEcoreWindow), (opaque ? 1 : 0)); } -bool WindowBaseEcoreWl::SetScreenOffMode(WindowScreenOffMode screenOffMode) +Dali::WindowOperationResult WindowBaseEcoreWl::SetScreenOffMode(WindowScreenOffMode screenOffMode) { while(!mTizenPolicy) { @@ -1753,17 +1753,17 @@ bool WindowBaseEcoreWl::SetScreenOffMode(WindowScreenOffMode screenOffMode) if(!mScreenOffModeChangeDone) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState); - return false; + return Dali::WindowOperationResult::UNKNOWN_ERROR; } else if(mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode); - return false; + return Dali::WindowOperationResult::PERMISSION_DENIED; } DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode); - return true; + return Dali::WindowOperationResult::SUCCEED; } WindowScreenOffMode WindowBaseEcoreWl::GetScreenOffMode() const @@ -1809,7 +1809,7 @@ WindowScreenOffMode WindowBaseEcoreWl::GetScreenOffMode() const return screenMode; } -bool WindowBaseEcoreWl::SetBrightness(int brightness) +Dali::WindowOperationResult WindowBaseEcoreWl::SetBrightness(int brightness) { while(!mTizenDisplayPolicy) { @@ -1833,17 +1833,17 @@ bool WindowBaseEcoreWl::SetBrightness(int brightness) if(!mBrightnessChangeDone) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState); - return false; + return Dali::WindowOperationResult::UNKNOWN_ERROR; } else if(mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Permission denied! [%d]\n", brightness); - return false; + return Dali::WindowOperationResult::PERMISSION_DENIED; } DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Brightness is changed [%d]\n", mBrightness); - return true; + return Dali::WindowOperationResult::SUCCEED; } int WindowBaseEcoreWl::GetBrightness() const diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h index 8726cd4..7c3bdd7 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h @@ -333,7 +333,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel() */ - bool SetNotificationLevel(Dali::WindowNotificationLevel level) override; + Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel() @@ -348,7 +348,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode() */ - bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override; + Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode() @@ -358,7 +358,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness() */ - bool SetBrightness(int brightness) override; + Dali::WindowOperationResult SetBrightness(int brightness) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness() diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 4c91c35..69ca3c0 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -1849,7 +1849,7 @@ void WindowBaseEcoreWl2::SetType(Dali::WindowType type) ecore_wl2_window_type_set(mEcoreWindow, windowType); } -bool WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level) +Dali::WindowOperationResult WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level) { while(!mTizenPolicy) { @@ -1910,17 +1910,17 @@ bool WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel leve if(!mNotificationLevelChangeDone) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState); - return false; + Dali::WindowOperationResult::UNKNOWN_ERROR; } else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Permission denied! [%d]\n", level); - return false; + return Dali::WindowOperationResult::PERMISSION_DENIED; } DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel); - return true; + return Dali::WindowOperationResult::SUCCEED; } Dali::WindowNotificationLevel WindowBaseEcoreWl2::GetNotificationLevel() const @@ -1997,7 +1997,7 @@ void WindowBaseEcoreWl2::SetOpaqueState(bool opaque) tizen_policy_set_opaque_state(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), (opaque ? 1 : 0)); } -bool WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode) +Dali::WindowOperationResult WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode) { while(!mTizenPolicy) { @@ -2037,17 +2037,17 @@ bool WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode) if(!mScreenOffModeChangeDone) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState); - return false; + return Dali::WindowOperationResult::UNKNOWN_ERROR; } else if(mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode); - return false; + return Dali::WindowOperationResult::PERMISSION_DENIED; } DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode); - return true; + return Dali::WindowOperationResult::SUCCEED; } WindowScreenOffMode WindowBaseEcoreWl2::GetScreenOffMode() const @@ -2093,7 +2093,7 @@ WindowScreenOffMode WindowBaseEcoreWl2::GetScreenOffMode() const return screenMode; } -bool WindowBaseEcoreWl2::SetBrightness(int brightness) +Dali::WindowOperationResult WindowBaseEcoreWl2::SetBrightness(int brightness) { while(!mTizenDisplayPolicy) { @@ -2117,17 +2117,17 @@ bool WindowBaseEcoreWl2::SetBrightness(int brightness) if(!mBrightnessChangeDone) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState); - return false; + return Dali::WindowOperationResult::UNKNOWN_ERROR; } else if(mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) { DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Permission denied! [%d]\n", brightness); - return false; + return Dali::WindowOperationResult::PERMISSION_DENIED; } DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness is changed [%d]\n", mBrightness); - return true; + return Dali::WindowOperationResult::SUCCEED; } int WindowBaseEcoreWl2::GetBrightness() const diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index 66582a8..338d234 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -364,7 +364,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel() */ - bool SetNotificationLevel(Dali::WindowNotificationLevel level) override; + Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel() @@ -379,7 +379,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode() */ - bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override; + Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode() @@ -389,7 +389,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness() */ - bool SetBrightness(int brightness) override; + Dali::WindowOperationResult SetBrightness(int brightness) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness() diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index b12f37e..0eea078 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -768,9 +768,9 @@ void WindowBaseEcoreX::SetType(Dali::WindowType type) { } -bool WindowBaseEcoreX::SetNotificationLevel(Dali::WindowNotificationLevel level) +Dali::WindowOperationResult WindowBaseEcoreX::SetNotificationLevel(Dali::WindowNotificationLevel level) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } Dali::WindowNotificationLevel WindowBaseEcoreX::GetNotificationLevel() const @@ -782,9 +782,9 @@ void WindowBaseEcoreX::SetOpaqueState(bool opaque) { } -bool WindowBaseEcoreX::SetScreenOffMode(WindowScreenOffMode screenOffMode) +Dali::WindowOperationResult WindowBaseEcoreX::SetScreenOffMode(WindowScreenOffMode screenOffMode) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } WindowScreenOffMode WindowBaseEcoreX::GetScreenOffMode() const @@ -792,9 +792,9 @@ WindowScreenOffMode WindowBaseEcoreX::GetScreenOffMode() const return WindowScreenOffMode::TIMEOUT; } -bool WindowBaseEcoreX::SetBrightness(int brightness) +Dali::WindowOperationResult WindowBaseEcoreX::SetBrightness(int brightness) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } int WindowBaseEcoreX::GetBrightness() const diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 24081d6..2630578 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -267,7 +267,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel() */ - bool SetNotificationLevel(Dali::WindowNotificationLevel level) override; + Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel() @@ -282,7 +282,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode() */ - bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override; + Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode() @@ -292,7 +292,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness() */ - bool SetBrightness(int brightness) override; + Dali::WindowOperationResult SetBrightness(int brightness) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness() diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index 2b2f6bd..6382e43 100644 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -372,9 +372,9 @@ void WindowBaseWin::SetType(Dali::WindowType type) { } -bool WindowBaseWin::SetNotificationLevel(Dali::WindowNotificationLevel level) +Dali::WindowOperationResult WindowBaseWin::SetNotificationLevel(Dali::WindowNotificationLevel level) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } Dali::WindowNotificationLevel WindowBaseWin::GetNotificationLevel() const @@ -386,9 +386,9 @@ void WindowBaseWin::SetOpaqueState(bool opaque) { } -bool WindowBaseWin::SetScreenOffMode(WindowScreenOffMode screenOffMode) +Dali::WindowOperationResult WindowBaseWin::SetScreenOffMode(WindowScreenOffMode screenOffMode) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } WindowScreenOffMode WindowBaseWin::GetScreenOffMode() const @@ -396,9 +396,9 @@ WindowScreenOffMode WindowBaseWin::GetScreenOffMode() const return WindowScreenOffMode::TIMEOUT; } -bool WindowBaseWin::SetBrightness(int brightness) +Dali::WindowOperationResult WindowBaseWin::SetBrightness(int brightness) { - return false; + return Dali::WindowOperationResult::NOT_SUPPORTED; } int WindowBaseWin::GetBrightness() const diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index dedbccb..57b51c4 100644 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -254,7 +254,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel() */ - bool SetNotificationLevel(Dali::WindowNotificationLevel level) override; + Dali::WindowOperationResult SetNotificationLevel(Dali::WindowNotificationLevel level) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel() @@ -269,7 +269,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode() */ - bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override; + Dali::WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode() @@ -279,7 +279,7 @@ public: /** * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness() */ - bool SetBrightness(int brightness) override; + Dali::WindowOperationResult SetBrightness(int brightness) override; /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness() diff --git a/dali/public-api/adaptor-framework/window-enumerations.h b/dali/public-api/adaptor-framework/window-enumerations.h index 22895ca..9797af1 100644 --- a/dali/public-api/adaptor-framework/window-enumerations.h +++ b/dali/public-api/adaptor-framework/window-enumerations.h @@ -93,6 +93,18 @@ enum class WindowEffectType HIDE, ///< Window hide effect. @SINCE_2_0.0 }; +/** + * @brief An enum of window operation result. + */ +enum class WindowOperationResult +{ + UNKNOWN_ERROR = 0, ///< Failed for unknown reason. + SUCCEED, ///< Succeed. + PERMISSION_DENIED, ///< Permission denied. + NOT_SUPPORTED, ///< The operation is not supported. + INVALID_OPERATION, ///< The operation is invalid. (e.g. Try to operate to the wrong window) +}; + } // namespace Dali #endif // DALI_WINDOW_ENUMERATIONS_H diff --git a/dali/public-api/adaptor-framework/window.cpp b/dali/public-api/adaptor-framework/window.cpp index f1b67fe..0000add 100644 --- a/dali/public-api/adaptor-framework/window.cpp +++ b/dali/public-api/adaptor-framework/window.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -248,7 +248,7 @@ WindowType Window::GetType() const return GetImplementation(*this).GetType(); } -bool Window::SetNotificationLevel(WindowNotificationLevel level) +WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level) { return GetImplementation(*this).SetNotificationLevel(level); } @@ -268,7 +268,7 @@ bool Window::IsOpaqueState() const return GetImplementation(*this).IsOpaqueState(); } -bool Window::SetScreenOffMode(WindowScreenOffMode screenMode) +WindowOperationResult Window::SetScreenOffMode(WindowScreenOffMode screenMode) { return GetImplementation(*this).SetScreenOffMode(screenMode); } @@ -278,7 +278,7 @@ WindowScreenOffMode Window::GetScreenOffMode() const return GetImplementation(*this).GetScreenOffMode(); } -bool Window::SetBrightness(int brightness) +WindowOperationResult Window::SetBrightness(int brightness) { return GetImplementation(*this).SetBrightness(brightness); } diff --git a/dali/public-api/adaptor-framework/window.h b/dali/public-api/adaptor-framework/window.h index 759dfcd..e0c8d34 100644 --- a/dali/public-api/adaptor-framework/window.h +++ b/dali/public-api/adaptor-framework/window.h @@ -420,12 +420,12 @@ public: * @brief Sets a priority level for the specified notification window. * @@SINCE_2_0.0 * @param[in] level The notification window level. - * @return True if no error occurred, false otherwise. + * @return The result of the window operation. * @PRIVLEVEL_PUBLIC * @PRIVILEGE_WINDOW_PRIORITY * @remarks This can be used for a notification type window only. The default level is NotificationLevel::NONE. */ - bool SetNotificationLevel(WindowNotificationLevel level); + WindowOperationResult SetNotificationLevel(WindowNotificationLevel level); /** * @brief Gets a priority level for the specified notification window. @@ -462,11 +462,11 @@ public: * If the window is no longer shown, then the window manager requests the display system to go back to normal operation. * @@SINCE_2_0.0 * @param[in] screenOffMode The screen mode. - * @return True if no error occurred, false otherwise. + * @return The result of the window operation. * @PRIVLEVEL_PUBLIC * @PRIVILEGE_DISPLAY */ - bool SetScreenOffMode(WindowScreenOffMode screenOffMode); + WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode); /** * @brief Gets a screen off mode of the window. @@ -483,11 +483,11 @@ public: * A value less than 0 results in default brightness and a value greater than 100 results in maximum brightness. * @SINCE_1_2.60 * @param[in] brightness The preferred brightness (0 to 100). - * @return True if no error occurred, false otherwise. + * @return The result of the window operation. * @PRIVLEVEL_PUBLIC * @PRIVILEGE_DISPLAY */ - bool SetBrightness(int brightness); + WindowOperationResult SetBrightness(int brightness); /** * @brief Gets preferred brightness of the window. -- 2.7.4