From bdc1081a1b7fd70be2a43decc1fef4760fe4592a Mon Sep 17 00:00:00 2001 From: Choi Munseok Date: Thu, 23 May 2013 15:26:23 +0900 Subject: [PATCH] Set the window name Change-Id: I1be9799ee2187b5ded1f51842af6657e84154fc4 Signed-off-by: Choi Munseok --- src/ui/FUi_EcoreEvas.cpp | 19 +++++++++++++++++++ src/ui/FUi_Window.cpp | 12 ++++++++++++ src/ui/inc/FUi_EcoreEvas.h | 1 + 3 files changed, 32 insertions(+) diff --git a/src/ui/FUi_EcoreEvas.cpp b/src/ui/FUi_EcoreEvas.cpp index 7952609..dc6fd54 100644 --- a/src/ui/FUi_EcoreEvas.cpp +++ b/src/ui/FUi_EcoreEvas.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "FUi_CoordinateSystemUtils.h" #include "FUi_EcoreEvas.h" @@ -1881,6 +1882,24 @@ _EcoreEvas::IsWindowActivationEnabled(const _Window& window) } void +_EcoreEvas::SetWindowName(const _Window& window, const Tizen::Base::String& name) +{ + _EflLayer* pLayer = GetEflLayer(window); + SysTryReturnVoidResult(NID_UI, pLayer, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer."); + + Evas_Object* pWinObj = pLayer->GetElmWin(); + SysTryReturnVoidResult(NID_UI, pWinObj, E_SYSTEM, "[E_SYSTEM] A system error occurred."); + + const char* windowName = _StringConverter::CopyToCharArrayN(name); + if (windowName) + { + elm_win_title_set(pWinObj, windowName); + + delete[] windowName; + } +} + +void _EcoreEvas::SetWindowType(const _Window& window, int winType) { _EflLayer* pLayer = GetEflLayer(window); diff --git a/src/ui/FUi_Window.cpp b/src/ui/FUi_Window.cpp index b017843..6c0042a 100644 --- a/src/ui/FUi_Window.cpp +++ b/src/ui/FUi_Window.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "FUi_Window.h" #include "FUi_ControlManager.h" #include "FUi_TouchManager.h" @@ -39,6 +40,7 @@ #include "FUiCtrl_FormImpl.h" #include "FUiCtrl_FrameImpl.h" +using namespace Tizen::App; using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Graphics; @@ -324,6 +326,16 @@ _Window::CreateLayer(void) __pRootVisualElement->SetName(L"Root"); + _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas(); + if (pEcoreEvas) + { + String osp(L"OSP_"); + String appName = _AppInfo::GetAppName(); + osp.Append(appName); + + pEcoreEvas->SetWindowName(*this, osp); + } + return E_SUCCESS; } diff --git a/src/ui/inc/FUi_EcoreEvas.h b/src/ui/inc/FUi_EcoreEvas.h index 7762ba1..5477e70 100644 --- a/src/ui/inc/FUi_EcoreEvas.h +++ b/src/ui/inc/FUi_EcoreEvas.h @@ -116,6 +116,7 @@ public: void SetWindowRotationBounds(const _Window& window, int rotation, const Tizen::Graphics::Rectangle& bounds); void SetWindowRotationBounds(const _Window& window, int rotation, const Tizen::Graphics::FloatRectangle& bounds); + void SetWindowName(const _Window& window, const Tizen::Base::String& name); void SetWindowType(const _Window& window, int winType); result SetFloatingMode(const _Window& window, bool enable); bool GetFloatingMode(const _Window& window) const; -- 2.7.4