int _e_util_menu_item_edje_icon_set(E_Menu_Item *mi, const char *name, Eina_Bool fallback) { const char *file; char buf[4096]; if ((!name) || (!name[0])) return 0; if ((!fallback) && (name[0] == '/') && ecore_file_exists(name)) { e_menu_item_icon_edje_set(mi, name, "icon"); return 1; } snprintf(buf, sizeof(buf), "e/icons/%s", name); if (fallback) file = e_theme_edje_icon_fallback_file_get(buf); else file = e_theme_edje_file_get("base/theme/icons", buf); if (file[0]) { e_menu_item_icon_edje_set(mi, file, buf); return 1; } return 0; }
static void _fill_data(E_Config_Dialog_Data *cfdata) { Eina_List *l; const char *bg; char name[40]; int ok = 0; bg = e_bg_file_get(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y); if (!bg) bg = e_theme_edje_file_get("base/theme/backgrounds", "e/desktop/background"); cfdata->bg = strdup(bg); for (l = e_config->desktop_names; l; l = l->next) { E_Config_Desktop_Name *dn; dn = l->data; if (!dn) continue; if (dn->container != cfdata->con_num) continue; if (dn->zone != cfdata->zone_num) continue; if ((dn->desk_x != cfdata->desk_x) || (dn->desk_y != cfdata->desk_y)) continue; if (dn->name) cfdata->name = strdup(dn->name); ok = 1; break; } if (!ok) { snprintf(name, sizeof(name), _(e_config->desktop_default_name), cfdata->desk_x, cfdata->desk_y); cfdata->name = strdup(name); } }
E_API int e_util_edje_icon_check(const char *name) { const char *file; char buf[4096]; if ((!name) || (!name[0])) return 0; snprintf(buf, sizeof(buf), "e/icons/%s", name); file = e_theme_edje_file_get("base/theme/icons", buf); if (file[0]) return 1; return 0; }
/* WARNING This function is deprecated,. must be made static. * You should use e_util_icon_theme_set instead */ E_API int e_util_edje_icon_set(Evas_Object *obj, const char *name) { const char *file; char buf[4096]; if ((!name) || (!name[0])) return 0; snprintf(buf, sizeof(buf), "e/icons/%s", name); file = e_theme_edje_file_get("base/theme/icons", buf); if (file[0]) { edje_object_file_set(obj, file, buf); return 1; } return 0; }
E_API const char * e_util_mime_icon_get(const char *mime, unsigned int size) { char buf[1024]; const char *file = NULL; if (e_config->icon_theme_overrides) file = efreet_mime_type_icon_get(mime, e_config->icon_theme, e_util_icon_size_normalize(size)); if (file) return file; if (snprintf(buf, sizeof(buf), "e/icons/fileman/mime/%s", mime) >= (int)sizeof(buf)) return NULL; file = e_theme_edje_file_get("base/theme/icons", buf); if (file && file[0]) return file; return efreet_mime_type_icon_get(mime, e_config->icon_theme, e_util_icon_size_normalize(size)); }
static int _e_util_icon_theme_set(Evas_Object *obj, const char *icon, Eina_Bool fallback) { const char *file; char buf[4096]; if ((!icon) || (!icon[0])) return 0; snprintf(buf, sizeof(buf), "e/icons/%s", icon); if (fallback) file = e_theme_edje_icon_fallback_file_get(buf); else file = e_theme_edje_file_get("base/theme/icons", buf); if (file[0]) { e_icon_file_edje_set(obj, file, buf); return 1; } return 0; }
void ngi_border_menu_show(Ngi_Box *box, E_Border *bd, Evas_Coord x, Evas_Coord y, int dir, Ecore_X_Time timestamp) { E_Menu *m; E_Menu_Item *mi; Ng *ng = box->ng; if (bd->border_menu) return; m = e_menu_new(); e_menu_category_set(m,"border"); e_menu_category_data_set("border",bd); e_object_data_set(E_OBJECT(m), bd); bd->border_menu = m; e_menu_post_deactivate_callback_set(m, _ng_border_cb_border_menu_end, ng); /* FIXME */ if ((!bd->lock_user_fullscreen) && (!bd->shaded)) { mi = e_menu_item_new(m); e_menu_item_label_set(mi, D_("Fullscreen")); e_menu_item_check_set(mi, 1); e_menu_item_toggle_set(mi, bd->fullscreen); e_menu_item_callback_set(mi, _ng_border_menu_cb_fullscreen, bd); e_menu_item_icon_edje_set(mi, e_theme_edje_file_get("base/theme/borders", "e/widgets/border/default/fullscreen"), "e/widgets/border/default/fullscreen"); } mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); if (!bd->lock_close) { mi = e_menu_item_new(m); e_menu_item_label_set(mi, D_("Close")); e_menu_item_callback_set(mi, _ng_border_menu_cb_close, bd); e_menu_item_icon_edje_set(mi, e_theme_edje_file_get("base/theme/borders", "e/widgets/border/default/close"), "e/widgets/border/default/close"); } if (!bd->internal) { mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); if (!(((bd->client.icccm.min_w == bd->client.icccm.max_w) && (bd->client.icccm.min_h == bd->client.icccm.max_h)) || (bd->lock_user_maximize))) { if ((!bd->lock_user_maximize) && (!bd->shaded) && ((bd->layer == 50) || (bd->layer == 100) || (bd->layer == 150))) { mi = e_menu_item_new(m); e_menu_item_label_set(mi, D_("Maximized")); e_menu_item_check_set(mi, 1); e_menu_item_toggle_set(mi, (bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH); if((bd->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_BOTH) e_menu_item_callback_set(mi, _ng_border_menu_cb_unmaximize, bd); else e_menu_item_callback_set(mi, _ng_border_menu_cb_maximize, bd); e_menu_item_icon_edje_set(mi, e_theme_edje_file_get("base/theme/borders", "e/widgets/border/default/maximize"), "e/widgets/border/default/maximize"); } } } if (!bd->lock_user_iconify) { mi = e_menu_item_new(m); if(bd->iconic) e_menu_item_label_set(mi, D_("Uniconify")); else e_menu_item_label_set(mi, D_("Iconify")); e_menu_item_callback_set(mi, _ng_border_menu_cb_iconify, bd); e_menu_item_icon_edje_set(mi, e_theme_edje_file_get("base/theme/borders", "e/widgets/border/default/minimize"), "e/widgets/border/default/minimize"); } e_menu_activate_mouse(m, ng->zone, ng->zone->x + x, ng->zone->y + y, 1, 1, dir, timestamp); }