bool UiBaseKeyListenerImpl::term()
{
evas_object_del(this->keyGrabber);
+
return true;
}
bool UiBaseKeyListenerImpl::init()
{
- if (!this->viewmgr)
- {
+ if (!this->viewmgr) {
LOGE("No view manager??");
return false;
}
Evas *e = evas_object_evas_get(this->viewmgr->getWindow());
- if (!e)
- {
+ if (!e) {
LOGE("Failed to get Evas from window");
return false;
}
Evas_Object *keyGrabRect = evas_object_rectangle_add(e);
- if (!keyGrabRect)
- {
+ if (!keyGrabRect) {
LOGE("Failed to create a key grabber rectangle");
return false;
}
_keyGrabRectKeyUpCb(keyListener, ev);
}, this);
- if (!evas_object_key_grab(keyGrabRect, KEY_BACK, 0, 0, EINA_FALSE))
- {
+ if (!evas_object_key_grab(keyGrabRect, KEY_BACK, 0, 0, EINA_FALSE)) {
LOGE("Failed to grab BACK KEY(%s)\n", KEY_BACK);
evas_object_del(keyGrabRect);
return false;
}
- if (!evas_object_key_grab(keyGrabRect, KEY_BACK2, 0, 0, EINA_FALSE))
- {
+ if (!evas_object_key_grab(keyGrabRect, KEY_BACK2, 0, 0, EINA_FALSE)) {
LOGE("Failed to grab BACK KEY(%s)\n", KEY_BACK2);
evas_object_del(keyGrabRect);
return false;
bool UiBaseView::setContent(Evas_Object *content)
{
Evas_Object *pcontent = this->unsetContent();
- if (pcontent)
- {
+
+ if (pcontent) {
evas_object_del(pcontent);
}
- if (content)
- {
+
+ if (content) {
evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, _contentDelCb, this);
UiIfaceView::setContent(content);
}
+
return true;
}
Evas_Object *UiBaseView::unsetContent()
{
Evas_Object *obj = UiIfaceView::unsetContent();
- if (obj)
- {
+
+ if (obj) {
evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, _contentDelCb);
evas_object_hide(obj);
}
+
return obj;
}
Evas_Object *UiBaseView::getBase()
{
UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
- if (!viewmgr)
- {
+
+ if (!viewmgr) {
return NULL;
}
+
return viewmgr->getBase();
}
Evas_Object *UiBaseView ::getParent()
{
UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
- if (!viewmgr)
- {
+
+ if (!viewmgr) {
LOGE("Failed to get a viewmgr");
return NULL;
}
+
return viewmgr->getBase();
}
UiIfaceView::setIndicator(indicator);
UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
- if (!viewmgr)
- {
+
+ if (!viewmgr) {
LOGE("Failed to get a viewmgr");
return;
}
void UiBaseView::setEventBlock(bool block)
{
UiIfaceView::setEventBlock(block);
+
evas_object_freeze_events_set(this->getContent(), block);
}
int UiBaseView::getDegree()
{
UiBaseViewmgr *viewmgr = UI_BASE_VIEWMGR;
- if (!viewmgr)
- {
+
+ if (!viewmgr) {
LOGE("Failed to get a viewmgr");
return -1;
}
+
return elm_win_rotation_get(viewmgr->getWindow());
}
bool insertViewBefore(UiBaseView *view, UiBaseView *before);
bool insertViewAfter(UiBaseView *view, UiBaseView *after);
- Evas_Object *getBase()
- {
+ Evas_Object *getBase() {
return this->_layout;
}
- Elm_Win *getWindow()
- {
+
+ Elm_Win *getWindow() {
return this->_win;
}
- Elm_Conformant *getConformant()
- {
+
+ Elm_Conformant *getConformant() {
return this->_conform;
}
};
Elm_Layout *playout = elm_object_part_content_unset(this->_scroller, NULL);
evas_object_hide(playout);
- if (!effectLayout)
- {
+ if (!effectLayout) {
//Create and add effect_layouts in map here.
//FIXME: If we have to support many effects, this logic should be changed.
_effectMap.insert(pair<string, Elm_Layout *>("default", this->_layout));
//In case of UiBaseView, it doesn't have any base form. It uses viewmgr base instead.
Evas_Object *content;
- if (view->getBase() == this->getBase())
- {
+ if (view->getBase() == this->getBase()) {
content = view->getContent();
} else {
content = view->getBase();
Elm_Win *window = this->getWindow();
Elm_Conformant *conform = this->getConformant();
- switch (indicator)
- {
+ switch (indicator) {
case UI_VIEW_INDICATOR_DEFAULT:
elm_win_indicator_opacity_set(window, ELM_WIN_INDICATOR_OPAQUE);
elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW);
UiBaseViewmgrImpl::UiBaseViewmgrImpl(UiBaseViewmgr *viewmgr, const char *pkg, UiBaseKeyListener *keyListener)
: _viewmgr(viewmgr), _keyListener(keyListener), _transitionStyle("default")
{
- if (!pkg)
- {
+ if (!pkg) {
LOGE("Invalid package name");
return;
}
//Window
this->_win = elm_win_util_standard_add(pkg, pkg);
- if (!this->_win)
- {
+ if (!this->_win) {
LOGE("Failed to create a window (%s)", pkg);
return;
}
//FIXME: Make a method? to set available rotation degree.
//Set window rotation
- if (elm_win_wm_rotation_supported_get(this->_win))
- {
+ if (elm_win_wm_rotation_supported_get(this->_win)) {
int rots[4] =
{ 0, 90, 180, 270 };
elm_win_wm_rotation_available_rotations_set(this->_win, (const int *) (&rots), 4);
this->_viewmgr);
//FIXME: Make conformant configurable?
- if (!this->_createConformant(this->_win))
- {
+ if (!this->_createConformant(this->_win)) {
LOGE("Failed to create a conformant (%s)", pkg);
return;
}
- if (!this->_createScroller(this->_conform))
- {
+ if (!this->_createScroller(this->_conform)) {
LOGE("Failed to create a scroller (%s)", pkg);
return;
}
- if (!this->_createBaseLayout(this->_scroller, "default"))
- {
+ if (!this->_createBaseLayout(this->_scroller, "default")) {
LOGE("Failed to create a base layout (%s)", pkg);
return;
}
bool UiBaseViewmgrImpl::deactivate()
{
//FIXME: based on the profile, we should app to go behind or terminate.
- if (true)
- {
+ if (true) {
evas_object_lower(this->_win);
} else {
delete(this->_viewmgr);
UiBaseView *view = this->_viewmgr->getLastView();
//In case, if view doesn't have any transition effects.
- if (!strcmp(view->getTransitionStyle(), "none"))
- {
+ if (!strcmp(view->getTransitionStyle(), "none")) {
this->_viewmgr->popViewFinished(pview);
this->_viewmgr->popViewFinished(view);
this->_activateTopView();
bool UiBaseViewmgr::popView()
{
- if (this->getViewCount() == 1)
- {
+ if (this->getViewCount() == 1) {
this->deactivate();
return true;
}
- if(!UiIfaceViewmgr::popView())
- {
+ if(!UiIfaceViewmgr::popView()) {
return false;
}
UiView *v = dynamic_cast<UiView *>(view);
UiMenu *menu = v->onMenuPre();
if (!menu) return;
+
v->onMenu(menu);
v->onMenuPost();
}
LOGE("Failed to grab MENU KEY(%s)\n", KEY_MENU2);
return false;
}
+
return true;
}
elm_win_screen_size_get(win, NULL, NULL, &w, &h);
int rot = elm_win_rotation_get(win);
- switch (rot)
- {
+ switch (rot) {
case 0:
case 180:
evas_object_move(ctxpopup, (w / 2), h);
{
UiMenu *menu = static_cast<UiMenu *>(data);
if (!menu->isActivated()) return;
+
_updateMenu(menu);
}
{
Elm_Win *win = this->getWindow();
if (win) evas_object_event_callback_del(win, EVAS_CALLBACK_RESIZE, _winResizeCb);
+
Elm_Ctxpopup *ctxpopup = this->unsetContent();
evas_object_del(ctxpopup);
}
Elm_Win *UiMenu::getWindow()
{
UiViewmgr *viewmgr = UI_VIEWMGR;
- if (!viewmgr)
- {
+ if (!viewmgr) {
LOGE("Viewmgr is null?? menu(%p)", this);
return NULL;
}
{
bool ret = _updateMenu(this);
if (ret) dynamic_cast<UiView *>(this->getView())->onPause();
+
return ret;
}
if (!ctxpopup) return true;
- if (strcmp(evas_object_type_get(ctxpopup), "elm_ctxpopup"))
- {
+ if (strcmp(evas_object_type_get(ctxpopup), "elm_ctxpopup")) {
LOGE("Menu widget is not a ctxpopup!");
return false;
}
{
Elm_Ctxpopup *ctxpopup = this->getContent();
if (!ctxpopup) return false;
+
return evas_object_visible_get(ctxpopup);
}
Elm_Win *UiPopup::getWindow()
{
UiViewmgr *viewmgr = UI_VIEWMGR;
- if (!viewmgr)
- {
+ if (!viewmgr) {
LOGE("Viewmgr is null?? menu(%p)", this);
return NULL;
}
+
return viewmgr->getWindow();
}
bool UiPopup::deactivate()
{
Elm_Popup *popup = this->getContent();
- if (!popup)
- {
+ if (!popup) {
LOGE("Content is not set! = UiPopup(%p)", this);
return false;
}
if (!popup) return true;
- if (strcmp(evas_object_type_get(popup), "elm_popup"))
- {
+ if (strcmp(evas_object_type_get(popup), "elm_popup")) {
LOGE("Menu widget is not a popup!");
return false;
}
Elm_Toolbar *unsetToolbar();
Evas_Object *getBase();
- Elm_Button *getTitleLeftBtn()
- {
+ Elm_Button *getTitleLeftBtn() {
return this->_titleLeftBtn;
}
- Elm_Button *getTitleRightBtn()
- {
+ Elm_Button *getTitleRightBtn() {
return this->_titleRightBtn;
}
- Elm_Toolbar *getToolbar()
- {
+ Elm_Toolbar *getToolbar() {
return this->_toolbar;
}
};
#define DEFAULT_GROUP "tizen_view/default"
-#define LAYOUT_VALIDATE() if (!layout) \
- { \
- LOGE("Layout is invalid! UiStandardView(%p)", this); \
- return false; \
- }
+#define LAYOUT_VALIDATE() if (!layout) { \
+ LOGE("Layout is invalid! UiStandardView(%p)", this); \
+ return false; \
+ }
static void _titleLeftBtnDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiStandardView *view = static_cast<UiStandardView *>(data);
+
view->unsetTitleLeftBtn();
}
static void _titleRightBtnDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiStandardView *view = static_cast<UiStandardView *>(data);
+
view->unsetTitleRightBtn();
}
static void _toolbarDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
UiStandardView *view = static_cast<UiStandardView *>(data);
+
view->unsetToolbar();
}
bool UiStandardViewImpl::_destroyLayout()
{
if (!this->_layout) return false;
+
evas_object_del(this->_layout);
this->_layout = NULL;
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/ui-viewmgr.edj", EDJ_PATH);
- if (!elm_layout_file_set(layout, buf, DEFAULT_GROUP))
- {
+ if (!elm_layout_file_set(layout, buf, DEFAULT_GROUP)) {
LOGE("Failed to set file = UiStandardView(%p), path(%s), group(%s)", this, buf, DEFAULT_GROUP);
evas_object_del(layout);
return false;
}
+
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- if (this->_view->getContent())
- {
+ if (this->_view->getContent()) {
elm_object_part_content_set(layout, "elm.swallow.content", this->_view->getContent());
}
//Set software back key, if it's needed
UiViewmgr *viewmgr = UI_VIEWMGR;
- if (viewmgr && viewmgr->needSoftKey())
- {
+ if (viewmgr && viewmgr->needSoftKey()) {
Elm_Button *prevBtn = elm_button_add(layout);
- if (!prevBtn)
- {
+ if (!prevBtn) {
LOGE("Failed to create a button = UiStandardView(%p)", this);
} else {
evas_object_smart_callback_add(prevBtn, "clicked", [](void *data, Evas_Object *obj, void *event_info) -> void
LAYOUT_VALIDATE();
elm_object_part_content_set(layout, "elm.swallow.content", content);
+
if (content)
{
elm_object_signal_emit(layout, "elm.state,elm.swallow.content,show", "viewmgr");
LAYOUT_VALIDATE();
elm_object_part_text_set(layout, "elm.text.subtitle", text);
+
if (text) elm_object_signal_emit(layout, "elm,state,subtitle,show", "viewmgr");
else elm_object_signal_emit(layout, "elm,state,subtitle,hide", "viewmgr");
LAYOUT_VALIDATE();
elm_object_part_text_set(layout, "title_badge", text);
+
if (text) elm_object_signal_emit(layout, "elm,state,title_badge,show", "viewmgr");
else elm_object_signal_emit(layout, "elm,state,title_badge,hide", "viewmgr");
LAYOUT_VALIDATE();
elm_object_part_text_set(layout, "elm.text.title", text);
+
if (text) elm_object_signal_emit(layout, "elm,state,title,show", "viewmgr");
else elm_object_signal_emit(layout, "elm,state,title,hide", "viewmgr");
if (!toolbar) return true;
//FIXME: eeeek. check style?? :(
- if (!strcmp(elm_object_style_get(toolbar), "navigationbar"))
- {
+ if (!strcmp(elm_object_style_get(toolbar), "navigationbar")) {
elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_SCROLL);
elm_toolbar_align_set(toolbar, 0);
} else {
void UiStandardViewImpl::unsetContent()
{
Elm_Layout *layout = this->getBase();
- if (!layout)
- {
+ if (!layout) {
LOGE("Layout is invalid! UiStandardView(%p)", this);
return;
}
+
elm_object_part_content_unset(layout, "elm.swallow.content");
elm_object_signal_emit(layout, "elm.state,elm.swallow.content,hide", "viewmgr");
}
if (!btn) return NULL;
Elm_Layout *layout = this->getBase();
- if (!layout)
- {
+ if (!layout) {
LOGE("Layout is invalid! UiStandardView(%p)", this);
return btn;
}
if (!btn) return NULL;
Elm_Layout *layout = this->getBase();
- if (!layout)
- {
+ if (!layout) {
LOGE("Layout is invalid! UiStandardView(%p)", this);
return btn;
}
if (!toolbar) return NULL;
Elm_Layout *layout = this->getBase();
- if (!layout)
- {
+ if (!layout) {
LOGE("Layout is invalid! UiStandardView(%p)", this);
return toolbar;
}
Evas_Object *UiStandardViewImpl::getBase()
{
- if (!this->_layout)
- {
+ if (!this->_layout) {
this->_createLayout();
}
+
return this->_layout;
}
{
//FIXME: save visible, anim value. they can be used in layout created time.
Elm_Layout *layout = this->getBase();
- if (!layout)
- {
+ if (!layout) {
LOGE("Layout is invalid! UiStandardView(%p)", this);
return false;
}
- if (visible)
- {
+ if (visible) {
if (anim) elm_object_signal_emit(layout, "elm,state,title,show,anim", "viewmgr");
else elm_object_signal_emit(layout, "elm,state,title,show", "viewmgr");
} else {
bool UiStandardView::setContent(Evas_Object *content, const char *title)
{
UiView::setContent(content);
+
return this->_impl->setContent(content, title);
}
void UiStandardView::setEventBlock(bool block)
{
UiView::setEventBlock(block);
+
evas_object_freeze_events_set(this->getBase(), block);
}
bool UiViewImpl::_deactivatePopup(bool topOne)
{
- for (popupRitr it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++)
- {
+ for (popupRitr it = this->_popupList.rbegin(); it != this->_popupList.rend(); it++) {
UiPopup *popup = *it;
if (!popup->isActivated()) continue;
popup->onBack();
//deactivate only one top one? or all popups?
if (topOne) return true;
}
+
return false;
}
bool UiViewImpl::onBack()
{
//If any popup is activated, deactivate the popup first.
- if (this->_deactivatePopup(true))
- {
+ if (this->_deactivatePopup(true)) {
return false;
}
- if (this->_menu)
- {
- if (this->_menu->isActivated())
- {
+ if (this->_menu) {
+ if (this->_menu->isActivated()) {
this->_menu->onBack();
return false;
}
}
+
return true;
}
UiMenu *UiViewImpl::onMenuPre()
{
- if (!this->_menu)
- {
+ if (!this->_menu) {
this->_menu = new UiMenu(this->_view);
}
- if (this->_menu->isActivated())
- {
+ if (this->_menu->isActivated()) {
this->_menu->deactivate();
+
return NULL;
}
void UiViewImpl::onMenuPost()
{
if (!this->_menu) return;
+
this->_menu->activate();
}
{
if (!this->_menu) return;
if (!this->_menu->isActivated()) return;
+
this->_menu->onRotate(degree);
}
{
if (!this->_menu) return;
if (!this->_menu->isActivated()) return;
+
this->_menu->onPortrait();
}
{
if (!this->_menu) return;
if (!this->_menu->isActivated()) return;
+
this->_menu->onLandscape();
}
void UiView::onDeactivate()
{
this->_impl->_deactivatePopup(false);
+
UiBaseView::onDeactivate();
}
void UiView::onBack()
{
if (!this->_impl->onBack()) return;
+
UiBaseView::onBack();
}
{
//FIXME: see how to handle on_menu()
UiBaseView::onRotate(degree);
+
this->_impl->onRotate(degree);
}
{
//FIXME: see how to handle on_menu()
UiBaseView::onPortrait();
+
this->_impl->onPortrait();
}
{
//FIXME: see how to handle on_menu()
UiBaseView::onLandscape();
+
this->_impl->onLandscape();
}
int ret = ui_app_main(argc, argv, &event_callback, this);
- if (ret != APP_ERROR_NONE)
- {
+ if (ret != APP_ERROR_NONE) {
LOGE("ui_app_main() is failed. err = %d", ret);
}
UiIfaceApp::UiIfaceApp(const char *pkg, const char *locale_dir, UiIfaceViewmgr *viewmgr)
{
- if (_inst)
- {
+ if (_inst) {
LOGE("You created UiIfaceApp multiple times!!");
}
_inst = this;
void UiIfaceViewImpl::onUnload()
{
this->_state = UI_VIEW_STATE_UNLOAD;
- if (this->getRemovableContent())
- {
+ if (this->getRemovableContent()) {
this->setContent(NULL);
return;
}
void UiIfaceViewImpl::onBack()
{
UiIfaceViewmgr *viewmgr = this->_viewmgr;
- if (!viewmgr)
- {
+ if (!viewmgr) {
LOGE("Failed to get a viewmgr, view =%p", this);
return;
}
{
VIEW_ITR it;
- if (!view)
- {
+ if (!view) {
LOGE("invalid view argument. view(NULL)");
return false;
}
- if (!this->connectView(view))
- {
+ if (!this->connectView(view)) {
LOGE("connect view failed");
return false;
}
- if (this->_viewList.size() > 0)
- {
- for (it = this->_viewList.begin(); it != this->_viewList.end(); it++)
- {
- if (after == *it)
- {
+ if (this->_viewList.size() > 0) {
+ for (it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
+ if (after == *it) {
//If the after is a last item of list.
//view has to push now.
if (it == this->_viewList.end())
int nameLen = strlen(view->getName());
const char *name = view->getName();
- for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
- {
+ for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
UiIfaceView *view = *it;
const char *viewName = view->getName();
if (!viewName) continue;
int viewNameLen = strlen(viewName);
//Got you!
- if ((viewNameLen == nameLen) && !strcmp(name, viewName))
- {
+ if ((viewNameLen == nameLen) && !strcmp(name, viewName)) {
LOGE("the same name of UiIfaceView(%p) is already in this UiIfaceViewmgr(%p)", view, this);
return false;
}
UiIfaceView *last = this->_viewList.back();
//The previous view has been pushed. This should be unload.
- if (last != view)
- {
+ if (last != view) {
view->onUnload();
return true;
}
UiIfaceView *last = this->_viewList.back();
//This view has been popped. It should be destroyed.
- if (last == view)
- {
+ if (last == view) {
view->onUnload();
view->onDestroy();
delete (view);
{
//Terminate views
this->_destroying = EINA_TRUE;
- for (VIEW_RITR ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++)
- {
+ for (VIEW_RITR ritr = this->_viewList.rbegin(); ritr != this->_viewList.rend(); ritr++) {
UiIfaceView *view = *ritr;
if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) &&
- (view->getState() != UI_VIEW_STATE_UNLOAD))
- {
+ (view->getState() != UI_VIEW_STATE_UNLOAD)) {
view->onDeactivate();
}
- if (view->getState() != UI_VIEW_STATE_UNLOAD)
- {
+ if (view->getState() != UI_VIEW_STATE_UNLOAD) {
view->onUnload();
}
+
view->onDestroy();
delete (view);
}
UiIfaceView *UiIfaceViewmgrImpl::pushView(UiIfaceView *view)
{
- if (!view)
- {
+ if (!view) {
LOGE("invalid view argument. view(NULL)");
return NULL;
}
- if (!this->connectView(view))
- {
+ if (!this->connectView(view)) {
LOGE("connect view failed");
return NULL;
}
UiIfaceView *pview;
//Previous view
- if (this->_viewList.size() > 0)
- {
+ if (this->_viewList.size() > 0) {
pview = this->_viewList.back();
pview->onDeactivate();
this->setEventBlock(pview, true);
view->onLoad();
view->onDeactivate();
- if (this->_viewList.size() != 1)
- {
+ if (this->_viewList.size() != 1) {
this->setEventBlock(view, true);
}
//last page to be popped.
UiIfaceView*view = this->_viewList.back();
- if (view->getEventBlock())
- {
+ if (view->getEventBlock()) {
return false;
}
//FIXME: No more view?
- if (this->getViewCount() == 0)
- {
+ if (this->getViewCount() == 0) {
LOGE("No Views. Can't pop anymore!");
return false;
}
//This is the last page.
- if (this->getViewCount() == 1)
- {
+ if (this->getViewCount() == 1) {
//destroy viewmgr?
UiIfaceView*view = this->_viewList.back();
view->onDeactivate();
{
VIEW_ITR it;
- if (!view)
- {
+ if (!view) {
LOGE("invalid view argument. view(NULL)");
return false;
}
- if (!this->connectView(view))
- {
+ if (!this->connectView(view)) {
LOGE("connect view failed");
return false;
}
- if (this->_viewList.size() > 0)
- {
- for (it = this->_viewList.begin(); it != this->_viewList.end(); it++)
- {
- if (before == *it)
- {
+ if (this->_viewList.size() > 0) {
+ for (it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
+ if (before == *it) {
this->_viewList.insert(it, view);
return true;
UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx)
{
- if (idx < 0 || idx >= this->_viewList.size())
- {
+ if (idx < 0 || idx >= this->_viewList.size()) {
LOGE("Invalid idx(%d)! =? (idx range: %d ~ %d)", idx, 0, this->_viewList.size() - 1);
return NULL;
}
+
VIEW_ITR it = this->_viewList.begin();
advance(it, idx);
return *it;
{
int idx = 0;
- for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
- {
+ for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
if (view == *it) return idx;
++idx;
}
UiIfaceView *view = this->getLastView();
if ((view->getState() != UI_VIEW_STATE_DEACTIVATE) &&
- (view->getState() != UI_VIEW_STATE_UNLOAD))
- {
+ (view->getState() != UI_VIEW_STATE_UNLOAD)) {
view->onDeactivate();
}
- if (view->getState() != UI_VIEW_STATE_UNLOAD)
- {
+ if (view->getState() != UI_VIEW_STATE_UNLOAD) {
view->onUnload();
}
if (!name) return NULL;
int nameLen = strlen(name);
- for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++)
- {
+ for (VIEW_ITR it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
UiIfaceView *view = *it;
const char *viewName = view->getName();
if (!viewName) continue;
int viewNameLen = strlen(viewName);
//Got you!
- if ((viewNameLen == nameLen) && !strcmp(name, viewName))
- {
+ if ((viewNameLen == nameLen) && !strcmp(name, viewName)) {
return view;
}
}