<commit_before>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "e.h"

#if ((E17_PROFILE >= LOWRES_PDA) && (E17_PROFILE <= HIRES_PDA))
#define DEF_MENUCLICK 1.25
#else
#define DEF_MENUCLICK 0.25
#endif

EAPI E_Config *e_config = NULL;

/* local subsystem functions */
static int  _e_config_save_cb(void *data);
static void _e_config_free(void);
static int  _e_config_cb_timer(void *data);
static void _e_config_eet_close_handle(Eet_File *ef, char *file);

/* local subsystem globals */
static int _e_config_save_block = 0;
static Ecore_Timer *_e_config_save_timer = NULL;
static char *_e_config_profile = NULL;

static E_Config_DD *_e_config_edd = NULL;
static E_Config_DD *_e_config_module_edd = NULL;
static E_Config_DD *_e_config_font_fallback_edd = NULL;
static E_Config_DD *_e_config_font_default_edd = NULL;
static E_Config_DD *_e_config_theme_edd = NULL;
static E_Config_DD *_e_config_bindings_mouse_edd = NULL;
static E_Config_DD *_e_config_bindings_key_edd = NULL;
static E_Config_DD *_e_config_bindings_signal_edd = NULL;
static E_Config_DD *_e_config_bindings_wheel_edd = NULL;
static E_Config_DD *_e_config_path_append_edd = NULL;
static E_Config_DD *_e_config_desktop_bg_edd = NULL;
static E_Config_DD *_e_config_desktop_name_edd = NULL;
static E_Config_DD *_e_config_remember_edd = NULL;
static E_Config_DD *_e_config_color_class_edd = NULL;
static E_Config_DD *_e_config_gadcon_edd = NULL;
static E_Config_DD *_e_config_gadcon_client_edd = NULL;
static E_Config_DD *_e_config_shelf_edd = NULL;


/* externally accessible functions */
EAPI int
e_config_init(void)
{
   _e_config_profile = getenv("CONF_PROFILE");
   if (!_e_config_profile)
     {
	Eet_File *ef;
	char buf[4096];
	char *homedir;

	homedir = e_user_homedir_get();
	snprintf(buf, sizeof(buf), "%s/.e/e/config/profile.cfg",
		 homedir);
	ef = eet_open(buf, EET_FILE_MODE_READ);
	E_FREE(homedir);
	if (ef)
	  {
	     char *data;
	     int data_len = 0;
	     
	     data = eet_read(ef, "config", &data_len);
	     if ((data) && (data_len > 0))
	       {
		  _e_config_profile = malloc(data_len + 1);
		  if (_e_config_profile)
		    {
		       memcpy(_e_config_profile, data, data_len);
		       _e_config_profile[data_len] = 0;
		    }
		  free(data);
	       }
	     eet_close(ef);
	  }
	else
	  _e_config_profile = strdup("default");
     }
   else _e_config_profile = strdup(_e_config_profile);

   _e_config_gadcon_client_edd = E_CONFIG_DD_NEW("E_Config_Gadcon_Client", E_Config_Gadcon_Client);
#undef T
#undef D
#define T E_Config_Gadcon_Client
#define D _e_config_gadcon_client_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, id, STR);
   E_CONFIG_VAL(D, T, geom.pos, INT);
   E_CONFIG_VAL(D, T, geom.size, INT);
   E_CONFIG_VAL(D, T, geom.res, INT);
   E_CONFIG_VAL(D, T, style, STR);
   E_CONFIG_VAL(D, T, autoscroll, UCHAR);
   E_CONFIG_VAL(D, T, resizable, UCHAR);
   
   _e_config_gadcon_edd = E_CONFIG_DD_NEW("E_Config_Gadcon", E_Config_Gadcon);
#undef T
#undef D
#define T E_Config_Gadcon
#define D _e_config_gadcon_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, id, STR);
   E_CONFIG_LIST(D, T, clients, _e_config_gadcon_client_edd);
   
   _e_config_shelf_edd = E_CONFIG_DD_NEW("E_Config_Shelf", E_Config_Shelf);
#undef T
#undef D
#define T E_Config_Shelf
#define D _e_config_shelf_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, container, INT);
   E_CONFIG_VAL(D, T, zone, INT);
   E_CONFIG_VAL(D, T, layer, INT);
   E_CONFIG_VAL(D, T, popup, UCHAR);
   E_CONFIG_VAL(D, T, orient, INT);
   E_CONFIG_VAL(D, T, fit_along, UCHAR);
   E_CONFIG_VAL(D, T, fit_size, UCHAR);
   E_CONFIG_VAL(D, T, style, STR);
   E_CONFIG_VAL(D, T, size, INT);
   
   _e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", E_Config_Desktop_Background);
#undef T
#undef D
#define T E_Config_Desktop_Background
#define D _e_config_desktop_bg_edd
   E_CONFIG_VAL(D, T, container, INT);
   E_CONFIG_VAL(D, T, zone, INT);
   E_CONFIG_VAL(D, T, desk_x, INT);
   E_CONFIG_VAL(D, T, desk_y, INT);
   E_CONFIG_VAL(D, T, file, STR);
   
   _e_config_desktop_name_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Name", E_Config_Desktop_Name);
#undef T
#undef D
#define T E_Config_Desktop_Name
#define D _e_config_desktop_name_edd
   E_CONFIG_VAL(D, T, container, INT);
   E_CONFIG_VAL(D, T, zone, INT);
   E_CONFIG_VAL(D, T, desk_x, INT);
   E_CONFIG_VAL(D, T, desk_y, INT);
   E_CONFIG_VAL(D, T, name, STR);

   _e_config_path_append_edd = E_CONFIG_DD_NEW("E_Path_Dir", E_Path_Dir);
#undef T
#undef D
#define T E_Path_Dir
#define D _e_config_path_append_edd
   E_CONFIG_VAL(D, T, dir, STR);

   _e_config_theme_edd = E_CONFIG_DD_NEW("E_Config_Theme", E_Config_Theme);
#undef T
#undef D
#define T E_Config_Theme
#define D _e_config_theme_edd
   E_CONFIG_VAL(D, T, category, STR);
   E_CONFIG_VAL(D, T, file, STR);
   
   _e_config_module_edd = E_CONFIG_DD_NEW("E_Config_Module", E_Config_Module);
#undef T
#undef D
#define T E_Config_Module
#define D _e_config_module_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, enabled, UCHAR);

   _e_config_font_default_edd = E_CONFIG_DD_NEW("E_Font_Default", 
						 E_Font_Default);   
#undef T
#undef D
#define T E_Font_Default
#define D _e_config_font_default_edd
   E_CONFIG_VAL(D, T, text_class, STR);
   E_CONFIG_VAL(D, T, font, STR);
   E_CONFIG_VAL(D, T, size, INT);

   _e_config_font_fallback_edd = E_CONFIG_DD_NEW("E_Font_Fallback", 
						  E_Font_Fallback);   
#undef T
#undef D
#define T E_Font_Fallback
#define D _e_config_font_fallback_edd
   E_CONFIG_VAL(D, T, name, STR);

   _e_config_bindings_mouse_edd = E_CONFIG_DD_NEW("E_Config_Binding_Mouse", E_Config_Binding_Mouse);
#undef T
#undef D
#define T E_Config_Binding_Mouse
#define D _e_config_bindings_mouse_edd
   E_CONFIG_VAL(D, T, context, INT);
   E_CONFIG_VAL(D, T, modifiers, INT);
   E_CONFIG_VAL(D, T, action, STR);
   E_CONFIG_VAL(D, T, params, STR);
   E_CONFIG_VAL(D, T, button, UCHAR);
   E_CONFIG_VAL(D, T, any_mod, UCHAR);

   _e_config_bindings_key_edd = E_CONFIG_DD_NEW("E_Config_Binding_Key", E_Config_Binding_Key);
#undef T
#undef D
#define T E_Config_Binding_Key
#define D _e_config_bindings_key_edd
   E_CONFIG_VAL(D, T, context, INT);
   E_CONFIG_VAL(D, T, modifiers, INT);
   E_CONFIG_VAL(D, T, key, STR);
   E_CONFIG_VAL(D, T, action, STR);
   E_CONFIG_VAL(D, T, params, STR);
   E_CONFIG_VAL(D, T, any_mod, UCHAR);

   _e_config_bindings_signal_edd = E_CONFIG_DD_NEW("E_Config_Binding_Signal", E_Config_Binding_Signal);
#undef T
#undef D
#define T E_Config_Binding_Signal
#define D _e_config_bindings_signal_edd
   E_CONFIG_VAL(D, T, context, INT);
   E_CONFIG_VAL(D, T, signal, STR);
   E_CONFIG_VAL(D, T, source, STR);
   E_CONFIG_VAL(D, T, modifiers, INT);
   E_CONFIG_VAL(D, T, any_mod, UCHAR);
   E_CONFIG_VAL(D, T, action, STR);
   E_CONFIG_VAL(D, T, params, STR);

   _e_config_bindings_wheel_edd = E_CONFIG_DD_NEW("E_Config_Binding_Wheel", E_Config_Binding_Wheel);
#undef T
#undef D
#define T E_Config_Binding_Wheel
#define D _e_config_bindings_wheel_edd
   E_CONFIG_VAL(D, T, context, INT);
   E_CONFIG_VAL(D, T, direction, INT);
   E_CONFIG_VAL(D, T, z, INT);
   E_CONFIG_VAL(D, T, modifiers, INT);
   E_CONFIG_VAL(D, T, any_mod, UCHAR);
   E_CONFIG_VAL(D, T, action, STR);
   E_CONFIG_VAL(D, T, params, STR);

   _e_config_remember_edd = E_CONFIG_DD_NEW("E_Remember", E_Remember);
#undef T
#undef D
#define T E_Remember
#define D _e_config_remember_edd
   E_CONFIG_VAL(D, T, match, INT);
   E_CONFIG_VAL(D, T, apply_first_only, UCHAR);
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, class, STR);
   E_CONFIG_VAL(D, T, title, STR);
   E_CONFIG_VAL(D, T, role, STR);
   E_CONFIG_VAL(D, T, type, INT);
   E_CONFIG_VAL(D, T, transient, UCHAR);
   E_CONFIG_VAL(D, T, apply, INT);
   E_CONFIG_VAL(D, T, prop.pos_x, INT);
   E_CONFIG_VAL(D, T, prop.pos_y, INT);
   E_CONFIG_VAL(D, T, prop.res_x, INT);
   E_CONFIG_VAL(D, T, prop.res_y, INT);
   E_CONFIG_VAL(D, T, prop.pos_w, INT);
   E_CONFIG_VAL(D, T, prop.pos_h, INT);
   E_CONFIG_VAL(D, T, prop.w, INT);
   E_CONFIG_VAL(D, T, prop.h, INT);
   E_CONFIG_VAL(D, T, prop.layer, INT);
   E_CONFIG_VAL(D, T, prop.lock_user_location, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_location, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_size, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_size, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_stacking, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_stacking, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_iconify, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_iconify, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_desk, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_desk, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_sticky, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_sticky, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_shade, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_shade, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_maximize, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_maximize, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_fullscreen, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_fullscreen, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_border, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_close, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_focus_in, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_focus_out, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_life, UCHAR);
   E_CONFIG_VAL(D, T, prop.border, STR);
   E_CONFIG_VAL(D, T, prop.sticky, UCHAR);
   E_CONFIG_VAL(D, T, prop.shaded, UCHAR);
   E_CONFIG_VAL(D, T, prop.skip_winlist, UCHAR);
   E_CONFIG_VAL(D, T, prop.desk_x, INT);
   E_CONFIG_VAL(D, T, prop.desk_y, INT);
   E_CONFIG_VAL(D, T, prop.zone, INT);
   E_CONFIG_VAL(D, T, prop.head, INT);
   E_CONFIG_VAL(D, T, prop.command, STR);
   
   _e_config_color_class_edd = E_CONFIG_DD_NEW("E_Color_Class", E_Color_Class);
