本文整理匯總了C++中E_NEW函數的典型用法代碼示例。如果您正苦於以下問題:C++ E_NEW函數的具體用法?C++ E_NEW怎麽用?C++ E_NEW使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了E_NEW函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: e_int_config_mime_edit
E_Config_Dialog *
e_int_config_mime_edit(E_Config_Mime_Icon *data, void *data2)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
E_Config_Dialog_Data *cfdata;
if (e_config_dialog_find("E", "fileman/mime_edit_dialog")) return NULL;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->data = data;
cfdata->data2 = data2;
v = E_NEW(E_Config_Dialog_View, 1);
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.create_widgets = _basic_create;
v->basic.check_changed = _basic_check;
v->basic.apply_cfdata = _basic_apply;
cfd = e_config_dialog_new(NULL, _("File Icon"), "E",
"fileman/mime_edit_dialog",
"preferences-file-icons", 0, v, cfdata);
return cfd;
}
示例2: e_int_config_desk
E_Config_Dialog *
e_int_config_desk(E_Container *con, const char *params)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
E_Config_Dialog_Data *cfdata;
int con_num, zone_num, dx, dy;
if (!params) return NULL;
con_num = zone_num = dx = dy = -1;
if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) != 4)
return NULL;
if (e_config_dialog_find("E", "internal/desk")) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->con_num = con_num;
cfdata->zone_num = zone_num;
cfdata->desk_x = dx;
cfdata->desk_y = dy;
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _basic_apply;
v->basic.create_widgets = _basic_create;
v->override_auto_apply = 1;
cfd = e_config_dialog_new(con, _("Desk Settings"), "E", "internal/desk",
"preferences-desktop", 0, v, cfdata);
return cfd;
}
示例3: e_modapi_init
EAPI void *
e_modapi_init(E_Module *m)
{
char buf[PATH_MAX];
#if HAVE_LOCALE_H
setlocale(LC_ALL, "");
#endif
snprintf(buf, sizeof(buf), "%s/locale", m->dir);
bindtextdomain(PACKAGE, buf);
bind_textdomain_codeset(PACKAGE, "UTF-8");
conf_item_edd = E_CONFIG_DD_NEW("TClock_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, show_date, INT);
E_CONFIG_VAL(D, T, show_time, INT);
E_CONFIG_VAL(D, T, show_tip, INT);
E_CONFIG_VAL(D, T, date_format, STR);
E_CONFIG_VAL(D, T, time_format, STR);
E_CONFIG_VAL(D, T, time_offset, STR);
E_CONFIG_VAL(D, T, tip_format, STR);
conf_edd = E_CONFIG_DD_NEW("TClock_Config", Config);
#undef T
#undef D
#define T Config
#define D conf_edd
E_CONFIG_LIST(D, T, items, conf_item_edd);
tclock_config = e_config_domain_load("module.tclock", conf_edd);
if (!tclock_config)
{
Config_Item *ci;
tclock_config = E_NEW(Config, 1);
ci = E_NEW(Config_Item, 1);
ci->id = eina_stringshare_add("0");
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("%d");
tclock_config->items = eina_list_append(tclock_config->items, ci);
}
tclock_config->mod_dir = eina_stringshare_add(m->dir);
e_gadcon_provider_register(&_gc_class);
return m;
}
示例4: _battery_openbsd_start
int
_battery_openbsd_start(void)
{
int mib[] = {CTL_HW, HW_SENSORS, 0, 0, 0};
int devn;
struct sensordev snsrdev;
size_t sdlen = sizeof(struct sensordev);
for (devn = 0;; devn++) {
mib[2] = devn;
if (sysctl(mib, 3, &snsrdev, &sdlen, NULL, 0) == -1)
{
if (errno == ENXIO)
continue;
if (errno == ENOENT)
break;
}
if (!strcmp("acpibat0", snsrdev.xname))
{
if (!(bat = E_NEW(Battery, 1)))
return 0;
bat->udi = eina_stringshare_add("acpibat0"),
bat->mib = malloc(sizeof(int) * 5);
if (!bat->mib) return 0;
bat->mib[0] = mib[0];
bat->mib[1] = mib[1];
bat->mib[2] = mib[2];
bat->technology = eina_stringshare_add("Unknow");
bat->model = eina_stringshare_add("Unknow");
bat->vendor = eina_stringshare_add("Unknow");
bat->last_update = ecore_time_get();
bat->poll = ecore_poller_add(ECORE_POLLER_CORE,
battery_config->poll_interval,
_battery_openbsd_battery_update_poll, NULL);
device_batteries = eina_list_append(device_batteries, bat);
}
else if (!strcmp("acpiac0", snsrdev.xname))
{
if (!(ac = E_NEW(Ac_Adapter, 1)))
return 0;
ac->udi = eina_stringshare_add("acpiac0");
ac->mib = malloc(sizeof(int) * 5);
if (!ac->mib) return 0;
ac->mib[0] = mib[0];
ac->mib[1] = mib[1];
ac->mib[2] = mib[2];
device_ac_adapters = eina_list_append(device_ac_adapters, ac);
}
}
_battery_openbsd_battery_update();
init_time = ecore_time_get();
return 1;
}
示例5: e_modapi_init
EAPI void *
e_modapi_init(E_Module *m)
{
char buf[4095];
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("Forecasts_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, days, DOUBLE);
E_CONFIG_VAL(D, T, degrees, INT);
E_CONFIG_VAL(D, T, host, STR);
E_CONFIG_VAL(D, T, code, STR);
E_CONFIG_VAL(D, T, show_text, INT);
E_CONFIG_VAL(D, T, popup_on_hover, INT);
E_CONFIG_VAL(D, T, by_code, INT);
conf_edd = E_CONFIG_DD_NEW("Forecasts_Config", Config);
#undef T
#undef D
#define T Config
#define D conf_edd
E_CONFIG_LIST(D, T, items, conf_item_edd);
forecasts_config = e_config_domain_load("module.forecasts", conf_edd);
if (!forecasts_config)
{
Config_Item *ci;
forecasts_config = E_NEW(Config, 1);
ci = E_NEW(Config_Item, 1);
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->id = eina_stringshare_add("0");
ci->show_text = 1;
ci->popup_on_hover = 1;
forecasts_config->items = eina_list_append(forecasts_config->items, ci);
}
_forecasts_get_proxy();
forecasts_config->module = m;
e_gadcon_provider_register(&_gadcon_class);
return m;
}
示例6: _fill_data
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
News_Config *c;
c = news->config;
cfdata->feed.timer_m = c->feed.timer_m;
cfdata->feed.sort_name = c->feed.sort_name;
cfdata->proxy.enable = c->proxy.enable;
if (c->proxy.host)
cfdata->proxy.host = strdup(c->proxy.host);
else
cfdata->proxy.host = strdup("");
if (c->proxy.port)
{
char buf[6];
snprintf(buf, sizeof(buf), "%d", c->proxy.port);
cfdata->proxy.port = strdup(buf);
}
else
cfdata->proxy.port = strdup("");
cfdata->viewer.vfeeds.unread_first = c->viewer.vfeeds.unread_first;
cfdata->viewer.varticles.unread_first = c->viewer.varticles.unread_first;
cfdata->viewer.varticles.sort_date = c->viewer.varticles.sort_date;
cfdata->viewer.vcontent.font_size = c->viewer.vcontent.font_size;
cfdata->viewer.vcontent.font_color = E_NEW(E_Color, 1);
sscanf(c->viewer.vcontent.font_color, "#%2x%2x%2x",
&cfdata->viewer.vcontent.font_color->r,
&cfdata->viewer.vcontent.font_color->g,
&cfdata->viewer.vcontent.font_color->b);
cfdata->viewer.vcontent.font_color->a = 255;
e_color_update_rgb(cfdata->viewer.vcontent.font_color);
cfdata->viewer.vcontent.font_shadow = c->viewer.vcontent.font_shadow;
cfdata->viewer.vcontent.font_shadow_color = E_NEW(E_Color, 1);
sscanf(c->viewer.vcontent.font_shadow_color, "#%2x%2x%2x",
&cfdata->viewer.vcontent.font_shadow_color->r,
&cfdata->viewer.vcontent.font_shadow_color->g,
&cfdata->viewer.vcontent.font_shadow_color->b);
cfdata->viewer.vcontent.font_shadow_color->a = 255;
e_color_update_rgb(cfdata->viewer.vcontent.font_shadow_color);
cfdata->viewer.vcontent.color_changed = 0;
cfdata->popup_news.active = c->popup_news.active;
cfdata->popup_news.timer_s = c->popup_news.timer_s;
cfdata->popup_other.on_timeout = c->popup_other.on_timeout;
cfdata->popup_other.timer_s = c->popup_other.timer_s;
}
示例7: e_modapi_init
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;
}
示例8: _gc_init
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc,
const char *name,
const char *id,
const char *style)
{
Notification_Box *b;
E_Gadcon_Client *gcc;
Config_Item *ci;
Instance *inst;
inst = E_NEW(Instance, 1);
ci = notification_box_config_item_get(id);
b = notification_box_get(ci->id, gc->evas);
inst->ci = ci;
b->inst = inst;
inst->n_box = b;
gcc = e_gadcon_client_new(gc, name, id, style, b->o_box);
gcc->data = inst;
inst->gcc = gcc;
evas_object_event_callback_add(b->o_box, EVAS_CALLBACK_MOVE,
notification_box_cb_obj_moveresize, inst);
evas_object_event_callback_add(b->o_box, EVAS_CALLBACK_RESIZE,
notification_box_cb_obj_moveresize, inst);
notification_cfg->instances = eina_list_append(notification_cfg->instances, inst);
_gc_orient(gcc, gc->orient);
return gcc;
}
示例9: _create_data
static void *
_create_data(E_Config_Dialog *dialog)
{
E_Config_Dialog_Data *cfdata;
E_Bluez_Instance *inst;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
if (!cfdata)
return NULL;
cfdata->inst = dialog->data;
inst = cfdata->inst;
if (!e_bluez_adapter_discoverable_get(inst->adapter, &cfdata->mode))
cfdata->mode = 0;
if (!e_bluez_adapter_discoverable_timeout_get
(inst->adapter, &cfdata->timeout))
cfdata->timeout = 0;
cfdata->timeout /= 60;
if (!e_bluez_adapter_name_get(inst->adapter, &cfdata->name))
cfdata->name = NULL;
cfdata->name = strdup(cfdata->name);
return cfdata;
}
示例10: alarm_alarm_duplicate
Alarm *
alarm_alarm_duplicate(Alarm *al)
{
Alarm *al_new;
al_new = E_NEW(Alarm, 1);
if (al->name)
al_new->name = eina_stringshare_add(al->name);
al_new->state = al->state;
if (al->description)
al_new->description = eina_stringshare_add(al->description);
al_new->autoremove = al->autoremove;
al_new->open_popup = al->open_popup;
al_new->run_program = al->run_program;
if (al->program)
al_new->program = eina_stringshare_add(al->program);
al_new->sched.type = al->sched.type;
al_new->sched.date_epoch = al->sched.date_epoch;
al_new->sched.hour = al->sched.hour;
al_new->sched.minute = al->sched.minute;
al_new->sched.day_monday = al->sched.day_monday;
al_new->sched.day_tuesday = al->sched.day_tuesday;
al_new->sched.day_wenesday = al->sched.day_wenesday;
al_new->sched.day_thursday = al->sched.day_thursday;
al_new->sched.day_friday = al->sched.day_friday;
al_new->sched.day_saturday = al->sched.day_saturday;
al_new->sched.day_sunday = al->sched.day_sunday;
al_new->snooze.hour = al->snooze.hour;
al_new->snooze.minute = al->snooze.minute;
al_new->snooze.remember = al->snooze.remember;
return al_new;
}
示例11: news_config_dialog_item_content_show
int
news_config_dialog_item_content_show(News_Item *ni)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
v = E_NEW(E_Config_Dialog_View, 1);
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _basic_apply_data;
v->basic.create_widgets = _basic_create_widgets;
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
D_("News Gadget Content Configuration"),
"News", DIALOG_CLASS,
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, ni);
if (news->config->feed.langs_notset)
{
news_config_dialog_langs_show();
news->config->feed.langs_notset = 0;
news_config_save();
}
return 1;
}
示例12: news_config_dialog_show
int
news_config_dialog_show(void)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
if (e_config_dialog_find("News", DIALOG_CLASS))
return 0;
v = E_NEW(E_Config_Dialog_View, 1);
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _advanced_apply_data;
v->basic.create_widgets = _basic_create_widgets;
v->advanced.apply_cfdata = _advanced_apply_data;
v->advanced.create_widgets = _advanced_create_widgets;
cfd = e_config_dialog_new(e_container_current_get(e_manager_current_get()),
D_("News Main Configuration"),
"News", DIALOG_CLASS,
news_theme_file_get(NEWS_THEME_CAT_ICON), 0, v, NULL);
return 1;
}
示例13: _create_data
/*
* Fills the E_Config_Dialog-struct with the data currently in use
*
*/
static void *
_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata = E_NEW(E_Config_Dialog_Data, 1);
/* Because we save a lot of lines here by using memcpy, the structs have to be ordered the same */
memcpy(cfdata, tiling_g.config, sizeof(Config));
/* Handle things which can't be easily memcpy'd */
cfdata->tiling_border = (tiling_g.config->tiling_border ? strdup(tiling_g.config->tiling_border) : NULL);
cfdata->floating_border = (tiling_g.config->floating_border ? strdup(tiling_g.config->floating_border) : NULL);
cfdata->vdesks = NULL;
Eina_List *l;
for (l = tiling_g.config->vdesks; l; l = l->next)
{
struct _E_Config_vdesk *vd = l->data;
if (!vd) continue;
struct _E_Config_vdesk *newvd = malloc(sizeof(struct _E_Config_vdesk));
newvd->x = vd->x;
newvd->y = vd->y;
newvd->zone_num = vd->zone_num;
newvd->layout = vd->layout;
cfdata->vdesks = eina_list_append(cfdata->vdesks, newvd);
}
return cfdata;
}
示例14: _gc_init
static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
Instance *inst;
E_Gadcon_Client *gcc;
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/exalt.edj", e_module_dir_get(exalt_config->module));
inst = E_NEW(Instance, 1);
inst->o_button = edje_object_add(gc->evas);
if (!e_theme_edje_object_set(inst->o_button, "base/theme/modules/exalt",
"modules/exalt/main"))
edje_object_file_set(inst->o_button, buf, "e/modules/exalt/main");
gcc = e_gadcon_client_new(gc, name, id, style, inst->o_button);
gcc->data = inst;
inst->gcc = gcc;
evas_object_event_callback_add(inst->o_button, EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down, inst);
exalt_config->instances = evas_list_append(exalt_config->instances, inst);
exalt_dbus_notify_set( exalt_config->conn, _exalt_notify_cb, inst);
return gcc;
}
示例15: e_bluez_config_dialog_new
E_Config_Dialog *
e_bluez_config_dialog_new(E_Container *con,
E_Bluez_Instance *inst)
{
E_Config_Dialog *dialog;
E_Config_Dialog_View *view;
if (inst->conf_dialog)
return inst->conf_dialog;
view = E_NEW(E_Config_Dialog_View, 1);
if (!view)
return NULL;
view->create_cfdata = _create_data;
view->free_cfdata = _free_data;
view->basic.create_widgets = _basic_create;
view->basic.apply_cfdata = _basic_apply;
dialog = e_config_dialog_new(con, _("Bluetooth Settings"),
_e_bluez_Name, "e_bluez_config_dialog_new",
e_bluez_theme_path(), 0, view, inst);
return dialog;
}