Set the window name
authorChoi Munseok <ms47.choi@samsung.com>
Thu, 23 May 2013 06:26:23 +0000 (15:26 +0900)
committerChoi Munseok <ms47.choi@samsung.com>
Thu, 23 May 2013 06:26:23 +0000 (15:26 +0900)
Change-Id: I1be9799ee2187b5ded1f51842af6657e84154fc4
Signed-off-by: Choi Munseok <ms47.choi@samsung.com>
src/ui/FUi_EcoreEvas.cpp
src/ui/FUi_Window.cpp
src/ui/inc/FUi_EcoreEvas.h

index 7952609..dc6fd54 100644 (file)
@@ -34,6 +34,7 @@
 #include <FBaseSysLog.h>
 #include <FBaseRtThread.h>
 #include <FApp_IActiveWindowEventListener.h>
+#include <FBase_StringConverter.h>
 #include <FGrp_CanvasImpl.h>
 #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);
index b017843..6c0042a 100644 (file)
@@ -25,6 +25,7 @@
 #include <FUiWindow.h>
 #include <FBase_Log.h>
 #include <FBaseColArrayListT.h>
+#include <FApp_AppInfo.h>
 #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;
 }
 
index 7762ba1..5477e70 100644 (file)
@@ -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;