#undef T
#undef D
#define T E_Color_Class
#define D _e_config_color_class_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, r, INT);
   E_CONFIG_VAL(D, T, g, INT);
   E_CONFIG_VAL(D, T, b, INT);
   E_CONFIG_VAL(D, T, a, INT);
   E_CONFIG_VAL(D, T, r2, INT);
   E_CONFIG_VAL(D, T, g2, INT);
   E_CONFIG_VAL(D, T, b2, INT);
   E_CONFIG_VAL(D, T, a2, INT);
   E_CONFIG_VAL(D, T, r3, INT);
   E_CONFIG_VAL(D, T, g3, INT);
   E_CONFIG_VAL(D, T, b3, INT);
   E_CONFIG_VAL(D, T, a3, INT);

   _e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config);
#undef T
#undef D
#define T E_Config
#define D _e_config_edd
   /**/ /* == already configurable via ipc */
   E_CONFIG_VAL(D, T, config_version, INT); /**/
   E_CONFIG_VAL(D, T, show_splash, INT); /**/
   E_CONFIG_VAL(D, T, init_default_theme, STR); /**/
   E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/
   E_CONFIG_VAL(D, T, desktop_default_name, STR); /**/
   E_CONFIG_LIST(D, T, desktop_backgrounds, _e_config_desktop_bg_edd); /**/
   E_CONFIG_LIST(D, T, desktop_names, _e_config_desktop_name_edd); /**/
   E_CONFIG_VAL(D, T, menus_scroll_speed, DOUBLE); /**/
   E_CONFIG_VAL(D, T, menus_fast_mouse_move_threshhold, DOUBLE); /**/
   E_CONFIG_VAL(D, T, menus_click_drag_timeout, DOUBLE); /**/
   E_CONFIG_VAL(D, T, border_shade_animate, INT); /**/
   E_CONFIG_VAL(D, T, border_shade_transition, INT); /**/
   E_CONFIG_VAL(D, T, border_shade_speed, DOUBLE); /**/
   E_CONFIG_VAL(D, T, framerate, DOUBLE); /**/
   E_CONFIG_VAL(D, T, image_cache, INT); /**/
   E_CONFIG_VAL(D, T, font_cache, INT); /**/
   E_CONFIG_VAL(D, T, edje_cache, INT); /**/
   E_CONFIG_VAL(D, T, edje_collection_cache, INT); /**/
   E_CONFIG_VAL(D, T, cache_flush_interval, DOUBLE); /**/
   E_CONFIG_VAL(D, T, zone_desks_x_count, INT); /**/
   E_CONFIG_VAL(D, T, zone_desks_y_count, INT); /**/
   E_CONFIG_VAL(D, T, use_virtual_roots, INT); /* should not make this a config option (for now) */
   E_CONFIG_VAL(D, T, use_edge_flip, INT); /**/
   E_CONFIG_VAL(D, T, edge_flip_timeout, DOUBLE); /**/
   E_CONFIG_VAL(D, T, evas_engine_default, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_container, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_init, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_menus, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_borders, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_errors, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_popups, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_drag, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_win, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_zone, INT); /**/
   E_CONFIG_VAL(D, T, language, STR); /**/
   E_CONFIG_LIST(D, T, modules, _e_config_module_edd); /**/
   E_CONFIG_LIST(D, T, font_fallbacks, _e_config_font_fallback_edd); /**/
   E_CONFIG_LIST(D, T, font_defaults, _e_config_font_default_edd); /**/
   E_CONFIG_LIST(D, T, themes, _e_config_theme_edd); /**/
   E_CONFIG_LIST(D, T, mouse_bindings, _e_config_bindings_mouse_edd); /**/
   E_CONFIG_LIST(D, T, key_bindings, _e_config_bindings_key_edd); /**/
   E_CONFIG_LIST(D, T, signal_bindings, _e_config_bindings_signal_edd); /**/
   E_CONFIG_LIST(D, T, wheel_bindings, _e_config_bindings_wheel_edd); /**/
   E_CONFIG_LIST(D, T, path_append_data, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_images, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_fonts, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_themes, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_init, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_icons, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_modules, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_backgrounds, _e_config_path_append_edd); /**/
   E_CONFIG_VAL(D, T, window_placement_policy, INT);
   E_CONFIG_VAL(D, T, focus_policy, INT); /**/
   E_CONFIG_VAL(D, T, focus_setting, INT); /**/
   E_CONFIG_VAL(D, T, pass_click_on, INT); /**/
   E_CONFIG_VAL(D, T, always_click_to_raise, INT); /**/
   E_CONFIG_VAL(D, T, always_click_to_focus, INT); /**/
   E_CONFIG_VAL(D, T, use_auto_raise, INT); /**/
   E_CONFIG_VAL(D, T, auto_raise_delay, DOUBLE); /**/
   E_CONFIG_VAL(D, T, use_resist, INT); /**/
   E_CONFIG_VAL(D, T, drag_resist, INT); /**/
   E_CONFIG_VAL(D, T, desk_resist, INT); /**/
   E_CONFIG_VAL(D, T, window_resist, INT); /**/
   E_CONFIG_VAL(D, T, gadget_resist, INT); /**/
   E_CONFIG_VAL(D, T, winlist_warp_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_warp_at_end, INT); /**/
   E_CONFIG_VAL(D, T, winlist_warp_speed, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_scroll_animate, INT); /**/
   E_CONFIG_VAL(D, T, winlist_scroll_speed, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_list_show_iconified, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_show_other_desk_windows, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_show_other_screen_windows, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_uncover_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_jump_desk_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_focus_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_raise_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_pos_align_x, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_pos_align_y, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_pos_size_w, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_pos_size_h, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_pos_min_w, INT); /**/
   E_CONFIG_VAL(D, T, winlist_pos_min_h, INT); /**/
   E_CONFIG_VAL(D, T, winlist_pos_max_w, INT); /**/
   E_CONFIG_VAL(D, T, winlist_pos_max_h, INT); /**/
   E_CONFIG_VAL(D, T, maximize_policy, INT); /**/
   E_CONFIG_VAL(D, T, allow_manip, INT); /**/
   E_CONFIG_VAL(D, T, kill_if_close_not_possible, INT); /**/
   E_CONFIG_VAL(D, T, kill_process, INT); /**/
   E_CONFIG_VAL(D, T, kill_timer_wait, DOUBLE); /**/
   E_CONFIG_VAL(D, T, ping_clients, INT); /**/
   E_CONFIG_VAL(D, T, ping_clients_wait, DOUBLE); /**/
   E_CONFIG_VAL(D, T, transition_start, STR); /**/
   E_CONFIG_VAL(D, T, transition_desk, STR); /**/
   E_CONFIG_VAL(D, T, transition_change, STR); /**/
   E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
   E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
   E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
   E_CONFIG_VAL(D, T, move_info_visible, INT); /**/
   E_CONFIG_VAL(D, T, resize_info_visible, INT); /**/
   E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT); /**/
   E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT); /**/
   E_CONFIG_VAL(D, T, use_e_cursor, INT); /**/
   E_CONFIG_VAL(D, T, cursor_size, INT); /**/
   E_CONFIG_VAL(D, T, menu_autoscroll_margin, INT); /**/
   E_CONFIG_VAL(D, T, menu_autoscroll_cursor_margin, INT); /**/
   E_CONFIG_VAL(D, T, transient.move, INT); /* FIXME: implement */
   E_CONFIG_VAL(D, T, transient.resize, INT); /* FIXME: implement */
   E_CONFIG_VAL(D, T, transient.raise, INT); /**/
   E_CONFIG_VAL(D, T, transient.lower, INT); /**/
   E_CONFIG_VAL(D, T, transient.layer, INT); /**/
   E_CONFIG_VAL(D, T, transient.desktop, INT); /**/
   E_CONFIG_VAL(D, T, transient.iconify, INT); /**/
   E_CONFIG_VAL(D, T, modal_windows, INT); /**/
   E_CONFIG_VAL(D, T, menu_eap_name_show, INT); /**/
   E_CONFIG_VAL(D, T, menu_eap_generic_show, INT); /**/
   E_CONFIG_VAL(D, T, menu_eap_comment_show, INT); /**/
   E_CONFIG_VAL(D, T, fullscreen_policy, INT); /**/
   E_CONFIG_VAL(D, T, input_method, STR); /**/
   E_CONFIG_LIST(D, T, path_append_input_methods, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_messages, _e_config_path_append_edd); /**/
   E_CONFIG_VAL(D, T, exebuf_max_exe_list, INT);
   E_CONFIG_VAL(D, T, exebuf_max_eap_list, INT);
   E_CONFIG_VAL(D, T, exebuf_scroll_animate, INT);
   E_CONFIG_VAL(D, T, exebuf_scroll_speed, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_align_x, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_align_y, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_size_w, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_size_h, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_min_w, INT);
   E_CONFIG_VAL(D, T, exebuf_pos_min_h, INT);
   E_CONFIG_VAL(D, T, exebuf_pos_max_w, INT);
   E_CONFIG_VAL(D, T, exebuf_pos_max_h, INT);
   E_CONFIG_LIST(D, T, color_classes, _e_config_color_class_edd);
   E_CONFIG_VAL(D, T, use_app_icon, INT);
   E_CONFIG_VAL(D, T, cfgdlg_auto_apply, INT); /**/
   E_CONFIG_VAL(D, T, cfgdlg_default_mode, INT); /**/
   E_CONFIG_LIST(D, T, gadcons, _e_config_gadcon_edd);
   E_CONFIG_LIST(D, T, shelves, _e_config_shelf_edd);
   E_CONFIG_VAL(D, T, font_hinting, INT); /**/
   E_CONFIG_VAL(D, T, desklock_personal_passwd, STR);
   E_CONFIG_VAL(D, T, desklock_background, STR);
   E_CONFIG_VAL(D, T, desklock_auth_method, INT);
   E_CONFIG_VAL(D, T, desklock_login_box_zone, INT);
   E_CONFIG_VAL(D, T, desklock_autolock, INT);
   E_CONFIG_VAL(D, T, desklock_use_timeout, INT);
   E_CONFIG_VAL(D, T, desklock_timeout, DOUBLE);
   E_CONFIG_VAL(D, T, desklock_disable_screensaver, INT);
   E_CONFIG_VAL(D, T, display_res_restore, INT);
   E_CONFIG_VAL(D, T, display_res_width, INT);
   E_CONFIG_VAL(D, T, display_res_height, INT);
   E_CONFIG_VAL(D, T, display_res_hz, INT);
   E_CONFIG_VAL(D, T, display_res_rotation, INT);
   
   E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT);
   E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
   E_CONFIG_VAL(D, T, desk_flip_wrap, INT);
   
   e_config = e_config_domain_load("e", _e_config_edd);
   if (e_config)
     {
	if ((e_config->config_version >> 16) < E_CONFIG_FILE_EPOCH)
	  {
	     /* your config is too old - need new defaults */
	     _e_config_free();
	     ecore_timer_add(1.0, _e_config_cb_timer,
			     _("Configuration data needed upgrading. Your old configuration<br>"
			       "has been wiped and a new set of defaults initialized. This<br>"
			       "will happen regularly during development, so don't report a<br>"
			       "bug. This simply means Enlightenment needs new configuration<br>"
			       "data by default for usable functionality that your old<br>"
			       "configuration simply lacks. This new set of defaults will fix<br>"
			       "that by adding it in. You can re-configure things now to your<br>"
			       "liking. Sorry for the hiccup in your configuration.<br>"));
	  }
	else if (e_config->config_version > E_CONFIG_FILE_VERSION)
	  {
	     /* your config is too new - what the fuck??? */
	     _e_config_free();
	     ecore_timer_add(1.0, _e_config_cb_timer,
			     _("Your configuration is NEWER than Enlightenment. This is very<br>"
			       "strange. This should not happen unless you downgraded<br>"
			       "Enlightenment or copied the configuration from a place where<br>"
			       "a newer version of Enlightenment was running. This is bad and<br>"
			       "as a precaution your configuration has been now restored to<br>"
			       "defaults. Sorry for the inconvenience.<br>"));
	  }
     }
   
   if (!e_config)
     {
	/* DEFAULT CONFIG */
	e_config = E_NEW(E_Config, 1);
	e_config->config_version = (E_CONFIG_FILE_EPOCH << 16);
     }
