EAPI void e_backlight_level_set(E_Zone *zone, double val, double tim) { double bl_now; // zone == NULL == everything // set backlight associated with zone to val over period of tim // if tim == 0.0 - then do it instantnly, if time == -1 use some default // transition time if (val < 0.0) val = 0.0; else if (val > 1.0) val = 1.0; if ((fabs(val - e_bl_val) < DBL_EPSILON) && (!bl_anim)) return; if (!zone) zone = e_util_zone_current_get(e_manager_current_get()); ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL); bl_now = e_bl_val; e_bl_val = val; if (fabs(tim) < DBL_EPSILON) { _e_backlight_set(zone, val); return; } // if (e_config->backlight.mode != E_BACKLIGHT_MODE_NORMAL) return; if (e_config->backlight.mode == E_BACKLIGHT_MODE_NORMAL) tim = 0.5; else if (tim < 0.0) tim = e_config->backlight.transition; E_FREE_FUNC(bl_anim, ecore_animator_del); bl_anim = ecore_animator_timeline_add(tim, _bl_anim, zone); bl_animval = bl_now; }
static void cone_clicked_cb(void *data, Evas_Object *obj, void *event_info) { view_sys *p_sys = data; cone_animation *anim = p_sys->p_anim; int y, h; evas_object_geometry_get(anim->obj, NULL, &y, NULL, &h); if (anim->initial_y < 0) anim->initial_y = y; evas_object_geometry_get(anim->container, NULL, NULL, NULL, &anim->container_height); anim->anim_begin_y = y; anim->anim_end_y = anim->container_height + h; ecore_animator_timeline_add(2, cone_do_drop, p_sys); }
static Eina_Bool cone_do_drop(void *data, double pos) { view_sys *p_sys = data; cone_animation *anim = p_sys->p_anim; int x,y,w,h; double frame = pos; frame = ecore_animator_pos_map(pos, ECORE_POS_MAP_BOUNCE, 2, 4); evas_object_geometry_get(anim->obj, &x, &y, &w, &h); double posy = frame * (anim->anim_end_y - anim->anim_begin_y); evas_object_move(anim->obj, x, anim->anim_begin_y + posy); if (y > anim->container_height) { anim->anim_begin_y = -h; anim->anim_end_y = anim->initial_y; ecore_animator_timeline_add(1, cone_do_drop, p_sys); return EINA_FALSE; } return EINA_TRUE; }