static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; _elm_widget_mirrored_reload(obj); _mirrored_set(obj, elm_widget_mirrored_get(obj)); _elm_theme_object_set(obj, wd->bbl, "bubble", wd->corner, elm_widget_style_get(obj)); edje_object_part_text_set(wd->bbl, "elm.text", wd->label); if (wd->label) edje_object_signal_emit(wd->bbl, "elm,state,text,visible", "elm"); else edje_object_signal_emit(wd->bbl, "elm,state,text,hidden", "elm"); edje_object_part_text_set(wd->bbl, "elm.info", wd->info); if (wd->info) edje_object_signal_emit(wd->bbl, "elm,state,info,visible", "elm"); else edje_object_signal_emit(wd->bbl, "elm,state,info,hidden", "elm"); if (wd->content) { edje_object_part_swallow(wd->bbl, "elm.swallow.content", wd->content); edje_object_message_signal_process(wd->bbl); } if (wd->icon) edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm"); else edje_object_signal_emit(wd->bbl, "elm,state,icon,hidden", "elm"); edje_object_scale_set(wd->bbl, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); }
/** * Moves notification to orientation. * * This function moves notification to orientation * according to object RTL orientation. * * @param obj notification object. * * @param orient notification orientation. * * @internal **/ static void _notify_move_to_orientation(Evas_Object *obj) { Evas_Coord minw = -1, minh = -1; Evas_Coord x, y, w, h; double ax, ay; ELM_NOTIFY_DATA_GET(obj, sd); evas_object_geometry_get(obj, &x, &y, &w, &h); edje_object_size_min_get(sd->notify, &minw, &minh); edje_object_size_min_restricted_calc(sd->notify, &minw, &minh, minw, minh); ax = sd->horizontal_align; ay = sd->vertical_align; if ((elm_widget_mirrored_get(obj)) && (ax != ELM_NOTIFY_ALIGN_FILL)) ax = 1.0 - ax; if (ax == ELM_NOTIFY_ALIGN_FILL) minw = w; if (ay == ELM_NOTIFY_ALIGN_FILL) minh = h; x = x + ((w - minw) * ax); y = y + ((h - minh) * ay); evas_object_move(sd->notify, x, y); }
EAPI Evas_Object * elm_separator_add(Evas_Object *parent) { Evas_Object *obj; Evas *e; Widget_Data *wd; ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); ELM_SET_WIDTYPE(widtype, "separator"); wd->horizontal = EINA_FALSE; elm_widget_type_set(obj, "separator"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); elm_widget_del_hook_set(obj, _del_hook); elm_widget_theme_hook_set(obj, _theme_hook); elm_widget_can_focus_set(obj, EINA_FALSE); wd->sep = edje_object_add(e); _elm_theme_object_set(obj, wd->sep, "separator", "vertical", "default"); elm_widget_resize_object_set(obj, wd->sep); _mirrored_set(obj, elm_widget_mirrored_get(obj)); _sizing_eval(obj); return obj; }
static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; _elm_widget_mirrored_reload(obj); if (wd->scr) { Evas_Object *edj; const char *str; _mirrored_set(obj, elm_widget_mirrored_get(obj)); elm_smart_scroller_object_theme_set(obj, wd->scr, "panel", "base", elm_widget_style_get(obj)); // scale = (elm_widget_scale_get(obj) * _elm_config->scale); // edje_object_scale_set(wd->scr, scale); edj = elm_smart_scroller_edje_object_get(wd->scr); str = edje_object_data_get(edj, "focus_highlight"); if ((str) && (!strcmp(str, "on"))) elm_widget_highlight_in_theme_set(obj, EINA_TRUE); else elm_widget_highlight_in_theme_set(obj, EINA_FALSE); } _sizing_eval(obj); }
static void _val_fetch(Evas_Object *obj, Eina_Bool user_event) { Eina_Bool rtl; double posx = 0.0, posy = 0.0, pos = 0.0, val; ELM_SLIDER_DATA_GET(obj, sd); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); edje_object_part_drag_value_get (wd->resize_obj, "elm.dragable.slider", &posx, &posy); if (sd->horizontal) pos = posx; else pos = posy; rtl = elm_widget_mirrored_get(obj); if ((!rtl && sd->inverted) || (rtl && ((!sd->horizontal && sd->inverted) || (sd->horizontal && !sd->inverted)))) pos = 1.0 - pos; val = (pos * (sd->val_max - sd->val_min)) + sd->val_min; if (val != sd->val) { sd->val = val; if (user_event) { evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); if (sd->delay) ecore_timer_del(sd->delay); sd->delay = ecore_timer_add(SLIDER_DELAY_CHANGED_INTERVAL, _delay_change, obj); } } }
/** * Return Notification orientation with RTL * * This function switches-sides of notification area when in RTL mode. * * @param obj notification object. * * @param orient Original notification orientation. * * @return notification orientation with respect to the object RTL mode. * * @internal **/ static Elm_Notify_Orient _notify_orientation_with_rtl(Evas_Object *obj, Elm_Notify_Orient orient) { if (elm_widget_mirrored_get(obj)) { switch (orient) { case ELM_NOTIFY_ORIENT_LEFT: orient = ELM_NOTIFY_ORIENT_RIGHT; break; case ELM_NOTIFY_ORIENT_RIGHT: orient = ELM_NOTIFY_ORIENT_LEFT; break; case ELM_NOTIFY_ORIENT_TOP_LEFT: orient = ELM_NOTIFY_ORIENT_TOP_RIGHT; break; case ELM_NOTIFY_ORIENT_TOP_RIGHT: orient = ELM_NOTIFY_ORIENT_TOP_LEFT; break; case ELM_NOTIFY_ORIENT_BOTTOM_LEFT: orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT; break; case ELM_NOTIFY_ORIENT_BOTTOM_RIGHT: orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT; break; default: break; } } return orient; }
static void _val_set(Evas_Object *obj) { Eina_Bool rtl; double pos; ELM_SLIDER_DATA_GET(obj, sd); if (sd->val_max > sd->val_min) pos = (sd->val - sd->val_min) / (sd->val_max - sd->val_min); else pos = 0.0; if (pos < 0.0) pos = 0.0; else if (pos > 1.0) pos = 1.0; rtl = elm_widget_mirrored_get(obj); if ((!rtl && sd->inverted) || (rtl && ((!sd->horizontal && sd->inverted) || (sd->horizontal && !sd->inverted)))) pos = 1.0 - pos; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); edje_object_part_drag_value_set (wd->resize_obj, "elm.dragable.slider", pos, pos); }
static Eina_Bool _elm_table_smart_theme(Evas_Object *obj) { if (!_elm_table_parent_sc->theme(obj)) return EINA_FALSE; _mirrored_set(obj, elm_widget_mirrored_get(obj)); return EINA_TRUE; }
static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; _elm_widget_mirrored_reload(obj); _mirrored_set(obj, elm_widget_mirrored_get(obj)); _notify_theme_apply(obj); if (wd->block_events) _block_events_theme_apply(obj); edje_object_scale_set(wd->notify, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); }
static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; _elm_widget_mirrored_reload(obj); _mirrored_set(obj, elm_widget_mirrored_get(obj)); _elm_theme_object_set(obj, wd->frm, "frame", "base", elm_widget_style_get(obj)); edje_object_part_text_set(wd->frm, "elm.text", wd->label); if (wd->content) edje_object_part_swallow(wd->frm, "elm.swallow.content", wd->content); edje_object_scale_set(wd->frm, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); }
static void _theme_hook(Evas_Object *obj) { Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; _elm_widget_mirrored_reload(obj); _mirrored_set(obj, elm_widget_mirrored_get(obj)); if (wd->horizontal) _elm_theme_object_set(obj, wd->sep, "separator", "horizontal", elm_widget_style_get(obj)); else _elm_theme_object_set(obj, wd->sep, "separator", "vertical", elm_widget_style_get(obj)); edje_object_scale_set(wd->sep, elm_widget_scale_get(obj) * _elm_config->scale); _sizing_eval(obj); }
EOLIAN static Eina_Bool _elm_notify_elm_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd) { Eina_Bool int_ret = EINA_FALSE; eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply()); if (!int_ret) return EINA_FALSE; _mirrored_set(obj, elm_widget_mirrored_get(obj)); _notify_theme_apply(obj); if (sd->block_events) _block_events_theme_apply(obj); edje_object_scale_set (sd->notify, elm_widget_scale_get(obj) * elm_config_scale_get()); _sizing_eval(obj); return EINA_TRUE; }
static void _notify_theme_apply(Evas_Object *obj) { const char *style = elm_widget_style_get(obj); const char *position; double ax, ay; ELM_NOTIFY_DATA_GET(obj, sd); ax = sd->horizontal_align; ay = sd->vertical_align; if ((elm_widget_mirrored_get(obj)) && (ax != ELM_NOTIFY_ALIGN_FILL)) ax = 1.0 - ax; if (ay == 0.0) { if (ax == 0.0) position = "top_left"; else if (ax == 1.0) position = "top_right"; else position = "top"; } else if (ay == 1.0) { if (ax == 0.0) position = "bottom_left"; else if (ax == 1.0) position = "bottom_right"; else position = "bottom"; } else { if (ax == 0.0) position = "left"; else if (ax == 1.0) position = "right"; else position = "center"; } elm_widget_theme_object_set(obj, sd->notify, "notify", position, style); }
static Elm_Actionslider_Pos _get_pos_by_orientation(const Evas_Object *obj, Elm_Actionslider_Pos pos) { if (elm_widget_mirrored_get(obj)) { switch (pos) { case ELM_ACTIONSLIDER_LEFT: pos = ELM_ACTIONSLIDER_RIGHT; break; case ELM_ACTIONSLIDER_RIGHT: pos = ELM_ACTIONSLIDER_LEFT; break; default: break; } } return pos; }
static Eina_Bool _elm_photo_smart_theme(Evas_Object *obj) { ELM_PHOTO_DATA_GET(obj, sd); if (!ELM_WIDGET_CLASS(_elm_photo_parent_sc)->theme(obj)) return EINA_FALSE; edje_object_mirrored_set (ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_mirrored_get(obj)); elm_widget_theme_object_set (obj, ELM_WIDGET_DATA(sd)->resize_obj, "photo", "base", elm_widget_style_get(obj)); elm_object_scale_set(sd->icon, elm_widget_scale_get(obj)); edje_object_scale_set(ELM_WIDGET_DATA(sd)->resize_obj, elm_widget_scale_get(obj) * elm_config_scale_get()); _sizing_eval(obj); return EINA_TRUE; }
static void _elm_notify_smart_theme(Eo *obj, void *_pd, va_list *list) { Elm_Notify_Smart_Data *sd = _pd; Eina_Bool *ret = va_arg(*list, Eina_Bool *); if (ret) *ret = EINA_FALSE; Eina_Bool int_ret = EINA_FALSE; eo_do_super(obj, MY_CLASS, elm_wdg_theme(&int_ret)); if (!int_ret) return; _mirrored_set(obj, elm_widget_mirrored_get(obj)); _notify_theme_apply(obj); if (sd->block_events) _block_events_theme_apply(obj); edje_object_scale_set (sd->notify, elm_widget_scale_get(obj) * elm_config_scale_get()); _sizing_eval(obj); if (ret) *ret = EINA_TRUE; }
static void _notify_theme_apply(Evas_Object *obj) { const char *style = elm_widget_style_get(obj); double ax, ay; ELM_NOTIFY_DATA_GET(obj, sd); ax = sd->horizontal_align; ay = sd->vertical_align; if ((elm_widget_mirrored_get(obj)) && (ax != ELM_NOTIFY_ALIGN_FILL)) ax = 1.0 - ax; if (ay == 0.0) elm_widget_theme_object_set(obj, sd->notify, "notify", "top", style); else if (ay == 1.0) elm_widget_theme_object_set(obj, sd->notify, "notify", "bottom", style); else if (ax == 0.0) elm_widget_theme_object_set(obj, sd->notify, "notify", "left", style); else if (ax == 1.0) elm_widget_theme_object_set(obj, sd->notify, "notify", "right", style); else elm_widget_theme_object_set(obj, sd->notify, "notify", "center", style); }
EOLIAN static Elm_Theme_Apply _elm_photo_elm_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd) { Elm_Theme_Apply int_ret = ELM_THEME_APPLY_FAILED; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); int_ret = elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS)); if (!int_ret) return ELM_THEME_APPLY_FAILED; edje_object_mirrored_set (wd->resize_obj, elm_widget_mirrored_get(obj)); elm_widget_theme_object_set (obj, wd->resize_obj, "photo", "base", elm_widget_style_get(obj)); elm_object_scale_set(sd->icon, elm_widget_scale_get(obj)); edje_object_scale_set(wd->resize_obj, elm_widget_scale_get(obj) * elm_config_scale_get()); _sizing_eval(obj); return int_ret; }
static Eina_Bool _elm_fileselector_smart_theme(Evas_Object *obj) { const char *style; const char *data; char buf[1024]; ELM_FILESELECTOR_DATA_GET(obj, sd); if (!ELM_WIDGET_CLASS(_elm_fileselector_parent_sc)->theme(obj)) return EINA_FALSE; style = elm_widget_style_get(obj); _mirrored_set(obj, elm_widget_mirrored_get(obj)); data = edje_object_data_get (ELM_WIDGET_DATA(sd)->resize_obj, "path_separator"); if (data) sd->path_separator = data; else sd->path_separator = "/"; snprintf(buf, sizeof(buf), "fileselector/%s", style); #define SWALLOW(part_name, object_ptn) \ if (object_ptn) \ { \ elm_widget_style_set(object_ptn, buf); \ if (!elm_layout_content_set(obj, part_name, object_ptn)) \ evas_object_hide(object_ptn); \ } SWALLOW("elm.swallow.up", sd->up_button); SWALLOW("elm.swallow.home", sd->home_button); SWALLOW("elm.swallow.spinner", sd->spinner); elm_object_style_set(sd->spinner, "wheel"); if (sd->mode == ELM_FILESELECTOR_LIST) { if (elm_layout_content_set(obj, "elm.swallow.files", sd->files_list)) evas_object_hide(sd->files_grid); else evas_object_hide(sd->files_list); } else { if (elm_layout_content_set(obj, "elm.swallow.files", sd->files_grid)) evas_object_hide(sd->files_list); else evas_object_hide(sd->files_grid); } SWALLOW("elm.swallow.filename", sd->filename_entry); SWALLOW("elm.swallow.path", sd->path_entry); snprintf(buf, sizeof(buf), "fileselector/actions/%s", style); SWALLOW("elm.swallow.cancel", sd->cancel_button); SWALLOW("elm.swallow.ok", sd->ok_button); #undef SWALLOW edje_object_message_signal_process(ELM_WIDGET_DATA(sd)->resize_obj); elm_layout_sizing_eval(obj); return EINA_TRUE; }