#define IFCFG(v) \
   if ((e_config->config_version & 0xffff) < (v)) { \
      e_config->config_version = (e_config->config_version & 0xffff0000) | (v)
#define IFCFGEND }
   IFCFG(0x008d);
   e_config->show_splash = 1;
   e_config->init_default_theme = NULL;
   e_config->desktop_default_background = NULL;
   e_config->desktop_default_name = evas_stringshare_add(_("Desktop %i, %i"));
   e_config->menus_scroll_speed = 1000.0;
   e_config->menus_fast_mouse_move_threshhold = 300.0;
   e_config->menus_click_drag_timeout = DEF_MENUCLICK;
   e_config->border_shade_animate = 1;
   e_config->border_shade_transition = E_TRANSITION_DECELERATE;
   e_config->border_shade_speed = 3000.0;
   e_config->framerate = 30.0;
   e_config->image_cache = 4096;
   e_config->font_cache = 512;
   e_config->edje_cache = 32;
   e_config->edje_collection_cache = 64;
   e_config->cache_flush_interval = 60.0;
   e_config->zone_desks_x_count = 4;
   e_config->zone_desks_y_count = 1;
   e_config->use_virtual_roots = 0;
   e_config->use_edge_flip = 1;
   e_config->edge_flip_timeout = 0.25;
   e_config->evas_engine_default = E_EVAS_ENGINE_SOFTWARE_X11;
   e_config->evas_engine_container = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_init = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_menus = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_borders = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_errors = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_popups = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_drag = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_win = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_zone = E_EVAS_ENGINE_DEFAULT;
   e_config->language = NULL;
   e_config->window_placement_policy = E_WINDOW_PLACEMENT_SMART;
   e_config->focus_policy = E_FOCUS_SLOPPY;
   e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED;
   e_config->pass_click_on = 1;
   e_config->always_click_to_raise = 0;
   e_config->always_click_to_focus = 0;
   e_config->use_auto_raise = 0;
   e_config->auto_raise_delay = 0.5;
   e_config->use_resist = 1;
   e_config->drag_resist = 16;
   e_config->desk_resist = 32;
   e_config->window_resist = 12;
   e_config->gadget_resist = 32;
   e_config->winlist_warp_while_selecting = 1;
   e_config->winlist_warp_at_end = 1;
   e_config->winlist_warp_speed = 0.1;
   e_config->winlist_scroll_animate = 1;
   e_config->winlist_scroll_speed = 0.1;
   e_config->winlist_list_show_iconified = 1;
   e_config->winlist_list_show_other_desk_windows = 0;
   e_config->winlist_list_show_other_screen_windows = 0;
   e_config->winlist_list_uncover_while_selecting = 0;
   e_config->winlist_list_jump_desk_while_selecting = 0;
   e_config->winlist_list_focus_while_selecting = 1;
   e_config->winlist_list_raise_while_selecting = 1;
   e_config->winlist_pos_align_x = 0.5;
   e_config->winlist_pos_align_y = 0.5;
   e_config->winlist_pos_size_w = 0.5;
   e_config->winlist_pos_size_h = 0.5;
   e_config->winlist_pos_min_w = 0;
   e_config->winlist_pos_min_h = 0;
   e_config->winlist_pos_max_w = 320;
   e_config->winlist_pos_max_h = 320;
   e_config->maximize_policy = E_MAXIMIZE_SMART | E_MAXIMIZE_BOTH;
   e_config->allow_manip = 0;
   e_config->kill_if_close_not_possible = 1;
   e_config->kill_process = 1;
   e_config->kill_timer_wait = 10.0;
   e_config->ping_clients = 1;
   e_config->ping_clients_wait = 10.0;
   e_config->transition_start = NULL;
   e_config->transition_desk = evas_stringshare_add("vswipe");
   e_config->transition_change = evas_stringshare_add("crossfade");
   e_config->move_info_follows = 1;
   e_config->resize_info_follows = 1;
   e_config->move_info_visible = 1;
   e_config->resize_info_visible = 1;
   e_config->focus_last_focused_per_desktop = 1;
   e_config->focus_revert_on_hide_or_close = 1;
   e_config->use_e_cursor = 1;
   e_config->cursor_size = 32;
   e_config->menu_autoscroll_margin = 0;
   e_config->menu_autoscroll_cursor_margin = 1;
   e_config->transient.move = 1;
   e_config->transient.resize = 0;
   e_config->transient.raise = 1;
   e_config->transient.lower = 1;
   e_config->transient.layer = 1;
   e_config->transient.desktop = 1;
   e_config->transient.iconify = 1;
   e_config->modal_windows = 1;
   e_config->menu_eap_name_show = 1;
   e_config->menu_eap_generic_show = 1;
   e_config->menu_eap_comment_show = 0;
   e_config->fullscreen_policy = E_FULLSCREEN_RESIZE;
   e_config->input_method = NULL;	
   e_config->exebuf_max_exe_list = 20;
   e_config->exebuf_max_eap_list = 20;
   e_config->exebuf_scroll_animate = 1;
   e_config->exebuf_scroll_speed = 0.1;
   e_config->exebuf_pos_align_x = 0.5;
   e_config->exebuf_pos_align_y = 0.5;
   e_config->exebuf_pos_size_w = 0.75;
   e_config->exebuf_pos_size_h = 0.25;
   e_config->exebuf_pos_min_w = 200;
   e_config->exebuf_pos_min_h = 160;
   e_config->exebuf_pos_max_w = 400;
   e_config->exebuf_pos_max_h = 320;
   e_config->color_classes = NULL;
   e_config->use_app_icon = 0;
   e_config->cfgdlg_auto_apply = 0;
   e_config->cfgdlg_default_mode = 0;
   e_config->gadcons = NULL;
   e_config->font_hinting = 0;
   
   e_config->desklock_personal_passwd = <PASSWORD>;
   e_config->desklock_background = NULL;
   e_config->desklock_auth_method = 0;
   e_config->desklock_login_box_zone = -1;
   e_config->desklock_autolock = 0;
   e_config->desklock_use_timeout = 0;
   e_config->desklock_timeout = 300.0;
   e_config->desklock_disable_screensaver = 0;
   
   e_config->display_res_restore = 0;
   e_config->display_res_width = 0;
   e_config->display_res_height = 0;
   e_config->display_res_hz = 0;
   e_config->display_res_rotation = 0;
   
     {
	E_Config_Module *em;

#define CFG_MODULE(_name, _enabled) \
   em = E_NEW(E_Config_Module, 1); \
   em->name = evas_stringshare_add(_name); \
   em->enabled = _enabled; \
   e_config->modules = evas_list_append(e_config->modules, em)

	CFG_MODULE("start", 1);
	CFG_MODULE("ibar", 1);
	CFG_MODULE("ibox", 1);
	CFG_MODULE("dropshadow", 1);
	CFG_MODULE("clock", 1);
	CFG_MODULE("battery", 1);
	CFG_MODULE("cpufreq", 1);
	CFG_MODULE("temperature", 1);
	CFG_MODULE("pager", 1);
     }
     {
//	E_Font_Fallback* eff;
	
#define CFG_FONTFALLBACK(_name) \
   eff = E_NEW(E_Font_Fallback, 1); \
   eff->name = evas_stringshare_add(_name); \
   e_config->font_fallbacks = evas_list_append(e_config->font_fallbacks, eff)
	
//	CFG_FONTFALLBACK("New-Sung");
//	CFG_FONTFALLBACK("Kochi-Gothic");
//	CFG_FONTFALLBACK("Baekmuk-Dotum");
     }
     { 
	E_Font_Default* efd;
	
#define CFG_FONTDEFAULT(_tclass, _name, _size) \
   efd = E_NEW(E_Font_Default, 1); \
   efd->text_class = evas_stringshare_add(_tclass); \
   efd->font = evas_stringshare_add(_name); \
   efd->size = _size; \
   e_config->font_defaults = evas_list_append(e_config->font_defaults, efd)
	
	CFG_FONTDEFAULT("default", "Vera", 10);
	CFG_FONTDEFAULT("title_bar", "Vera", 10);
     }
     {
	E_Config_Theme *et;
	
	et = E_NEW(E_Config_Theme, 1);
	et->category = evas_stringshare_add("theme");
	et->file = evas_stringshare_add("default.edj");
	e_config->themes = evas_list_append(e_config->themes, et);
     }
     {
	E_Config_Binding_Mouse *eb;

#define CFG_MOUSEBIND(_context, _button, _modifiers, _anymod, _action, _params) \
   eb = E_NEW(E_Config_Binding_Mouse, 1); \
   eb->context = _context; \
   eb->button = _button; \
   eb->modifiers = _modifiers; \
   eb->any_mod = _anymod; \
   eb->action = _action == NULL ? NULL : evas_stringshare_add(_action); \
   eb->params = _params == NULL ? NULL : evas_stringshare_add(_params); \
   e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb)
	
	CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 1,
		      E_BINDING_MODIFIER_ALT, 0, 
		      "window_move", NULL);
	CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 2,
		      E_BINDING_MODIFIER_ALT, 0, 
		      "window_resize", NULL);
	CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 3,
		      E_BINDING_MODIFIER_ALT, 0, 
		      "window_menu", NULL);
	CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 1,
		      0, 0, 
		      "menu_show", "main");
	CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 2,
		      0, 0, 
		      "menu_show", "clients");
	CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 3,
		      0, 0, 
		      "menu_show", "favorites");
     }
     {
	E_Config_Binding_Key *eb;

#define CFG_KEYBIND(_context, _key, _modifiers, _anymod, _action, _params) \
   eb = E_NEW(E_Config_Binding_Key, 1); \
   eb->context = _context; \
   eb->key = evas_stringshare_add(_key); \
   eb->modifiers = _modifiers; \
   eb->any_mod = _anymod; \
   eb->action = _action == NULL ? NULL : evas_stringshare_add(_action); \
   eb->params = _params == NULL ? NULL : evas_stringshare_add(_params); \
   e_config->key_bindings = evas_list_append(e_config->key_bindings, eb)

	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Left",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "desk_flip_by", "-1 0");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Right",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "desk_flip_by", "1 0");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Up",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "desk_flip_by", "0 -1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Down",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "desk_flip_by", "0 1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Up",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_raise", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Down",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_lower", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "x",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_close", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "k",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_kill", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "w",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_menu", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "s",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_sticky_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "i",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_iconic_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "f",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_maximized_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F10",
		    E_BINDING_MODIFIER_ALT, 0,
		    "window_maximized_toggle", "vertical");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F10",
		    E_BINDING_MODIFIER_CTRL, 0,
		    "window_maximized_toggle", "horizontal");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "r",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_shaded_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Left",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_by", "-1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Right",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_by", "1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F1",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "0");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F2",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F3",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "2");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F4",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "3");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F5",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "4");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F6",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "5");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F7",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "6");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F8",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "7");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F9",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "8");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F10",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "9");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F11",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "10");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F12",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "11");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "m",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "menu_show", "main");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "a",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "menu_show", "favorites");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Menu",
		    0, 0,
		    "menu_show", "main");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Menu",
		    E_BINDING_MODIFIER_CTRL, 0,
		    "menu_show", "clients");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Menu",
		    E_BINDING_MODIFIER_ALT, 0,
		    "menu_show", "favorites");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Insert",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "exec", "Eterm");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Tab",
		    E_BINDING_MODIFIER_ALT, 0,
		    "winlist", "next");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Tab",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "winlist", "prev");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "g",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "edit_mode_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "End",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "restart", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Delete",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "exit", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Escape",
		    E_BINDING_MODIFIER_ALT, 0,
		    "exebuf", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "l",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "desk_lock", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "d",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "zone_deskshow_toggle", NULL);
     }
     {
	E_Config_Binding_Signal *eb;

#define CFG_SIGNALBIND(_context, _signal, _source, _modifiers, _anymod, _action, _params) \
   eb = E_NEW(E_Config_Binding_Signal, 1); \
   eb->context = _context; \
   eb->signal = _signal == NULL ? NULL : evas_stringshare_add(_signal); \
   eb->source = _source == NULL ? NULL : evas_stringshare_add(_source); \
   eb->modifiers = _modifiers; \
   eb->any_mod = _anymod; \
   eb->action = _action == NULL ? NULL : evas_stringshare_add(_action); \
   eb->params = _params == NULL ? NULL : evas_stringshare_add(_params); \
   e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb)
   
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1,double", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_shaded_toggle", "up");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,2", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_shaded_toggle", "up");		       
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,wheel,?,1", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_shaded", "0 up");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,wheel,?,-1", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_shaded", "1 up");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,3", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_menu", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,?", "icon",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_menu", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,[12]", "close",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_close", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,3", "close",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_kill", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,1", "maximize",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_maximized_toggle", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,2", "maximize",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_maximized_toggle", "smart");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,3", "maximize",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_maximized_toggle", "expand");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,?", "minimize",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_iconic_toggle", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "icon",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_drag_icon", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_move", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,up,1", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_move", "end");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "resize_tl",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_resize", "tl");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "resize_t",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_resize", "t");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "resize_tr",
		       E_BINDING_MODIFIER_NONE, 1, <commit_msg>allow shade buttons on borders<commit_after>/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "e.h"

