EINTERN Eina_Bool e_randr2_init(void) { if (!E_EVENT_RANDR_CHANGE) E_EVENT_RANDR_CHANGE = ecore_event_type_new(); if ((!e_comp->screen) || (!e_comp->screen->available) || (!e_comp->screen->available())) return EINA_FALSE; // create data descriptors for config storage _e_randr2_cfg_screen_edd = E_CONFIG_DD_NEW("E_Config_Randr2_Screen", E_Config_Randr2_Screen); #undef T #undef D #define T E_Config_Randr2_Screen #define D _e_randr2_cfg_screen_edd E_CONFIG_VAL(D, T, id, STR); E_CONFIG_VAL(D, T, rel_to, STR); E_CONFIG_VAL(D, T, rel_align, DOUBLE); E_CONFIG_VAL(D, T, mode_refresh, DOUBLE); E_CONFIG_VAL(D, T, mode_w, UINT); E_CONFIG_VAL(D, T, mode_h, INT); E_CONFIG_VAL(D, T, rotation, INT); E_CONFIG_VAL(D, T, priority, INT); E_CONFIG_VAL(D, T, rel_mode, UCHAR); E_CONFIG_VAL(D, T, enabled, UCHAR); _e_randr2_cfg_edd = E_CONFIG_DD_NEW("E_Config_Randr2", E_Config_Randr2); #undef T #undef D #define T E_Config_Randr2 #define D _e_randr2_cfg_edd E_CONFIG_VAL(D, T, version, INT); E_CONFIG_LIST(D, T, screens, _e_randr2_cfg_screen_edd); E_CONFIG_VAL(D, T, restore, UCHAR); E_CONFIG_VAL(D, T, ignore_hotplug_events, UCHAR); E_CONFIG_VAL(D, T, ignore_acpi_events, UCHAR); // set up events from the driver if (e_comp->screen->init) e_comp->screen->init(); // get current screen info e_randr2 = e_comp->screen->create(); // from screen info calculate screen max dimensions _screen_config_maxsize(); // load config and apply it e_randr2_cfg = _config_load(); // only apply if restore is set AND at least one configured screen // matches one we have if ((e_randr2_cfg->restore) && (_config_screen_match_count(e_randr2, e_randr2_cfg) > 0)) { _do_apply(); } else { _config_update(e_randr2, e_randr2_cfg); e_randr2_config_save(); } return EINA_TRUE; }
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; }
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 ("Empris_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, player, STR); E_CONFIG_VAL (D, T, show_popup, UCHAR); conf_edd = E_CONFIG_DD_NEW ("Empris_Config", Config); #undef T #undef D #define T Config #define D conf_edd E_CONFIG_LIST (D, T, items, conf_item_edd); empris_config = e_config_domain_load ("module.empris", conf_edd); if (!empris_config) { Config_Item *ci; empris_config = E_NEW (Config, 1); ci = E_NEW (Config_Item, 1); ci->id = eina_stringshare_add ("0"); ci->player = eina_stringshare_add (""); ci->show_popup = 1; empris_config->items = eina_list_append (empris_config->items, ci); } empris_config->module = m; conn = e_dbus_bus_get(DBUS_BUS_SESSION); if (!conn) return NULL; cb_name_owner_changed = e_dbus_signal_handler_add (conn, fdo_bus_name, fdo_path, fdo_interface, "NameOwnerChanged", _dbus_cb_name_owner_changed, NULL); e_dbus_list_names(conn, _dbus_cb_list_names, NULL); e_gadcon_provider_register (&_gc_class); e_module_delayed_set(m, 1); return m; }
EAPI void e_mod_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd) { *match_edd = E_CONFIG_DD_NEW("Comp_Match", Match); #undef T #undef D #define T Match #define D *match_edd E_CONFIG_VAL(D, T, title, STR); E_CONFIG_VAL(D, T, name, STR); E_CONFIG_VAL(D, T, clas, STR); E_CONFIG_VAL(D, T, role, STR); E_CONFIG_VAL(D, T, primary_type, INT); E_CONFIG_VAL(D, T, borderless, CHAR); E_CONFIG_VAL(D, T, dialog, CHAR); E_CONFIG_VAL(D, T, accepts_focus, CHAR); E_CONFIG_VAL(D, T, vkbd, CHAR); E_CONFIG_VAL(D, T, quickpanel, CHAR); E_CONFIG_VAL(D, T, argb, CHAR); E_CONFIG_VAL(D, T, fullscreen, CHAR); E_CONFIG_VAL(D, T, modal, CHAR); E_CONFIG_VAL(D, T, shadow_style, STR); *conf_edd = E_CONFIG_DD_NEW("Comp_Config", Config); #undef T #undef D #define T Config #define D *conf_edd E_CONFIG_VAL(D, T, shadow_file, STR); E_CONFIG_VAL(D, T, shadow_style, STR); E_CONFIG_VAL(D, T, engine, INT); E_CONFIG_VAL(D, T, max_unmapped_pixels, INT); E_CONFIG_VAL(D, T, max_unmapped_time, INT); E_CONFIG_VAL(D, T, min_unmapped_time, INT); E_CONFIG_VAL(D, T, fps_average_range, INT); E_CONFIG_VAL(D, T, fps_corner, UCHAR); E_CONFIG_VAL(D, T, fps_show, UCHAR); E_CONFIG_VAL(D, T, use_shadow, UCHAR); E_CONFIG_VAL(D, T, indirect, UCHAR); E_CONFIG_VAL(D, T, texture_from_pixmap, UCHAR); E_CONFIG_VAL(D, T, lock_fps, UCHAR); E_CONFIG_VAL(D, T, efl_sync, UCHAR); E_CONFIG_VAL(D, T, loose_sync, UCHAR); E_CONFIG_VAL(D, T, grab, UCHAR); E_CONFIG_VAL(D, T, vsync, UCHAR); E_CONFIG_VAL(D, T, keep_unmapped, UCHAR); E_CONFIG_VAL(D, T, send_flush, UCHAR); E_CONFIG_VAL(D, T, send_dump, UCHAR); E_CONFIG_VAL(D, T, nocomp_fs, UCHAR); E_CONFIG_VAL(D, T, smooth_windows, UCHAR); E_CONFIG_VAL(D, T, first_draw_delay, DOUBLE); E_CONFIG_LIST(D, T, match.popups, *match_edd); E_CONFIG_LIST(D, T, match.borders, *match_edd); E_CONFIG_LIST(D, T, match.overrides, *match_edd); E_CONFIG_LIST(D, T, match.menus, *match_edd); }
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; }
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; }
EAPI void * e_modapi_init(E_Module *m) { E_Music_Control_Module_Context *ctxt; ctxt = calloc(1, sizeof(E_Music_Control_Module_Context)); EINA_SAFETY_ON_NULL_RETURN_VAL(ctxt, NULL); music_control_mod = m; ctxt->conf_edd = E_CONFIG_DD_NEW("music_control_config", Music_Control_Config); #undef T #undef D #define T Music_Control_Config #define D ctxt->conf_edd E_CONFIG_VAL(D, T, player_selected, INT); E_CONFIG_VAL(D, T, pause_on_desklock, INT); ctxt->config = e_config_domain_load(MUSIC_CONTROL_DOMAIN, ctxt->conf_edd); if (!ctxt->config) ctxt->config = calloc(1, sizeof(Music_Control_Config)); if (!music_control_dbus_init(ctxt, music_player_players[ctxt->config->player_selected].dbus_name)) goto error_dbus_bus_get; music_control_mod = m; e_gadcon_provider_register(&_gc_class); if (ctxt->config->pause_on_desklock) desklock_handler = ecore_event_handler_add(E_EVENT_DESKLOCK, _desklock_cb, ctxt); return ctxt; error_dbus_bus_get: free(ctxt); return NULL; }
EAPI void * e_modapi_init(E_Module *m) { e_configure_registry_category_add("screen", 30, _("Screen"), NULL, "preferences-desktop-display"); e_configure_registry_item_add("screen/randr", 20, _("Screen Setup"), NULL, "preferences-system-screen-resolution", e_int_config_randr); conf_randr_module = m; e_module_delayed_set(m, 1); conf_edd = E_CONFIG_DD_NEW("RandRR_Dialog_Config", Config); #undef T #undef D #define T Config #define D conf_edd E_CONFIG_VAL(D, T, display_disconnected_outputs, UCHAR); #undef T #undef D randr_dialog_config = e_config_domain_load("module.conf_randr", conf_edd); if (!randr_dialog_config) { randr_dialog_config = E_NEW(Config, 1); randr_dialog_config->display_disconnected_outputs = EINA_FALSE; } return m; }
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; }
EINTERN int e_icon_init(void) { #ifdef USE_ICON_CACHE Eet_File *ef; char buf[PATH_MAX]; #undef T #undef D #define T Cache_Item #define D cache_item_edd D = E_CONFIG_DD_NEW("Cache_Item", T); E_CONFIG_VAL(D, T, timestamp, UINT); #undef T #undef D #define T Cache #define D cache_edd D = E_CONFIG_DD_NEW("Cache", T); E_CONFIG_HASH(D, T, hash, cache_item_edd); #undef T #undef D e_user_dir_concat_static(buf, "icon_cache.eet"); ef = eet_open(buf, EET_FILE_MODE_READ_WRITE); if (!ef) return 1; /* not critical */ _cache = eet_data_read(ef, cache_edd, "idx"); if (!_cache) _cache = E_NEW(Cache, 1); if (!_cache->hash) _cache->hash = eina_hash_string_superfast_new(_e_icon_cache_item_free); eet_close(ef); _cache->file = strdup(buf); _cache->ef = NULL; #endif return 1; }
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 ("Uptime_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, check_interval, INT); E_CONFIG_VAL (D, T, update_interval, INT); conf_edd = E_CONFIG_DD_NEW ("Uptime_Config", Config); #undef T #undef D #define T Config #define D conf_edd E_CONFIG_LIST (D, T, items, conf_item_edd); ut_config = e_config_domain_load ("module.uptime", conf_edd); if (!ut_config) { Config_Item *ci; ut_config = E_NEW (Config, 1); ci = E_NEW (Config_Item, 1); ci->id = eina_stringshare_add ("0"); ci->check_interval = 60.0; ci->update_interval = 60.0; ut_config->items = eina_list_append (ut_config->items, ci); } ut_config->module = m; e_gadcon_provider_register (&_gc_class); return m; }
/* * This is the first function called by e17 when you click the enable button */ EAPI void * e_modapi_init(E_Module *m) { /* Note-to-self, if you add a catagory, and you did not add any item * to it , IT WILL NOT BE DISPLAYED!!! */ //e_configure_registry_category_add("elive", 32, "Elive", NULL, // NULL); e_configure_registry_item_add("preferences/skeletor", 10, "Skeletor Configuration", NULL, "preferences-system-screen-resolution",e_int_config_skeletor_module); conf_item_edd = E_CONFIG_DD_NEW("Config_Item", Config_Item); #undef T #undef D #define T Config_Item #define D conf_item_edd E_CONFIG_VAL(D, T, id, STR); conf_edd = E_CONFIG_DD_NEW("Config", Config); #undef T #undef D #define T Config #define D conf_edd E_CONFIG_LIST(D, T, items, conf_item_edd); E_CONFIG_VAL(D, T, set, INT); skeletor_config = e_config_domain_load("module.skeletor", conf_edd); if(!skeletor_config) skeletor_config = E_NEW(Config, 1); skeletor_config->module = m; e_module_delayed_set(m, 1); return m; }
void evry_history_init(void) { #undef T #undef D hist_item_edd = E_CONFIG_DD_NEW("History_Item", History_Item); #define T History_Item #define D hist_item_edd E_CONFIG_VAL(D, T, plugin, STR); E_CONFIG_VAL(D, T, context, STR); E_CONFIG_VAL(D, T, input, STR); E_CONFIG_VAL(D, T, last_used, DOUBLE); E_CONFIG_VAL(D, T, usage, DOUBLE); E_CONFIG_VAL(D, T, count, INT); E_CONFIG_VAL(D, T, transient, INT); E_CONFIG_VAL(D, T, data, STR); #undef T #undef D hist_entry_edd = E_CONFIG_DD_NEW("History_Entry", History_Entry); #define T History_Entry #define D hist_entry_edd E_CONFIG_LIST(D, T, items, hist_item_edd); #undef T #undef D hist_types_edd = E_CONFIG_DD_NEW("History_Types", History_Types); #define T History_Types #define D hist_types_edd E_CONFIG_HASH(D, T, types, hist_entry_edd); #undef T #undef D hist_edd = E_CONFIG_DD_NEW("History", Evry_History); #define T Evry_History #define D hist_edd E_CONFIG_VAL(D, T, version, INT); E_CONFIG_VAL(D, T, begin, DOUBLE); E_CONFIG_HASH(D, T, subjects, hist_types_edd); #undef T #undef D }
/* public functions */ void * e_modapi_init(E_Module *m) { char buff[PATH_MAX]; snprintf(buff, sizeof(buff), "%s/locale", m->dir); bindtextdomain(PACKAGE, buff); bind_textdomain_codeset(PACKAGE, "UTF-8"); item_edd = E_CONFIG_DD_NEW("Config_Item", Config_Item); E_CONFIG_VAL(item_edd, Config_Item, id, STR); E_CONFIG_VAL(item_edd, Config_Item, celcius, INT); E_CONFIG_VAL(item_edd, Config_Item, location, STR); E_CONFIG_VAL(item_edd, Config_Item, google, STR); E_CONFIG_VAL(item_edd, Config_Item, plugin, STR); E_CONFIG_VAL(item_edd, Config_Item, poll_time, DOUBLE); conf_edd = E_CONFIG_DD_NEW("Config", Config); E_CONFIG_VAL(conf_edd, Config, config_version, UINT); E_CONFIG_LIST(conf_edd, Config, items, item_edd); weather_cfg = e_config_domain_load("module.eweather", conf_edd); if (weather_cfg) { if (!e_util_module_config_check(D_("EWeather"), weather_cfg->config_version, MOD_CONFIG_FILE_VERSION)) { _weather_config_free(); weather_cfg = NULL; } } if (!weather_cfg) _weather_config_new(); weather_cfg->mod_dir = eina_stringshare_add(m->dir); _gc_register(); return m; }
EINTERN int e_intl_data_init(void) { _e_intl_input_method_config_edd = E_CONFIG_DD_NEW("input_method_config", E_Input_Method_Config); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, version, INT); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_name, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, gtk_im_module, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, qt_im_module, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, xmodifiers, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, ecore_imf_module, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_exec, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_setup_exec, STR); return 1; }
static void _e_mod_ds_config_load(void) { #undef T #undef D conf_edd = E_CONFIG_DD_NEW("Config", Config); #define T Config #define D conf_edd E_CONFIG_VAL(D, T, config_version, UINT); E_CONFIG_VAL(D, T, disable_ruler, UCHAR); E_CONFIG_VAL(D, T, disable_maximize, UCHAR); E_CONFIG_VAL(D, T, disable_transitions, UCHAR); E_CONFIG_VAL(D, T, disabled_transition_count, UINT); E_CONFIG_VAL(D, T, types.disable_PAN, UCHAR); E_CONFIG_VAL(D, T, types.disable_FADE_OUT, UCHAR); E_CONFIG_VAL(D, T, types.disable_FADE_IN, UCHAR); E_CONFIG_VAL(D, T, types.disable_BATMAN, UCHAR); E_CONFIG_VAL(D, T, types.disable_ZOOM_IN, UCHAR); E_CONFIG_VAL(D, T, types.disable_ZOOM_OUT, UCHAR); E_CONFIG_VAL(D, T, types.disable_GROW, UCHAR); E_CONFIG_VAL(D, T, types.disable_ROTATE_OUT, UCHAR); E_CONFIG_VAL(D, T, types.disable_ROTATE_IN, UCHAR); E_CONFIG_VAL(D, T, types.disable_SLIDE_SPLIT, UCHAR); E_CONFIG_VAL(D, T, types.disable_QUAD_SPLIT, UCHAR); E_CONFIG_VAL(D, T, types.disable_QUAD_MERGE, UCHAR); E_CONFIG_VAL(D, T, types.disable_BLINK, UCHAR); E_CONFIG_VAL(D, T, types.disable_VIEWPORT, UCHAR); ds_config = e_config_domain_load("module.compiz", conf_edd); if (ds_config) { if (!e_util_module_config_check("Compiz", ds_config->config_version, MOD_CONFIG_FILE_VERSION)) E_FREE(ds_config); } if (!ds_config) ds_config = E_NEW(Config, 1); ds_config->config_version = MOD_CONFIG_FILE_VERSION; }
EAPI void * e_modapi_init(E_Module *m) { char buf[4096]; /* Set up a new configuration panel */ snprintf(buf, sizeof(buf), "%s/e-module-gadman.edj", m->dir); e_configure_registry_category_add("extensions", 90, _("Extensions"), NULL, "preferences-extensions"); e_configure_registry_item_add("extensions/gadman", 150, _("Gadgets"), NULL, buf, _config_gadman_module); /* Set this module to be loaded after all other modules, or we don't see modules loaded after this */ e_module_priority_set(m, 100); gadman_init(m); //Settings values Man->conf_edd = E_CONFIG_DD_NEW("Gadman_Config", Config); #undef T #undef D #define T Config #define D Man->conf_edd E_CONFIG_VAL(D, T, bg_type, INT); E_CONFIG_VAL(D, T, color_r, INT); E_CONFIG_VAL(D, T, color_g, INT); E_CONFIG_VAL(D, T, color_b, INT); E_CONFIG_VAL(D, T, color_a, INT); E_CONFIG_VAL(D, T, anim_bg, INT); E_CONFIG_VAL(D, T, anim_gad, INT); E_CONFIG_VAL(D, T, custom_bg, STR); Man->conf = e_config_domain_load("module.gadman", Man->conf_edd); if (!Man->conf) { Man->conf = E_NEW(Config, 1); Man->conf->bg_type = 0; Man->conf->color_r = 255; Man->conf->color_g = 255; Man->conf->color_b = 255; Man->conf->color_a = 255; Man->conf->anim_bg = 1; Man->conf->anim_gad = 1; Man->conf->custom_bg = NULL; } E_CONFIG_LIMIT(Man->conf->bg_type, 0, 5); E_CONFIG_LIMIT(Man->conf->color_r, 0, 255); E_CONFIG_LIMIT(Man->conf->color_g, 0, 255); E_CONFIG_LIMIT(Man->conf->color_b, 0, 255); E_CONFIG_LIMIT(Man->conf->color_a, 0, 255); E_CONFIG_LIMIT(Man->conf->anim_bg, 0, 1); E_CONFIG_LIMIT(Man->conf->anim_gad, 0, 1); /* Menu augmentation */ Man->icon_name = eina_stringshare_add(buf); Man->maug = NULL; Man->maug = e_int_menus_menu_augmentation_add_sorted ("config/1", _("Gadgets"), _gadman_maug_add, (void *)Man->icon_name, NULL, NULL); /* Create toggle action */ Man->action = e_action_add("gadman_toggle"); if (Man->action) { Man->action->func.go = _gadman_action_cb; e_action_predef_name_set(_("Gadgets"), _("Show/hide gadgets"), "gadman_toggle", NULL, NULL, 0); } gadman_update_bg(); return Man; }
int news_config_init(void) { _news_feed_edd = E_CONFIG_DD_NEW("News_Feed", News_Feed); #undef T #undef D #define T News_Feed #define D _news_feed_edd E_CONFIG_VAL(D, T, name, STR); E_CONFIG_VAL(D, T, name_ovrw, SHORT); E_CONFIG_VAL(D, T, language, STR); E_CONFIG_VAL(D, T, language_ovrw, SHORT); E_CONFIG_VAL(D, T, description, STR); E_CONFIG_VAL(D, T, description_ovrw, SHORT); E_CONFIG_VAL(D, T, url_home, STR); E_CONFIG_VAL(D, T, url_home_ovrw, SHORT); E_CONFIG_VAL(D, T, url_feed, STR); E_CONFIG_VAL(D, T, icon, STR); E_CONFIG_VAL(D, T, icon_ovrw, SHORT); E_CONFIG_VAL(D, T, important, SHORT); _news_feed_ref_edd = E_CONFIG_DD_NEW("News_Feed_Ref", News_Feed_Ref); #undef T #undef D #define T News_Feed_Ref #define D _news_feed_ref_edd E_CONFIG_VAL(D, T, category, STR); E_CONFIG_VAL(D, T, name, STR); _news_feed_category_edd = E_CONFIG_DD_NEW("News_Feed_Category", News_Feed_Category); #undef T #undef D #define T News_Feed_Category #define D _news_feed_category_edd E_CONFIG_VAL(D, T, name, STR); E_CONFIG_VAL(D, T, icon, STR); E_CONFIG_LIST(D, T, feeds, _news_feed_edd); _news_feed_lang_edd = E_CONFIG_DD_NEW("News_Feed_Lang", News_Feed_Lang); #undef T #undef D #define T News_Feed_Lang #define D _news_feed_lang_edd E_CONFIG_VAL(D, T, key, STR); E_CONFIG_VAL(D, T, name, STR); _news_item_edd = E_CONFIG_DD_NEW("News_Item", News_Config_Item); #undef T #undef D #define T News_Config_Item #define D _news_item_edd E_CONFIG_VAL(D, T, id, STR); E_CONFIG_LIST(D, T, feed_refs, _news_feed_ref_edd); E_CONFIG_VAL(D, T, view_mode, SHORT); E_CONFIG_VAL(D, T, openmethod, SHORT); E_CONFIG_VAL(D, T, browser_open_home, SHORT); _news_edd = E_CONFIG_DD_NEW("News", News_Config); #undef T #undef D #define T News_Config #define D _news_edd E_CONFIG_VAL(D, T, version, SHORT); E_CONFIG_LIST(D, T, feed.categories, _news_feed_category_edd); E_CONFIG_VAL(D, T, feed.timer_m, INT); E_CONFIG_VAL(D, T, feed.sort_name, INT); E_CONFIG_LIST(D, T, feed.langs, _news_feed_lang_edd); E_CONFIG_VAL(D, T, feed.langs_all, SHORT); E_CONFIG_VAL(D, T, feed.langs_notset, SHORT); E_CONFIG_VAL(D, T, proxy.enable, SHORT); E_CONFIG_VAL(D, T, proxy.host, STR); E_CONFIG_VAL(D, T, proxy.port, INT); E_CONFIG_VAL(D, T, viewer.vfeeds.unread_first, SHORT); E_CONFIG_VAL(D, T, viewer.varticles.unread_first, SHORT); E_CONFIG_VAL(D, T, viewer.varticles.sort_date, SHORT); E_CONFIG_VAL(D, T, viewer.vcontent.font_size, SHORT); E_CONFIG_VAL(D, T, viewer.vcontent.font_color, STR); E_CONFIG_VAL(D, T, viewer.vcontent.font_shadow, SHORT); E_CONFIG_VAL(D, T, viewer.vcontent.font_shadow_color, STR); E_CONFIG_VAL(D, T, popup_news.active, SHORT); E_CONFIG_VAL(D, T, popup_news.timer_s, INT); E_CONFIG_VAL(D, T, popup_other.on_timeout, SHORT); E_CONFIG_VAL(D, T, popup_other.timer_s, INT); E_CONFIG_LIST(D, T, items, _news_item_edd); news->config = e_config_domain_load("module.news", _news_edd); if (news->config) { if (news->config->version < NEWS_CONFIG_VERSION) { news_util_message_show(D_("<hilight>News module : Configuration Upgraded</hilight><br><br>" "Your configuration of news module<br>" "has been upgraded<br>" "Your settings were removed<br>" "Sorry for the inconvenience<br><br>" "(%d -> %d)"), news->config->version, NEWS_CONFIG_VERSION); news->config = NULL; } else { if (news->config->version > NEWS_CONFIG_VERSION) { news_util_message_show(D_("<hilight>News module : Configuration Downgraded</hilight><br><br>" "Your configuration of News module<br>" "has been downgraded<br>" "Your settings were removed<br>" "Sorry for the inconvenience<br><br>" "(%d ->%d)"), news->config->version, NEWS_CONFIG_VERSION); news->config = NULL; } } } if (!news->config) { News_Config *c; c = E_NEW(News_Config, 1); news->config = c; c->version = NEWS_CONFIG_VERSION; news_feed_all_restore(); c->feed.timer_m = NEWS_FEED_TIMER_DEFAULT; c->feed.sort_name = NEWS_FEED_SORT_NAME_DEFAULT; c->feed.langs = news_util_lang_detect(); c->feed.langs_all = NEWS_FEED_LANG_ALL_DEFAULT; c->feed.langs_notset = 1; if (news_util_proxy_detect()) c->proxy.enable = 1; else { c->proxy.host = NULL; c->proxy.port = NEWS_FEED_PROXY_PORT_DEFAULT; } c->viewer.vfeeds.unread_first = NEWS_VIEWER_VFEEDS_UNREAD_FIRST_DEFAULT; c->viewer.varticles.unread_first = NEWS_VIEWER_VARTICLES_UNREAD_FIRST_DEFAULT; c->viewer.varticles.sort_date = NEWS_VIEWER_VARTICLES_SORT_DATE_DEFAULT; c->viewer.vcontent.font_size = NEWS_VIEWER_VCONTENT_FONT_SIZE_DEFAULT; c->viewer.vcontent.font_color = eina_stringshare_add(NEWS_VIEWER_VCONTENT_FONT_COLOR_DEFAULT); c->viewer.vcontent.font_shadow = NEWS_VIEWER_VCONTENT_FONT_SHADOW_DEFAULT; c->viewer.vcontent.font_shadow_color = eina_stringshare_add(NEWS_VIEWER_VCONTENT_FONT_SHADOW_COLOR_DEFAULT); c->popup_news.active = NEWS_FEED_POPUP_NEWS_ACTIVE_DEFAULT; c->popup_news.timer_s = NEWS_FEED_POPUP_NEWS_TIMER_S_DEFAULT; c->popup_other.on_timeout = NEWS_FEED_POPUP_OTHER_ON_TIMEOUT_DEFAULT; c->popup_other.timer_s = NEWS_FEED_POPUP_OTHER_TIMER_S_DEFAULT; } E_CONFIG_LIMIT(news->config->feed.timer_m, NEWS_FEED_TIMER_MIN, NEWS_FEED_TIMER_MAX); E_CONFIG_LIMIT(news->config->feed.sort_name, 0, 1); E_CONFIG_LIMIT(news->config->proxy.enable, 0, 1); E_CONFIG_LIMIT(news->config->proxy.port, 1, 65535); E_CONFIG_LIMIT(news->config->viewer.vfeeds.unread_first, 0, 1); E_CONFIG_LIMIT(news->config->viewer.varticles.unread_first, 0, 1); E_CONFIG_LIMIT(news->config->viewer.varticles.sort_date, 0, 1); E_CONFIG_LIMIT(news->config->viewer.vcontent.font_size, NEWS_VIEWER_VCONTENT_FONT_SIZE_MIN, NEWS_VIEWER_VCONTENT_FONT_SIZE_MAX); E_CONFIG_LIMIT(news->config->viewer.vcontent.font_shadow, 0, 1); E_CONFIG_LIMIT(news->config->popup_news.timer_s, NEWS_POPUP_TIMER_S_MIN, NEWS_POPUP_TIMER_S_MAX); E_CONFIG_LIMIT(news->config->popup_other.on_timeout, 0, 1); E_CONFIG_LIMIT(news->config->popup_other.timer_s, NEWS_POPUP_TIMER_S_MIN, NEWS_POPUP_TIMER_S_MAX); return 1; }
EAPI void * e_modapi_init(E_Module *m) { char buf[4096]; Eina_List *l; snprintf(buf, sizeof(buf), "%s/locale", e_module_dir_get(m)); bindtextdomain(PACKAGE, buf); bind_textdomain_codeset(PACKAGE, "UTF-8"); _alarms_edd = E_CONFIG_DD_NEW("Alarm_Alarm", Alarm); #undef T #undef D #define T Alarm #define D _alarms_edd E_CONFIG_VAL(D, T, name, STR); E_CONFIG_VAL(D, T, state, SHORT); E_CONFIG_VAL(D, T, description, STR); E_CONFIG_VAL(D, T, autoremove, SHORT); E_CONFIG_VAL(D, T, open_popup, SHORT); E_CONFIG_VAL(D, T, run_program, SHORT); E_CONFIG_VAL(D, T, program, STR); E_CONFIG_VAL(D, T, sched.type, SHORT); E_CONFIG_VAL(D, T, sched.date_epoch, DOUBLE); E_CONFIG_VAL(D, T, sched.day_monday, SHORT); E_CONFIG_VAL(D, T, sched.day_tuesday, SHORT); E_CONFIG_VAL(D, T, sched.day_wenesday, SHORT); E_CONFIG_VAL(D, T, sched.day_thursday, SHORT); E_CONFIG_VAL(D, T, sched.day_friday, SHORT); E_CONFIG_VAL(D, T, sched.day_saturday, SHORT); E_CONFIG_VAL(D, T, sched.day_sunday, SHORT); E_CONFIG_VAL(D, T, sched.hour, SHORT); E_CONFIG_VAL(D, T, sched.minute, SHORT); E_CONFIG_VAL(D, T, snooze.hour, SHORT); E_CONFIG_VAL(D, T, snooze.minute, SHORT); E_CONFIG_VAL(D, T, snooze.remember, SHORT); _conf_edd = E_CONFIG_DD_NEW("Alarm_Config", Config); #undef T #undef D #define T Config #define D _conf_edd E_CONFIG_VAL(D, T, time_format, SHORT); E_CONFIG_VAL(D, T, alarms_state, SHORT); E_CONFIG_LIST(D, T, alarms, _alarms_edd); E_CONFIG_VAL(D, T, alarms_details, SHORT); E_CONFIG_VAL(D, T, alarms_autoremove_default, SHORT); E_CONFIG_VAL(D, T, alarms_open_popup_default, SHORT); E_CONFIG_VAL(D, T, alarms_run_program_default, SHORT); E_CONFIG_VAL(D, T, alarms_program_default, STR); E_CONFIG_VAL(D, T, config_version, SHORT); alarm_config = e_config_domain_load("module.alarm", _conf_edd); if (alarm_config) { if (alarm_config->config_version < CONFIG_VERSION) { snprintf(buf, sizeof(buf), D_("<hilight>Alarm module : Configuration Upgraded</hilight><br><br>" "Your configuration of alarm module<br>" "has been upgraded<br>" "Your settings and alarms were removed<br>" "Sorry for the inconvenience<br><br>" "(%d -> %d)"), alarm_config->config_version, CONFIG_VERSION); e_module_dialog_show(alarm_config->module, D_("Alarm Module version " MODULE_VERSION), buf); alarm_config = NULL; } else { if (alarm_config->config_version > CONFIG_VERSION) { snprintf(buf, sizeof(buf), D_("<hilight>Alarm module : Configuration Downgraded</hilight><br><br>" "Your configuration of Alarm module<br>" "has been downgraded<br>" "Your settings and alarms were removed<br>" "Sorry for the inconvenience<br><br>" "(%d ->%d)"), alarm_config->config_version, CONFIG_VERSION); e_module_dialog_show(alarm_config->module, D_("Alarm Module version " MODULE_VERSION), buf); alarm_config = NULL; } } } if (!alarm_config) { alarm_config = E_NEW(Config, 1); alarm_config->time_format = TIME_FORMAT_DEFAULT; alarm_config->alarms_state = ALARM_STATE_OFF; alarm_config->alarms_details = ALARMS_DETAILS_DEFAULT; alarm_config->alarms_autoremove_default = ALARMS_AUTOREMOVE_DEFAULT; alarm_config->alarms_open_popup_default = ALARMS_OPEN_POPUP_DEFAULT; alarm_config->alarms_run_program_default = ALARMS_RUN_PROGRAM_DEFAULT; alarm_config->config_version = CONFIG_VERSION; } E_CONFIG_LIMIT(alarm_config->time_format, TIME_FORMAT_12, TIME_FORMAT_24); E_CONFIG_LIMIT(alarm_config->alarms_details, 0, 1); E_CONFIG_LIMIT(alarm_config->alarms_autoremove_default, 0, 1); E_CONFIG_LIMIT(alarm_config->alarms_open_popup_default, 0, 1); /* set the number of ringing alarms */ for (l=alarm_config->alarms; l; l=eina_list_next(l)) { Alarm *al; al = eina_list_data_get(l); if (al->state == ALARM_STATE_RINGING) alarm_config->alarms_ringing_nb++; } /* set alarms state and check dates */ if (alarm_config->alarms) { for (l=alarm_config->alarms; l; l=eina_list_next(l)) { Alarm *al; al = eina_list_data_get(l); _alarm_check_date(al, 0); } alarm_config->alarms_ring_etimer = ecore_timer_add(ALARMS_CHECK_TIMER, _cb_alarms_ring_etimer, NULL); } //FIXME not sure about that, maybe must use edje directly to find the part if (!e_theme_category_find(THEME_IN_E)) { char buf[512]; snprintf(buf, sizeof(buf), "%s/alarm.edj", e_module_dir_get(m)); alarm_config->theme = strdup(buf); } alarm_config->module = m; e_gadcon_provider_register((const E_Gadcon_Client_Class *)&_gadcon_class); return alarm_config; }
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_box_edd = E_CONFIG_DD_NEW ("Mail_Box_Config", Config_Box); #undef T #undef D #define T Config_Box #define D conf_box_edd E_CONFIG_VAL (D, T, name, STR); E_CONFIG_VAL (D, T, type, INT); E_CONFIG_VAL (D, T, port, INT); E_CONFIG_VAL (D, T, monitor, UCHAR); E_CONFIG_VAL (D, T, ssl, UCHAR); E_CONFIG_VAL (D, T, local, UCHAR); E_CONFIG_VAL (D, T, host, STR); E_CONFIG_VAL (D, T, user, STR); E_CONFIG_VAL (D, T, pass, STR); E_CONFIG_VAL (D, T, new_path, STR); E_CONFIG_VAL (D, T, cur_path, STR); E_CONFIG_VAL (D, T, use_exec, UCHAR); E_CONFIG_VAL (D, T, exec, STR); conf_item_edd = E_CONFIG_DD_NEW ("Mail_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_label, UCHAR); E_CONFIG_VAL (D, T, check_time, DOUBLE); E_CONFIG_VAL (D, T, show_popup, UCHAR); E_CONFIG_VAL (D, T, show_popup_empty, UCHAR); E_CONFIG_LIST (D, T, boxes, conf_box_edd); conf_edd = E_CONFIG_DD_NEW ("Mail_Config", Config); #undef T #undef D #define T Config #define D conf_edd E_CONFIG_LIST (D, T, items, conf_item_edd); mail_config = e_config_domain_load ("module.mail", conf_edd); if (!mail_config) { Config_Item *ci; mail_config = E_NEW (Config, 1); ci = E_NEW (Config_Item, 1); ci->id = eina_stringshare_add ("0"); ci->show_label = 1; ci->check_time = 15.0; ci->show_popup = 1; ci->show_popup_empty = 0; ci->boxes = NULL; mail_config->items = eina_list_append (mail_config->items, ci); } mail_config->module = m; e_gadcon_provider_register (&_gc_class); return m; }