Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_config.c e_config.h e_resist.c e_winlist.c Log Message: nuke some TODO's winlist is actually configurable - tho u'll have to modify code to configure it as theres no ipc yet. but a few suggestions are in there now as config. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -3 -r1.58 -r1.59 --- e_config.c 12 Jun 2005 06:50:33 -0000 1.58 +++ e_config.c 14 Jun 2005 10:19:25 -0000 1.59 @@ -145,8 +145,30 @@ E_CONFIG_VAL(D, T, always_click_to_raise, 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_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 = e_config_domain_load("e", _e_config_edd); if (e_config) { @@ -213,7 +235,30 @@ e_config->always_click_to_raise = 0; e_config->use_auto_raise = 0; e_config->auto_raise_delay = 0.5; + e_config->use_resist = 1; e_config->drag_resist = 8; + 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.2; + 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_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_Module *em; @@ -712,8 +757,30 @@ E_CONFIG_LIMIT(e_config->always_click_to_raise, 0, 1); E_CONFIG_LIMIT(e_config->use_auto_raise, 0, 1); E_CONFIG_LIMIT(e_config->auto_raise_delay, 0.0, 5.0); + E_CONFIG_LIMIT(e_config->use_resist, 0, 1); E_CONFIG_LIMIT(e_config->drag_resist, 0, 100); - + E_CONFIG_LIMIT(e_config->desk_resist, 0, 100); + E_CONFIG_LIMIT(e_config->window_resist, 0, 100); + E_CONFIG_LIMIT(e_config->gadget_resist, 0, 100); + E_CONFIG_LIMIT(e_config->winlist_warp_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_warp_at_end, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_warp_speed, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_scroll_animate, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_scroll_speed, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_list_show_iconified, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_windows, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_windows, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_uncover_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_jump_desk_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_pos_align_x, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_align_y, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_size_w, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_size_h, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_min_w, 0, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_min_h, 0, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_max_w, 8, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_max_h, 8, 4000); +; /* apply lang config - exception because config is loaded after intl setup */ if ((e_config->language) && (strlen(e_config->language) > 0)) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -3 -r1.29 -r1.30 --- e_config.h 12 Jun 2005 06:50:33 -0000 1.29 +++ e_config.h 14 Jun 2005 10:19:25 -0000 1.30 @@ -46,7 +46,7 @@ * defaults for e to work - started at 100 when we introduced this config * versioning feature */ -#define E_CONFIG_FILE_VERSION 108 +#define E_CONFIG_FILE_VERSION 111 #define E_EVAS_ENGINE_DEFAULT 0 #define E_EVAS_ENGINE_SOFTWARE_X11 1 @@ -99,7 +99,29 @@ int always_click_to_raise; int use_auto_raise; double auto_raise_delay; + int use_resist; int drag_resist; + int desk_resist; + int window_resist; + int gadget_resist; + int winlist_warp_while_selecting; + int winlist_warp_at_end; + double winlist_warp_speed; + int winlist_scroll_animate; + double winlist_scroll_speed; + int winlist_list_show_iconified; + int winlist_list_show_other_desk_windows; + int winlist_list_show_other_screen_windows; + int winlist_list_uncover_while_selecting; + int winlist_list_jump_desk_while_selecting; + double winlist_pos_align_x; + double winlist_pos_align_y; + double winlist_pos_size_w; + double winlist_pos_size_h; + int winlist_pos_min_w; + int winlist_pos_min_h; + int winlist_pos_max_w; + int winlist_pos_max_h; }; /* FIXME: all of thsie needs to become eet lumps for enmcode/decode */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_resist.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- e_resist.c 13 May 2005 14:05:17 -0000 1.9 +++ e_resist.c 14 Jun 2005 10:19:25 -0000 1.10 @@ -29,6 +29,10 @@ E_Border_List *bl; E_Border *bd; + resist = e_config->use_resist; + desk_resist = e_config->desk_resist; + win_resist = e_config->window_resist; + gad_resist = e_config->gadget_resist; /* FIXME: get resist values from config */ if (!resist) { @@ -38,6 +42,7 @@ *rw = h; return 0; } + /* edges of screen */ #define OBSTACLE(_x, _y, _w, _h, _resist) \ { \ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_winlist.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- e_winlist.c 13 Jun 2005 15:56:15 -0000 1.13 +++ e_winlist.c 14 Jun 2005 10:19:25 -0000 1.14 @@ -11,6 +11,8 @@ Evas_Object *bg_object; Evas_Object *icon_object; E_Border *border; + unsigned char was_iconified : 1; + unsigned char was_shaded : 1; }; static void _e_winlist_size_adjust(void); @@ -79,13 +81,17 @@ if (winlist) return 0; - /* FIXME: sizes/pos should be config */ - w = zone->w / 2; - if (w > 320) w = 320; - h = zone->h / 2; - if (h > 320) h = 320; - x = (zone->w - w) / 2; - y = (zone->h - h) / 2; + w = (double)zone->w * e_config->winlist_pos_size_w; + if (w > e_config->winlist_pos_max_w) w = e_config->winlist_pos_max_w; + else if (w < e_config->winlist_pos_min_w) w = e_config->winlist_pos_min_w; + if (w > zone->w) w = zone->w; + x = (double)(zone->w - w) * e_config->winlist_pos_align_x; + + h = (double)zone->h * e_config->winlist_pos_size_h; + if (h > e_config->winlist_pos_max_h) h = e_config->winlist_pos_max_h; + else if (h < e_config->winlist_pos_min_h) h = e_config->winlist_pos_min_h; + if (h > zone->h) h = zone->h; + y = (double)(zone->h - h) * e_config->winlist_pos_align_y; winlist = e_popup_new(zone, x, y, w, h); if (!winlist) return; @@ -234,11 +240,12 @@ } e_border_raise(bd); e_border_focus_set(bd, 1, 1); - if (e_config->focus_policy != E_FOCUS_CLICK) + if ((e_config->focus_policy != E_FOCUS_CLICK) || + (e_config->winlist_warp_at_end) || + (e_config->winlist_warp_while_selecting)) ecore_x_pointer_warp(bd->zone->container->win, bd->x + (bd->w / 2), bd->y + (bd->h / 2)); - /* FIXME: ensure whatever window is selected is focused after we finish cleanup - seee above for fix to mouse enter events */ } } @@ -284,6 +291,7 @@ _e_winlist_size_adjust(void) { Evas_Coord mw, mh; + E_Zone *zone; int x, y, w, h; e_box_freeze(list_object); @@ -295,13 +303,20 @@ edje_object_part_swallow(bg_object, "list_swallow", list_object); e_box_thaw(list_object); - /* FIXME: sizes/pos should be config */ - w = winlist->zone->w / 2; - if (w > 320) w = 320; + zone = winlist->zone; + w = (double)zone->w * e_config->winlist_pos_size_w; + if (w < mw) w = mw; + if (w > e_config->winlist_pos_max_w) w = e_config->winlist_pos_max_w; + else if (w < e_config->winlist_pos_min_w) w = e_config->winlist_pos_min_w; + if (w > zone->w) w = zone->w; + x = (double)(zone->w - w) * e_config->winlist_pos_align_x; + h = mh; - if (h > 320) h = 320; - x = (winlist->zone->w - w) / 2; - y = (winlist->zone->h - h) / 2; + if (h > e_config->winlist_pos_max_h) h = e_config->winlist_pos_max_h; + else if (h < e_config->winlist_pos_min_h) h = e_config->winlist_pos_min_h; + if (h > zone->h) h = zone->h; + y = (double)(zone->h - h) * e_config->winlist_pos_align_y; + evas_object_resize(bg_object, w, h); e_popup_move_resize(winlist, x, y, w, h); } @@ -309,12 +324,35 @@ static void _e_winlist_border_add(E_Border *bd, E_Zone *zone, E_Desk *desk) { - if ((((bd->zone) && (bd->zone == zone) && - ((bd->desk == desk) || (bd->sticky))) || - ((bd->zone->container == zone->container) && (bd->iconic))) && - (bd->client.icccm.accepts_focus) && - (!bd->client.netwm.state.skip_taskbar) - ) + int ok; + + ok = 1; + if ((!bd->client.icccm.accepts_focus)) ok = 0; + if (bd->client.netwm.state.skip_taskbar) ok = 0; + if (bd->iconic) + { + if (!e_config->winlist_list_show_iconified) ok = 0; + if ((bd->zone != zone) && + (!e_config->winlist_list_show_other_screen_windows)) ok = 0; + } + else + { + if (bd->sticky) + { + if ((bd->zone) && (bd->zone != zone) && + (!e_config->winlist_list_show_other_screen_windows)) ok = 0; + } + else + { + if (bd->desk != desk) + { + if ((bd->zone) && (bd->zone != zone) && + (!e_config->winlist_list_show_other_screen_windows)) ok = 0; + else if (!e_config->winlist_list_show_other_desk_windows) ok = 0; + } + } + } + if (ok) { E_Winlist_Win *ww; Evas_Coord mw, mh; @@ -400,21 +438,46 @@ { E_Winlist_Win *ww; Evas_Object *o; - + int ok; + if (!win_selected) return; ww = win_selected->data; edje_object_signal_emit(ww->bg_object, "active", ""); + ok = 0; + + if ((ww->border->iconic) && + (e_config->winlist_list_uncover_while_selecting)) + { + e_border_uniconify(ww->border); + ww->was_iconified = 1; + ok = 1; + } + if ((!ww->border->sticky) && + (ww->border->desk != e_desk_current_get(winlist->zone)) && + (e_config->winlist_list_jump_desk_while_selecting)) + { + if (ww->border->desk) e_desk_show(ww->border->desk); + ok = 1; + } + if ((ww->border->shaded) && + (ww->border->desk == e_desk_current_get(winlist->zone)) && + (e_config->winlist_list_uncover_while_selecting)) + { + e_border_unshade(ww->border, ww->border->shade.dir); + ww->was_shaded = 1; + ok = 1; + } if ((!ww->border->iconic) && ((ww->border->desk == e_desk_current_get(winlist->zone)) || (ww->border->sticky))) + ok = 1; + if (ok) { if (e_config->focus_policy != E_FOCUS_CLICK) { - int animate_warp = 1; - warp_to_x = ww->border->x + (ww->border->w / 2); warp_to_y = ww->border->y + (ww->border->h / 2); - if (animate_warp) + if (e_config->winlist_warp_while_selecting) { warp_to = 1; if (!warp_timer) @@ -456,6 +519,12 @@ if (!win_selected) return; ww = win_selected->data; + if (ww->was_shaded) + e_border_shade(ww->border, ww->border->shade.dir); + if (ww->was_iconified) + e_border_iconify(ww->border); + ww->was_shaded = 0; + ww->was_iconified = 0; if (icon_object) { evas_object_del(icon_object); @@ -471,7 +540,6 @@ { Evas_List *l; int i, n; - int animate_scroll = 1; if (!wins) return; for (i = 0, l = wins; l; l = l->next, i++) @@ -481,7 +549,7 @@ n = evas_list_count(wins); if (n <= 1) return; scroll_align_to = (double)i / (double)(n - 1); - if (animate_scroll) + if (e_config->winlist_scroll_animate) { scroll_to = 1; if (!scroll_timer) @@ -493,7 +561,6 @@ { e_box_align_set(list_object, 0.5, scroll_align); } - /* FIXME: scroll so the selected win is visible */ } static int @@ -650,9 +717,10 @@ { if (scroll_to) { - double scroll_speed = 0.1; + double spd; - scroll_align = (scroll_align * (1.0 - scroll_speed)) + (scroll_align_to * scroll_speed); + spd = e_config->winlist_scroll_speed; + scroll_align = (scroll_align * (1.0 - spd)) + (scroll_align_to * spd); return 1; } scroll_timer = NULL; @@ -665,11 +733,12 @@ if (warp_to) { int x, y; - double warp_speed = 0.2; + double spd; + spd = e_config->winlist_warp_speed; ecore_x_pointer_xy_get(winlist->zone->container->win, &x, &y); - warp_x = (x * (1.0 - warp_speed)) + (warp_to_x * warp_speed); - warp_y = (y * (1.0 - warp_speed)) + (warp_to_y * warp_speed); + warp_x = (x * (1.0 - spd)) + (warp_to_x * spd); + warp_y = (y * (1.0 - spd)) + (warp_to_y * spd); return 1; } warp_timer = NULL; @@ -709,7 +778,6 @@ } e_box_align_set(list_object, 0.5, 1.0 - scroll_align); } - /* FIXME: update scroll alignment */ if ((warp_to) || (scroll_to)) return 1; animator = NULL; return 0; ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs