From: <enl...@li...> - 2002-10-01 18:08:12
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : apps/e Dir : e17/apps/e/src Modified Files: Tag: SPLIT Makefile.am actions.c actions.h border.c border.h config.c config.h delayed.c e_view_look.c iconbar.c main.c menu.c place.c resist.c view.c Added Files: Tag: SPLIT data.c data.h Log Message: Major config system changes. Renamed the config node stuff to be data nodes, since it was already being used for more than config data. Config data is now in one db, ~/.e/behavior/behavior.db, which is monitored by efsd. The data is read into a global config struct at startup and when the db changes, so no more accessing db's every time we need a config value. Be warned, you will need to edit your behavior.db with edb_*ed until ebindings gets updated to handle the combined database. Also, a change to the border code so that borders are displayed right before the client is shown. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/Makefile.am,v retrieving revision 1.50.2.4 retrieving revision 1.50.2.5 diff -u -3 -r1.50.2.4 -r1.50.2.5 --- Makefile.am 24 Sep 2002 20:17:46 -0000 1.50.2.4 +++ Makefile.am 1 Oct 2002 18:08:11 -0000 1.50.2.5 @@ -20,6 +20,7 @@ menubuild.h menubuild.c \ config.h config.c \ cursors.c cursors.h \ + data.c data.h \ debug.c debug.h \ delayed.h delayed.c \ desktops.h desktops.c \ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/actions.c,v retrieving revision 1.49.2.5 retrieving revision 1.49.2.6 diff -u -3 -r1.49.2.5 -r1.49.2.6 --- actions.c 2 Sep 2002 23:56:53 -0000 1.49.2.5 +++ actions.c 1 Oct 2002 18:08:11 -0000 1.49.2.6 @@ -20,7 +20,6 @@ static void e_action_find(char *action, E_Action_Type act, int button, char *key, Ecore_Event_Key_Modifiers mods, E_Object * object); -static void e_action_cleanup(E_Action * a); static void e_act_move_start(E_Object * object, E_Action * a, void *data, int x, int y, int rx, int ry); @@ -133,102 +132,14 @@ e_action_find(char *action, E_Action_Type act, int button, char *key, Ecore_Event_Key_Modifiers mods, E_Object * object) { - char *actions_db; - E_DB_File *db; - int i, num; - char *a_name = NULL; - char *a_action = NULL; - char *a_params = NULL; - int a_event = 0; - int a_button = 0; - char *a_key = NULL; - int a_modifiers = 0; - Evas_List * l; + Evas_List *l; E_Action *a; - static Evas_List * actions = NULL; - - E_CFG_FILE(cfg_actions, "actions"); D_ENTER; - E_CONFIG_CHECK_VALIDITY(cfg_actions, "actions"); - - /* if we had a previous list - nuke it */ - - /* FIXME: this has potential to segfault if reference - * counting is actually used and those actions are - * referenced in more than one place --cK. - */ - - if (actions) - { - for (l = actions; l; l = l->next) - { - a = l->data; - if (a) - e_action_cleanup(a); - } - actions = evas_list_free(actions); - } - /* now build the list again */ - actions_db = e_config_get("actions"); - db = e_db_open_read(actions_db); - if (!db) - D_RETURN; - if (!e_db_int_get(db, "/actions/count", &num)) - goto error; - for (i = 0; i < num; i++) - { - char buf[PATH_MAX]; - - snprintf(buf, PATH_MAX, "/actions/%i/name", i); - a_name = e_db_str_get(db, buf); - snprintf(buf, PATH_MAX, "/actions/%i/action", i); - a_action = e_db_str_get(db, buf); - snprintf(buf, PATH_MAX, "/actions/%i/params", i); - a_params = e_db_str_get(db, buf); - snprintf(buf, PATH_MAX, "/actions/%i/event", i); - e_db_int_get(db, buf, &a_event); - snprintf(buf, PATH_MAX, "/actions/%i/button", i); - e_db_int_get(db, buf, &a_button); - snprintf(buf, PATH_MAX, "/actions/%i/key", i); - a_key = e_db_str_get(db, buf); - snprintf(buf, PATH_MAX, "/actions/%i/modifiers", i); - e_db_int_get(db, buf, &a_modifiers); - - a = NEW(E_Action, 1); - ZERO(a, E_Action, 1); - - e_object_init(E_OBJECT(a), (E_Cleanup_Func) e_action_cleanup); - - a->name = a_name; - a->action = a_action; - a->params = a_params; - a->event = a_event; - a->button = a_button; - a->key = a_key; - a->modifiers = a_modifiers; - a->action_impl = NULL; - a->object = NULL; - a->started = 0; - actions = evas_list_append(actions, a); - /* it's a key? lets grab it! */ - if ((a->key) && (strlen(a->key) > 0)) - { - if (a->modifiers == -1) - e_keys_grab(a->key, ECORE_EVENT_KEY_MODIFIER_NONE, 1); - else - e_keys_grab(a->key, (Ecore_Event_Key_Modifiers) a->modifiers, - 0); - a->grabbed = 1; - } - } - error: - e_db_close(db); - E_CONFIG_CHECK_VALIDITY_END; /* run thru our actions list and match event, state and stuff with an */ /* and action for it */ - for (l = actions; l; l = l->next) + for (l = config_data->actions; l; l = l->next) { Evas_List * ll; @@ -288,7 +199,7 @@ D_RETURN; } -static void +void e_action_cleanup(E_Action * a) { D_ENTER; @@ -677,23 +588,10 @@ double align_y = 0.5; E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE; - E_CFG_INT(cfg_window_move_mode, "settings", "/window/move/mode", - E_GUIDES_BOX); - E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5); - E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5); - E_CFG_INT(cfg_guides_display_location, "settings", - "/guides/display/location", - E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE); - D_ENTER; e_block_start("menus"); - E_CONFIG_INT_GET(cfg_window_move_mode, move_mode); - E_CONFIG_FLOAT_GET(cfg_guides_display_x, align_x); - E_CONFIG_FLOAT_GET(cfg_guides_display_y, align_y); - E_CONFIG_INT_GET(cfg_guides_display_location, display_loc); - b = (E_Border *) object; if (!b) @@ -705,6 +603,7 @@ if (b->client.fixed) D_RETURN; + move_mode = config_data->window->move_mode; if (move_mode >= E_GUIDES_BOX) b->hold_changes = 1; /* if non opaque */ b->mode.move = 1; @@ -839,22 +738,10 @@ double align_y = 0.5; E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE; - E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode", - E_GUIDES_BOX); - E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5); - E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5); - E_CFG_INT(cfg_guides_display_location, "settings", - "/guides/display/location", - E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE); - D_ENTER; e_block_start("menus"); - E_CONFIG_INT_GET(cfg_window_resize_mode, resize_mode); - E_CONFIG_FLOAT_GET(cfg_guides_display_x, align_x); - E_CONFIG_FLOAT_GET(cfg_guides_display_y, align_y); - E_CONFIG_INT_GET(cfg_guides_display_location, display_loc); b = (E_Border *) object; if (!b) b = e_border_current_focused(); @@ -866,6 +753,7 @@ D_RETURN; if (b->current.shaded != 0) D_RETURN; + resize_mode = config_data->window->resize_mode; if (resize_mode >= E_GUIDES_BOX) b->hold_changes = 1; /* if non opaque */ ecore_window_gravity_set(b->win.client, StaticGravity); @@ -1043,22 +931,10 @@ double align_y = 0.5; E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE; - E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode", - E_GUIDES_BOX); - E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5); - E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5); - E_CFG_INT(cfg_guides_display_location, "settings", - "/guides/display/location", - E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE); - D_ENTER; e_block_start("menus"); - E_CONFIG_INT_GET(cfg_window_resize_mode, resize_mode); - E_CONFIG_FLOAT_GET(cfg_guides_display_x, align_x); - E_CONFIG_FLOAT_GET(cfg_guides_display_y, align_y); - E_CONFIG_INT_GET(cfg_guides_display_location, display_loc); b = (E_Border *) object; if (!b) b = e_border_current_focused(); @@ -1068,6 +944,7 @@ D_RETURN; if (b->current.shaded != 0) D_RETURN; + resize_mode = config_data->window->resize_mode; if (resize_mode >= E_GUIDES_BOX) b->hold_changes = 1; /* if non opaque */ ecore_window_gravity_set(b->win.client, StaticGravity); @@ -1205,22 +1082,10 @@ double align_y = 0.5; E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE; - E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode", - E_GUIDES_BOX); - E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5); - E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5); - E_CFG_INT(cfg_guides_display_location, "settings", - "/guides/display/location", - E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE); - D_ENTER; e_block_start("menus"); - E_CONFIG_INT_GET(cfg_window_resize_mode, resize_mode); - E_CONFIG_FLOAT_GET(cfg_guides_display_x, align_x); - E_CONFIG_FLOAT_GET(cfg_guides_display_y, align_y); - E_CONFIG_INT_GET(cfg_guides_display_location, display_loc); b = (E_Border *) object; if (!b) b = e_border_current_focused(); @@ -1230,6 +1095,7 @@ D_RETURN; if (b->current.shaded != 0) D_RETURN; + resize_mode = config_data->window->resize_mode; if (resize_mode >= E_GUIDES_BOX) b->hold_changes = 1; /* if non opaque */ ecore_window_gravity_set(b->win.client, StaticGravity); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/actions.h,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -u -3 -r1.13.2.1 -r1.13.2.2 --- actions.h 2 Sep 2002 23:56:52 -0000 1.13.2.1 +++ actions.h 1 Oct 2002 18:08:11 -0000 1.13.2.2 @@ -73,6 +73,7 @@ * i.e. the way E performs actions. */ void e_action_init(void); +void e_action_cleanup(E_Action *a); int e_action_start(char *action, E_Action_Type act, int button, char *key, Ecore_Event_Key_Modifiers mods, =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/border.c,v retrieving revision 1.72.2.11 retrieving revision 1.72.2.12 diff -u -3 -r1.72.2.11 -r1.72.2.12 --- border.c 24 Sep 2002 20:17:46 -0000 1.72.2.11 +++ border.c 1 Oct 2002 18:08:11 -0000 1.72.2.12 @@ -90,9 +90,7 @@ { int focus_mode; - E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0); - - E_CONFIG_INT_GET(cfg_focus_mode, focus_mode); + focus_mode = config_data->window->focus_mode; if ((focus_mode == 2) && (ev->mods == ECORE_EVENT_KEY_MODIFIER_NONE)) /* FIXME: also if pass click always set */ D_RETURN_(1); @@ -508,9 +506,7 @@ { int focus_mode; - E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0); - - E_CONFIG_INT_GET(cfg_focus_mode, focus_mode); + focus_mode = config_data->window->focus_mode; b->current.selected = 0; if (e->key_grab) b->current.select_lost_from_grab = 1; @@ -585,9 +581,7 @@ { int focus_mode; - E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0); - - E_CONFIG_INT_GET(cfg_focus_mode, focus_mode); + focus_mode = config_data->window->focus_mode; if (focus_mode == 2) { e_focus_set_focus(b); @@ -956,10 +950,8 @@ char *class = "Window_Grab"; int focus_mode; - E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0); - D_ENTER; - E_CONFIG_INT_GET(cfg_focus_mode, focus_mode); + focus_mode = config_data->window->focus_mode; /* pointer focus stuff */ if (focus_mode == 0) e_focus_set_focus(b); @@ -1010,11 +1002,9 @@ char *class = "Window_Grab"; int focus_mode; - E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0); - D_ENTER; - E_CONFIG_INT_GET(cfg_focus_mode, focus_mode); + focus_mode = config_data->window->focus_mode; ecore_pointer_grab(((Ecore_Event_Mouse_Down *) (e->event))->win, CurrentTime); border_mouse_x = mouse_x; @@ -1026,36 +1016,6 @@ y = ((Ecore_Event_Mouse_Down *) (e->event))->y; bt = ((Ecore_Event_Mouse_Down *) (e->event))->button; { - Evas_List * l; - - again: - for (l = b->grabs; l; l = l->next) - { - E_Grab *g; - - g = l->data; - /* find a grab that triggered this */ - if (((((Ecore_Event_Mouse_Down *) (e->event))->button == g->button) - || (g->button == 0)) && ((g->any_mod) - || - (((Ecore_Event_Mouse_Down *) (e-> - event))-> - mods == g->mods))) - { - if (g->remove_after) - { - ecore_button_ungrab(b->win.main, g->button, g->mods, - g->any_mod); - ecore_window_button_grab_auto_replay_set(b->win.main, - NULL); - FREE(g); - b->grabs = evas_list_remove(b->grabs, g); - goto again; - } - } - } - } - { E_Action_Type act; Ecore_Event_Key_Modifiers mods; @@ -1186,8 +1146,6 @@ static void e_border_cleanup(E_Border * b) { - Evas_List * l; - D_ENTER; e_match_save_props(b); @@ -1229,15 +1187,6 @@ IF_FREE(b->border_style); IF_FREE(b->border_file); - if (b->grabs) - { - for (l = b->grabs; l; l = l->next) - { - FREE(l->data); - } - evas_list_free(b->grabs); - } - /* Cleanup superclass. */ e_object_cleanup(E_OBJECT(b)); @@ -1581,6 +1530,8 @@ b->current.requested.h = b->current.h; b->current.requested.w = b->current.w; e_border_raise(b); + e_border_update(b); + e_border_reshape(b); ecore_window_show(win); if (b->client.e.launch_id) @@ -1711,18 +1662,21 @@ D_ENTER; - if (b->grabs) + if (config_data->grabs) { - for (l = b->grabs; l; l = l->next) + for (l = config_data->grabs; l; l = l->next) { E_Grab *g; g = l->data; ecore_button_ungrab(b->win.main, g->button, g->mods, g->any_mod); - FREE(g); } - evas_list_free(b->grabs); - b->grabs = NULL; + } + if (b->click_grab) + { + ecore_button_ungrab(b->win.main, b->click_grab->button, + b->click_grab->mods, b->click_grab->any_mod); + FREE(b->click_grab); } b->click_grab = NULL; @@ -1751,18 +1705,13 @@ void e_border_attach_mouse_grabs(E_Border * b) { - char *grabs_db; - E_DB_File *db; int focus_mode; - char buf[PATH_MAX]; - - E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0); + Evas_List *l; D_ENTER; - E_CONFIG_INT_GET(cfg_focus_mode, focus_mode); + focus_mode = config_data->window->focus_mode; - grabs_db = e_config_get("grabs"); /* settings - click to focus would affect grabs */ if ((!b->current.selected) && (focus_mode == 2)) { @@ -1781,52 +1730,12 @@ b->click_grab = g; } - /* other grabs - liek alt+left to move */ - db = e_db_open_read(grabs_db); - if (db) + for (l = config_data->grabs; l; l = l->next) { - int i, num; - - snprintf(buf, PATH_MAX, "/grabs/count"); - if (!e_db_int_get(db, buf, &num)) - { - e_db_close(db); - D_RETURN; - } - for (i = 0; i < num; i++) - { - int button, any_mod, mod; - Ecore_Event_Key_Modifiers mods; - - button = -1; - mods = ECORE_EVENT_KEY_MODIFIER_NONE; - any_mod = 0; - snprintf(buf, PATH_MAX, "/grabs/%i/button", i); - if (!e_db_int_get(db, buf, &button)) - continue; - snprintf(buf, PATH_MAX, "/grabs/%i/modifiers", i); - if (!e_db_int_get(db, buf, &mod)) - continue; - if (mod == -1) - any_mod = 1; - mods = (Ecore_Event_Key_Modifiers) mod; - - if (button >= 0) - { - E_Grab *g; + E_Grab *g; - g = NEW(E_Grab, 1); - ZERO(g, E_Grab, 1); - g->button = button; - g->mods = mods; - g->any_mod = any_mod; - g->remove_after = 0; - b->grabs = evas_list_append(b->grabs, g); - ecore_button_grab(b->win.main, button, XEV_BUTTON_PRESS, mods, - 0); - } - } - e_db_close(db); + g = l->data; + ecore_button_grab(b->win.main, g->button, XEV_BUTTON_PRESS, g->mods, 0); } D_RETURN; @@ -2176,13 +2085,26 @@ info->info.mask = mask; evas_engine_info_set(b->evas, (Evas_Engine_Info *) info); + /* + * Hide the bits and render to clear the old appearance from generating + * damage rectangles. + */ if (b->bits.b) { ebits_hide(b->bits.b); } - /* Force a render of the evas to clear large updates from resizing */ + + if (b->obj.title) + { + evas_object_hide(b->obj.title_clip); + } + evas_render(b->evas); + /* + * Position and then show the bits so we only get damage rectangles for the + * area we want shown. + */ if (b->bits.b) { ebits_move(b->bits.b, 0, 0); @@ -2202,6 +2124,7 @@ evas_object_move(b->obj.title_clip, tx, ty); evas_object_resize(b->obj.title_clip, tw, th); + evas_object_show(b->obj.title_clip); } hp = up = evas_render_updates(b->evas); @@ -2267,6 +2190,7 @@ nwin = nwin->next; } + /* Order is important here to have a smooth update */ e_border_redraw_region(b, 0, 0, b->current.w, b->current.h); e_border_cleanup_window_list(owin); @@ -2445,11 +2369,9 @@ { int auto_raise = 0; - E_CFG_INT(cfg_auto_raise, "settings", "/window/raise/auto", 0); - D_ENTER; - E_CONFIG_INT_GET(cfg_auto_raise, auto_raise); + auto_raise = config_data->window->auto_raise; if (auto_raise) e_border_raise((E_Border *) b); @@ -2583,11 +2505,9 @@ { double raise_delay = 0.5; - E_CFG_FLOAT(cfg_raise_delay, "settings", "/window/raise/delay", 0.5); - D_ENTER; - E_CONFIG_FLOAT_GET(cfg_raise_delay, raise_delay); + raise_delay = config_data->window->raise_delay; ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down); ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/border.h,v retrieving revision 1.19.2.5 retrieving revision 1.19.2.6 diff -u -3 -r1.19.2.5 -r1.19.2.6 --- border.h 10 Sep 2002 21:58:55 -0000 1.19.2.5 +++ border.h 1 Oct 2002 18:08:11 -0000 1.19.2.6 @@ -197,7 +197,6 @@ int shape_changed; int placed; - Evas_List *grabs; E_Grab *click_grab; E_Desktop *desk; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/config.c,v retrieving revision 1.32.2.3 retrieving revision 1.32.2.4 diff -u -3 -r1.32.2.3 -r1.32.2.4 --- config.c 8 Sep 2002 04:56:18 -0000 1.32.2.3 +++ config.c 1 Oct 2002 18:08:11 -0000 1.32.2.4 @@ -1,6 +1,12 @@ #include "debug.h" +#include "actions.h" +#include "border.h" #include "config.h" +#include "data.h" +#include "e_dir.h" #include "file.h" +#include "keys.h" +#include "observer.h" #include "util.h" static char cfg_root[] = ""; @@ -24,6 +30,23 @@ static char cfg_epplets_dir[PATH_MAX] = ""; static char cfg_layout_dir[PATH_MAX] = ""; +static E_Observer *behavior_dir = NULL; +E_Config *config_data; + +E_Data_Base_Type *cfg_actions = NULL; +E_Data_Base_Type *cfg_config = NULL; +E_Data_Base_Type *cfg_grabs = NULL; +E_Data_Base_Type *cfg_guides = NULL; +E_Data_Base_Type *cfg_match = NULL; +E_Data_Base_Type *cfg_menu = NULL; +E_Data_Base_Type *cfg_move = NULL; +E_Data_Base_Type *cfg_window = NULL; + +void e_config_behavior_changed(E_Observer * observer, + E_Observee * observee, + E_Event_Type event, void *data); +void e_config_settings_reload(char *buf); + char * e_config_get(char *type) { @@ -74,25 +97,133 @@ E_CONF("images", cfg_images_dir, PACKAGE_DATA_DIR "/data/images/"); E_CONF("cursors", cfg_cursors_dir, PACKAGE_DATA_DIR "/data/cursors/"); E_CONF("backgrounds", cfg_backgrounds_dir, - PACKAGE_DATA_DIR"/data/backgrounds/"); - E_CONF("fonts", cfg_fonts_dir, - PACKAGE_DATA_DIR"/data/fonts/"); - E_CONF("epplets", cfg_epplets_dir, - PACKAGE_DATA_DIR"/data/epplets/"); - E_CONF("layout", cfg_layout_dir, - PACKAGE_DATA_DIR"/data/layout/"); + PACKAGE_DATA_DIR "/data/backgrounds/"); + E_CONF("fonts", cfg_fonts_dir, PACKAGE_DATA_DIR "/data/fonts/"); + E_CONF("epplets", cfg_epplets_dir, PACKAGE_DATA_DIR "/data/epplets/"); + E_CONF("layout", cfg_layout_dir, PACKAGE_DATA_DIR "/data/layout/"); D_RETURN_(""); } void +e_config_actions_init() +{ + D_ENTER; + + /* + * Define the data type for the E_Actions struct. + */ + cfg_actions = e_data_type_new(); + E_DATA_NODE(cfg_actions, "name", E_DATA_TYPE_STR, NULL, E_Action, name, + (E_Data_Value) ""); + E_DATA_NODE(cfg_actions, "action", E_DATA_TYPE_STR, NULL, E_Action, action, + (E_Data_Value) ""); + E_DATA_NODE(cfg_actions, "params", E_DATA_TYPE_STR, NULL, E_Action, + params, (E_Data_Value) ""); + E_DATA_NODE(cfg_actions, "event", E_DATA_TYPE_INT, NULL, E_Action, event, + (E_Data_Value) 0); + E_DATA_NODE(cfg_actions, "button", E_DATA_TYPE_INT, NULL, E_Action, button, + (E_Data_Value) 0); + E_DATA_NODE(cfg_actions, "key", E_DATA_TYPE_STR, NULL, E_Action, key, + (E_Data_Value) 0); + E_DATA_NODE(cfg_actions, "modifiers", E_DATA_TYPE_INT, NULL, E_Action, + modifiers, (E_Data_Value) 0); + + D_RETURN; +} + +void +e_config_grabs_init() +{ + cfg_grabs = e_data_type_new(); + E_DATA_NODE(cfg_grabs, "button", E_DATA_TYPE_INT, NULL, E_Grab, button, + (E_Data_Value) 0); + E_DATA_NODE(cfg_grabs, "modifiers", E_DATA_TYPE_INT, NULL, E_Grab, mods, + (E_Data_Value) 0); +} + +void +e_config_guides_init() +{ + cfg_guides = e_data_type_new(); + E_DATA_NODE(cfg_guides, "display/location", E_DATA_TYPE_INT, NULL, + E_Config_Guides, location, (E_Data_Value) 0); + E_DATA_NODE(cfg_guides, "display/x", E_DATA_TYPE_FLOAT, NULL, + E_Config_Guides, x, (E_Data_Value) 0); + E_DATA_NODE(cfg_guides, "display/y", E_DATA_TYPE_FLOAT, NULL, + E_Config_Guides, y, (E_Data_Value) 0); +} + +void +e_config_menu_init() +{ + cfg_menu = e_data_type_new(); + E_DATA_NODE(cfg_menu, "menu/scroll/resist", E_DATA_TYPE_INT, NULL, + E_Config_Menu, resist, (E_Data_Value) 0); + E_DATA_NODE(cfg_menu, "menu/scroll/speed", E_DATA_TYPE_INT, NULL, + E_Config_Menu, speed, (E_Data_Value) 0); +} + +void +e_config_move_init() +{ + cfg_move = e_data_type_new(); + E_DATA_NODE(cfg_move, "resist", E_DATA_TYPE_INT, NULL, + E_Config_Move, resist, (E_Data_Value) 0); + E_DATA_NODE(cfg_move, "resist/win", E_DATA_TYPE_INT, NULL, + E_Config_Move, win_resist, (E_Data_Value) 0); + E_DATA_NODE(cfg_move, "resist/desk", E_DATA_TYPE_INT, NULL, + E_Config_Move, desk_resist, (E_Data_Value) 0); +} + +void +e_config_window_init() +{ + cfg_window = e_data_type_new(); + E_DATA_NODE(cfg_window, "resize/mode", E_DATA_TYPE_INT, NULL, + E_Config_Window, resize_mode, (E_Data_Value) 0); + E_DATA_NODE(cfg_window, "move/mode", E_DATA_TYPE_INT, NULL, + E_Config_Window, move_mode, (E_Data_Value) 0); + E_DATA_NODE(cfg_window, "focus/mode", E_DATA_TYPE_INT, NULL, E_Config_Window, + focus_mode, (E_Data_Value) 0); + E_DATA_NODE(cfg_window, "raise/auto", E_DATA_TYPE_INT, NULL, + E_Config_Window, auto_raise, (E_Data_Value) 0); + E_DATA_NODE(cfg_window, "raise/delay", E_DATA_TYPE_FLOAT, NULL, + E_Config_Window, raise_delay, (E_Data_Value) (float)0.6); +} + +void e_config_init(void) { char buf[PATH_MAX]; + E_Dir *dir; D_ENTER; -#if 1 /* for now don't do this. i think a cp -r will be needed later anyway */ + /* Start by initializing the data loading structures */ + e_config_actions_init(); + e_config_grabs_init(); + e_config_guides_init(); + e_config_menu_init(); + e_config_move_init(); + e_config_window_init(); + + /* Then place the data structures within the config description */ + cfg_config = e_data_type_new(); + E_DATA_NODE(cfg_config, "actions", E_DATA_TYPE_LIST, cfg_actions, + E_Config, actions, (E_Data_Value) 0); + E_DATA_NODE(cfg_config, "grabs", E_DATA_TYPE_LIST, cfg_grabs, + E_Config, grabs, (E_Data_Value) 0); + E_DATA_NODE(cfg_config, "guides", E_DATA_TYPE_PTR, cfg_guides, + E_Config, guides, (E_Data_Value) 0); + E_DATA_NODE(cfg_config, "menu", E_DATA_TYPE_PTR, cfg_menu, + E_Config, menu, (E_Data_Value) 0); + E_DATA_NODE(cfg_config, "move", E_DATA_TYPE_PTR, cfg_move, + E_Config, move, (E_Data_Value) 0); + E_DATA_NODE(cfg_config, "window", E_DATA_TYPE_PTR, cfg_window, + E_Config, window, (E_Data_Value) 0); + + /* Create directories as needed */ if (!e_file_is_dir(e_config_user_dir())) e_file_mkdir(e_config_user_dir()); snprintf(buf, PATH_MAX, "%sappearance", e_config_user_dir()); @@ -104,6 +235,8 @@ snprintf(buf, PATH_MAX, "%sbehavior", e_config_user_dir()); if (!e_file_is_dir(buf)) e_file_mkdir(buf); + + /* With the directories created, create files if needed and load config */ snprintf(buf, PATH_MAX, "%sbehavior/grabs.db", e_config_user_dir()); if (!e_file_exists(buf)) e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/grabs.db", buf); @@ -119,17 +252,69 @@ if (!e_file_exists(buf)) e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/apps_menu.db", buf); - snprintf(buf, PATH_MAX, "%sappearance/borders/border.bits.db", - e_config_user_dir()); -#endif -#if 0 - ts(); -#endif + snprintf(buf, PATH_MAX, "%sbehavior/behavior.db", e_config_user_dir()); + if (!e_file_exists(buf)) + e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/behavior.db", + buf); + + /* Load config data and begin monitoring it with efsd */ + e_config_behavior_changed(NULL, NULL, 0, NULL); + + snprintf(buf, PATH_MAX, "%sbehavior", e_config_user_dir()); + dir = e_dir_new(); + e_dir_set_dir(dir, buf); + + behavior_dir = NEW(E_Observer, 1); + ZERO(behavior_dir, sizeof(E_Observer), 1); + e_observer_init(behavior_dir, E_EVENT_FILE_CHANGE, + e_config_behavior_changed, free); + e_observer_register_observee(behavior_dir, E_OBSERVEE(dir)); D_RETURN; } void +e_config_behavior_changed(E_Observer * observer, E_Observee * observee, + E_Event_Type event, void *data) +{ + char buf[PATH_MAX]; + Evas_List *l; + + if (config_data) + { + e_data_free(cfg_config, (char *)config_data); + FREE(config_data); + } + + snprintf(buf, PATH_MAX, "%sbehavior/behavior.db", e_config_user_dir()); + config_data = e_data_load(buf, "", cfg_config); + + /* FIXME: this should probably be a function in actions.c */ + for (l = config_data->actions; l; l = l->next) + { + E_Action *a; + + a = l->data; + e_object_init(E_OBJECT(a), (E_Cleanup_Func) e_action_cleanup); + if ((a->key) && (strlen(a->key) > 0)) + { + if (a->modifiers == -1) + e_keys_grab(a->key, ECORE_EVENT_KEY_MODIFIER_NONE, 1); + else + e_keys_grab(a->key, (Ecore_Event_Key_Modifiers) a->modifiers, + 0); + a->grabbed = 1; + } + } + + return; + UN(observer); + UN(observee); + UN(event); + UN(data); +} + +void e_config_set_user_dir(char *dir) { D_ENTER; @@ -167,11 +352,10 @@ D_RETURN_(cfg_user_dir); if (cfg_root[0]) D_RETURN_(cfg_root); -#if 1 /* disabled for now - use system ones only */ + snprintf(cfg_user_dir, PATH_MAX, "%s/.e/", e_util_get_user_home()); -#else - snprintf(cfg_user_dir, PATH_MAX, PACKAGE_DATA_DIR "/data/config/"); -#endif + if (!e_file_exists(cfg_user_dir) || !e_file_is_dir(cfg_user_dir)) + snprintf(cfg_user_dir, PATH_MAX, PACKAGE_DATA_DIR "/data/config/"); D_RETURN_(cfg_user_dir); } @@ -187,7 +371,7 @@ time_t last_mod; } user , system; - Evas_List * hash[256]; + Evas_List *hash[256]; }; void @@ -242,216 +426,3 @@ UN(key); UN(def); } - -void -e_config_type_add_node(E_Config_Base_Type * base, char *prefix, - E_Config_Datatype type, E_Config_Base_Type * list_type, - int offset, int def_int, float def_float, char *def_str) -{ - E_Config_Node *cfg_node; - - D_ENTER; - - cfg_node = NEW(E_Config_Node, 1); - ZERO(cfg_node, E_Config_Node, 1); - - cfg_node->prefix = strdup(prefix); - cfg_node->type = type; - cfg_node->sub_type = list_type; - cfg_node->offset = offset; - cfg_node->def_int = def_int; - cfg_node->def_float = def_float; - if (cfg_node->def_str) - { - e_strdup(cfg_node->def_str, def_str); - } - base->nodes = evas_list_append(base->nodes, cfg_node); - - D_RETURN; -} - -E_Config_Base_Type * -e_config_type_new(void) -{ - E_Config_Base_Type *t; - - D_ENTER; - - t = NEW(E_Config_Base_Type, 1); - ZERO(t, E_Config_Base_Type, 1); - - D_RETURN_(t); -} - -void * -e_config_load(char *file, char *prefix, E_Config_Base_Type * type) -{ - E_DB_File *db; - char buf[PATH_MAX]; - Evas_List * l; - char *data; - - D_ENTER; - - if (!e_file_exists(file)) - D_RETURN_(NULL); - db = e_db_open_read(file); - - if (!db) - D_RETURN_(NULL); - - data = NEW(char, type->size); - ZERO(data, char, type->size); - - for (l = type->nodes; l; l = l->next) - { - E_Config_Node *node; - - node = l->data; - - switch (node->type) - { - case E_CFG_TYPE_INT: - { - int val; - - val = 0; - snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix); - if (e_db_int_get(db, buf, &val)) - (*((int *)(&(data[node->offset])))) = val; - else - (*((int *)(&(data[node->offset])))) = node->def_int; - } - break; - case E_CFG_TYPE_STR: - { - char *val; - - snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix); - if ((val = e_db_str_get(db, buf))) - (*((char **)(&(data[node->offset])))) = val; - else - e_strdup((*((char **)(&(data[node->offset])))), - node->def_str); - } - break; - case E_CFG_TYPE_FLOAT: - { - float val; - - val = 0; - snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix); - if (e_db_float_get(db, buf, &val)) - (*((float *)(&(data[node->offset])))) = val; - else - (*((float *)(&(data[node->offset])))) = node->def_float; - } - break; - case E_CFG_TYPE_LIST: - { - Evas_List * l2; - int i, count; - - l2 = NULL; - snprintf(buf, PATH_MAX, "%s/%s/count", prefix, node->prefix); - count = 0; - e_db_int_get(db, buf, &count); - for (i = 0; i < count; i++) - { - void *data2; - - snprintf(buf, PATH_MAX, "%s/%s/%i", prefix, node->prefix, - i); - data2 = e_config_load(file, buf, node->sub_type); - l2 = evas_list_append(l2, data2); - } - (*((Evas_List **) (&(data[node->offset])))) = l2; - } - break; - case E_CFG_TYPE_KEY: - { - snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix); - (*((char **)(&(data[node->offset])))) = strdup(buf); - } - break; - default: - break; - } - } - e_db_close(db); - - D_RETURN_(data); -} - -#if 0 -typedef struct _list_base List_Base; -typedef struct _list_element List_Element; - -struct _list_base -{ - Evas_List * elements; -}; - -struct _list_element -{ - char *name; - int size; - float perc; -}; - -/* eg: */ -void -ts(void) -{ - /* define the different config types and structs to the config engine */ - E_Config_Base_Type *cf_list; - E_Config_Base_Type *cf_element; - - D_ENTER; - - cf_element = e_config_type_new(); - E_CONFIG_NODE(cf_element, "name", E_CFG_TYPE_STR, NULL, List_Element, name, - 0, 0, "DEFAULT_NAME"); - E_CONFIG_NODE(cf_element, "size", E_CFG_TYPE_INT, NULL, List_Element, size, - 777, 0, NULL); - E_CONFIG_NODE(cf_element, "perc", E_CFG_TYPE_FLOAT, NULL, List_Element, perc, - 0, 3.1415, NULL); - - cf_list = e_config_type_new(); - E_CONFIG_NODE(cf_list, "list", E_CFG_TYPE_LIST, cf_element, List_Base, - elements, 0, 0, NULL); - - /* now test it */ - { - List_Base *cfg_data; - - /* load the base data type from the base of the test db file */ - cfg_data = e_config_load("test.db", "", cf_list); - /* no data file? */ - if (!cfg_data) - { - D("no load!\n"); - } - /* got data */ - else - { - Evas_List * l; - - for (l = cfg_data->elements; l; l = l->next) - { - List_Element *cfg_element; - - D("element\n"); - cfg_element = l->data; - D("... name %s\n", cfg_element->name); - D("... size %i\n", cfg_element->size); - D("... perc %3.3f\n", cfg_element->perc); - } - } - exit(0); - } - - D_RETURN; -} - -#endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/config.h,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -u -3 -r1.8.2.1 -r1.8.2.2 --- config.h 29 Jul 2002 01:17:57 -0000 1.8.2.1 +++ config.h 1 Oct 2002 18:08:11 -0000 1.8.2.2 @@ -3,218 +3,61 @@ #include "e.h" -typedef struct _E_Config_File E_Config_File; -typedef struct _E_Config_Element E_Config_Element; - -/* something to check validity of config files where we get data from */ -/* for now its just a 5 second timout so it will only invalidate */ -/* if we havent looked for 5 seconds... BUT later when efsd is more solid */ -/* we should use that to tell us when its invalid */ -struct _E_Config_File -{ - char *src; - double last_fetch; +/* + * Define small subsets of the whole config for defining data types for + * loading from the databases. + */ +typedef struct _E_Config_Guides E_Config_Guides; +struct _E_Config_Guides +{ + float x; + float y; + int location; }; -struct _E_Config_Element +typedef struct _E_Config_Menu E_Config_Menu; +struct _E_Config_Menu { - char *src; - char *key; - double last_fetch; - int type; - int def_int_val; - float def_float_val; - char *def_str_val; - void *def_data_val; - int def_data_val_size; - int cur_int_val; - float cur_float_val; - char *cur_str_val; - void *cur_data_val; - int cur_data_val_size; + int resist; + int speed; }; -#define E_CFG_FILE(_var, _src) \ -static E_Config_File _var = {_src, 0.0} -#define E_CONFIG_CHECK_VALIDITY(_var, _src) \ -{ \ -double __time; \ -__time = ecore_get_time(); \ -if (_var.last_fetch < (__time - 5.0)) { \ -_var.last_fetch = __time; -#define E_CONFIG_CHECK_VALIDITY_END \ -} \ -} - -typedef enum e_config_type -{ - E_CFG_INT_T, - E_CFG_FLOAT_T, - E_CFG_STR_T, - E_CFG_DATA_T, -} -E_Config_Type; - -#define E_CFG_INT(_var, _src, _key, _default) \ -static E_Config_Element _var = { _src, _key, 0.0, E_CFG_INT_T, \ -_default, 0.0, NULL, NULL, 0, \ -0, 0.0, NULL, NULL, 0, \ -} - -#define E_CFG_FLOAT(_var, _src, _key, _default) \ -static E_Config_Element _var = { _src, _key, 0.0, E_CFG_FLOAT_T, \ -0, _default, NULL, NULL, 0, \ -0, 0.0, NULL, NULL, 0, \ -} - -#define E_CFG_STR(_var, _src, _key, _default) \ -static E_Config_Element _var = { _src, _key, 0.0, E_CFG_STR_T, \ -0, 0.0, _default, NULL, 0, \ -0, 0.0, NULL, NULL, 0, \ -} - -#define E_CFG_DATA(_var, _src, _key, _default, _default_size) \ -static E_Config_Element _var = { _src, _key, 0.0, E_CFG_DATAT_T, \ -0, 0.0, NULL, _default, _default_size, \ -0, 0.0, NULL, NULL, 0, \ -} - -/* yes for now it only fetches them every 5 seconds - in the end i need a */ -/* validity flag for the database file to know if it changed and only then */ -/* get the value again. this is waiting for efsd to become more solid */ -#define E_CFG_VALIDITY_CHECK(_var) \ -{ \ -double __time; \ -__time = ecore_get_time(); \ -if (_var.last_fetch < (__time - 5.0)) { \ -int __cfg_ok = 0; \ -_var.last_fetch = __time; - -#define E_CFG_END_VALIDITY_CHECK \ -} \ -} - -#define E_CONFIG_INT_GET(_var, _val) \ -{{ \ -E_CFG_VALIDITY_CHECK(_var) \ -E_DB_INT_GET(e_config_get(_var.src), _var.key, _var.cur_int_val, __cfg_ok); \ -if (!__cfg_ok) _var.cur_int_val = _var.def_int_val; \ -E_CFG_END_VALIDITY_CHECK \ -} \ -_val = _var.cur_int_val;} - -#define E_CONFIG_FLOAT_GET(_var, _val) \ -{{ \ -E_CFG_VALIDITY_CHECK(_var) \ -E_DB_FLOAT_GET(e_config_get(_var.src), _var.key, _var.cur_float_val, __cfg_ok); \ -if (!__cfg_ok) _var.cur_float_val = _var.def_float_val; \ -E_CFG_END_VALIDITY_CHECK \ -} \ -_val = _var.cur_float_val;} - -#define E_CONFIG_STR_GET(_var, _val) \ -{{ \ -E_CFG_VALIDITY_CHECK(_var) \ -if (_var.cur_str_val) free(_var.cur_str_val); \ -_var.cur_str_val = NULL; \ -E_DB_STR_GET(e_config_get(_var.src), _var.key, _var.cur_str_val, __cfg_ok); \ -if (!__cfg_ok) _var.cur_str_val = _var.def_str_val \ -E_CFG_END_VALIDITY_CHECK \ -} \ -_val = _var.cur_str_val;} - -#define E_CONFIG_DATA_GET(_var, _val, _size) \ -{{ \ -E_CFG_VALIDITY_CHECK(_var) \ -if (_var.cur_data_val) free(_var.cur_data_val); \ -_var.cur_data_val = NULL; \ -_var.cur_data_size = 0; \ -{ E_DB_File *__db; \ -__db = e_db_open_read(e_config_get(_var.src)); \ -if (__db) { \ -_var.cur_data_val = e_db_data_get(__db, _var.key, &(_var.cur_data_size)); \ -if (_var.cur_data_val) __cfg_ok = 1; \ -e_db_close(__db); \ -} \ -} \ -if (!__cfg_ok) { \ -_var.cur_data_val = e_memdup(_var.def_data_val, _var.def_data_size); \ -_var.cur_data_size = _var.def_data_size; \ -} \ -E_CFG_END_VALIDITY_CHECK \ -} \ -_val = _var.cur_data_val; \ -_size = _var.cur_data_size;} - -char *e_config_get(char *type); -void e_config_init(void); -void e_config_set_user_dir(char *dir); -char *e_config_user_dir(void); - -typedef struct _e_config_base_type E_Config_Base_Type; -typedef struct _e_config_node E_Config_Node; -typedef struct _e_config_value E_Config_Value; -typedef enum _e_config_datatype E_Config_Datatype; - -enum _e_config_datatype +typedef struct _E_Config_Move E_Config_Move; +struct _E_Config_Move { - E_CFG_TYPE_INT, - E_CFG_TYPE_STR, - E_CFG_TYPE_FLOAT, - E_CFG_TYPE_LIST, - E_CFG_TYPE_KEY + int resist; + int win_resist; + int desk_resist; }; -struct _e_config_base_type +typedef struct _E_Config_Window E_Config_Window; +struct _E_Config_Window { - int size; - Evas_List * nodes; + int move_mode; + int focus_mode; + int auto_raise; + float raise_delay; + int resize_mode; }; -struct _e_config_node +typedef struct _E_Config E_Config; +struct _E_Config { - char *prefix; - E_Config_Datatype type; - int offset; - E_Config_Base_Type *sub_type; - int def_int; - float def_float; - char *def_str; + Evas_List *actions; + Evas_List *grabs; + Evas_List *match; + + E_Config_Guides *guides; + E_Config_Menu *menu; + E_Config_Move *move; + E_Config_Window *window; }; -#define E_CONFIG_NODE(var, prefix, type, sub, struct_type, struct_member, def_int, def_float, def_str) \ -{ \ - struct_type _cfg_dummy; \ - char *_cfg_p1, *_cfg_p2; \ - int _cfg_offset; \ - \ - _cfg_p1 = (char *)(&(_cfg_dummy)); \ - _cfg_p2 = (char *)(&(_cfg_dummy.struct_member)); \ - _cfg_offset = (int)(_cfg_p2 - _cfg_p1); \ - \ - e_config_type_add_node(var, prefix, type, sub, _cfg_offset, def_int, def_float, def_str); \ - var->size = sizeof(struct_type); \ -} - -E_Config_Value *e_config_value_get_int(E_Config_Value * handle, char *file, - char *prefix, char *key, - int *val_ret, int default_val); -E_Config_Value *e_config_value_get_str(E_Config_Value * handle, char *file, - char *prefix, char *key, - char **val_ret, char *default_val); -E_Config_Value *e_config_value_get_float(E_Config_Value * handle, - char *file, char *prefix, - char *key, float *val_ret, - float default_val); -E_Config_Base_Type *e_config_type_new(void); -void e_config_type_add_node(E_Config_Base_Type * base, - char *prefix, - E_Config_Datatype type, - E_Config_Base_Type * list_type, - int offset, - int def_int, - float def_float, char *def_str); -void *e_config_load(char *file, - char *prefix, E_Config_Base_Type * type); +extern E_Config *config_data; + +char *e_config_get(char *type); +void e_config_init(void); +void e_config_set_user_dir(char *dir); +char *e_config_user_dir(void); #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/delayed.c,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -u -3 -r1.8 -r1.8.2.1 --- delayed.c 10 Mar 2002 17:23:41 -0000 1.8 +++ delayed.c 1 Oct 2002 18:08:11 -0000 1.8.2.1 @@ -1,6 +1,7 @@ #include <string.h> #include "debug.h" #include "delayed.h" +#include "util.h" static void e_delayed_action_cleanup(E_Delayed_Action * eda) @@ -44,6 +45,8 @@ ecore_add_event_timer(event_name, eda->delay, eda->delay_func, 0, obj); D_RETURN; + UN(event); + UN(data); } void =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/e_view_look.c,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -u -3 -r1.2.2.3 -r1.2.2.4 --- e_view_look.c 11 Sep 2002 21:12:04 -0000 1.2.2.3 +++ e_view_look.c 1 Oct 2002 18:08:11 -0000 1.2.2.4 @@ -117,25 +117,25 @@ char buf[PATH_MAX]; D_ENTER; snprintf(buf, PATH_MAX, "%s/%s", l->dir->dir, f->file); - if (!strcmp(f->file, "background.db")) + if (!strncmp(f->file, "background.db", PATH_MAX)) { IF_FREE(l->obj->bg); l->obj->bg = strdup(buf); e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_BG_CHANGED, f); } - else if (!strcmp(f->file, "iconbar.db")) + else if (!strncmp(f->file, "iconbar.db", PATH_MAX)) { IF_FREE(l->obj->icb); l->obj->icb = strdup(buf); e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_ICB_CHANGED, f); } - else if (!strcmp(f->file, "iconbar.bits.db")) + else if (!strncmp(f->file, "iconbar.bits.db", PATH_MAX)) { IF_FREE(l->obj->icb_bits); l->obj->icb_bits = strdup(buf); e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_ICB_CHANGED, f); } - else if (!strcmp(f->file, "layout.db")) + else if (!strncmp(f->file, "layout.db", PATH_MAX)) { IF_FREE(l->obj->layout); l->obj->layout = strdup(buf); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/iconbar.c,v retrieving revision 1.30.2.3 retrieving revision 1.30.2.4 diff -u -3 -r1.30.2.3 -r1.30.2.4 --- iconbar.c 11 Sep 2002 03:24:34 -0000 1.30.2.3 +++ iconbar.c 1 Oct 2002 18:08:11 -0000 1.30.2.4 @@ -1,4 +1,6 @@ +#include "e.h" #include "debug.h" +#include "data.h" #include "iconbar.h" #include "util.h" #include "desktops.h" @@ -10,8 +12,8 @@ #include <assert.h> #undef NDEBUG -static E_Config_Base_Type *cf_iconbar = NULL; -static E_Config_Base_Type *cf_iconbar_icon = NULL; +static E_Data_Base_Type *cf_iconbar = NULL; +static E_Data_Base_Type *cf_iconbar_icon = NULL; static Evas_List * iconbars = NULL; @@ -187,34 +189,34 @@ { D_ENTER; - /* we set up config structure and types so the config system can just */ + /* we set up data structure and types so the data system can just */ /* read a db and dump it right into memory - including lists of stuff */ - /* a new config type - an iconbar icon */ - cf_iconbar_icon = e_config_type_new(); - /* this is a member of the iconbar icon struct we want the config system */ + /* a new data type - an iconbar icon */ + cf_iconbar_icon = e_data_type_new(); + /* this is a member of the iconbar icon struct we want the data system */ /* to get from the db for us. the key is "exec". the type is a string */ - /* the struct memebr is exec. the default value is "". see the config.h */ + /* the struct memebr is exec. the default value is "". see the data.h */ /* header for more info */ - E_CONFIG_NODE(cf_iconbar_icon, "exec", E_CFG_TYPE_STR, NULL, - E_Iconbar_Icon, exec, 0, 0, ""); - E_CONFIG_NODE(cf_iconbar_icon, "wait", E_CFG_TYPE_INT, NULL, - E_Iconbar_Icon, wait, 0, 0, ""); - E_CONFIG_NODE(cf_iconbar_icon, "wait_timeout", E_CFG_TYPE_FLOAT, NULL, - E_Iconbar_Icon, wait_timeout, 0, 0, ""); + E_DATA_NODE(cf_iconbar_icon, "exec", E_DATA_TYPE_STR, NULL, + E_Iconbar_Icon, exec, (E_Data_Value)""); + E_DATA_NODE(cf_iconbar_icon, "wait", E_DATA_TYPE_INT, NULL, + E_Iconbar_Icon, wait, (E_Data_Value)""); + E_DATA_NODE(cf_iconbar_icon, "wait_timeout", E_DATA_TYPE_FLOAT, NULL, + E_Iconbar_Icon, wait_timeout, (E_Data_Value)""); /* this memebr will be replaced by the relative key path in the db as a */ /* string */ - E_CONFIG_NODE(cf_iconbar_icon, "image", E_CFG_TYPE_KEY, NULL, - E_Iconbar_Icon, image_path, 0, 0, ""); + E_DATA_NODE(cf_iconbar_icon, "image", E_DATA_TYPE_KEY, NULL, + E_Iconbar_Icon, image_path, (E_Data_Value)""); - /* a new config type - in this case the iconbar istelf. the only thing we */ - /* want the config system to do it fill it with iconbar icon members in */ + /* a new data type - in this case the iconbar istelf. the only thing we */ + /* want the data system to do it fill it with iconbar icon members in */ /* the list */ - cf_iconbar = e_config_type_new(); - E_CONFIG_NODE(cf_iconbar, "icons", E_CFG_TYPE_LIST, cf_iconbar_icon, - E_Iconbar, icons, 0, 0, NULL); - E_CONFIG_NODE(cf_iconbar, "scroll", E_CFG_TYPE_FLOAT, NULL, E_Iconbar, - scroll, 0, 0, NULL); + cf_iconbar = e_data_type_new(); + E_DATA_NODE(cf_iconbar, "icons", E_DATA_TYPE_LIST, cf_iconbar_icon, + E_Iconbar, icons, (E_Data_Value)((char *)NULL)); + E_DATA_NODE(cf_iconbar, "scroll", E_DATA_TYPE_FLOAT, NULL, E_Iconbar, + scroll, (E_Data_Value)0); ecore_event_filter_handler_add(ECORE_EVENT_CHILD, ib_child_handle); @@ -228,7 +230,7 @@ E_Iconbar * e_iconbar_new(E_View * v) { - Evas_List * l; + Evas_List *l; char buf[PATH_MAX]; E_Iconbar *ib; @@ -239,12 +241,12 @@ || !v->look->obj->icb || !v->look->obj->icb_bits) D_RETURN_(NULL); - /* first we want to load the iconbar data itself - ie the config info */ + /* first we want to load the iconbar data itself - ie the data info */ /* for what icons we have and what they execute */ snprintf(buf, PATH_MAX, "%s", v->look->obj->icb); - /* use the config system to simply load up the db and start making */ + /* use the data system to simply load up the db and start making */ /* structs and lists and stuff for us... we told it how to in init */ - ib = e_config_load(buf, "", cf_iconbar); + ib = e_data_load(buf, "", cf_iconbar); /* flush image cache */ { if (v->evas) @@ -258,14 +260,14 @@ } /* flush edb cached handled */ e_db_flush(); - /* no iconbar config loaded ? return NULL */ + /* no iconbar data loaded ? return NULL */ if (!ib) { - D("no config loaded, return null\n"); + D("no data loaded, return null\n"); D_RETURN_(NULL); } - /* now that the config system has doe the loading. we need to init the */ + /* now that the data system has doe the loading. we need to init the */ /* object and set up ref counts and free method */ e_object_init(E_OBJECT(ib), (E_Cleanup_Func) e_iconbar_cleanup); @@ -377,7 +379,7 @@ * @ib: The iconbar to initalize * * Turns an iconbar into more than a - * structure of config data -- actually create evas objcts + * structure of data -- actually create evas objcts * we can do something visual with */ void =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/main.c,v retrieving revision 1.33.2.3 retrieving revision 1.33.2.4 diff -u -3 -r1.33.2.3 -r1.33.2.4 --- main.c 24 Aug 2002 01:54:27 -0000 1.33.2.3 +++ main.c 1 Oct 2002 18:08:11 -0000 1.33.2.4 @@ -82,8 +82,6 @@ atexit(cb_exit); e_exec_set_args(argc, argv); - e_config_init(); - /* Check command line options here: */ for (i = 1; i < argc; i++) { @@ -136,12 +134,13 @@ /* Initialization for the various modules: */ + e_view_machine_init(); + e_config_init(); e_fs_init(); e_desktops_init(); e_border_init(); e_action_init(); e_menu_init(); - e_view_machine_init(); e_entry_init(); e_keys_init(); e_guides_init(); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/menu.c,v retrieving revision 1.33.2.3 retrieving revision 1.33.2.4 diff -u -3 -r1.33.2.3 -r1.33.2.4 --- menu.c 4 Sep 2002 03:12:52 -0000 1.33.2.3 +++ menu.c 1 Oct 2002 18:08:11 -0000 1.33.2.4 @@ -35,15 +35,10 @@ static double last_time = 0.0; double t; - /* these two lines... */ - E_CFG_INT(cfg_resist, "settings", "/menu/scroll/resist", 5); - E_CFG_INT(cfg_scroll_speed, "settings", "/menu/scroll/speed", 12); - D_ENTER; - /* and these 2 should do exactly what tom wants - see e.h */ - E_CONFIG_INT_GET(cfg_resist, resist); - E_CONFIG_INT_GET(cfg_scroll_speed, scroll_speed); + resist = config_data->menu->resist; + scroll_speed = config_data->menu->speed; t = ecore_get_time(); if (val != 0) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/place.c,v retrieving revision 1.10.2.2 retrieving revision 1.10.2.3 diff -u -3 -r1.10.2.2 -r1.10.2.3 --- place.c 31 Aug 2002 17:46:30 -0000 1.10.2.2 +++ place.c 1 Oct 2002 18:08:11 -0000 1.10.2.3 @@ -71,12 +71,9 @@ int mx, my, rx, ry; int move_mode = E_GUIDES_BOX; - E_CFG_INT(cfg_window_move_mode, "settings", "/window/move/mode", - E_GUIDES_BOX); - D_ENTER; - E_CONFIG_INT_GET(cfg_window_move_mode, move_mode); + move_mode = config_data->window->move_mode; w = b->current.requested.w; h = b->current.requested.h; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/resist.c,v retrieving revision 1.13.2.3 retrieving revision 1.13.2.4 diff -u -3 -r1.13.2.3 -r1.13.2.4 --- resist.c 24 Aug 2002 01:54:27 -0000 1.13.2.3 +++ resist.c 1 Oct 2002 18:08:11 -0000 1.13.2.4 @@ -17,15 +17,11 @@ Evas_List *l, *rects = NULL; E_Rect *r; - E_CFG_INT(cfg_resist, "settings", "/move/resist", 1); - E_CFG_INT(cfg_desk_resist, "settings", "/move/resist/desk", 32); - E_CFG_INT(cfg_win_resist, "settings", "/move/resist/win", 12); - D_ENTER; - E_CONFIG_INT_GET(cfg_resist, resist); - E_CONFIG_INT_GET(cfg_desk_resist, desk_resist); - E_CONFIG_INT_GET(cfg_win_resist, win_resist); + resist = config_data->move->resist; + desk_resist = config_data->move->desk_resist; + win_resist = config_data->move->win_resist; if (!resist) { b->current.x = b->current.requested.x; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/view.c,v retrieving revision 1.146.2.7 retrieving revision 1.146.2.8 diff -u -3 -r1.146.2.7 -r1.146.2.8 --- view.c 12 Sep 2002 05:34:08 -0000 1.146.2.7 +++ view.c 1 Oct 2002 18:08:11 -0000 1.146.2.8 @@ -1229,9 +1229,7 @@ { int focus_mode; - E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0); - - E_CONFIG_INT_GET(cfg_focus_mode, focus_mode); + focus_mode = config_data->window->focus_mode; if (focus_mode == 2) ecore_focus_to_window(v->win.base); evas_event_feed_mouse_down(v->evas, e->button); |