#if ((E17_PROFILE >= LOWRES_PDA) && (E17_PROFILE <= HIRES_PDA))
#define DEF_MENUCLICK 1.25
#else
#define DEF_MENUCLICK 0.25
#endif

EAPI E_Config *e_config = NULL;

/* local subsystem functions */
static int  _e_config_save_cb(void *data);
static void _e_config_free(void);
static int  _e_config_cb_timer(void *data);
static void _e_config_eet_close_handle(Eet_File *ef, char *file);

/* local subsystem globals */
static int _e_config_save_block = 0;
static Ecore_Timer *_e_config_save_timer = NULL;
static char *_e_config_profile = NULL;

static E_Config_DD *_e_config_edd = NULL;
static E_Config_DD *_e_config_module_edd = NULL;
static E_Config_DD *_e_config_font_fallback_edd = NULL;
static E_Config_DD *_e_config_font_default_edd = NULL;
static E_Config_DD *_e_config_theme_edd = NULL;
static E_Config_DD *_e_config_bindings_mouse_edd = NULL;
static E_Config_DD *_e_config_bindings_key_edd = NULL;
static E_Config_DD *_e_config_bindings_signal_edd = NULL;
static E_Config_DD *_e_config_bindings_wheel_edd = NULL;
static E_Config_DD *_e_config_path_append_edd = NULL;
static E_Config_DD *_e_config_desktop_bg_edd = NULL;
static E_Config_DD *_e_config_desktop_name_edd = NULL;
static E_Config_DD *_e_config_remember_edd = NULL;
static E_Config_DD *_e_config_color_class_edd = NULL;
static E_Config_DD *_e_config_gadcon_edd = NULL;
static E_Config_DD *_e_config_gadcon_client_edd = NULL;
static E_Config_DD *_e_config_shelf_edd = NULL;


