Evas_Module * evas_module_find_type(Evas_Module_Type type, const char *name) { const char *path; const char *format = NULL; char buffer[4096]; Evas_Module *em; Eina_Module *en; Eina_List *l; if ((unsigned int)type > 3) return NULL; em = eina_hash_find(evas_modules[type], name); if (em) return em; EINA_LIST_FOREACH(evas_module_paths, l, path) { switch (type) { case EVAS_MODULE_TYPE_ENGINE: format = "%s/engines/%s/%s/" EVAS_MODULE_NAME_ENGINE; break; case EVAS_MODULE_TYPE_IMAGE_LOADER: format = "%s/loaders/%s/%s/" EVAS_MODULE_NAME_IMAGE_LOADER; break; case EVAS_MODULE_TYPE_IMAGE_SAVER: format = "%s/savers/%s/%s/" EVAS_MODULE_NAME_IMAGE_SAVER; break; case EVAS_MODULE_TYPE_OBJECT: format = "%s/object/%s/%s/" EVAS_MODULE_NAME_OBJECT; break; } snprintf(buffer, sizeof (buffer), format, path, name, MODULE_ARCH, name); if (!evas_file_path_is_file(buffer)) continue; en = eina_module_new(buffer); if (!en) continue; if (!eina_module_load(en)) { eina_module_free(en); continue; } em = eina_hash_find(evas_modules[type], name); if (em) { eina_evas_modules = eina_list_append(eina_evas_modules, en); return em; } eina_module_free(en); } return NULL; }
int tpe_event_type_add(const char *name){ struct event_info *einfo; /* Register a new event by this name */ einfo = calloc(1,sizeof(struct event_info)); einfo->name = strdup(name); einfo->ecore_event = ecore_event_type_new(); einfo->handlers = 0; /* XXX: This cast needs to go: Needs a fix in ecore however */ //ecore_hash_set(hash, (void*)name, einfo); hash = eina_list_append(hash, einfo); return 0; }
void pre_line_x1y1(double x1, double y1) { XY *xy; Eina_List *list = NULL; xy = (XY *) malloc(sizeof(XY)); ENGY_ASSERT(xy); xy->x = x1; xy->y = y1; list = eina_list_append(list, xy); msg_create_and_send(CMD_PRE_DATA, 0, list); }
EAPI void e_layout_child_raise(Evas_Object *obj) { E_Layout_Item *li; li = evas_object_data_get(obj, "e_layout_data"); if (!li) return; if (!eina_list_data_find(li->sd->items, obj)) return; if ((li->sd->items) && eina_list_next(li->sd->items)) { li->sd->items = eina_list_remove(li->sd->items, obj); evas_object_raise(obj); li->sd->items = eina_list_append(li->sd->items, obj); } }
/** * @brief Refreshes history of realized pages * * @param self an EailNaviframe object * @param list list of realized pages */ static void _refresh_cached_pages(EailNaviframe *self, const Eina_List *list) { int list_count = eina_list_count(list); eina_list_free(self->cached_pages); for (int i = 0; i < list_count; i++) { AtkObject *child = eail_naviframe_page_new(ATK_OBJECT(self), i); atk_object_initialize(child, eina_list_nth(list, i)); g_object_ref(child); self->cached_pages = eina_list_append(self->cached_pages, child); } }
EAPI Evas_Object * elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) { Evas_Object *win; Evas_Object * (* _elm_win_add) (Evas_Object *, const char *, Elm_Win_Type) = dlsym(RTLD_NEXT, "elm_win_add"); win = _elm_win_add(parent, name, type); evas_list = eina_list_append(evas_list, evas_object_evas_get(win)); #ifdef DEBUG_TSUITE printf("Appended EVAS=<%p> list size=<%d>\n", evas_object_evas_get(win), eina_list_count(evas_list)); #endif return win; }
END_TEST START_TEST(inherits_test) { Eina_List *compare = NULL, *itr1, *itr2; Eina_List *inherits_list = NULL; char *str1, *str2; eina_init(); compare = eina_list_append(compare, "MyBaseClass1"); compare = eina_list_append(compare, "MyBaseClass2"); eolian_database_init(); eolian_eo_class_desc_parse(EO_COMMENT); inherits_list = (Eina_List*) database_class_inherits_list_get("MyClassName"); fail_if(!inherits_list); ck_assert_int_eq(eina_list_count(inherits_list), 2); itr2 = compare; EINA_LIST_FOREACH(inherits_list, itr1, str1) { str2 = eina_list_data_get(itr2); ck_assert_str_eq(str1, str2); itr2 = eina_list_next(itr2); }
EAPI void e_init_status_set(const char *str) { if (!init_exe) return; // printf("---STAT %p %s\n", client, str); if (!client) { stats = eina_list_append(stats, eina_stringshare_add(str)); return; } // printf("---SEND\n"); ecore_ipc_client_send(client, E_IPC_DOMAIN_INIT, 1, 0, 0, 0, (void *)str, strlen(str) + 1); ecore_ipc_client_flush(client); }
Eina_List* DumpRenderTreeSupportEfl::frameChildren(const Evas_Object* ewkFrame) { DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, 0); Eina_List* childFrames = 0; for (unsigned index = 0; index < frame->tree().childCount(); index++) { WebCore::Frame *childFrame = frame->tree().child(index); WebCore::FrameLoaderClientEfl& client = static_cast<WebCore::FrameLoaderClientEfl&>(childFrame->loader().client()); childFrames = eina_list_append(childFrames, client.webFrame()); } return childFrames; }
void setup_panel(Evas *_e) { int w; Panel_Button *pbutton1, *pbutton2, *pbutton3; o_panel = evas_object_image_add(_e); evas_object_image_file_set(o_panel, IM "panel.png", IM "panel.png"); evas_object_image_size_get(o_panel, &w, NULL); evas_object_move(o_panel, 0, 0); evas_object_resize(o_panel, w, win_h); evas_object_image_fill_set(o_panel, 0, 0, w, win_h); evas_object_layer_set(o_panel, 200); evas_object_show(o_panel); /* Panel title */ o_txt_paneltitle = evas_object_text_add(_e); evas_object_text_font_set(o_txt_paneltitle, "sinon", 17); evas_object_text_text_set(o_txt_paneltitle, "Etox Test"); evas_object_color_set(o_txt_paneltitle, 255, 255, 255, 255); evas_object_layer_set(o_txt_paneltitle, 250); evas_object_show(o_txt_paneltitle); /* Panel buttons */ pbutton1 = panel_button(evas, "Basic", basic_tests()); pbuttons = eina_list_append(pbuttons, pbutton1); pbutton2 = panel_button(evas, "Style", style_tests()); pbuttons = eina_list_append(pbuttons, pbutton2); pbutton3 = panel_button(evas, "Callbacks", callback_tests()); pbuttons = eina_list_append(pbuttons, pbutton3); }
/** * @brief Prepares Eina_List filled with Elm_Object_Item* objects * representing items in the list * * @return filled list with list items. Call eina_list_free on that list when * results processing has been finished */ static Eina_List * eail_genlist_get_items(EailGenlist *genlist) { Eina_List *items = NULL; Elm_Object_Item *item; Evas_Object *widget = eail_widget_get_widget(EAIL_WIDGET(genlist)); item = elm_genlist_first_item_get(widget); while (item) { items = eina_list_append(items, item); item = elm_genlist_item_next_get(item); } return items; }
void * evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg) { Evas_Engine_GL_Context *gc = context; Evas_GL_Texture *tex; int w, h, j, nw, fh, x, y; DATA8 *ndata, *data, *p1, *p2; if (fg->ext_dat) return fg->ext_dat; // FIXME: one engine at a time can do this :( w = fg->glyph_out->bitmap.width; h = fg->glyph_out->bitmap.rows; if ((w == 0) || (h == 0)) return NULL; if (!fg->glyph_out->rle) return NULL; data = evas_common_font_glyph_uncompress(fg, &w, &h); if (!data) return NULL; j = w; if (j < w) j = w; // expand to 32bit (4 byte) aligned rows for texture upload nw = ((w + 3) / 4) * 4; ndata = alloca(nw *h); if (!ndata) return NULL; for (y = 0; y < h; y++) { p1 = data + (j * y); p2 = ndata + (nw * y); for (x = 0; x < w; x++) { *p2 = *p1; p1++; p2++; } } fh = fg->fi->max_h; tex = evas_gl_common_texture_alpha_new(gc, ndata, w, h, fh); if (!tex) goto done; tex->sx1 = ((double)(tex->x)) / (double)tex->pt->w; tex->sy1 = ((double)(tex->y)) / (double)tex->pt->h; tex->sx2 = ((double)(tex->x + tex->w)) / (double)tex->pt->w; tex->sy2 = ((double)(tex->y + tex->h)) / (double)tex->pt->h; tex->fglyph = fg; gc->font_glyph_textures = eina_list_append(gc->font_glyph_textures, tex); done: free(data); return tex; }
E_API E_Drag * e_drag_new(int x, int y, const char **types, unsigned int num_types, void *data, int size, void *(*convert_cb)(E_Drag * drag, const char *type), void (*finished_cb)(E_Drag *drag, int dropped)) { E_Drag *drag; unsigned int i; /* No need to create a drag object without type */ if ((!types) || (!num_types)) return NULL; drag = e_object_alloc(sizeof(E_Drag) + num_types * sizeof(char *), E_DRAG_TYPE, E_OBJECT_CLEANUP_FUNC(_e_drag_free)); if (!drag) return NULL; drag->x = x; drag->y = y; drag->w = 24; drag->h = 24; drag->layer = E_LAYER_CLIENT_DRAG; drag->evas = e_comp->evas; drag->type = E_DRAG_NONE; for (i = 0; i < num_types; i++) drag->types[i] = eina_stringshare_add(types[i]); drag->num_types = num_types; drag->data = data; drag->data_size = size; drag->cb.convert = convert_cb; drag->cb.finished = finished_cb; _drag_list = eina_list_append(_drag_list, drag); #ifndef HAVE_WAYLAND_ONLY if (e_comp_util_has_x()) ecore_x_window_shadow_tree_flush(); #endif _drag_win_root = e_comp->root; drag->cb.key_down = NULL; drag->cb.key_up = NULL; return drag; }
Eina_Bool azy_content_deserialize_request_json(Azy_Content *content, const char *buf, ssize_t len EINA_UNUSED) { cJSON *object, *grab; int i; if ((!content) || (!buf)) return EINA_FALSE; if (!(object = cJSON_Parse(buf))) { azy_content_error_code_set(content, AZY_ERROR_REQUEST_JSON_OBJECT); return EINA_FALSE; } if ((grab = cJSON_GetObjectItem(object, "id"))) content->id = grab->valueint; if (!(grab = cJSON_GetObjectItem(object, "method"))) { azy_content_error_code_set(content, AZY_ERROR_REQUEST_JSON_METHOD); cJSON_Delete(object); return EINA_FALSE; } content->method = eina_stringshare_add(grab->valuestring); grab = cJSON_GetObjectItem(object, "params"); for (i = 0; grab && (i < cJSON_GetArraySize(grab)); i++) { Eina_Value *v; if (!(v = azy_value_deserialize_json(cJSON_GetArrayItem(grab, i)))) { azy_content_error_faultmsg_set(content, -1, "Can't parse JSON-RPC request. Failed to deserialize parameter %d.", i); cJSON_Delete(object); return EINA_FALSE; } content->params = eina_list_append(content->params, v); } cJSON_Delete(object); return EINA_TRUE; }
static Config_Item * _forecasts_config_item_get(const char *id) { Eina_List *l; Config_Item *ci; char buf[128]; if (!id) { int num = 0; /* Create id */ if (forecasts_config->items) { const char *p; ci = eina_list_last(forecasts_config->items)->data; p = strrchr(ci->id, '.'); if (p) num = strtol(p + 1, NULL, 10) + 1; } snprintf(buf, sizeof(buf), "%s.%d", _gadcon_class.name, num); id = buf; } else { for (l = forecasts_config->items; l; l = l->next) { ci = l->data; if (!ci->id) continue; if (!strcmp(ci->id, id)) return ci; } } ci = E_NEW(Config_Item, 1); ci->id = eina_stringshare_add(id); ci->poll_time = 60.0; ci->days = 15.0; ci->degrees = DEGREES_C; ci->host = eina_stringshare_add("query.yahooapis.com"); ci->code = eina_stringshare_add(DEFAULT_LOCATION); ci->show_text = 1; ci->popup_on_hover = 1; ci->by_code = 1; forecasts_config->items = eina_list_append(forecasts_config->items, ci); return ci; }
EAPI void * e_modapi_init (E_Module * m) { char buf[4096]; snprintf (buf, sizeof (buf), "%s/locale", e_module_dir_get (m)); bindtextdomain (PACKAGE, buf); bind_textdomain_codeset (PACKAGE, "UTF-8"); conf_item_edd = E_CONFIG_DD_NEW ("MPDule_Config_Item", Config_Item); #undef T #undef D #define T Config_Item #define D conf_item_edd E_CONFIG_VAL (D, T, id, STR); E_CONFIG_VAL (D, T, poll_time, DOUBLE); E_CONFIG_VAL (D, T, hostname, STR); E_CONFIG_VAL (D, T, port, INT); E_CONFIG_VAL (D, T, show_popup, UCHAR); conf_edd = E_CONFIG_DD_NEW ("MPDule_Config", Config); #undef T #undef D #define T Config #define D conf_edd E_CONFIG_LIST (D, T, items, conf_item_edd); mpdule_config = e_config_domain_load ("module.mpdule", conf_edd); if (!mpdule_config) { Config_Item *ci; mpdule_config = E_NEW (Config, 1); ci = E_NEW (Config_Item, 1); ci->id = eina_stringshare_add ("0"); ci->poll_time = 1.0; ci->hostname = eina_stringshare_add ("localhost"); ci->port = 6600; ci->show_popup = 1; mpdule_config->items = eina_list_append (mpdule_config->items, ci); } mpdule_config->module = m; e_gadcon_provider_register (&_gc_class); return m; }
Efl_Net_Socket_Windows_Operation * _efl_net_socket_windows_operation_new(Eo *o, Efl_Net_Socket_Windows_Operation_Success_Cb success_cb, Efl_Net_Socket_Windows_Operation_Failure_Cb failure_cb, const void *data) { Efl_Net_Socket_Windows_Operation *op; Efl_Net_Socket_Windows_Data *pd = efl_data_scope_get(o, EFL_NET_SOCKET_WINDOWS_CLASS); EINA_SAFETY_ON_NULL_RETURN_VAL(pd, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(success_cb, NULL); EINA_SAFETY_ON_NULL_RETURN_VAL(failure_cb, NULL); op = calloc(1, sizeof(*op)); EINA_SAFETY_ON_NULL_RETURN_VAL(op, NULL); op->base.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); if (!op->base.hEvent) { char *msg = _efl_net_windows_error_msg_get(GetLastError()); ERR("socket=%p success_cb=%p failure_cb=%p data=%p: error=%s", op->o, op->success_cb, op->failure_cb, op->data, msg); free(msg); goto error_event; } op->event_handler = ecore_main_win32_handler_add(op->base.hEvent, _efl_net_socket_windows_operation_event, op); if (!op->event_handler) { ERR("socket=%p success_cb=%p failure_cb=%p data=%p: could not create event handler", op->o, op->success_cb, op->failure_cb, op->data); goto error_handler; } op->success_cb = success_cb; op->failure_cb = failure_cb; op->data = data; op->o = o; pd->pending_ops = eina_list_append(pd->pending_ops, op); DBG("op=%p (socket=%p) success_cb=%p failure_cb=%p data=%p", op, op->o, op->success_cb, op->failure_cb, op->data); return op; error_handler: CloseHandle(op->base.hEvent); error_event: free(op); return NULL; }
Enna_Volumes_Listener * enna_volumes_listener_add(const char *name, EnnaVolumesFunc add, EnnaVolumesFunc rmv, void *data) { Enna_Volumes_Listener *vl; vl = ENNA_NEW(Enna_Volumes_Listener, 1); vl->name = eina_stringshare_add(name); vl->add = add; vl->remove = rmv; vl->data = data; enna_log(ENNA_MSG_EVENT, "volumes", "Add: %s listener", vl->name); enna_volumes_listeners = eina_list_append(enna_volumes_listeners, vl); return vl; }
static size_t _ecore_con_url_header_cb(void *ptr, size_t size, size_t nitems, void *stream) { size_t real_size = size * nitems; Ecore_Con_Url *url_con = stream; char *header = malloc(sizeof(char)*(real_size + 1)); if (!header) return real_size; memcpy(header, ptr, real_size); header[real_size] = '\0'; url_con->response_headers = eina_list_append(url_con->response_headers, header); return real_size; }
static int elua_init_module(lua_State *L) { if (!lua_isnoneornil(L, 1)) { lua_pushvalue(L, 1); lua_call(L, 0, 0); } if (!lua_isnoneornil(L, 2)) { lua_pushvalue(L, 2); elua_modlist = eina_list_append(elua_modlist, (void*)(size_t)luaL_ref(L, LUA_REGISTRYINDEX)); } return 0; }
void ephysics_constraint_body_del(EPhysics_Body *body) { void *ldata; EPhysics_Constraint *constraint; Eina_List *l, *constraints, *rem = NULL; constraints = ephysics_world_constraints_get(body->world); if (!constraints) return; EINA_LIST_FOREACH(constraints, l, ldata) { constraint = (EPhysics_Constraint *)ldata; if (constraint->bodies[0] == body || constraint->bodies[1]) rem = eina_list_append(rem, constraint); }
/** * @brief Gets the list of widget's children * * @param widget EailWidget instance * * @returns Eina_list representing the list of children * or NULL if widget has no children */ static Eina_List * eail_button_get_widget_children(EailWidget *widget) { Eina_List *list = NULL; Evas_Object *child, *obj; obj = eail_widget_get_widget(EAIL_WIDGET(widget)); if (obj) { child = elm_object_part_content_get(obj, "icon"); if (child && elm_object_widget_check(child)) list = eina_list_append(list, child); } return list; }
static void bs_menu_add (Bookstore_Service *s) { Enna_File *f; if (!s) return; f = calloc (1, sizeof(Enna_File)); f->icon = (char *) eina_stringshare_add(s->icon); f->label = (char *) eina_stringshare_add(s->label); f->type = ENNA_FILE_MENU; enna_wall_file_append(mod->menu, f, bs_menu_item_cb_selected, s); mod->menu_items = eina_list_append (mod->menu_items, f); }
static Config_Item * _tclock_config_item_get(const char *id) { Eina_List *l; Config_Item *ci; if (!id) { int num = 0; char buf[128]; /* Create id */ if (tclock_config->items) { const char *p; ci = eina_list_last(tclock_config->items)->data; p = strrchr(ci->id, '.'); if (p) num = atoi(p + 1) + 1; } snprintf(buf, sizeof(buf), "%s.%d", _gc_class.name, num); id = buf; } else { for (l = tclock_config->items; l; l = l->next) { ci = l->data; if (!ci->id) continue; if (!strcmp(ci->id, id)) return ci; } } ci = E_NEW(Config_Item, 1); ci->id = eina_stringshare_add(id); ci->show_date = 1; ci->show_time = 1; ci->show_tip = 1; ci->time_format = eina_stringshare_add("%T"); ci->time_offset = eina_stringshare_add("0"); ci->date_format = eina_stringshare_add("%d/%m/%y"); ci->tip_format = eina_stringshare_add("%A, %B %d, %Y"); tclock_config->items = eina_list_append(tclock_config->items, ci); return ci; }
static void _joystick_register(const char* syspath) { int fd, index; const char *devnode; Joystick_Info *ji; Joystick_Mapper mapper; devnode = eeze_udev_syspath_get_devpath(syspath); if (!devnode) return; if (!eina_str_has_prefix(devnode, joystickPrefix)) goto register_failed; mapper = _joystick_mapping_info_get(syspath); if (!mapper) { ERR("Unsupported joystick."); goto register_failed; } index = _joystick_index_get(devnode); if (index == -1) { ERR("Invalid index value."); goto register_failed; } ji = calloc(1, sizeof(Joystick_Info)); if (!ji) { ERR("Cannot allocate memory."); goto register_failed; } ji->index = index; ji->mapper = mapper; ji->system_path = eina_stringshare_ref(syspath); fd = open(devnode, O_RDONLY | O_NONBLOCK); ji->fd_handler = ecore_main_fd_handler_add(fd, ECORE_FD_READ, _fd_handler_cb, ji, 0, 0); joystick_list = eina_list_append(joystick_list, ji); _joystick_connected_event_add(index, EINA_TRUE); register_failed: eina_stringshare_del(devnode); }
static Config_Item * _wlan_config_item_get (const char *id) { Eina_List *l; Config_Item *ci; char buf[128]; if (!id) { int num = 0; /* Create id */ if (wlan_config->items) { const char *p; ci = eina_list_last (wlan_config->items)->data; p = strrchr (ci->id, '.'); if (p) num = atoi (p + 1) + 1; } snprintf (buf, sizeof (buf), "%s.%d", _gc_class.name, num); id = buf; } else { for (l = wlan_config->items; l; l = l->next) { ci = l->data; if (!ci->id) continue; if (!strcmp (ci->id, id)) { if (!ci->device) ci->device = eina_stringshare_add ("wlan0"); return ci; } } } ci = E_NEW (Config_Item, 1); ci->id = eina_stringshare_add (id); ci->device = eina_stringshare_add ("wlan0"); ci->poll_time = 1.0; ci->always_text = 0; ci->show_percent = 1; wlan_config->items = eina_list_append (wlan_config->items, ci); return ci; }
Eina_Bool _evas_render2(Eo *eo_e, Evas_Public_Data *e) { double t; // if nothing changed at all since last render - skip this frame if (!e->changed) return EINA_FALSE; // we are still rendering while being asked to render - skip this if (e->rendering) return EINA_FALSE; // mark this canvas as a render2 canvas - not normal render e->render2 = EINA_TRUE; // check viewport size is same as output - not allowed to differ if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h)) ERR("viewport size != output size!"); // if render threads not initted - init them - maybe move this later? _evas_render2_th_init(); printf("-------------------------------------------- %p %p\n", eo_e, e); // wait for any previous render pass to do its thing t = get_time(); evas_canvas_async_block(e); t = get_time() - t; printf("T: block wait: "); out_time(t); // we have to calculate smare objects before render so do that here t = get_time(); evas_call_smarts_calculate(eo_e); t = get_time() - t; printf("T: smart calc: "); out_time(t); // call canvas callbacks saying we are in the pre-render state _always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL); // bock any susbequent rneders from doing this walk eina_lock_take(&(e->lock_objects)); // gain a reference efl_ref(eo_e); // put into the "i'm rendering" pool e->rendering = EINA_TRUE; _rendering = eina_list_append(_rendering, eo_e); // call our flush pre at this point before rendering begins... _always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL); // tell main render thread to wake up and begin processing this canvas _evas_render2_th_main_msg_render(eo_e, e); return EINA_FALSE; }
static Item_Menu * _item_menu_add(Plugin *p, Efreet_Menu *menu) { Item_Menu *m; m = EVRY_ITEM_NEW(Item_Menu, p, NULL, NULL, NULL); EVRY_ITEM(m)->type = EVRY_TYPE_NONE; EVRY_ITEM(m)->browseable = EINA_TRUE; EVRY_ITEM(m)->label = eina_stringshare_add(menu->name); EVRY_ITEM(m)->icon = eina_stringshare_add(menu->icon); EVRY_ITEM(m)->usage = -1; m->menu = menu; p->menu_items = eina_list_append(p->menu_items, m); return m; }
/** * @brief Get a list of all the network interfaces available * @return A list of Eeze_Net objects * Use this function to get all network interfaces available to the application. * This list must be freed by the user. */ Eina_List * eeze_net_list(void) { struct if_nameindex *ifs, *i; Eina_List *ret = NULL; Eeze_Net *net; ifs = if_nameindex(); for (i = ifs; i && i->if_name && i->if_name[0]; i++) { net = eeze_net_new(i->if_name); if (net) ret = eina_list_append(ret, net); } if_freenameindex(ifs); return ret; }
EAPI void * e_modapi_init (E_Module * m) { char buf[PATH_MAX]; snprintf (buf, sizeof (buf), "%s/locale", e_module_dir_get (m)); bindtextdomain (PACKAGE, buf); bind_textdomain_codeset (PACKAGE, "UTF-8"); conf_item_edd = E_CONFIG_DD_NEW ("Wlan_Config_Item", Config_Item); #undef T #undef D #define T Config_Item #define D conf_item_edd E_CONFIG_VAL (D, T, id, STR); E_CONFIG_VAL (D, T, device, STR); E_CONFIG_VAL (D, T, poll_time, DOUBLE); E_CONFIG_VAL (D, T, always_text, INT); E_CONFIG_VAL (D, T, show_percent, INT); conf_edd = E_CONFIG_DD_NEW ("Wlan_Config", Config); #undef T #undef D #define T Config #define D conf_edd E_CONFIG_LIST (D, T, items, conf_item_edd); wlan_config = e_config_domain_load ("module.wlan", conf_edd); if (!wlan_config) { Config_Item *ci; wlan_config = E_NEW (Config, 1); ci = E_NEW (Config_Item, 1); ci->id = eina_stringshare_add ("0"); ci->device = eina_stringshare_add ("wlan0"); ci->poll_time = 1.0; ci->always_text = 0; ci->show_percent = 1; wlan_config->items = eina_list_append (wlan_config->items, ci); } wlan_config->module = m; e_gadcon_provider_register (&_gc_class); return m; }