void ngi_launcher_new(Ng *ng, Config_Box *cfg) { char buf[4096]; Ecore_Event_Handler *h; Ngi_Box *box = ngi_box_new(ng); box->cfg = cfg; cfg->box = box; const char *drop[] = { "enlightenment/desktop", "enlightenment/border", "text/uri-list" }; box->drop_handler = e_drop_handler_add (ng->win->drop_win, box, _cb_drop_enter, _cb_drop_move, _cb_drop_leave, _cb_drop_end, drop, 3, 0, 0, 0, 0); h = ecore_event_handler_add(E_EVENT_CONFIG_ICON_THEME, _cb_icons_update, box); if (h) box->handlers = eina_list_append(box->handlers, h); h = ecore_event_handler_add(EFREET_EVENT_ICON_CACHE_UPDATE, _cb_icons_update, box); if (h) box->handlers = eina_list_append(box->handlers, h); h = ecore_event_handler_add(EFREET_EVENT_DESKTOP_CACHE_UPDATE, _cb_icons_update, box); if (h) box->handlers = eina_list_append(box->handlers, h); if (!cfg->launcher_app_dir || strlen(cfg->launcher_app_dir) == 0) return; if (cfg->launcher_app_dir[0] != '/') { snprintf(buf, sizeof(buf), "%s/applications/bar/%s/.order", e_user_dir_get(), cfg->launcher_app_dir); } else snprintf(buf, sizeof(buf), "%s", cfg->launcher_app_dir); box->apps = e_order_new(buf); e_order_update_callback_set(box->apps, _app_change_cb, box); _box_fill(box); }
static E_Gadcon_Client * _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style) { IBox *b; Evas_Object *o; E_Gadcon_Client *gcc; Instance *inst; Evas_Coord x, y, w, h; const char *drop[] = { "enlightenment/border" }; Config_Item *ci; inst = E_NEW(Instance, 1); ci = _ibox_config_item_get(id); inst->ci = ci; b = _ibox_new(gc->evas, gc->zone); b->inst = inst; inst->ibox = b; _ibox_fill(b); o = b->o_box; gcc = e_gadcon_client_new(gc, name, id, style, o); gcc->data = inst; ci->gcc = gcc; inst->gcc = gcc; inst->o_ibox = o; inst->orient = E_GADCON_ORIENT_HORIZ; evas_object_geometry_get(o, &x, &y, &w, &h); inst->drop_handler = e_drop_handler_add(E_OBJECT(inst->gcc), inst, _ibox_inst_cb_enter, _ibox_inst_cb_move, _ibox_inst_cb_leave, _ibox_inst_cb_drop, drop, 1, x, y, w, h); evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE, _ibox_cb_obj_moveresize, inst); evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE, _ibox_cb_obj_moveresize, inst); ibox_config->instances = eina_list_append(ibox_config->instances, inst); return gcc; }