Change-Id: Id003e9c69889a823601b781af84205add7dcb0e2
Signed-off-by: SeungWon Lee <lsw2000.lee@samsung.com>
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
r = __transitionMap.Construct(0, 0, sceneHashCodeProvider, strComparer);
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
r = __transitionMap.Construct(0, 0, sceneHashCodeProvider, strComparer);
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ r = __formIdMap.Construct(0, 0, sceneHashCodeProvider, strComparer);
+ SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
r = __sceneControlEvent.Construct();
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
r = __sceneControlEvent.Construct();
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
SysTryReturnResult(NID_UI_SCENES, !isContains, E_OBJ_ALREADY_EXIST, "Specified sceneId already exist.");
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
SysTryReturnResult(NID_UI_SCENES, !isContains, E_OBJ_ALREADY_EXIST, "Specified sceneId already exist.");
+ __formIdMap.ContainsKey(formId, isContains);
+ if (panelId.IsEmpty())
+ {
+ SysTryReturnResult(NID_UI_SCENES, !isContains, E_INVALID_ARG, "Specified formId already exist. Only 'PanelScene' can share a formId for use as base form.");
+ }
+
+ if (!isContains)
+ {
+ __formIdMap.Add(formId, 1);
+ }
+ else
+ {
+ int refCount = 0;
+ __formIdMap.GetValue(formId, refCount);
+ ++refCount;
+ __formIdMap.SetValue(formId, refCount);
+ }
+
pSceneDescription = new (std::nothrow) _SceneDescription(formId, panelId);
SysTryReturnResult(NID_UI_SCENES, pSceneDescription != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
pSceneDescription = new (std::nothrow) _SceneDescription(formId, panelId);
SysTryReturnResult(NID_UI_SCENES, pSceneDescription != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
r = __sceneMap.GetValue(sceneId, pSceneDescription);
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
r = __sceneMap.GetValue(sceneId, pSceneDescription);
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ // Remove FormId from __formIdMap
+ if (pSceneDescription)
+ {
+ bool isContains = false;
+ __formIdMap.ContainsKey(pSceneDescription->formId, isContains);
+ if (isContains)
+ {
+ int refCount = 0;
+ __formIdMap.GetValue(pSceneDescription->formId, refCount);
+ --refCount;
+ if (refCount <= 0)
+ {
+ __formIdMap.Remove(pSceneDescription->formId);
+ }
+ else
+ {
+ __formIdMap.SetValue(pSceneDescription->formId, refCount);
+ }
+ }
+ }
+
r = __sceneMap.Remove(sceneId);
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
r = __sceneMap.Remove(sceneId);
SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
SysTryReturnResult(NID_UI_SCENES, !__sceneTransitionProgressing, E_IN_PROGRESS, "Previous operation in progressing");
result r = __sceneTransitionMutex.TryToAcquire();
SysTryReturnResult(NID_UI_SCENES, !__sceneTransitionProgressing, E_IN_PROGRESS, "Previous operation in progressing");
result r = __sceneTransitionMutex.TryToAcquire();
- SysLog(NID_UI_SCENES, "TryToAcquire result= %s", GetErrorMessage(r));
SysTryReturnResult(NID_UI_SCENES, r != E_OBJECT_LOCKED, E_IN_PROGRESS, "Previous operation in progressing");
SysTryReturnResult(NID_UI_SCENES, r != E_SYSTEM, E_SYSTEM, "A system error has been occurred.");
r = __sceneTransitionMutex.Acquire();
SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_SYSTEM, "A system error has been occurred. Mutex acquire failed.");
__sceneTransitionProgressing = true; //## Temporary
SysTryReturnResult(NID_UI_SCENES, r != E_OBJECT_LOCKED, E_IN_PROGRESS, "Previous operation in progressing");
SysTryReturnResult(NID_UI_SCENES, r != E_SYSTEM, E_SYSTEM, "A system error has been occurred.");
r = __sceneTransitionMutex.Acquire();
SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_SYSTEM, "A system error has been occurred. Mutex acquire failed.");
__sceneTransitionProgressing = true; //## Temporary
- SysLog(NID_UI_SCENES, "##### Mutex acquired.");
SceneId sceneId;
_SceneTransitionImpl forwardSceneTransition;
SceneId sceneId;
_SceneTransitionImpl forwardSceneTransition;
__sceneTransitionProgressing = false; //## Temporary
SysTryReturnResult(NID_UI_SCENES, !IsFailed(__sceneTransitionMutex.Release()), E_SYSTEM,
"A system error has been occurred. Mutext release failed.");
__sceneTransitionProgressing = false; //## Temporary
SysTryReturnResult(NID_UI_SCENES, !IsFailed(__sceneTransitionMutex.Release()), E_SYSTEM,
"A system error has been occurred. Mutext release failed.");
- SysLog(NID_UI_SCENES, "##### Mutex released.");
ForwardSceneTransition forwardTransition;
result r = GetSceneTransition(transitionId, forwardTransition);
ForwardSceneTransition forwardTransition;
result r = GetSceneTransition(transitionId, forwardTransition);
- SysTryReturn(NID_UI_SCENES, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturnResult(NID_UI_SCENES, !IsFailed(r), E_INVALID_ARG, "Cannot get transition from Id.");
return GoForward(forwardTransition, pArgs);
}
return GoForward(forwardTransition, pArgs);
}
IListT<SceneId>*
_SceneManagerImpl::GetSceneHistoryN(void) const
{
IListT<SceneId>*
_SceneManagerImpl::GetSceneHistoryN(void) const
{
- IListT<String>* pSceneList = null;
- pSceneList = new (std::nothrow) ArrayListT<String>;
+ std::unique_ptr<IListT<String> > pSceneList(new (std::nothrow) ArrayListT<String>);
SysTryReturn(NID_UI_SCENES, pSceneList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",
GetErrorMessage(E_OUT_OF_MEMORY));
pSceneList->AddItems(__sceneHistory);
SysTryReturn(NID_UI_SCENES, pSceneList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.",
GetErrorMessage(E_OUT_OF_MEMORY));
pSceneList->AddItems(__sceneHistory);
+ return pSceneList.release();
};
Tizen::Base::Collection::HashMapT <Tizen::Base::String, _SceneDescription*> __sceneMap;
Tizen::Base::Collection::HashMapT <Tizen::Base::String, SceneTransition*> __transitionMap;
};
Tizen::Base::Collection::HashMapT <Tizen::Base::String, _SceneDescription*> __sceneMap;
Tizen::Base::Collection::HashMapT <Tizen::Base::String, SceneTransition*> __transitionMap;
+ Tizen::Base::Collection::HashMapT <Tizen::Base::String, int> __formIdMap;
_SceneControlEvent __sceneControlEvent;
SceneId __destroyReservedScene;
_SceneControlEvent __sceneControlEvent;
SceneId __destroyReservedScene;