/* externally accessible functions */
EAPI int
e_config_init(void)
{
   _e_config_profile = getenv("CONF_PROFILE");
   if (!_e_config_profile)
     {
	Eet_File *ef;
	char buf[4096];
	char *homedir;

	homedir = e_user_homedir_get();
	snprintf(buf, sizeof(buf), "%s/.e/e/config/profile.cfg",
		 homedir);
	ef = eet_open(buf, EET_FILE_MODE_READ);
	E_FREE(homedir);
	if (ef)
	  {
	     char *data;
	     int data_len = 0;
	     
	     data = eet_read(ef, "config", &data_len);
	     if ((data) && (data_len > 0))
	       {
		  _e_config_profile = malloc(data_len + 1);
		  if (_e_config_profile)
		    {
		       memcpy(_e_config_profile, data, data_len);
		       _e_config_profile[data_len] = 0;
		    }
		  free(data);
	       }
	     eet_close(ef);
	  }
	else
	  _e_config_profile = strdup("default");
     }
   else _e_config_profile = strdup(_e_config_profile);

   _e_config_gadcon_client_edd = E_CONFIG_DD_NEW("E_Config_Gadcon_Client", E_Config_Gadcon_Client);
#undef T
#undef D
#define T E_Config_Gadcon_Client
#define D _e_config_gadcon_client_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, id, STR);
   E_CONFIG_VAL(D, T, geom.pos, INT);
   E_CONFIG_VAL(D, T, geom.size, INT);
   E_CONFIG_VAL(D, T, geom.res, INT);
   E_CONFIG_VAL(D, T, style, STR);
   E_CONFIG_VAL(D, T, autoscroll, UCHAR);
   E_CONFIG_VAL(D, T, resizable, UCHAR);
   
   _e_config_gadcon_edd = E_CONFIG_DD_NEW("E_Config_Gadcon", E_Config_Gadcon);
#undef T
#undef D
#define T E_Config_Gadcon
#define D _e_config_gadcon_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, id, STR);
   E_CONFIG_LIST(D, T, clients, _e_config_gadcon_client_edd);
   
   _e_config_shelf_edd = E_CONFIG_DD_NEW("E_Config_Shelf", E_Config_Shelf);
#undef T
#undef D
#define T E_Config_Shelf
#define D _e_config_shelf_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, container, INT);
   E_CONFIG_VAL(D, T, zone, INT);
   E_CONFIG_VAL(D, T, layer, INT);
   E_CONFIG_VAL(D, T, popup, UCHAR);
   E_CONFIG_VAL(D, T, orient, INT);
   E_CONFIG_VAL(D, T, fit_along, UCHAR);
   E_CONFIG_VAL(D, T, fit_size, UCHAR);
   E_CONFIG_VAL(D, T, style, STR);
   E_CONFIG_VAL(D, T, size, INT);
   
   _e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", E_Config_Desktop_Background);
#undef T
#undef D
#define T E_Config_Desktop_Background
#define D _e_config_desktop_bg_edd
   E_CONFIG_VAL(D, T, container, INT);
   E_CONFIG_VAL(D, T, zone, INT);
   E_CONFIG_VAL(D, T, desk_x, INT);
   E_CONFIG_VAL(D, T, desk_y, INT);
   E_CONFIG_VAL(D, T, file, STR);
   
   _e_config_desktop_name_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Name", E_Config_Desktop_Name);
#undef T
#undef D
#define T E_Config_Desktop_Name
#define D _e_config_desktop_name_edd
   E_CONFIG_VAL(D, T, container, INT);
   E_CONFIG_VAL(D, T, zone, INT);
   E_CONFIG_VAL(D, T, desk_x, INT);
   E_CONFIG_VAL(D, T, desk_y, INT);
   E_CONFIG_VAL(D, T, name, STR);

   _e_config_path_append_edd = E_CONFIG_DD_NEW("E_Path_Dir", E_Path_Dir);
#undef T
#undef D
#define T E_Path_Dir
#define D _e_config_path_append_edd
   E_CONFIG_VAL(D, T, dir, STR);

   _e_config_theme_edd = E_CONFIG_DD_NEW("E_Config_Theme", E_Config_Theme);
#undef T
#undef D
#define T E_Config_Theme
#define D _e_config_theme_edd
   E_CONFIG_VAL(D, T, category, STR);
   E_CONFIG_VAL(D, T, file, STR);
   
   _e_config_module_edd = E_CONFIG_DD_NEW("E_Config_Module", E_Config_Module);
#undef T
#undef D
#define T E_Config_Module
#define D _e_config_module_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, enabled, UCHAR);

   _e_config_font_default_edd = E_CONFIG_DD_NEW("E_Font_Default", 
						 E_Font_Default);   
#undef T
#undef D
#define T E_Font_Default
#define D _e_config_font_default_edd
   E_CONFIG_VAL(D, T, text_class, STR);
   E_CONFIG_VAL(D, T, font, STR);
   E_CONFIG_VAL(D, T, size, INT);

   _e_config_font_fallback_edd = E_CONFIG_DD_NEW("E_Font_Fallback", 
						  E_Font_Fallback);   
#undef T
#undef D
#define T E_Font_Fallback
#define D _e_config_font_fallback_edd
   E_CONFIG_VAL(D, T, name, STR);

   _e_config_bindings_mouse_edd = E_CONFIG_DD_NEW("E_Config_Binding_Mouse", E_Config_Binding_Mouse);
#undef T
#undef D
#define T E_Config_Binding_Mouse
#define D _e_config_bindings_mouse_edd
   E_CONFIG_VAL(D, T, context, INT);
   E_CONFIG_VAL(D, T, modifiers, INT);
   E_CONFIG_VAL(D, T, action, STR);
   E_CONFIG_VAL(D, T, params, STR);
   E_CONFIG_VAL(D, T, button, UCHAR);
   E_CONFIG_VAL(D, T, any_mod, UCHAR);

   _e_config_bindings_key_edd = E_CONFIG_DD_NEW("E_Config_Binding_Key", E_Config_Binding_Key);
#undef T
#undef D
#define T E_Config_Binding_Key
#define D _e_config_bindings_key_edd
   E_CONFIG_VAL(D, T, context, INT);
   E_CONFIG_VAL(D, T, modifiers, INT);
   E_CONFIG_VAL(D, T, key, STR);
   E_CONFIG_VAL(D, T, action, STR);
   E_CONFIG_VAL(D, T, params, STR);
   E_CONFIG_VAL(D, T, any_mod, UCHAR);

   _e_config_bindings_signal_edd = E_CONFIG_DD_NEW("E_Config_Binding_Signal", E_Config_Binding_Signal);
#undef T
#undef D
#define T E_Config_Binding_Signal
#define D _e_config_bindings_signal_edd
   E_CONFIG_VAL(D, T, context, INT);
   E_CONFIG_VAL(D, T, signal, STR);
   E_CONFIG_VAL(D, T, source, STR);
   E_CONFIG_VAL(D, T, modifiers, INT);
   E_CONFIG_VAL(D, T, any_mod, UCHAR);
   E_CONFIG_VAL(D, T, action, STR);
   E_CONFIG_VAL(D, T, params, STR);

   _e_config_bindings_wheel_edd = E_CONFIG_DD_NEW("E_Config_Binding_Wheel", E_Config_Binding_Wheel);
#undef T
#undef D
#define T E_Config_Binding_Wheel
#define D _e_config_bindings_wheel_edd
   E_CONFIG_VAL(D, T, context, INT);
   E_CONFIG_VAL(D, T, direction, INT);
   E_CONFIG_VAL(D, T, z, INT);
   E_CONFIG_VAL(D, T, modifiers, INT);
   E_CONFIG_VAL(D, T, any_mod, UCHAR);
   E_CONFIG_VAL(D, T, action, STR);
   E_CONFIG_VAL(D, T, params, STR);

   _e_config_remember_edd = E_CONFIG_DD_NEW("E_Remember", E_Remember);
#undef T
#undef D
#define T E_Remember
#define D _e_config_remember_edd
   E_CONFIG_VAL(D, T, match, INT);
   E_CONFIG_VAL(D, T, apply_first_only, UCHAR);
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, class, STR);
   E_CONFIG_VAL(D, T, title, STR);
   E_CONFIG_VAL(D, T, role, STR);
   E_CONFIG_VAL(D, T, type, INT);
   E_CONFIG_VAL(D, T, transient, UCHAR);
   E_CONFIG_VAL(D, T, apply, INT);
   E_CONFIG_VAL(D, T, prop.pos_x, INT);
   E_CONFIG_VAL(D, T, prop.pos_y, INT);
   E_CONFIG_VAL(D, T, prop.res_x, INT);
   E_CONFIG_VAL(D, T, prop.res_y, INT);
   E_CONFIG_VAL(D, T, prop.pos_w, INT);
   E_CONFIG_VAL(D, T, prop.pos_h, INT);
   E_CONFIG_VAL(D, T, prop.w, INT);
   E_CONFIG_VAL(D, T, prop.h, INT);
   E_CONFIG_VAL(D, T, prop.layer, INT);
   E_CONFIG_VAL(D, T, prop.lock_user_location, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_location, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_size, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_size, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_stacking, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_stacking, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_iconify, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_iconify, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_desk, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_desk, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_sticky, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_sticky, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_shade, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_shade, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_maximize, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_maximize, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_user_fullscreen, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_client_fullscreen, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_border, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_close, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_focus_in, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_focus_out, UCHAR);
   E_CONFIG_VAL(D, T, prop.lock_life, UCHAR);
   E_CONFIG_VAL(D, T, prop.border, STR);
   E_CONFIG_VAL(D, T, prop.sticky, UCHAR);
   E_CONFIG_VAL(D, T, prop.shaded, UCHAR);
   E_CONFIG_VAL(D, T, prop.skip_winlist, UCHAR);
   E_CONFIG_VAL(D, T, prop.desk_x, INT);
   E_CONFIG_VAL(D, T, prop.desk_y, INT);
   E_CONFIG_VAL(D, T, prop.zone, INT);
   E_CONFIG_VAL(D, T, prop.head, INT);
   E_CONFIG_VAL(D, T, prop.command, STR);
   
   _e_config_color_class_edd = E_CONFIG_DD_NEW("E_Color_Class", E_Color_Class);
