EAPI E_Zone * e_util_zone_current_get(E_Manager *man) { E_Container *con; E_OBJECT_CHECK_RETURN(man, NULL); E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL); con = e_container_current_get(man); if (con) { E_Zone *zone; zone = e_zone_current_get(con); return zone; } return NULL; }
E_API 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 ((!e_comp->screen) || (!e_comp->screen->backlight_enabled)) return; 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_zone_current_get(); ecore_event_add(E_EVENT_BACKLIGHT_CHANGE, NULL, NULL, NULL); bl_now = e_bl_val; if (sysmode != MODE_RANDR) e_bl_val = val; if (fabs(tim) < DBL_EPSILON) { _e_backlight_set(val); e_backlight_update(); 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; bl_anim_toval = val; }
E_API void e_util_win_auto_resize_fill(Evas_Object *win) { E_Zone *zone = NULL; E_Client *ec; ec = e_win_client_get(win); if (ec) zone = ec->zone; if (!zone) zone = e_zone_current_get(); if (zone) { int w, h, mw, mh; e_zone_useful_geometry_get(zone, NULL, NULL, &w, &h); evas_object_size_hint_min_get(win, &mw, &mh); w = _win_auto_size_calc(w, mw); h = _win_auto_size_calc(h, mh); evas_object_resize(win, w, h); } }
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) { int need_rearrangement = memcmp(cfdata, tiling_g.config, sizeof(Config) - (sizeof(char *) * 2) - sizeof(Eina_List *)); if (!need_rearrangement) { if (cfdata->tiling_border && tiling_g.config->tiling_border) need_rearrangement = strcmp(cfdata->tiling_border, tiling_g.config->tiling_border); else if (cfdata->tiling_border || tiling_g.config->tiling_border) need_rearrangement = 1; } if (!need_rearrangement) { if (cfdata->floating_border && tiling_g.config->floating_border) need_rearrangement = strcmp(cfdata->floating_border, tiling_g.config->floating_border); else if (cfdata->floating_border || tiling_g.config->floating_border) need_rearrangement = 1; } if (!need_rearrangement) { /* Check if the layout for one of the vdesks has changed */ Eina_List *l; for (l = tiling_g.config->vdesks; l; l = l->next) { struct _E_Config_vdesk *vd = l->data, *newvd; if (!vd || !(newvd = get_vdesk(cfdata, vd->x, vd->y, vd->zone_num))) continue; if (newvd->layout != vd->layout) { E_Zone *zone = e_zone_current_get(e_container_current_get(e_manager_current_get())); E_Desk *desk = e_desk_current_get(zone); if (desk->x == vd->x && desk->y == vd->y && zone->num == vd->zone_num) { need_rearrangement = 1; break; } } } } if (tiling_g.config->floating_border) free(tiling_g.config->floating_border); if (tiling_g.config->tiling_border) free(tiling_g.config->tiling_border); memcpy(tiling_g.config, cfdata, sizeof(Config)); cfdata->floating_border = NULL; cfdata->tiling_border = NULL; cfdata->vdesks = NULL; e_config_save_queue(); if (need_rearrangement) e_mod_tiling_rearrange(); return 1; }