virtual Evas_Object *onWindowCreate();
private:
+ void onFocused(Evas_Object *obj, void *eventInfo);
+ void onUnfocused(Evas_Object *obj, void *eventInfo);
+ void onRotationChanged(Evas_Object *obj, void *eventInfo);
void onBackPressed(Evas_Object *obj, void *eventInfo);
void onMenuPressed(Evas_Object *obj, void *eventInfo);
- void onRotationChanged(Evas_Object *obj, void *eventInfo);
Evas_Object *m_Conform;
Evas_Object *m_Layout;
void Window::attachView(View *view)
{
- elm_object_part_content_set(m_Layout, "elm.swallow.content", view->create(m_Layout));
- view->onNavigation(true, elm_win_rotation_get(getEvasObject()));
m_MainView = view;
+ elm_object_part_content_set(m_Layout, "elm.swallow.content", m_MainView->create(m_Layout));
+ if (elm_win_focus_get(getEvasObject())) {
+ m_MainView->onNavigation(true, elm_win_rotation_get(getEvasObject()));
+ }
}
Evas_Object *Window::onCreate(Evas_Object *parent)
evas_object_show(bg);
elm_object_part_content_set(m_Layout, "elm.swallow.bg", bg);
+ evas_object_smart_callback_add(window, "focused",
+ makeCallback(&Window::onFocused), this);
+ evas_object_smart_callback_add(window, "unfocused",
+ makeCallback(&Window::onUnfocused), this);
evas_object_smart_callback_add(window, "rotation,changed",
makeCallback(&Window::onRotationChanged), this);
+
eext_object_event_callback_add(m_Layout, EEXT_CALLBACK_BACK,
makeCallback(&Window::onBackPressed), this);
eext_object_event_callback_add(m_Layout, EEXT_CALLBACK_MORE,
return window;
}
-void Window::onBackPressed(Evas_Object *obj, void *eventInfo)
+void Window::onFocused(Evas_Object *obj, void *eventInfo)
{
- if (!m_MainView || m_MainView->onBackPressed()) {
- elm_win_lower(getEvasObject());
+ if (m_MainView) {
+ m_MainView->onNavigation(true, elm_win_rotation_get(getEvasObject()));
}
}
-void Window::onMenuPressed(Evas_Object *obj, void *eventInfo)
+void Window::onUnfocused(Evas_Object *obj, void *eventInfo)
{
if (m_MainView) {
- m_MainView->onMenuPressed();
+ m_MainView->onNavigation(false, elm_win_rotation_get(getEvasObject()));
}
}
{
m_MainView->onRotation(elm_win_rotation_get(obj));
}
+
+void Window::onBackPressed(Evas_Object *obj, void *eventInfo)
+{
+ if (!m_MainView || m_MainView->onBackPressed()) {
+ elm_win_lower(getEvasObject());
+ }
+}
+
+void Window::onMenuPressed(Evas_Object *obj, void *eventInfo)
+{
+ if (m_MainView) {
+ m_MainView->onMenuPressed();
+ }
+}