#undef T
#undef D
#define T E_Color_Class
#define D _e_config_color_class_edd
   E_CONFIG_VAL(D, T, name, STR);
   E_CONFIG_VAL(D, T, r, INT);
   E_CONFIG_VAL(D, T, g, INT);
   E_CONFIG_VAL(D, T, b, INT);
   E_CONFIG_VAL(D, T, a, INT);
   E_CONFIG_VAL(D, T, r2, INT);
   E_CONFIG_VAL(D, T, g2, INT);
   E_CONFIG_VAL(D, T, b2, INT);
   E_CONFIG_VAL(D, T, a2, INT);
   E_CONFIG_VAL(D, T, r3, INT);
   E_CONFIG_VAL(D, T, g3, INT);
   E_CONFIG_VAL(D, T, b3, INT);
   E_CONFIG_VAL(D, T, a3, INT);

   _e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config);
#undef T
#undef D
#define T E_Config
#define D _e_config_edd
   /**/ /* == already configurable via ipc */
   E_CONFIG_VAL(D, T, config_version, INT); /**/
   E_CONFIG_VAL(D, T, show_splash, INT); /**/
   E_CONFIG_VAL(D, T, init_default_theme, STR); /**/
   E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/
   E_CONFIG_VAL(D, T, desktop_default_name, STR); /**/
   E_CONFIG_LIST(D, T, desktop_backgrounds, _e_config_desktop_bg_edd); /**/
   E_CONFIG_LIST(D, T, desktop_names, _e_config_desktop_name_edd); /**/
   E_CONFIG_VAL(D, T, menus_scroll_speed, DOUBLE); /**/
   E_CONFIG_VAL(D, T, menus_fast_mouse_move_threshhold, DOUBLE); /**/
   E_CONFIG_VAL(D, T, menus_click_drag_timeout, DOUBLE); /**/
   E_CONFIG_VAL(D, T, border_shade_animate, INT); /**/
   E_CONFIG_VAL(D, T, border_shade_transition, INT); /**/
   E_CONFIG_VAL(D, T, border_shade_speed, DOUBLE); /**/
   E_CONFIG_VAL(D, T, framerate, DOUBLE); /**/
   E_CONFIG_VAL(D, T, image_cache, INT); /**/
   E_CONFIG_VAL(D, T, font_cache, INT); /**/
   E_CONFIG_VAL(D, T, edje_cache, INT); /**/
   E_CONFIG_VAL(D, T, edje_collection_cache, INT); /**/
   E_CONFIG_VAL(D, T, cache_flush_interval, DOUBLE); /**/
   E_CONFIG_VAL(D, T, zone_desks_x_count, INT); /**/
   E_CONFIG_VAL(D, T, zone_desks_y_count, INT); /**/
   E_CONFIG_VAL(D, T, use_virtual_roots, INT); /* should not make this a config option (for now) */
   E_CONFIG_VAL(D, T, use_edge_flip, INT); /**/
   E_CONFIG_VAL(D, T, edge_flip_timeout, DOUBLE); /**/
   E_CONFIG_VAL(D, T, evas_engine_default, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_container, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_init, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_menus, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_borders, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_errors, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_popups, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_drag, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_win, INT); /**/
   E_CONFIG_VAL(D, T, evas_engine_zone, INT); /**/
   E_CONFIG_VAL(D, T, language, STR); /**/
   E_CONFIG_LIST(D, T, modules, _e_config_module_edd); /**/
   E_CONFIG_LIST(D, T, font_fallbacks, _e_config_font_fallback_edd); /**/
   E_CONFIG_LIST(D, T, font_defaults, _e_config_font_default_edd); /**/
   E_CONFIG_LIST(D, T, themes, _e_config_theme_edd); /**/
   E_CONFIG_LIST(D, T, mouse_bindings, _e_config_bindings_mouse_edd); /**/
   E_CONFIG_LIST(D, T, key_bindings, _e_config_bindings_key_edd); /**/
   E_CONFIG_LIST(D, T, signal_bindings, _e_config_bindings_signal_edd); /**/
   E_CONFIG_LIST(D, T, wheel_bindings, _e_config_bindings_wheel_edd); /**/
   E_CONFIG_LIST(D, T, path_append_data, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_images, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_fonts, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_themes, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_init, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_icons, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_modules, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_backgrounds, _e_config_path_append_edd); /**/
   E_CONFIG_VAL(D, T, window_placement_policy, INT);
   E_CONFIG_VAL(D, T, focus_policy, INT); /**/
   E_CONFIG_VAL(D, T, focus_setting, INT); /**/
   E_CONFIG_VAL(D, T, pass_click_on, INT); /**/
   E_CONFIG_VAL(D, T, always_click_to_raise, INT); /**/
   E_CONFIG_VAL(D, T, always_click_to_focus, INT); /**/
   E_CONFIG_VAL(D, T, use_auto_raise, INT); /**/
   E_CONFIG_VAL(D, T, auto_raise_delay, DOUBLE); /**/
   E_CONFIG_VAL(D, T, use_resist, INT); /**/
   E_CONFIG_VAL(D, T, drag_resist, INT); /**/
   E_CONFIG_VAL(D, T, desk_resist, INT); /**/
   E_CONFIG_VAL(D, T, window_resist, INT); /**/
   E_CONFIG_VAL(D, T, gadget_resist, INT); /**/
   E_CONFIG_VAL(D, T, winlist_warp_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_warp_at_end, INT); /**/
   E_CONFIG_VAL(D, T, winlist_warp_speed, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_scroll_animate, INT); /**/
   E_CONFIG_VAL(D, T, winlist_scroll_speed, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_list_show_iconified, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_show_other_desk_windows, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_show_other_screen_windows, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_uncover_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_jump_desk_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_focus_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_list_raise_while_selecting, INT); /**/
   E_CONFIG_VAL(D, T, winlist_pos_align_x, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_pos_align_y, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_pos_size_w, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_pos_size_h, DOUBLE); /**/
   E_CONFIG_VAL(D, T, winlist_pos_min_w, INT); /**/
   E_CONFIG_VAL(D, T, winlist_pos_min_h, INT); /**/
   E_CONFIG_VAL(D, T, winlist_pos_max_w, INT); /**/
   E_CONFIG_VAL(D, T, winlist_pos_max_h, INT); /**/
   E_CONFIG_VAL(D, T, maximize_policy, INT); /**/
   E_CONFIG_VAL(D, T, allow_manip, INT); /**/
   E_CONFIG_VAL(D, T, kill_if_close_not_possible, INT); /**/
   E_CONFIG_VAL(D, T, kill_process, INT); /**/
   E_CONFIG_VAL(D, T, kill_timer_wait, DOUBLE); /**/
   E_CONFIG_VAL(D, T, ping_clients, INT); /**/
   E_CONFIG_VAL(D, T, ping_clients_wait, DOUBLE); /**/
   E_CONFIG_VAL(D, T, transition_start, STR); /**/
   E_CONFIG_VAL(D, T, transition_desk, STR); /**/
   E_CONFIG_VAL(D, T, transition_change, STR); /**/
   E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
   E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
   E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
   E_CONFIG_VAL(D, T, move_info_visible, INT); /**/
   E_CONFIG_VAL(D, T, resize_info_visible, INT); /**/
   E_CONFIG_VAL(D, T, focus_last_focused_per_desktop, INT); /**/
   E_CONFIG_VAL(D, T, focus_revert_on_hide_or_close, INT); /**/
   E_CONFIG_VAL(D, T, use_e_cursor, INT); /**/
   E_CONFIG_VAL(D, T, cursor_size, INT); /**/
   E_CONFIG_VAL(D, T, menu_autoscroll_margin, INT); /**/
   E_CONFIG_VAL(D, T, menu_autoscroll_cursor_margin, INT); /**/
   E_CONFIG_VAL(D, T, transient.move, INT); /* FIXME: implement */
   E_CONFIG_VAL(D, T, transient.resize, INT); /* FIXME: implement */
   E_CONFIG_VAL(D, T, transient.raise, INT); /**/
   E_CONFIG_VAL(D, T, transient.lower, INT); /**/
   E_CONFIG_VAL(D, T, transient.layer, INT); /**/
   E_CONFIG_VAL(D, T, transient.desktop, INT); /**/
   E_CONFIG_VAL(D, T, transient.iconify, INT); /**/
   E_CONFIG_VAL(D, T, modal_windows, INT); /**/
   E_CONFIG_VAL(D, T, menu_eap_name_show, INT); /**/
   E_CONFIG_VAL(D, T, menu_eap_generic_show, INT); /**/
   E_CONFIG_VAL(D, T, menu_eap_comment_show, INT); /**/
   E_CONFIG_VAL(D, T, fullscreen_policy, INT); /**/
   E_CONFIG_VAL(D, T, input_method, STR); /**/
   E_CONFIG_LIST(D, T, path_append_input_methods, _e_config_path_append_edd); /**/
   E_CONFIG_LIST(D, T, path_append_messages, _e_config_path_append_edd); /**/
   E_CONFIG_VAL(D, T, exebuf_max_exe_list, INT);
   E_CONFIG_VAL(D, T, exebuf_max_eap_list, INT);
   E_CONFIG_VAL(D, T, exebuf_scroll_animate, INT);
   E_CONFIG_VAL(D, T, exebuf_scroll_speed, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_align_x, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_align_y, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_size_w, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_size_h, DOUBLE);
   E_CONFIG_VAL(D, T, exebuf_pos_min_w, INT);
   E_CONFIG_VAL(D, T, exebuf_pos_min_h, INT);
   E_CONFIG_VAL(D, T, exebuf_pos_max_w, INT);
   E_CONFIG_VAL(D, T, exebuf_pos_max_h, INT);
   E_CONFIG_LIST(D, T, color_classes, _e_config_color_class_edd);
   E_CONFIG_VAL(D, T, use_app_icon, INT);
   E_CONFIG_VAL(D, T, cfgdlg_auto_apply, INT); /**/
   E_CONFIG_VAL(D, T, cfgdlg_default_mode, INT); /**/
   E_CONFIG_LIST(D, T, gadcons, _e_config_gadcon_edd);
   E_CONFIG_LIST(D, T, shelves, _e_config_shelf_edd);
   E_CONFIG_VAL(D, T, font_hinting, INT); /**/
   E_CONFIG_VAL(D, T, desklock_personal_passwd, STR);
   E_CONFIG_VAL(D, T, desklock_background, STR);
   E_CONFIG_VAL(D, T, desklock_auth_method, INT);
   E_CONFIG_VAL(D, T, desklock_login_box_zone, INT);
   E_CONFIG_VAL(D, T, desklock_autolock, INT);
   E_CONFIG_VAL(D, T, desklock_use_timeout, INT);
   E_CONFIG_VAL(D, T, desklock_timeout, DOUBLE);
   E_CONFIG_VAL(D, T, desklock_disable_screensaver, INT);
   E_CONFIG_VAL(D, T, display_res_restore, INT);
   E_CONFIG_VAL(D, T, display_res_width, INT);
   E_CONFIG_VAL(D, T, display_res_height, INT);
   E_CONFIG_VAL(D, T, display_res_hz, INT);
   E_CONFIG_VAL(D, T, display_res_rotation, INT);
   
   E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT);
   E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
   E_CONFIG_VAL(D, T, desk_flip_wrap, INT);
   
   e_config = e_config_domain_load("e", _e_config_edd);
   if (e_config)
     {
	if ((e_config->config_version >> 16) < E_CONFIG_FILE_EPOCH)
	  {
	     /* your config is too old - need new defaults */
	     _e_config_free();
	     ecore_timer_add(1.0, _e_config_cb_timer,
			     _("Configuration data needed upgrading. Your old configuration<br>"
			       "has been wiped and a new set of defaults initialized. This<br>"
			       "will happen regularly during development, so don't report a<br>"
			       "bug. This simply means Enlightenment needs new configuration<br>"
			       "data by default for usable functionality that your old<br>"
			       "configuration simply lacks. This new set of defaults will fix<br>"
			       "that by adding it in. You can re-configure things now to your<br>"
			       "liking. Sorry for the hiccup in your configuration.<br>"));
	  }
	else if (e_config->config_version > E_CONFIG_FILE_VERSION)
	  {
	     /* your config is too new - what the fuck??? */
	     _e_config_free();
	     ecore_timer_add(1.0, _e_config_cb_timer,
			     _("Your configuration is NEWER than Enlightenment. This is very<br>"
			       "strange. This should not happen unless you downgraded<br>"
			       "Enlightenment or copied the configuration from a place where<br>"
			       "a newer version of Enlightenment was running. This is bad and<br>"
			       "as a precaution your configuration has been now restored to<br>"
			       "defaults. Sorry for the inconvenience.<br>"));
	  }
     }
   
   if (!e_config)
     {
	/* DEFAULT CONFIG */
	e_config = E_NEW(E_Config, 1);
	e_config->config_version = (E_CONFIG_FILE_EPOCH << 16);
     }
