bool viewmgr_pop_view(void);
/**
+ * Pops most all views from view stack till it's empty.
+ *
+ * Hides a all visible views.
+ *
+ * @return If the operation was sucessful true is returned;
+ * otherwise false is returned
+ */
+bool viewmgr_pop_all_views(void);
+
+/**
* Sets a view data to be supplied to view.
*
* If view data is setted, view data is passed to view
elm_table_padding_set(table, padding_x, padding_y);
evas_object_size_hint_weight_set(table, 0.5,
EVAS_HINT_EXPAND);
- //evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
- //evas_object_size_hint_align_set(table, 0.5, EVAS_HINT_FILL);
evas_object_show(table);
top = eina_list_data_get(vmgr->view_stack);
top->state = VIEW_STATE_VISIBLE;
top->view_class->show(top->view_data);
+ } else {
+ _INFO("No more views to pop. Exiting app.");
+ ui_app_exit();
+ return true;
}
return true;
}
+bool viewmgr_pop_all_views(void)
+{
+ struct _view_item *top = NULL;
+
+ if (!vmgr) {
+ _ERR("View manager didn't initialized.");
+ return false;
+ }
+
+ while (vmgr->view_stack) {
+
+ top = eina_list_data_get(vmgr->view_stack);
+ top->view_class->hide(top->view_data);
+ top->state = VIEW_STATE_CREATED;
+
+ vmgr->view_stack = eina_list_remove(vmgr->view_stack, top);
+
+ if (vmgr->view_stack) {
+ top = eina_list_data_get(vmgr->view_stack);
+ top->state = VIEW_STATE_VISIBLE;
+ top->view_class->show(top->view_data);
+ }
+ }
+ return true;
+}
+
bool viewmgr_set_view_data(const char *view_id, void *view_data)
{
struct _view_item *view = NULL;
const char *name;
};
+typedef struct {
+ const char *subview;
+ view_class *(*class_getter)(void);
+} subview_class_map;
+
+subview_class_map appctl_subview_values[] = {
+ {
+ .subview = "brightness",
+ .class_getter = &view_picture_brightness_get_vclass
+ },
+ {
+ .subview = "contrast",
+ .class_getter = &view_picture_contrast_get_vclass
+ },
+ {
+ .subview = "color",
+ .class_getter = &view_picture_color_get_vclass
+ },
+ {
+ .subview = "tint",
+ .class_getter = &view_picture_tint_get_vclass
+ }
+};
+
static bool _create_picture_ui(void);
static bool _create_system_ui(void);
static void _app_control(app_control_h control, void *data)
{
+ int res = APP_CONTROL_ERROR_NONE;
struct _appdata *ad;
+ char *subview = NULL;
+ view_class *v_class = NULL;
+ int i = 0;
if (!data) {
_ERR("Get data failed.");
}
ad = data;
- if (ad->win)
- elm_win_activate(ad->win);
+ elm_win_activate(ad->win);
+
+ res = app_control_get_extra_data(control, "subview", &subview);
+ if (APP_CONTROL_ERROR_NONE == res && subview) {
+ for(i = 0; i < ARRAY_SIZE(appctl_subview_values); i++) {
+ if (!strcmp(appctl_subview_values[i].subview, subview)) {
+ v_class = appctl_subview_values[i].class_getter();
+ viewmgr_pop_all_views();
+ if (!viewmgr_push_view(v_class->view_id))
+ _ERR("View %d push failed", v_class->view_id);
+ free(subview);
+ return;
+ }
+ }
+ free(subview);
+ }
if (!viewmgr_push_view(VIEW_BASE))
_ERR("Push view failed.");
return NULL;
}
- /*release changes:*/
- /* TODO: needed in temporary disabled component
- _tab_order_restore();
- */
-
priv->base = utils_add_layout(win, GRP_VIEW_BASE, EINA_TRUE);
if (!priv->base) {
_ERR("Add layout failed.");
}
for (i = 0; i < LAYOUT_MAX; i++)
- layoutmgr_add_layout(priv->lmgr, _mdata_p[i]->get_lclass(), priv->menu[i]);
+ layoutmgr_add_layout(priv->lmgr, _mdata_p[i]->get_lclass(),
+ priv->menu[i]);
priv->win = win;
priv->cur_menu = LAYOUT_MAX;