#define IFCFG(v) \
   if ((e_config->config_version & 0xffff) < (v)) { \
      e_config->config_version = (e_config->config_version & 0xffff0000) | (v)
#define IFCFGEND }
   IFCFG(0x008d);
   e_config->show_splash = 1;
   e_config->init_default_theme = NULL;
   e_config->desktop_default_background = NULL;
   e_config->desktop_default_name = evas_stringshare_add(_("Desktop %i, %i"));
   e_config->menus_scroll_speed = 1000.0;
   e_config->menus_fast_mouse_move_threshhold = 300.0;
   e_config->menus_click_drag_timeout = DEF_MENUCLICK;
   e_config->border_shade_animate = 1;
   e_config->border_shade_transition = E_TRANSITION_DECELERATE;
   e_config->border_shade_speed = 3000.0;
   e_config->framerate = 30.0;
   e_config->image_cache = 4096;
   e_config->font_cache = 512;
   e_config->edje_cache = 32;
   e_config->edje_collection_cache = 64;
   e_config->cache_flush_interval = 60.0;
   e_config->zone_desks_x_count = 4;
   e_config->zone_desks_y_count = 1;
   e_config->use_virtual_roots = 0;
   e_config->use_edge_flip = 1;
   e_config->edge_flip_timeout = 0.25;
   e_config->evas_engine_default = E_EVAS_ENGINE_SOFTWARE_X11;
   e_config->evas_engine_container = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_init = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_menus = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_borders = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_errors = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_popups = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_drag = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_win = E_EVAS_ENGINE_DEFAULT;
   e_config->evas_engine_zone = E_EVAS_ENGINE_DEFAULT;
   e_config->language = NULL;
   e_config->window_placement_policy = E_WINDOW_PLACEMENT_SMART;
   e_config->focus_policy = E_FOCUS_SLOPPY;
   e_config->focus_setting = E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED;
   e_config->pass_click_on = 1;
   e_config->always_click_to_raise = 0;
   e_config->always_click_to_focus = 0;
   e_config->use_auto_raise = 0;
   e_config->auto_raise_delay = 0.5;
   e_config->use_resist = 1;
   e_config->drag_resist = 16;
   e_config->desk_resist = 32;
   e_config->window_resist = 12;
   e_config->gadget_resist = 32;
   e_config->winlist_warp_while_selecting = 1;
   e_config->winlist_warp_at_end = 1;
   e_config->winlist_warp_speed = 0.1;
   e_config->winlist_scroll_animate = 1;
   e_config->winlist_scroll_speed = 0.1;
   e_config->winlist_list_show_iconified = 1;
   e_config->winlist_list_show_other_desk_windows = 0;
   e_config->winlist_list_show_other_screen_windows = 0;
   e_config->winlist_list_uncover_while_selecting = 0;
   e_config->winlist_list_jump_desk_while_selecting = 0;
   e_config->winlist_list_focus_while_selecting = 1;
   e_config->winlist_list_raise_while_selecting = 1;
   e_config->winlist_pos_align_x = 0.5;
   e_config->winlist_pos_align_y = 0.5;
   e_config->winlist_pos_size_w = 0.5;
   e_config->winlist_pos_size_h = 0.5;
   e_config->winlist_pos_min_w = 0;
   e_config->winlist_pos_min_h = 0;
   e_config->winlist_pos_max_w = 320;
   e_config->winlist_pos_max_h = 320;
   e_config->maximize_policy = E_MAXIMIZE_SMART | E_MAXIMIZE_BOTH;
   e_config->allow_manip = 0;
   e_config->kill_if_close_not_possible = 1;
   e_config->kill_process = 1;
   e_config->kill_timer_wait = 10.0;
   e_config->ping_clients = 1;
   e_config->ping_clients_wait = 10.0;
   e_config->transition_start = NULL;
   e_config->transition_desk = evas_stringshare_add("vswipe");
   e_config->transition_change = evas_stringshare_add("crossfade");
   e_config->move_info_follows = 1;
   e_config->resize_info_follows = 1;
   e_config->move_info_visible = 1;
   e_config->resize_info_visible = 1;
   e_config->focus_last_focused_per_desktop = 1;
   e_config->focus_revert_on_hide_or_close = 1;
   e_config->use_e_cursor = 1;
   e_config->cursor_size = 32;
   e_config->menu_autoscroll_margin = 0;
   e_config->menu_autoscroll_cursor_margin = 1;
   e_config->transient.move = 1;
   e_config->transient.resize = 0;
   e_config->transient.raise = 1;
   e_config->transient.lower = 1;
   e_config->transient.layer = 1;
   e_config->transient.desktop = 1;
   e_config->transient.iconify = 1;
   e_config->modal_windows = 1;
   e_config->menu_eap_name_show = 1;
   e_config->menu_eap_generic_show = 1;
   e_config->menu_eap_comment_show = 0;
   e_config->fullscreen_policy = E_FULLSCREEN_RESIZE;
   e_config->input_method = NULL;	
   e_config->exebuf_max_exe_list = 20;
   e_config->exebuf_max_eap_list = 20;
   e_config->exebuf_scroll_animate = 1;
   e_config->exebuf_scroll_speed = 0.1;
   e_config->exebuf_pos_align_x = 0.5;
   e_config->exebuf_pos_align_y = 0.5;
   e_config->exebuf_pos_size_w = 0.75;
   e_config->exebuf_pos_size_h = 0.25;
   e_config->exebuf_pos_min_w = 200;
   e_config->exebuf_pos_min_h = 160;
   e_config->exebuf_pos_max_w = 400;
   e_config->exebuf_pos_max_h = 320;
   e_config->color_classes = NULL;
   e_config->use_app_icon = 0;
   e_config->cfgdlg_auto_apply = 0;
   e_config->cfgdlg_default_mode = 0;
   e_config->gadcons = NULL;
   e_config->font_hinting = 0;
   
   e_config->desklock_personal_passwd = NULL;
   e_config->desklock_background = NULL;
   e_config->desklock_auth_method = 0;
   e_config->desklock_login_box_zone = -1;
   e_config->desklock_autolock = 0;
   e_config->desklock_use_timeout = 0;
   e_config->desklock_timeout = 300.0;
   e_config->desklock_disable_screensaver = 0;
   
   e_config->display_res_restore = 0;
   e_config->display_res_width = 0;
   e_config->display_res_height = 0;
   e_config->display_res_hz = 0;
   e_config->display_res_rotation = 0;
   
     {
	E_Config_Module *em;

#define CFG_MODULE(_name, _enabled) \
   em = E_NEW(E_Config_Module, 1); \
   em->name = evas_stringshare_add(_name); \
   em->enabled = _enabled; \
   e_config->modules = evas_list_append(e_config->modules, em)

	CFG_MODULE("start", 1);
	CFG_MODULE("ibar", 1);
	CFG_MODULE("ibox", 1);
	CFG_MODULE("dropshadow", 1);
	CFG_MODULE("clock", 1);
	CFG_MODULE("battery", 1);
	CFG_MODULE("cpufreq", 1);
	CFG_MODULE("temperature", 1);
	CFG_MODULE("pager", 1);
     }
     {
//	E_Font_Fallback* eff;
	
#define CFG_FONTFALLBACK(_name) \
   eff = E_NEW(E_Font_Fallback, 1); \
   eff->name = evas_stringshare_add(_name); \
   e_config->font_fallbacks = evas_list_append(e_config->font_fallbacks, eff)
	
//	CFG_FONTFALLBACK("New-Sung");
//	CFG_FONTFALLBACK("Kochi-Gothic");
//	CFG_FONTFALLBACK("Baekmuk-Dotum");
     }
     { 
	E_Font_Default* efd;
	
#define CFG_FONTDEFAULT(_tclass, _name, _size) \
   efd = E_NEW(E_Font_Default, 1); \
   efd->text_class = evas_stringshare_add(_tclass); \
   efd->font = evas_stringshare_add(_name); \
   efd->size = _size; \
   e_config->font_defaults = evas_list_append(e_config->font_defaults, efd)
	
	CFG_FONTDEFAULT("default", "Vera", 10);
	CFG_FONTDEFAULT("title_bar", "Vera", 10);
     }
     {
	E_Config_Theme *et;
	
	et = E_NEW(E_Config_Theme, 1);
	et->category = evas_stringshare_add("theme");
	et->file = evas_stringshare_add("default.edj");
	e_config->themes = evas_list_append(e_config->themes, et);
     }
     {
	E_Config_Binding_Mouse *eb;

#define CFG_MOUSEBIND(_context, _button, _modifiers, _anymod, _action, _params) \
   eb = E_NEW(E_Config_Binding_Mouse, 1); \
   eb->context = _context; \
   eb->button = _button; \
   eb->modifiers = _modifiers; \
   eb->any_mod = _anymod; \
   eb->action = _action == NULL ? NULL : evas_stringshare_add(_action); \
   eb->params = _params == NULL ? NULL : evas_stringshare_add(_params); \
   e_config->mouse_bindings = evas_list_append(e_config->mouse_bindings, eb)
	
	CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 1,
		      E_BINDING_MODIFIER_ALT, 0, 
		      "window_move", NULL);
	CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 2,
		      E_BINDING_MODIFIER_ALT, 0, 
		      "window_resize", NULL);
	CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 3,
		      E_BINDING_MODIFIER_ALT, 0, 
		      "window_menu", NULL);
	CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 1,
		      0, 0, 
		      "menu_show", "main");
	CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 2,
		      0, 0, 
		      "menu_show", "clients");
	CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 3,
		      0, 0, 
		      "menu_show", "favorites");
     }
     {
	E_Config_Binding_Key *eb;

#define CFG_KEYBIND(_context, _key, _modifiers, _anymod, _action, _params) \
   eb = E_NEW(E_Config_Binding_Key, 1); \
   eb->context = _context; \
   eb->key = evas_stringshare_add(_key); \
   eb->modifiers = _modifiers; \
   eb->any_mod = _anymod; \
   eb->action = _action == NULL ? NULL : evas_stringshare_add(_action); \
   eb->params = _params == NULL ? NULL : evas_stringshare_add(_params); \
   e_config->key_bindings = evas_list_append(e_config->key_bindings, eb)

	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Left",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "desk_flip_by", "-1 0");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Right",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "desk_flip_by", "1 0");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Up",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "desk_flip_by", "0 -1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Down",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "desk_flip_by", "0 1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Up",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_raise", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Down",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_lower", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "x",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_close", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "k",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_kill", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "w",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_menu", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "s",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_sticky_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "i",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_iconic_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "f",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_maximized_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F10",
		    E_BINDING_MODIFIER_ALT, 0,
		    "window_maximized_toggle", "vertical");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F10",
		    E_BINDING_MODIFIER_CTRL, 0,
		    "window_maximized_toggle", "horizontal");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "r",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "window_shaded_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Left",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_by", "-1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Right",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_by", "1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F1",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "0");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F2",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "1");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F3",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "2");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F4",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "3");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F5",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "4");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F6",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "5");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F7",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "6");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F8",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "7");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F9",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "8");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F10",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "9");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F11",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "10");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "F12",
		    E_BINDING_MODIFIER_ALT, 0,
		    "desk_linear_flip_to", "11");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "m",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "menu_show", "main");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "a",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "menu_show", "favorites");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Menu",
		    0, 0,
		    "menu_show", "main");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Menu",
		    E_BINDING_MODIFIER_CTRL, 0,
		    "menu_show", "clients");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Menu",
		    E_BINDING_MODIFIER_ALT, 0,
		    "menu_show", "favorites");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Insert",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "exec", "Eterm");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Tab",
		    E_BINDING_MODIFIER_ALT, 0,
		    "winlist", "next");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Tab",
		    E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
		    "winlist", "prev");
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "g",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "edit_mode_toggle", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "End",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "restart", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Delete",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "exit", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "Escape",
		    E_BINDING_MODIFIER_ALT, 0,
		    "exebuf", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "l",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "desk_lock", NULL);
	CFG_KEYBIND(E_BINDING_CONTEXT_ANY, "d",
		    E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
		    "zone_deskshow_toggle", NULL);
     }
     {
	E_Config_Binding_Signal *eb;

#define CFG_SIGNALBIND(_context, _signal, _source, _modifiers, _anymod, _action, _params) \
   eb = E_NEW(E_Config_Binding_Signal, 1); \
   eb->context = _context; \
   eb->signal = _signal == NULL ? NULL : evas_stringshare_add(_signal); \
   eb->source = _source == NULL ? NULL : evas_stringshare_add(_source); \
   eb->modifiers = _modifiers; \
   eb->any_mod = _anymod; \
   eb->action = _action == NULL ? NULL : evas_stringshare_add(_action); \
   eb->params = _params == NULL ? NULL : evas_stringshare_add(_params); \
   e_config->signal_bindings = evas_list_append(e_config->signal_bindings, eb)
   
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1,double", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_shaded_toggle", "up");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,2", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_shaded_toggle", "up");		       
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,wheel,?,1", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_shaded", "0 up");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,wheel,?,-1", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_shaded", "1 up");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,3", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_menu", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,?", "icon",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_menu", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,[12]", "close",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_close", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,3", "close",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_kill", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,1", "maximize",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_maximized_toggle", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,2", "maximize",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_maximized_toggle", "smart");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,3", "maximize",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_maximized_toggle", "expand");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,?", "minimize",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_iconic_toggle", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,clicked,?", "shade",
		       E_BINDING_MODIFIER_NONE, 1,
		       "window_shaded_toggle", "up");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "icon",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_drag_icon", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_move", NULL);
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,up,1", "title",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_move", "end");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "resize_tl",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_resize", "tl");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "resize_t",
		       E_BINDING_MODIFIER_NONE, 1, 
		       "window_resize", "t");
	CFG_SIGNALBIND(E_BINDING_CONTEXT_BORDER, "mouse,down,1", "resize_tr",
		       E_BINDING_MODIFIER_NONE, 1, 
{'fraction_non_alphanumeric': 0.12885029123156846, 'fraction_numerical': 0.009956971191688094, 'mean_word_length': 4.6394910113190795, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 396, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '306813', 'n_tokens_mistral': 33870, 'n_tokens_neox': 32316, 'n_words': 5295}