From: <enl...@li...> - 2005-02-10 13:53:07
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_border.c Log Message: Now both resize limit and resize resist should work. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -3 -r1.92 -r1.93 --- e_border.c 10 Feb 2005 13:33:07 -0000 1.92 +++ e_border.c 10 Feb 2005 13:53:00 -0000 1.93 @@ -2748,7 +2748,6 @@ tw = bd->w; th = bd->h; - _e_border_resize_limit(bd, &w, &h); if ((bd->resize_mode == RESIZE_TL) || (bd->resize_mode == RESIZE_L) || @@ -2766,6 +2765,18 @@ &new_x, &new_y, &new_w, &new_h); evas_list_free(skiplist); + w = new_w; + h = new_h; + _e_border_resize_limit(bd, &new_w, &new_h); + if ((bd->resize_mode == RESIZE_TL) || + (bd->resize_mode == RESIZE_L) || + (bd->resize_mode == RESIZE_BL)) + new_x += (w - new_w); + if ((bd->resize_mode == RESIZE_TL) || + (bd->resize_mode == RESIZE_T) || + (bd->resize_mode == RESIZE_TR)) + new_y += (h - new_h); + e_border_move_resize(bd, new_x, new_y, new_w, new_h); } |
From: <enl...@li...> - 2005-02-10 15:19:45
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/modules/pager Modified Files: e_mod_main.c e_mod_main.h Log Message: Sticky windows =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/pager/e_mod_main.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- e_mod_main.c 10 Feb 2005 12:52:31 -0000 1.46 +++ e_mod_main.c 10 Feb 2005 15:19:32 -0000 1.47 @@ -40,6 +40,8 @@ static int _pager_face_cb_event_border_remove(void *data, int type, void *event); static int _pager_face_cb_event_border_hide(void *data, int type, void *event); static int _pager_face_cb_event_border_show(void *data, int type, void *event); +static int _pager_face_cb_event_border_stick(void *data, int type, void *event); +static int _pager_face_cb_event_border_unstick(void *data, int type, void *event); static int _pager_face_cb_event_border_desk_set(void *data, int type, void *event); static int _pager_face_cb_event_zone_desk_count_set(void *data, int type, void *event); static void _pager_face_cb_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi); @@ -302,6 +304,12 @@ face->ev_handler_border_show = ecore_event_handler_add(E_EVENT_BORDER_SHOW, _pager_face_cb_event_border_show, face); + face->ev_handler_border_stick = + ecore_event_handler_add(E_EVENT_BORDER_STICK, + _pager_face_cb_event_border_stick, face); + face->ev_handler_border_unstick = + ecore_event_handler_add(E_EVENT_BORDER_UNSTICK, + _pager_face_cb_event_border_unstick, face); face->ev_handler_border_desk_set = ecore_event_handler_add(E_EVENT_BORDER_DESK_SET, _pager_face_cb_event_border_desk_set, face); @@ -346,6 +354,8 @@ ecore_event_handler_del(face->ev_handler_border_remove); ecore_event_handler_del(face->ev_handler_border_hide); ecore_event_handler_del(face->ev_handler_border_show); + ecore_event_handler_del(face->ev_handler_border_stick); + ecore_event_handler_del(face->ev_handler_border_unstick); ecore_event_handler_del(face->ev_handler_border_desk_set); ecore_event_handler_del(face->ev_handler_zone_desk_count_set); @@ -794,7 +804,10 @@ while (wins) { win = wins->data; - if (win->border == border) + /* We have to check the desk, wouldn't want + * a sticky copy */ + if ((win->border->desk == desk->desk) + && (win->border == border)) return win; wins = wins->next; } @@ -858,18 +871,25 @@ _pager_face_cb_event_border_resize(void *data, int type, void *event) { Pager_Face *face; + Pager_Desk *desk; Pager_Win *win; E_Event_Border_Resize *ev; + Evas_List *desks, *wins; face = data; ev = event; - if ((win = _pager_window_find(face, ev->border))) - { - _pager_window_move(face, win); - } - else + for (desks = face->desks; desks; desks = desks->next) { - printf("ERROR: event_border_resize %p:%p\n", event, ev->border); + desk = desks->data; + for (wins = desk->wins; wins; wins = wins->next) + { + win = wins->data; + if (win->border == ev->border) + { + _pager_window_move(face, win); + break; + } + } } return 1; } @@ -878,18 +898,25 @@ _pager_face_cb_event_border_move(void *data, int type, void *event) { Pager_Face *face; + Pager_Desk *desk; Pager_Win *win; - E_Event_Border_Resize *ev; + E_Event_Border_Move *ev; + Evas_List *desks, *wins; face = data; ev = event; - if((win = _pager_window_find(face, ev->border))) - { - _pager_window_move(face, win); - } - else + for (desks = face->desks; desks; desks = desks->next) { - printf("ERROR: event_border_move %p:%p\n", event, ev->border); + desk = desks->data; + for (wins = desk->wins; wins; wins = wins->next) + { + win = wins->data; + if (win->border == ev->border) + { + _pager_window_move(face, win); + break; + } + } } return 1; } @@ -901,15 +928,29 @@ Pager_Desk *desk; Pager_Win *win; E_Event_Border_Add *ev; + Evas_List *desks; face = data; ev = event; +#if 0 if (_pager_window_find(face, ev->border)) { printf("event_border_add, window found :'(\n"); return 1; } - if ((desk = _pager_desk_find(face, ev->border->desk))) +#endif + if (ev->border->sticky) + { + /* Put on all desks */ + for (desks = face->desks; desks; desks = desks->next) + { + desk = desks->data; + win = _pager_window_new(desk, ev->border); + if (win) + desk->wins = evas_list_append(desk->wins, win); + } + } + else if ((desk = _pager_desk_find(face, ev->border->desk))) { win = _pager_window_new(desk, ev->border); if (win) @@ -927,18 +968,25 @@ { Pager_Face *face; Pager_Desk *desk; - Pager_Win *old; + Pager_Win *win; E_Event_Border_Remove *ev; + Evas_List *desks, *wins; face = data; ev = event; - - old = _pager_window_find(face, ev->border); - desk = _pager_desk_find(face, ev->border->desk); - if (old && desk) + for (desks = face->desks; desks; desks = desks->next) { - desk->wins = evas_list_remove(desk->wins, old); - _pager_window_free(old); + desk = desks->data; + for (wins = desk->wins; wins; wins = wins->next) + { + win = wins->data; + if (win->border == ev->border) + { + desk->wins = evas_list_remove_list(desk->wins, wins); + _pager_window_free(win); + break; + } + } } return 1; } @@ -947,16 +995,27 @@ _pager_face_cb_event_border_hide(void *data, int type, void *event) { Pager_Face *face; + Pager_Desk *desk; Pager_Win *win; E_Event_Border_Hide *ev; + Evas_List *desks, *wins; face = data; ev = event; - win = _pager_window_find(face, ev->border); - if (win && ev->border->desk->visible) + for (desks = face->desks; desks; desks = desks->next) { - evas_object_hide(win->obj); - evas_object_hide(win->icon); + desk = desks->data; + for (wins = desk->wins; wins; wins = wins->next) + { + win = wins->data; + if ((win->border == ev->border) + && (ev->border->desk->visible)) + { + evas_object_hide(win->obj); + evas_object_hide(win->icon); + break; + } + } } return 1; } @@ -965,18 +1024,85 @@ _pager_face_cb_event_border_show(void *data, int type, void *event) { Pager_Face *face; + Pager_Desk *desk; Pager_Win *win; E_Event_Border_Show *ev; + Evas_List *desks, *wins; face = data; ev = event; - win = _pager_window_find(face, ev->border); - if (win) + for (desks = face->desks; desks; desks = desks->next) { - evas_object_show(win->obj); - evas_object_show(win->icon); + desk = desks->data; + for (wins = desk->wins; wins; wins = wins->next) + { + win = wins->data; + if ((win->border == ev->border) + && (ev->border->desk->visible)) + { + evas_object_show(win->obj); + evas_object_show(win->icon); + break; + } + } + } + evas_object_raise(face->screen); + return 1; +} - evas_object_raise(face->screen); +static int +_pager_face_cb_event_border_stick(void *data, int type, void *event) +{ + Pager_Face *face; + Pager_Desk *desk; + Pager_Win *win; + E_Event_Border_Stick *ev; + Evas_List *desks; + + face = data; + ev = event; + for (desks = face->desks; desks; desks = desks->next) + { + desk = desks->data; + /* On this desk there should already be a border */ + if (ev->border->desk == desk->desk) + continue; + + win = _pager_window_new(desk, ev->border); + desk->wins = evas_list_append(desk->wins, win); + } + return 1; +} + +static int +_pager_face_cb_event_border_unstick(void *data, int type, void *event) +{ + Pager_Face *face; + Pager_Desk *desk; + Pager_Win *win; + E_Event_Border_Unstick *ev; + Evas_List *desks, *wins; + + face = data; + ev = event; + + for (desks = face->desks; desks; desks = desks->next) + { + desk = desks->data; + /* On this desk there should be a border */ + if (desk->desk == ev->border->desk) + continue; + + for (wins = desk->wins; wins; wins = wins->next) + { + win = wins->data; + if (win->border == ev->border) + { + desk->wins = evas_list_remove_list(desk->wins, wins); + _pager_window_free(win); + break; + } + } } return 1; } @@ -991,6 +1117,9 @@ face = data; ev = event; + if (ev->border->sticky) + return 1; + win = _pager_window_find(face, ev->border); desk = _pager_desk_find(face, ev->border->desk); if (win && desk) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/pager/e_mod_main.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- e_mod_main.h 10 Feb 2005 12:03:09 -0000 1.13 +++ e_mod_main.h 10 Feb 2005 15:19:33 -0000 1.14 @@ -63,6 +63,8 @@ Ecore_Event_Handler *ev_handler_border_remove; Ecore_Event_Handler *ev_handler_border_hide; Ecore_Event_Handler *ev_handler_border_show; + Ecore_Event_Handler *ev_handler_border_stick; + Ecore_Event_Handler *ev_handler_border_unstick; Ecore_Event_Handler *ev_handler_border_desk_set; Ecore_Event_Handler *ev_handler_zone_desk_count_set; }; |
From: <enl...@li...> - 2005-02-10 15:21:34
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_border.h e_border.c Log Message: Sticky windows =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- e_border.h 7 Feb 2005 13:51:09 -0000 1.25 +++ e_border.h 10 Feb 2005 15:21:22 -0000 1.26 @@ -27,6 +27,8 @@ typedef struct _E_Event_Border_Remove E_Event_Border_Remove; typedef struct _E_Event_Border_Show E_Event_Border_Show; typedef struct _E_Event_Border_Hide E_Event_Border_Hide; +typedef struct _E_Event_Border_Stick E_Event_Border_Stick; +typedef struct _E_Event_Border_Unstick E_Event_Border_Unstick; typedef struct _E_Event_Border_Desk_Set E_Event_Border_Desk_Set; #else @@ -236,6 +238,16 @@ E_Border *border; }; +struct _E_Event_Border_Stick +{ + E_Border *border; +}; + +struct _E_Event_Border_Unstick +{ + E_Border *border; +}; + struct _E_Event_Border_Desk_Set { E_Border *border; @@ -282,6 +294,8 @@ extern EAPI int E_EVENT_BORDER_SHOW; extern EAPI int E_EVENT_BORDER_HIDE; extern EAPI int E_EVENT_BORDER_REMOVE; +extern EAPI int E_EVENT_BORDER_STICK; +extern EAPI int E_EVENT_BORDER_UNSTICK; extern EAPI int E_EVENT_BORDER_DESK_SET; #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -3 -r1.93 -r1.94 --- e_border.c 10 Feb 2005 13:53:00 -0000 1.93 +++ e_border.c 10 Feb 2005 15:21:23 -0000 1.94 @@ -78,6 +78,8 @@ static void _e_border_event_border_move_free(void *data, void *ev); static void _e_border_event_border_show_free(void *data, void *ev); static void _e_border_event_border_hide_free(void *data, void *ev); +static void _e_border_event_border_stick_free(void *data, void *ev); +static void _e_border_event_border_unstick_free(void *data, void *ev); static void _e_border_zone_update(E_Border *bd); @@ -102,6 +104,8 @@ int E_EVENT_BORDER_MOVE = 0; int E_EVENT_BORDER_SHOW = 0; int E_EVENT_BORDER_HIDE = 0; +int E_EVENT_BORDER_STICK = 0; +int E_EVENT_BORDER_UNSTICK = 0; #define GRAV_SET(bd, grav) \ printf("GRAV TO %i\n", grav); \ @@ -138,6 +142,8 @@ E_EVENT_BORDER_MOVE = ecore_event_type_new(); E_EVENT_BORDER_SHOW = ecore_event_type_new(); E_EVENT_BORDER_HIDE = ecore_event_type_new(); + E_EVENT_BORDER_STICK = ecore_event_type_new(); + E_EVENT_BORDER_UNSTICK = ecore_event_type_new(); return 1; } @@ -882,20 +888,34 @@ void e_border_stick(E_Border *bd) { + E_Event_Border_Stick *ev; + E_OBJECT_CHECK(bd); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); bd->sticky = 1; e_hints_window_sticky_set(bd->client.win, 1); + + ev = E_NEW(E_Event_Border_Stick, 1); + ev->border = bd; + e_object_ref(E_OBJECT(bd)); + ecore_event_add(E_EVENT_BORDER_STICK, ev, _e_border_event_border_stick_free, NULL); } void e_border_unstick(E_Border *bd) { + E_Event_Border_Unstick *ev; + E_OBJECT_CHECK(bd); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); bd->sticky = 0; e_hints_window_sticky_set(bd->client.win, 0); e_border_desk_set(bd, e_desk_current_get(bd->zone)); + + ev = E_NEW(E_Event_Border_Unstick, 1); + ev->border = bd; + e_object_ref(E_OBJECT(bd)); + ecore_event_add(E_EVENT_BORDER_UNSTICK, ev, _e_border_event_border_unstick_free, NULL); } E_Border * @@ -3119,6 +3139,26 @@ } static void +_e_border_event_border_stick_free(void *data, void *ev) +{ + E_Event_Border_Stick *e; + + e = ev; + e_object_unref(E_OBJECT(e->border)); + free(e); +} + +static void +_e_border_event_border_unstick_free(void *data, void *ev) +{ + E_Event_Border_Unstick *e; + + e = ev; + e_object_unref(E_OBJECT(e->border)); + free(e); +} + +static void _e_border_event_border_desk_set_free(void *data, void *ev) { E_Event_Border_Desk_Set *e; |
From: <enl...@li...> - 2005-02-10 15:25:15
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/modules/pager Modified Files: e_mod_main.c Log Message: Don't honor sticky flag when border is added. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/pager/e_mod_main.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -3 -r1.47 -r1.48 --- e_mod_main.c 10 Feb 2005 15:19:32 -0000 1.47 +++ e_mod_main.c 10 Feb 2005 15:25:07 -0000 1.48 @@ -939,18 +939,7 @@ return 1; } #endif - if (ev->border->sticky) - { - /* Put on all desks */ - for (desks = face->desks; desks; desks = desks->next) - { - desk = desks->data; - win = _pager_window_new(desk, ev->border); - if (win) - desk->wins = evas_list_append(desk->wins, win); - } - } - else if ((desk = _pager_desk_find(face, ev->border->desk))) + if ((desk = _pager_desk_find(face, ev->border->desk))) { win = _pager_window_new(desk, ev->border); if (win) |
From: <enl...@li...> - 2005-02-10 16:42:14
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/modules/battery Modified Files: e_mod_main.c e_mod_main.h Log Message: Add main menu to face menu. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/battery/e_mod_main.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- e_mod_main.c 10 Feb 2005 12:44:10 -0000 1.16 +++ e_mod_main.c 10 Feb 2005 16:42:07 -0000 1.17 @@ -186,15 +186,13 @@ _battery_face_menu_new(ef); /* Add main menu to face menu */ - /* - for (ml = e->menus; ml; ml = ml->next) - { - mn = ml->data; - mi = e_menu_item_new(ef->menu); - e_menu_item_label_set(mi, "????"); - e_menu_item_submenu_set(mi, mn); - } - */ + mi = e_menu_item_new(ef->menu); + e_menu_item_label_set(mi, "Set Poll Time"); + e_menu_item_submenu_set(mi, e->config_menu_poll); + + mi = e_menu_item_new(ef->menu); + e_menu_item_label_set(mi, "Set Alarm"); + e_menu_item_submenu_set(mi, e->config_menu_alarm); mi = e_menu_item_new(e->config_menu); e_menu_item_label_set(mi, con->name); @@ -224,10 +222,9 @@ _battery_face_free(l->data); evas_list_free(e->faces); - for (l = e->menus; l; l = l->next) - e_object_del(E_OBJECT(l->data)); - evas_list_free(e->menus); e_object_del(E_OBJECT(e->config_menu)); + e_object_del(E_OBJECT(e->config_menu_poll)); + e_object_del(E_OBJECT(e->config_menu_alarm)); ecore_timer_del(e->battery_check_timer); @@ -368,7 +365,7 @@ static void _battery_config_menu_new(Battery *e) { - E_Menu *mn, *config_menu_alarm, *config_menu_poll; + E_Menu *mn; E_Menu_Item *mi; /* Alarm */ @@ -423,7 +420,7 @@ if (e->conf->alarm == 60) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _battery_menu_alarm_60, e); - config_menu_alarm = mn; + e->config_menu_alarm = mn; /* Check interval */ mn = e_menu_new(); @@ -463,21 +460,19 @@ if (e->conf->poll_time == 60.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _battery_menu_very_slow, e); - config_menu_poll = mn; + e->config_menu_poll = mn; mn = e_menu_new(); mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Set Poll Time"); - e_menu_item_submenu_set(mi, config_menu_poll); + e_menu_item_submenu_set(mi, e->config_menu_poll); mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Set Alarm"); - e_menu_item_submenu_set(mi, config_menu_alarm); + e_menu_item_submenu_set(mi, e->config_menu_alarm); e->config_menu = mn; - e->menus = evas_list_append(e->menus, config_menu_poll); - e->menus = evas_list_append(e->menus, config_menu_alarm); } static Battery_Face * =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/battery/e_mod_main.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- e_mod_main.h 10 Feb 2005 12:00:39 -0000 1.7 +++ e_mod_main.h 10 Feb 2005 16:42:07 -0000 1.8 @@ -30,7 +30,8 @@ struct _Battery { E_Menu *config_menu; - Evas_List *menus; + E_Menu *config_menu_poll; + E_Menu *config_menu_alarm; Evas_List *faces; Config *conf; |
From: <enl...@li...> - 2005-02-10 16:48:44
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/modules/temperature Modified Files: e_mod_main.c e_mod_main.h Log Message: Add main menu to face menu. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/temperature/e_mod_main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_mod_main.c 10 Feb 2005 12:49:20 -0000 1.10 +++ e_mod_main.c 10 Feb 2005 16:48:36 -0000 1.11 @@ -105,8 +105,7 @@ _temperature_new() { Temperature *e; - Evas_List *managers, *l, *l2, *cl, *ml; - E_Menu *mn; + Evas_List *managers, *l, *l2, *cl; E_Menu_Item *mi; temperature_count = 0; @@ -181,15 +180,17 @@ _temperature_face_menu_new(ef); /* Add main menu to face menu */ - /* - for (ml = e->menus; ml; ml = ml->next) - { - mn = ml->data; - mi = e_menu_item_new(ef->menu); - e_menu_item_label_set(mi, "????"); - e_menu_item_submenu_set(mi, mn); - } - */ + mi = e_menu_item_new(ef->menu); + e_menu_item_label_set(mi, "Check Interval"); + e_menu_item_submenu_set(mi, e->config_menu_poll); + + mi = e_menu_item_new(ef->menu); + e_menu_item_label_set(mi, "Low Temperature"); + e_menu_item_submenu_set(mi, e->config_menu_low); + + mi = e_menu_item_new(ef->menu); + e_menu_item_label_set(mi, "High Temperature"); + e_menu_item_submenu_set(mi, e->config_menu_high); mi = e_menu_item_new(e->config_menu); e_menu_item_label_set(mi, con->name); @@ -220,10 +221,10 @@ _temperature_face_free(l->data); evas_list_free(e->faces); - for (l = e->menus; l; l = l->next) - e_object_del(E_OBJECT(l->data)); - evas_list_free(e->menus); e_object_del(E_OBJECT(e->config_menu)); + e_object_del(E_OBJECT(e->config_menu_poll)); + e_object_del(E_OBJECT(e->config_menu_low)); + e_object_del(E_OBJECT(e->config_menu_high)); ecore_timer_del(e->temperature_check_timer); @@ -448,7 +449,7 @@ static void _temperature_config_menu_new(Temperature *e) { - E_Menu *mn, *config_menu1, *config_menu2, *config_menu3; + E_Menu *mn; E_Menu_Item *mi; /* Check interval */ @@ -489,7 +490,7 @@ if (e->conf->poll_time == 60.0) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_very_slow, e); - config_menu1 = mn; + e->config_menu_poll = mn; /* Low temperature */ mn = e_menu_new(); @@ -529,7 +530,7 @@ if (e->conf->low == 50) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_low_50, e); - config_menu2 = mn; + e->config_menu_low = mn; /* High temperature */ mn = e_menu_new(); @@ -597,27 +598,24 @@ if (e->conf->high == 100) e_menu_item_toggle_set(mi, 1); e_menu_item_callback_set(mi, _temperature_menu_high_100, e); - config_menu3 = mn; + e->config_menu_high = mn; /* Main */ mn = e_menu_new(); mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Check Interval"); - e_menu_item_submenu_set(mi, config_menu1); + e_menu_item_submenu_set(mi, e->config_menu_poll); mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Low Temperature"); - e_menu_item_submenu_set(mi, config_menu2); + e_menu_item_submenu_set(mi, e->config_menu_low); mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "High Temperature"); - e_menu_item_submenu_set(mi, config_menu3); + e_menu_item_submenu_set(mi, e->config_menu_high); e->config_menu = mn; - e->menus = evas_list_append(e->menus, config_menu1); - e->menus = evas_list_append(e->menus, config_menu2); - e->menus = evas_list_append(e->menus, config_menu3); } static Temperature_Face * =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/temperature/e_mod_main.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- e_mod_main.h 10 Feb 2005 11:58:14 -0000 1.4 +++ e_mod_main.h 10 Feb 2005 16:48:37 -0000 1.5 @@ -24,7 +24,9 @@ struct _Temperature { E_Menu *config_menu; - Evas_List *menus; + E_Menu *config_menu_low; + E_Menu *config_menu_high; + E_Menu *config_menu_poll; Evas_List *faces; Config *conf; |
From: <enl...@li...> - 2005-02-11 14:38:53
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_border.c Log Message: Don't accept LOCK keys as modifiers on event Mouse Down. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.94 retrieving revision 1.95 diff -u -3 -r1.94 -r1.95 --- e_border.c 10 Feb 2005 15:21:23 -0000 1.94 +++ e_border.c 11 Feb 2005 14:38:46 -0000 1.95 @@ -1795,6 +1795,8 @@ bd->mouse.current.mx = ev->root.x; bd->mouse.current.my = ev->root.y; /* Bindings */ + /* Remove LOCK keys */ + ev->modifers &= ~(ECORE_X_LOCK_SCROLL|ECORE_X_LOCK_NUM|ECORE_X_LOCK_CAPS); for (list = e_config->bindings; list; list = list->next) { eb = list->data; |
From: <enl...@li...> - 2005-02-11 14:39:50
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_border.c Log Message: Bad me. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -3 -r1.95 -r1.96 --- e_border.c 11 Feb 2005 14:38:46 -0000 1.95 +++ e_border.c 11 Feb 2005 14:39:44 -0000 1.96 @@ -1796,7 +1796,7 @@ bd->mouse.current.my = ev->root.y; /* Bindings */ /* Remove LOCK keys */ - ev->modifers &= ~(ECORE_X_LOCK_SCROLL|ECORE_X_LOCK_NUM|ECORE_X_LOCK_CAPS); + ev->modifiers &= ~(ECORE_X_LOCK_SCROLL|ECORE_X_LOCK_NUM|ECORE_X_LOCK_CAPS); for (list = e_config->bindings; list; list = list->next) { eb = list->data; |
From: <enl...@li...> - 2005-02-11 14:50:15
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_border.c Log Message: Don't change the event structure. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.96 retrieving revision 1.97 diff -u -3 -r1.96 -r1.97 --- e_border.c 11 Feb 2005 14:39:44 -0000 1.96 +++ e_border.c 11 Feb 2005 14:50:08 -0000 1.97 @@ -1778,9 +1778,11 @@ E_Config_Binding *eb; int x, y, w, h; char source[16]; + int modifiers; ev = event; bd = data; + modifiers = ev->modifiers; if (ev->event_win == bd->win) { if ((ev->button >= 1) && (ev->button <= 3)) @@ -1796,11 +1798,11 @@ bd->mouse.current.my = ev->root.y; /* Bindings */ /* Remove LOCK keys */ - ev->modifiers &= ~(ECORE_X_LOCK_SCROLL|ECORE_X_LOCK_NUM|ECORE_X_LOCK_CAPS); + modifiers &= ~(ECORE_X_LOCK_SCROLL|ECORE_X_LOCK_NUM|ECORE_X_LOCK_CAPS); for (list = e_config->bindings; list; list = list->next) { eb = list->data; - if ((ev->button == eb->button) && (ev->modifiers == eb->modifiers)) + if ((ev->button == eb->button) && (modifiers == eb->modifiers)) { snprintf(source, sizeof(source) - 1, "mouse,%d", eb->button); switch (eb->action) |
From: <enl...@li...> - 2005-02-11 15:18:42
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_border.c Log Message: Remember which window is resizing, and if that window is removed, stop resizing. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -3 -r1.97 -r1.98 --- e_border.c 11 Feb 2005 14:50:08 -0000 1.97 +++ e_border.c 11 Feb 2005 15:18:21 -0000 1.98 @@ -92,7 +92,8 @@ static Evas_List *borders = NULL; static E_Border *focused = NULL; -static Ecore_Evas *resize_ee = NULL; +static E_Border *resize = NULL; +static Ecore_Evas *resize_ee = NULL; static Evas_Object *resize_obj = NULL; extern int _e_desk_current_changing; @@ -961,6 +962,9 @@ Evas_List *list; E_Config_Binding *eb; + if (resize == bd) + _e_border_resize_end(bd); + while (bd->pending_move_resize) { free(bd->pending_move_resize->data); @@ -3231,6 +3235,7 @@ ecore_evas_resize(resize_ee, w, h); ecore_evas_show(resize_ee); + resize = bd; } static void @@ -3238,6 +3243,7 @@ { evas_object_del(resize_obj); ecore_evas_free(resize_ee); + resize = NULL; } static void |
From: <enl...@li...> - 2005-02-11 15:19:48
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e Modified Files: TODO Log Message: Fixed. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/TODO,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- TODO 11 Feb 2005 14:36:26 -0000 1.36 +++ TODO 11 Feb 2005 15:19:40 -0000 1.37 @@ -30,8 +30,6 @@ ISSUES: * if xinerama screens overlap... dont use the later screen overlapping -* if window exits while resizing, resize display stays up - fix -* All objects should be an e_object? * focus newly created windows when appropriate (under mouse and focus follows mouse etc.) * ibar module should only make 1 gadget per container and allow u to enable/disable that gadget on that container (like clock) * make ibar a gadman client |
From: <enl...@li...> - 2005-02-13 10:41:30
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_atoms.h e_atoms.c Log Message: Create atoms to hold container and zone info. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_atoms.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- e_atoms.h 7 Feb 2005 13:51:08 -0000 1.7 +++ e_atoms.h 13 Feb 2005 10:41:14 -0000 1.8 @@ -10,6 +10,8 @@ extern EAPI Ecore_X_Atom E_ATOM_MANAGED; /* basic window properties */ +extern EAPI Ecore_X_Atom E_ATOM_CONTAINER; +extern EAPI Ecore_X_Atom E_ATOM_ZONE; extern EAPI Ecore_X_Atom E_ATOM_DESK; extern EAPI Ecore_X_Atom E_ATOM_ICONIC; extern EAPI Ecore_X_Atom E_ATOM_MAPPED; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_atoms.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_atoms.c 7 Feb 2005 13:51:08 -0000 1.6 +++ e_atoms.c 13 Feb 2005 10:41:14 -0000 1.7 @@ -5,6 +5,8 @@ /* Atoms */ Ecore_X_Atom E_ATOM_MANAGED = 0; +Ecore_X_Atom E_ATOM_CONTAINER = 0; +Ecore_X_Atom E_ATOM_ZONE = 0; Ecore_X_Atom E_ATOM_DESK = 0; Ecore_X_Atom E_ATOM_ICONIC = 0; Ecore_X_Atom E_ATOM_MAPPED = 0; @@ -14,6 +16,8 @@ e_atoms_init(void) { E_ATOM_MANAGED = ecore_x_atom_get("__E_WINDOW_MANAGED"); + E_ATOM_CONTAINER = ecore_x_atom_get("__E_WINDOW_CONTAINER"); + E_ATOM_ZONE = ecore_x_atom_get("__E_WINDOW_ZONE"); E_ATOM_DESK = ecore_x_atom_get("__E_WINDOW_DESK"); E_ATOM_ICONIC = ecore_x_atom_get("__E_WINDOW_ICONIC"); E_ATOM_MAPPED = ecore_x_atom_get("__E_WINDOW_MAPPED"); |
From: <enl...@li...> - 2005-02-13 10:42:47
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_config.c Log Message: Formatting. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- e_config.c 8 Feb 2005 03:51:07 -0000 1.20 +++ e_config.c 13 Feb 2005 10:42:11 -0000 1.21 @@ -120,8 +120,8 @@ eb = E_NEW(E_Config_Binding, 1); eb->button = 1; eb->mask = ECORE_X_EVENT_MASK_MOUSE_DOWN | - ECORE_X_EVENT_MASK_MOUSE_UP | - ECORE_X_EVENT_MASK_MOUSE_MOVE; + ECORE_X_EVENT_MASK_MOUSE_UP | + ECORE_X_EVENT_MASK_MOUSE_MOVE; eb->modifiers = ECORE_X_MODIFIER_ALT; eb->action = E_BINDING_ACTION_MOVE; e_config->bindings = evas_list_append(e_config->bindings, eb); |
From: <enl...@li...> - 2005-02-13 10:44:11
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_container.h Log Message: Formatting. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- e_container.h 7 Feb 2005 13:51:09 -0000 1.13 +++ e_container.h 13 Feb 2005 10:44:02 -0000 1.14 @@ -87,7 +87,7 @@ EAPI Evas_List *e_container_clients_list_get(E_Container *con); EAPI E_Zone *e_container_zone_at_point_get(E_Container *con, int x, int y); EAPI E_Zone *e_container_zone_number_get(E_Container *con, int num); - + EAPI E_Container_Shape *e_container_shape_add(E_Container *con); EAPI void e_container_shape_show(E_Container_Shape *es); EAPI void e_container_shape_hide(E_Container_Shape *es); |
From: <enl...@li...> - 2005-02-13 10:46:10
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_gadman.c Log Message: Remove e_client_gadman_edge_set, because e_gadman_client_edge_set exists. Respect policy changes while in editing mode. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_gadman.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- e_gadman.c 27 Jan 2005 15:17:09 -0000 1.20 +++ e_gadman.c 13 Feb 2005 10:46:04 -0000 1.21 @@ -214,14 +214,6 @@ } void -e_client_gadman_edge_set(E_Gadman_Client *gmc, E_Gadman_Edge edge) -{ - E_OBJECT_CHECK(gmc); - E_OBJECT_TYPE_CHECK(gmc, E_GADMAN_CLIENT_TYPE); - gmc->edge = edge; -} - -void e_gadman_client_load(E_Gadman_Client *gmc) { Gadman_Client_Config *cf; @@ -309,6 +301,23 @@ E_OBJECT_CHECK(gmc); E_OBJECT_TYPE_CHECK(gmc, E_GADMAN_CLIENT_TYPE); gmc->policy = pol; + + if (gmc->control_object) + { + if (gmc->policy & E_GADMAN_POLICY_HSIZE) + edje_object_signal_emit(gmc->control_object, "hsize", "on"); + else + edje_object_signal_emit(gmc->control_object, "hsize", "off"); + if (gmc->policy & E_GADMAN_POLICY_VSIZE) + edje_object_signal_emit(gmc->control_object, "vsize", "on"); + else + edje_object_signal_emit(gmc->control_object, "vsize", "off"); + if (gmc->policy & (E_GADMAN_POLICY_HMOVE | E_GADMAN_POLICY_VMOVE)) + edje_object_signal_emit(gmc->control_object, "move", "on"); + else + edje_object_signal_emit(gmc->control_object, "move", "off"); + } + } void |
From: <enl...@li...> - 2005-02-13 10:48:10
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_module.c Log Message: Mark problem with FIXME =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_module.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- e_module.c 10 Feb 2005 12:29:25 -0000 1.16 +++ e_module.c 13 Feb 2005 10:47:57 -0000 1.17 @@ -343,7 +343,8 @@ e_config->modules = evas_list_remove(e_config->modules, em); E_FREE(em->name); E_FREE(em); - /* This is crap, a job is added, but doesn't run because + /* FIXME + * This is crap, a job is added, but doesn't run because * main loop has quit! e_config_save_queue(); */ |
From: <enl...@li...> - 2005-02-13 10:56:40
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default_clock.edc Log Message: Formatting. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default_clock.edc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- default_clock.edc 10 Jan 2005 22:33:53 -0000 1.2 +++ default_clock.edc 13 Feb 2005 10:56:28 -0000 1.3 @@ -260,65 +260,65 @@ } \ } HAND("00") - HAND("01") - HAND("02") - HAND("03") - HAND("04") - HAND("05") - HAND("06") - HAND("07") - HAND("08") - HAND("09") - HAND("10") - HAND("11") - HAND("12") - HAND("13") - HAND("14") - HAND("15") - HAND("16") - HAND("17") - HAND("18") - HAND("19") - HAND("20") - HAND("21") - HAND("22") - HAND("23") - HAND("24") - HAND("25") - HAND("26") - HAND("27") - HAND("28") - HAND("29") - HAND("30") - HAND("31") - HAND("32") - HAND("33") - HAND("34") - HAND("35") - HAND("36") - HAND("37") - HAND("38") - HAND("39") - HAND("40") - HAND("41") - HAND("42") - HAND("43") - HAND("44") - HAND("45") - HAND("46") - HAND("47") - HAND("48") - HAND("49") - HAND("50") - HAND("51") - HAND("52") - HAND("53") - HAND("54") - HAND("55") - HAND("56") - HAND("57") - HAND("58") - HAND("59") + HAND("01") + HAND("02") + HAND("03") + HAND("04") + HAND("05") + HAND("06") + HAND("07") + HAND("08") + HAND("09") + HAND("10") + HAND("11") + HAND("12") + HAND("13") + HAND("14") + HAND("15") + HAND("16") + HAND("17") + HAND("18") + HAND("19") + HAND("20") + HAND("21") + HAND("22") + HAND("23") + HAND("24") + HAND("25") + HAND("26") + HAND("27") + HAND("28") + HAND("29") + HAND("30") + HAND("31") + HAND("32") + HAND("33") + HAND("34") + HAND("35") + HAND("36") + HAND("37") + HAND("38") + HAND("39") + HAND("40") + HAND("41") + HAND("42") + HAND("43") + HAND("44") + HAND("45") + HAND("46") + HAND("47") + HAND("48") + HAND("49") + HAND("50") + HAND("51") + HAND("52") + HAND("53") + HAND("54") + HAND("55") + HAND("56") + HAND("57") + HAND("58") + HAND("59") } #endif #ifdef IND @@ -353,65 +353,65 @@ } \ } HAND("00") - HAND("01") - HAND("02") - HAND("03") - HAND("04") - HAND("05") - HAND("06") - HAND("07") - HAND("08") - HAND("09") - HAND("10") - HAND("11") - HAND("12") - HAND("13") - HAND("14") - HAND("15") - HAND("16") - HAND("17") - HAND("18") - HAND("19") - HAND("20") - HAND("21") - HAND("22") - HAND("23") - HAND("24") - HAND("25") - HAND("26") - HAND("27") - HAND("28") - HAND("29") - HAND("30") - HAND("31") - HAND("32") - HAND("33") - HAND("34") - HAND("35") - HAND("36") - HAND("37") - HAND("38") - HAND("39") - HAND("40") - HAND("41") - HAND("42") - HAND("43") - HAND("44") - HAND("45") - HAND("46") - HAND("47") - HAND("48") - HAND("49") - HAND("50") - HAND("51") - HAND("52") - HAND("53") - HAND("54") - HAND("55") - HAND("56") - HAND("57") - HAND("58") - HAND("59") + HAND("01") + HAND("02") + HAND("03") + HAND("04") + HAND("05") + HAND("06") + HAND("07") + HAND("08") + HAND("09") + HAND("10") + HAND("11") + HAND("12") + HAND("13") + HAND("14") + HAND("15") + HAND("16") + HAND("17") + HAND("18") + HAND("19") + HAND("20") + HAND("21") + HAND("22") + HAND("23") + HAND("24") + HAND("25") + HAND("26") + HAND("27") + HAND("28") + HAND("29") + HAND("30") + HAND("31") + HAND("32") + HAND("33") + HAND("34") + HAND("35") + HAND("36") + HAND("37") + HAND("38") + HAND("39") + HAND("40") + HAND("41") + HAND("42") + HAND("43") + HAND("44") + HAND("45") + HAND("46") + HAND("47") + HAND("48") + HAND("49") + HAND("50") + HAND("51") + HAND("52") + HAND("53") + HAND("54") + HAND("55") + HAND("56") + HAND("57") + HAND("58") + HAND("59") } #ifdef IND # undef IND @@ -445,65 +445,65 @@ } \ } HAND("00") - HAND("01") - HAND("02") - HAND("03") - HAND("04") - HAND("05") - HAND("06") - HAND("07") - HAND("08") - HAND("09") - HAND("10") - HAND("11") - HAND("12") - HAND("13") - HAND("14") - HAND("15") - HAND("16") - HAND("17") - HAND("18") - HAND("19") - HAND("20") - HAND("21") - HAND("22") - HAND("23") - HAND("24") - HAND("25") - HAND("26") - HAND("27") - HAND("28") - HAND("29") - HAND("30") - HAND("31") - HAND("32") - HAND("33") - HAND("34") - HAND("35") - HAND("36") - HAND("37") - HAND("38") - HAND("39") - HAND("40") - HAND("41") - HAND("42") - HAND("43") - HAND("44") - HAND("45") - HAND("46") - HAND("47") - HAND("48") - HAND("49") - HAND("50") - HAND("51") - HAND("52") - HAND("53") - HAND("54") - HAND("55") - HAND("56") - HAND("57") - HAND("58") - HAND("59") + HAND("01") + HAND("02") + HAND("03") + HAND("04") + HAND("05") + HAND("06") + HAND("07") + HAND("08") + HAND("09") + HAND("10") + HAND("11") + HAND("12") + HAND("13") + HAND("14") + HAND("15") + HAND("16") + HAND("17") + HAND("18") + HAND("19") + HAND("20") + HAND("21") + HAND("22") + HAND("23") + HAND("24") + HAND("25") + HAND("26") + HAND("27") + HAND("28") + HAND("29") + HAND("30") + HAND("31") + HAND("32") + HAND("33") + HAND("34") + HAND("35") + HAND("36") + HAND("37") + HAND("38") + HAND("39") + HAND("40") + HAND("41") + HAND("42") + HAND("43") + HAND("44") + HAND("45") + HAND("46") + HAND("47") + HAND("48") + HAND("49") + HAND("50") + HAND("51") + HAND("52") + HAND("53") + HAND("54") + HAND("55") + HAND("56") + HAND("57") + HAND("58") + HAND("59") } part { name: "fg"; |
From: <enl...@li...> - 2005-02-13 10:58:15
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default_gadman.edc Log Message: Clip the complete handle when not in use. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default_gadman.edc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- default_gadman.edc 18 Jan 2005 15:40:51 -0000 1.4 +++ default_gadman.edc 13 Feb 2005 10:58:08 -0000 1.5 @@ -635,6 +635,7 @@ part { name: "h1th"; mouse_events: 0; + clip_to: "hclip"; description { state: "default" 0.0; max: 6 16; @@ -694,6 +695,7 @@ part { name: "h2th"; mouse_events: 0; + clip_to: "hclip"; description { state: "default" 0.0; max: 6 16; @@ -753,6 +755,7 @@ part { name: "v1th"; mouse_events: 0; + clip_to: "vclip"; description { state: "default" 0.0; max: 16 6; @@ -812,6 +815,7 @@ part { name: "v2th"; mouse_events: 0; + clip_to: "vclip"; description { state: "default" 0.0; max: 16 6; |
From: <enl...@li...> - 2005-02-13 11:13:02
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_border.h e_border.c Log Message: Add code for zone setting, and remembering zone and container. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- e_border.h 10 Feb 2005 15:21:22 -0000 1.26 +++ e_border.h 13 Feb 2005 11:12:51 -0000 1.27 @@ -29,6 +29,7 @@ typedef struct _E_Event_Border_Hide E_Event_Border_Hide; typedef struct _E_Event_Border_Stick E_Event_Border_Stick; typedef struct _E_Event_Border_Unstick E_Event_Border_Unstick; +typedef struct _E_Event_Border_Zone_Set E_Event_Border_Zone_Set; typedef struct _E_Event_Border_Desk_Set E_Event_Border_Desk_Set; #else @@ -248,6 +249,12 @@ E_Border *border; }; +struct _E_Event_Border_Zone_Set +{ + E_Border *border; + E_Zone *zone; +}; + struct _E_Event_Border_Desk_Set { E_Border *border; @@ -261,6 +268,7 @@ EAPI void e_border_free(E_Border *bd); EAPI void e_border_ref(E_Border *bd); EAPI void e_border_unref(E_Border *bd); +EAPI void e_border_zone_set(E_Border *bd, E_Zone *zone); EAPI void e_border_desk_set(E_Border *bd, E_Desk *desk); EAPI void e_border_show(E_Border *bd); EAPI void e_border_hide(E_Border *bd); @@ -296,6 +304,7 @@ extern EAPI int E_EVENT_BORDER_REMOVE; extern EAPI int E_EVENT_BORDER_STICK; extern EAPI int E_EVENT_BORDER_UNSTICK; +extern EAPI int E_EVENT_BORDER_ZONE_SET; extern EAPI int E_EVENT_BORDER_DESK_SET; #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -3 -r1.98 -r1.99 --- e_border.c 11 Feb 2005 15:18:21 -0000 1.98 +++ e_border.c 13 Feb 2005 11:12:51 -0000 1.99 @@ -73,6 +73,7 @@ static void _e_border_event_border_add_free(void *data, void *ev); static void _e_border_event_border_remove_free(void *data, void *ev); +static void _e_border_event_border_zone_set_free(void *data, void *ev); static void _e_border_event_border_desk_set_free(void *data, void *ev); static void _e_border_event_border_resize_free(void *data, void *ev); static void _e_border_event_border_move_free(void *data, void *ev); @@ -100,6 +101,7 @@ int E_EVENT_BORDER_ADD = 0; int E_EVENT_BORDER_REMOVE = 0; +int E_EVENT_BORDER_ZONE_SET = 0; int E_EVENT_BORDER_DESK_SET = 0; int E_EVENT_BORDER_RESIZE = 0; int E_EVENT_BORDER_MOVE = 0; @@ -139,6 +141,7 @@ E_EVENT_BORDER_ADD = ecore_event_type_new(); E_EVENT_BORDER_REMOVE = ecore_event_type_new(); E_EVENT_BORDER_DESK_SET = ecore_event_type_new(); + E_EVENT_BORDER_ZONE_SET = ecore_event_type_new(); E_EVENT_BORDER_RESIZE = ecore_event_type_new(); E_EVENT_BORDER_MOVE = ecore_event_type_new(); E_EVENT_BORDER_SHOW = ecore_event_type_new(); @@ -299,6 +302,8 @@ managed = 1; ecore_x_window_prop_card32_set(win, E_ATOM_MANAGED, &managed, 1); + ecore_x_window_prop_card32_set(win, E_ATOM_CONTAINER, &bd->zone->container->num, 1); + ecore_x_window_prop_card32_set(win, E_ATOM_ZONE, &bd->zone->num, 1); e_desk_xy_get(bd->desk, &deskx, &desky); desk[0] = deskx; desk[1] = desky; @@ -308,6 +313,41 @@ } void +e_border_zone_set(E_Border *bd, E_Zone *zone) +{ + E_Event_Border_Zone_Set *ev; + + E_OBJECT_CHECK(bd); + E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); + E_OBJECT_CHECK(zone); + E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); + if (bd->zone == zone) return; + bd->zone = zone; + + if (bd->desk->zone != bd->zone) + { + E_Desk *desk; + int x, y; + + e_desk_xy_get(bd->desk, &x, &y); + desk = e_desk_at_xy_get(bd->zone, x, y); + if (desk) + e_border_desk_set(bd, desk); + else + e_border_desk_set(bd, e_desk_current_get(bd->zone)); + } + + ev = calloc(1, sizeof(E_Event_Border_Zone_Set)); + ev->border = bd; + e_object_ref(E_OBJECT(bd)); + ev->zone = zone; + e_object_ref(E_OBJECT(zone)); + ecore_event_add(E_EVENT_BORDER_ZONE_SET, ev, _e_border_event_border_zone_set_free, NULL); + + ecore_x_window_prop_card32_set(bd->client.win, E_ATOM_ZONE, &bd->zone->num, 1); +} + +void e_border_desk_set(E_Border *bd, E_Desk *desk) { E_Event_Border_Desk_Set *ev; @@ -322,6 +362,8 @@ bd->desk->clients = evas_list_remove(bd->desk->clients, bd); desk->clients = evas_list_append(desk->clients, bd); bd->desk = desk; + if (bd->zone != desk->zone) + e_border_zone_set(bd, desk->zone); ev = calloc(1, sizeof(E_Event_Border_Desk_Set)); ev->border = bd; @@ -3167,6 +3209,17 @@ } static void +_e_border_event_border_zone_set_free(void *data, void *ev) +{ + E_Event_Border_Zone_Set *e; + + e = ev; + e_object_unref(E_OBJECT(e->border)); + e_object_unref(E_OBJECT(e->zone)); + free(e); +} + +static void _e_border_event_border_desk_set_free(void *data, void *ev) { E_Event_Border_Desk_Set *e; @@ -3197,7 +3250,7 @@ if (E_INTERSECTS(bd->x, bd->y, bd->w, bd->h, zone->x, zone->y, zone->w, zone->h)) { - bd->zone = zone; + e_border_zone_set(bd, zone); return; } } |
From: <enl...@li...> - 2005-02-13 11:17:54
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_main.c e_manager.h e_manager.c Log Message: Move managing code from e_main.c to e_manager.c Check for the existence of E_ATOM_CONTAINER and E_ATOM_ZONE Use e_object_del to delete objects. Convenience functions: - e_manager_container_current_get() - e_manager_container_number_get() =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- e_main.c 9 Feb 2005 06:40:23 -0000 1.46 +++ e_main.c 13 Feb 2005 11:17:46 -0000 1.47 @@ -520,75 +520,7 @@ con = e_container_new(man); if (con) { - /* FIXME: move this to an actual function to start managing */ - Ecore_X_Window *windows; - int wnum; - - windows = ecore_x_window_children_get(con->manager->root, &wnum); - if (windows) - { - int i; - - for (i = 0; i < wnum; i++) - { - Ecore_X_Window_Attributes att; - unsigned int ret_val, deskxy[2]; - int ret; - - ecore_x_window_attributes_get(windows[i], &att); - ret = ecore_x_window_prop_card32_get(windows[i], - E_ATOM_MANAGED, - &ret_val, 1); - - /* we have seen this window before */ - if ((ret > -1) && (ret_val == 1)) - { - E_Border *bd; - - /* get all information from window before it is - * reset by e_border_new */ - ret = ecore_x_window_prop_card32_get(windows[i], - E_ATOM_DESK, - deskxy, 2); - bd = e_border_new(con, windows[i], 1); - if (bd) - { - if (ret == 2) - { - E_Desk *target; - target = e_desk_at_xy_get(bd->zone, - deskxy[0], - deskxy[1]); - if (target) - e_border_desk_set(bd, target); - if (!target || target == e_desk_current_get(bd->zone)) - { - ret = ecore_x_window_prop_card32_get(windows[i], - E_ATOM_MAPPED, - &ret_val, 1); - if ((ret > -1) && ret_val) - e_border_show(bd); - } - } - } - ret = ecore_x_window_prop_card32_get(windows[i], - E_ATOM_ICONIC, - &ret_val, 1); - if ((ret > -1) && ret_val) - e_border_iconify(bd); - } - else if ((att.visible) && (!att.override) && - (!att.input_only)) - { - /* We have not seen this window, and X tells us it - * should be seen */ - E_Border *bd; - bd = e_border_new(con, windows[i], 1); - if (bd) - e_border_show(bd); - } - } - } + e_manager_manage_windows(man); ecore_x_netwm_desk_roots_set(man->root, 1, &(con->win)); e_container_show(con); } @@ -598,7 +530,8 @@ i); return 0; } - /* + /* FIXME + * This should be removed! { E_Gadman_Client *gmc; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_manager.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_manager.h 7 Feb 2005 13:51:09 -0000 1.6 +++ e_manager.h 13 Feb 2005 11:17:46 -0000 1.7 @@ -36,5 +36,8 @@ EAPI void e_manager_raise(E_Manager *man); EAPI void e_manager_lower(E_Manager *man); +EAPI E_Container *e_manager_container_current_get(E_Manager *man); +EAPI E_Container *e_manager_container_number_get(E_Manager *man, int num); + #endif #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_manager.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- e_manager.c 22 Jan 2005 06:58:34 -0000 1.9 +++ e_manager.c 13 Feb 2005 11:17:46 -0000 1.10 @@ -37,7 +37,7 @@ e_manager_shutdown(void) { while (managers) - _e_manager_free((E_Manager *)(managers->data)); + e_object_del(E_OBJECT(managers->data)); return 1; } @@ -69,6 +69,110 @@ } void +e_manager_manage_windows(E_Manager *man) +{ + /* FIXME: move this to an actual function to start managing */ + Ecore_X_Window *windows; + int wnum; + + windows = ecore_x_window_children_get(man->root, &wnum); + if (windows) + { + int i; + + for (i = 0; i < wnum; i++) + { + Ecore_X_Window_Attributes att; + unsigned int ret_val, deskxy[2]; + int ret; + + ecore_x_window_attributes_get(windows[i], &att); + ret = ecore_x_window_prop_card32_get(windows[i], + E_ATOM_MANAGED, + &ret_val, 1); + + /* we have seen this window before */ + if ((ret > -1) && (ret_val == 1)) + { + E_Container *con = NULL; + E_Zone *zone = NULL; + E_Border *bd = NULL; + int id; + + /* get all information from window before it is + * reset by e_border_new */ + ret = ecore_x_window_prop_card32_get(windows[i], + E_ATOM_CONTAINER, + &id, 1); + if (ret == 1) + con = e_manager_container_number_get(man, id); + else + con = e_manager_container_current_get(man); + + ret = ecore_x_window_prop_card32_get(windows[i], + E_ATOM_ZONE, + &id, 1); + if (ret == 1) + zone = e_container_zone_number_get(con, id); + /* FIXME + * This is the default behaviour, should it be + * done here? + else + zone = e_zone_current_get(con); + */ + + ret = ecore_x_window_prop_card32_get(windows[i], + E_ATOM_DESK, + deskxy, 2); + + bd = e_border_new(con, windows[i], 1); + if (bd) + { + if (zone) + e_border_zone_set(bd, zone); + + if (ret == 2) + { + E_Desk *target; + target = e_desk_at_xy_get(bd->zone, + deskxy[0], + deskxy[1]); + if (target) + e_border_desk_set(bd, target); + if (!target || target == e_desk_current_get(bd->zone)) + { + ret = ecore_x_window_prop_card32_get(windows[i], + E_ATOM_MAPPED, + &ret_val, 1); + if ((ret > -1) && ret_val) + e_border_show(bd); + } + } + } + /* FIXME: Shouldn't be here! */ + ret = ecore_x_window_prop_card32_get(windows[i], + E_ATOM_ICONIC, + &ret_val, 1); + if ((ret > -1) && ret_val) + e_border_iconify(bd); + } + else if ((att.visible) && (!att.override) && + (!att.input_only)) + { + /* We have not seen this window, and X tells us it + * should be seen */ + E_Container *con; + E_Border *bd; + con = e_manager_container_current_get(man); + bd = e_border_new(con, windows[i], 1); + if (bd) + e_border_show(bd); + } + } + } +} + +void e_manager_show(E_Manager *man) { E_OBJECT_CHECK(man); @@ -162,6 +266,36 @@ ecore_x_window_lower(man->win); } +E_Container * +e_manager_container_current_get(E_Manager *man) +{ + /* FIXME + * Currently only one container, but... + */ + E_OBJECT_CHECK_RETURN(man, NULL); + E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL); + + return (E_Container *)man->containers->data; +} + +E_Container * +e_manager_container_number_get(E_Manager *man, int num) +{ + Evas_List *l; + + E_OBJECT_CHECK_RETURN(man, NULL); + E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL); + for (l = man->containers; l; l = l->next) + { + E_Container *con; + + con = l->data; + if (con->num == num) + return con; + } + return NULL; +} + /* local subsystem functions */ static void _e_manager_free(E_Manager *man) @@ -175,7 +309,7 @@ ecore_event_handler_del(h); } while (man->containers) - e_object_free(E_OBJECT(man->containers->data)); + e_object_del(E_OBJECT(man->containers->data)); ecore_x_window_del(man->win); managers = evas_list_remove(managers, man); free(man); |
From: <enl...@li...> - 2005-02-13 11:36:26
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_container.c Log Message: Fix for overlapping xinerama screens. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- e_container.c 22 Jan 2005 06:58:34 -0000 1.24 +++ e_container.c 13 Feb 2005 11:36:19 -0000 1.25 @@ -90,9 +90,25 @@ for (i = 0; i < n; i++) { int zx, zy, zw, zh; + int skip; + Evas_List *l; if (ecore_x_xinerama_screen_geometry_get(i, &zx, &zy, &zw, &zh)) - zone = e_zone_new(con, zx, zy, zw, zh); + { + skip = 0; + for (l = con->zones; l; l = l->next) + { + zone = l->data; + if (E_INTERSECTS(zone->x, zone->y, zone->w, zone->h, + zx, zy, zw, zh)) + { + skip = 1; + break; + } + } + if (!skip) + zone = e_zone_new(con, zx, zy, zw, zh); + } } } |
From: <enl...@li...> - 2005-02-13 11:36:55
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/data/themes Modified Files: default_ibar.edc Log Message: Gadman ibar =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/themes/default_ibar.edc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- default_ibar.edc 10 Jan 2005 22:33:53 -0000 1.2 +++ default_ibar.edc 13 Feb 2005 11:36:48 -0000 1.3 @@ -1,16 +1,6 @@ images { - image: "e17_ibar_arrow_d.png" COMP; - image: "e17_ibar_arrow_l.png" COMP; - image: "e17_ibar_arrow_r.png" COMP; - image: "e17_ibar_arrow_u.png" COMP; image: "e17_ibar_bg_h.png" COMP; image: "e17_ibar_bg_v.png" COMP; - image: "e17_ibar_handle_h.png" COMP; - image: "e17_ibar_handle_h2.png" COMP; - image: "e17_ibar_handle_thumb_h.png" COMP; - image: "e17_ibar_handle_thumb_v.png" COMP; - image: "e17_ibar_handle_v.png" COMP; - image: "e17_ibar_handle_v2.png" COMP; image: "e17_ibar_lamp_d.png" COMP; image: "e17_ibar_lamp_l.png" COMP; image: "e17_ibar_lamp_r.png" COMP; @@ -93,1101 +83,126 @@ description { state: "default" 0.0; rel1 { - relative: 1.0 1.0; - offset: 0 0; - to_x: "h1"; - to_y: "h3"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to_x: "h2"; - } - color: 0 0 0 0; - } - description { - state: "top" 0.0; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to_x: "h1"; - } - rel2 { - relative: 0.0 0.0; - offset: -1 -1; - to_x: "h2"; - to_y: "h3"; - } - color: 0 0 0 0; - } - description { - state: "left" 0.0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - to_y: "h1"; - } - rel2 { - relative: 0.0 0.0; - offset: -1 -1; - to_y: "h2"; - to_x: "h3"; - } - color: 0 0 0 0; - } - description { - state: "right" 0.0; - rel1 { - relative: 1.0 1.0; - offset: 0 0; - to_y: "h1"; - to_x: "h3"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to_y: "h2"; - } - color: 0 0 0 0; - } - } - part { - name: "overlay"; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - relative: 0.0 1.0; - offset: 18 0; - to_y: "h3"; - } - rel2 { - relative: 1.0 1.0; - offset: -19 -1; - } - image { - normal: "e17_ibar_over_h.png"; - border: 25 25 25 25; - } - fill { - smooth: 0; - } - } - description { - state: "top" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 18 0; - } - rel2 { - relative: 1.0 0.0; - offset: -19 -1; - to_y: "h3"; - } - image { - normal: "e17_ibar_over_h.png"; - border: 25 25 25 25; - } - fill { - smooth: 0; - } - } - description { - state: "left" 0.0; - rel1 { - relative: 0.0 0.0; - offset: 0 18; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -19; - to_x: "h3"; - } - image { - normal: "e17_ibar_over_v.png"; - border: 25 25 25 25; - } - fill { - smooth: 0; - } - } - description { - state: "right" 0.0; - rel1 { - relative: 1.0 0.0; - offset: 0 18; - to_x: "h3"; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -19; - } - image { - normal: "e17_ibar_over_v.png"; - border: 25 25 25 25; - } - fill { - smooth: 0; - } - } - } - part { - name: "h1a1"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 1.0 0.5; - min: 21 29; - max: 21 29; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -1 0; - to: "h1"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to: "h1"; - } - image { - normal: "e17_ibar_arrow_l.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "vert" 0.0; - align: 0.5 1.0; - min: 29 21; - max: 29 21; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: 0 -1; - to: "h1"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to: "h1"; - } - image { - normal: "e17_ibar_arrow_u.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "h1a2"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 1.0 0.5; - min: 21 29; - max: 21 29; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -1 0; - to: "h1a1"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to: "h1a1"; - } - image { - normal: "e17_ibar_arrow_l.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "vert" 0.0; - align: 0.5 1.0; - min: 29 21; - max: 29 21; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: 0 -1; - to: "h1a1"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to: "h1a1"; - } - image { - normal: "e17_ibar_arrow_u.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "h1a3"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 1.0 0.5; - min: 21 29; - max: 21 29; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -1 0; - to: "h1a2"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to: "h1a2"; - } - image { - normal: "e17_ibar_arrow_l.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "vert" 0.0; - align: 0.5 1.0; - min: 29 21; - max: 29 21; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: 0 -1; - to: "h1a2"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to: "h1a2"; - } - image { - normal: "e17_ibar_arrow_u.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "h1a4"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 1.0 0.5; - min: 21 29; - max: 21 29; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: -1 0; - to: "h1a3"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to: "h1a3"; - } - image { - normal: "e17_ibar_arrow_l.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "vert" 0.0; - align: 0.5 1.0; - min: 29 21; - max: 29 21; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 0.0; - offset: 0 -1; - to: "h1a3"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 -1; - to: "h1a3"; - } - image { - normal: "e17_ibar_arrow_u.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "h1"; - mouse_events: 1; - clip_to: "clp"; - description { - state: "default" 0.0; - align: 0.0 0.5; - min: 18 36; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - to_y: "overlay"; - } - rel2 { - relative: 0.0 1.0; - offset: 0 -1; - } - image { - normal: "e17_ibar_handle_h.png"; - border: 0 0 19 19; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_ibar_handle_h2.png"; - } - } - description { - state: "top" 0.0; - align: 0.0 0.5; - min: 18 36; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 0.0 1.0; - offset: 0 -1; - to_y: "overlay"; - } - image { - normal: "e17_ibar_handle_h.png"; - border: 0 0 19 19; - } - } - description { - state: "top2" 0.0; - inherit: "top" 0.0; - image { - normal: "e17_ibar_handle_h2.png"; - } - } - description { - state: "left" 0.0; - align: 0.5 0.0; - min: 36 18; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 1.0 0.0; - offset: -1 0; - to_x: "overlay"; - } - image { - normal: "e17_ibar_handle_v.png"; - border: 19 19 0 0; - } - } - description { - state: "left2" 0.0; - inherit: "left" 0.0; - image { - normal: "e17_ibar_handle_v2.png"; - } - } - description { - state: "right" 0.0; - align: 0.5 0.0; - min: 36 18; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - to_x: "overlay"; - } - rel2 { - relative: 1.0 0.0; - offset: -1 0; - } - image { - normal: "e17_ibar_handle_v.png"; - border: 19 19 0 0; - } - } - description { - state: "right2" 0.0; - inherit: "right" 0.0; - image { - normal: "e17_ibar_handle_v2.png"; - } - } - } - part { - name: "h1th"; - mouse_events: 0; - clip_to: "clp"; - description { - state: "default" 0.0; - max: 6 16; - rel1 { - offset: -1 -1; - to: "h1"; - } - rel2 { - offset: -2 -2; - to: "h1"; - } - image { - normal: "e17_ibar_handle_thumb_h.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - rel1 { - offset: 0 0; - } - rel2 { - offset: -1 -1; - } - } - description { - state: "vert" 0.0; - max: 16 6; - rel1 { - offset: -1 -1; - to: "h1"; - } - rel2 { - offset: -2 -2; - to: "h1"; - } - image { - normal: "e17_ibar_handle_thumb_v.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - rel1 { - offset: 0 0; - } - rel2 { - offset: -1 -1; - } - } - } - part { - name: "h2a1"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.5; - min: 21 29; - max: 21 29; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to: "h2"; - } - rel2 { - relative: 1.0 1.0; - offset: 0 -1; - to: "h2"; - } - image { - normal: "e17_ibar_arrow_r.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "vert" 0.0; - align: 0.5 0.0; - min: 29 21; - max: 29 21; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - to: "h2"; - } - rel2 { - relative: 1.0 1.0; - offset: -1 0; - to: "h2"; - } - image { - normal: "e17_ibar_arrow_d.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "h2a2"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.5; - min: 21 29; - max: 21 29; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to: "h2a1"; - } - rel2 { - relative: 1.0 1.0; - offset: 0 -1; - to: "h2a1"; - } - image { - normal: "e17_ibar_arrow_r.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "vert" 0.0; - align: 0.5 0.0; - min: 29 21; - max: 29 21; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - to: "h2a1"; - } - rel2 { - relative: 1.0 1.0; - offset: -1 0; - to: "h2a1"; - } - image { - normal: "e17_ibar_arrow_d.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "h2a3"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.5; - min: 21 29; - max: 21 29; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to: "h2a2"; - } - rel2 { - relative: 1.0 1.0; - offset: 0 -1; - to: "h2a2"; - } - image { - normal: "e17_ibar_arrow_r.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "vert" 0.0; - align: 0.5 0.0; - min: 29 21; - max: 29 21; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - to: "h2a2"; - } - rel2 { - relative: 1.0 1.0; - offset: -1 0; - to: "h2a2"; - } - image { - normal: "e17_ibar_arrow_d.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "h2a4"; - mouse_events: 0; - description { - state: "default" 0.0; - align: 0.0 0.5; - min: 21 29; - max: 21 29; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 1.0 0.0; - offset: 0 0; - to: "h2a3"; - } - rel2 { - relative: 1.0 1.0; - offset: 0 -1; - to: "h2a3"; - } - image { - normal: "e17_ibar_arrow_r.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { - state: "vert" 0.0; - align: 0.5 0.0; - min: 29 21; - max: 29 21; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 0.0 1.0; - offset: 0 0; - to: "h2a3"; - } - rel2 { - relative: 1.0 1.0; - offset: -1 0; - to: "h2a3"; - } - image { - normal: "e17_ibar_arrow_d.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "h2"; - mouse_events: 1; - clip_to: "clp"; - description { - state: "default" 0.0; - align: 1.0 0.5; - min: 18 36; - rel1 { - relative: 1.0 0.0; - offset: -1 0; - to_y: "overlay"; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "e17_ibar_handle_h.png"; - border: 0 0 19 19; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_ibar_handle_h2.png"; - } - } - description { - state: "top" 0.0; - align: 1.0 0.5; - min: 18 36; - rel1 { - relative: 1.0 0.0; - offset: -1 0; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - to_y: "overlay"; - } - image { - normal: "e17_ibar_handle_h.png"; - border: 0 0 19 19; - } - } - description { - state: "top2" 0.0; - inherit: "top" 0.0; - image { - normal: "e17_ibar_handle_h2.png"; - } - } - description { - state: "left" 0.0; - align: 0.5 1.0; - min: 36 18; - rel1 { - relative: 0.0 1.0; - offset: 0 -1; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - to_x: "overlay"; - } - image { - normal: "e17_ibar_handle_v.png"; - border: 19 19 0 0; - } - } - description { - state: "left2" 0.0; - inherit: "left" 0.0; - image { - normal: "e17_ibar_handle_v2.png"; - } - } - description { - state: "right" 0.0; - align: 0.5 1.0; - min: 36 18; - rel1 { - relative: 0.0 1.0; - offset: 0 -1; - to_x: "overlay"; - } - rel2 { - relative: 1.0 1.0; - offset: -1 -1; - } - image { - normal: "e17_ibar_handle_v.png"; - border: 19 19 0 0; - } - } - description { - state: "right2" 0.0; - inherit: "right" 0.0; - image { - normal: "e17_ibar_handle_v2.png"; - } - } - } - part { - name: "h2th"; - mouse_events: 0; - clip_to: "clp"; - description { - state: "default" 0.0; - max: 6 16; - rel1 { - offset: -1 -1; - to: "h2"; - } - rel2 { - offset: -2 -2; - to: "h2"; - } - image { - normal: "e17_ibar_handle_thumb_h.png"; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - rel1 { - offset: 0 0; - } - rel2 { - offset: -1 -1; - } - } - description { - state: "vert" 0.0; - max: 16 6; - rel1 { - offset: -1 -1; - to: "h2"; - } - rel2 { - offset: -2 -2; - to: "h2"; - } - image { - normal: "e17_ibar_handle_thumb_v.png"; - } - } - description { - state: "vert2" 0.0; - inherit: "vert" 0.0; - rel1 { - offset: 0 0; - } - rel2 { - offset: -1 -1; - } - } - } - part { - name: "h3"; - mouse_events: 1; - clip_to: "clp"; - description { - state: "default" 0.0; - align: 0.5 0.0; - min: 36 18; - max: 60 18; - rel1 { relative: 0.0 0.0; offset: 0 0; } rel2 { - relative: 1.0 0.0; - offset: -1 0; - } - image { - normal: "e17_ibar_handle_v.png"; - border: 19 19 0 0; - } - } - description { - state: "default2" 0.0; - inherit: "default" 0.0; - image { - normal: "e17_ibar_handle_v2.png"; + relative: 1.0 1.0; + offset: -1 -1; } + color: 0 0 0 0; } description { state: "top" 0.0; - align: 0.5 1.0; - min: 36 18; - max: 60 18; rel1 { - relative: 0.0 1.0; - offset: 0 -1; + relative: 0.0 0.0; + offset: 0 0; } rel2 { relative: 1.0 1.0; offset: -1 -1; } - image { - normal: "e17_ibar_handle_v.png"; - border: 19 19 0 0; - } - } - description { - state: "top2" 0.0; - inherit: "top" 0.0; - image { - normal: "e17_ibar_handle_v2.png"; - } + color: 0 0 0 0; } description { state: "left" 0.0; - align: 1.0 0.5; - min: 18 36; - max: 18 60; rel1 { - relative: 1.0 0.0; - offset: -1 0; + relative: 0.0 0.0; + offset: 0 0; } rel2 { relative: 1.0 1.0; offset: -1 -1; } - image { - normal: "e17_ibar_handle_h.png"; - border: 0 0 19 19; - } - } - description { - state: "left2" 0.0; - inherit: "left" 0.0; - image { - normal: "e17_ibar_handle_h2.png"; - } + color: 0 0 0 0; } description { state: "right" 0.0; - align: 0.0 0.5; - min: 18 36; - max: 18 60; rel1 { relative: 0.0 0.0; offset: 0 0; } rel2 { - relative: 0.0 1.0; - offset: 0 -1; - } - image { - normal: "e17_ibar_handle_h.png"; - border: 0 0 19 19; - } - } - description { - state: "right2" 0.0; - inherit: "right" 0.0; - image { - normal: "e17_ibar_handle_h2.png"; + relative: 1.0 1.0; + offset: -1 -1; } + color: 0 0 0 0; } } part { - name: "h3th"; + name: "overlay"; mouse_events: 0; - clip_to: "clp"; description { state: "default" 0.0; - max: 16 6; rel1 { - offset: -1 -1; - to: "h3"; + relative: 0.0 0.0; + offset: 0 0; } rel2 { - offset: -2 -2; - to: "h3"; + relative: 1.0 1.0; + offset: -1 -1; } image { - normal: "e17_ibar_handle_thumb_v.png"; + normal: "e17_ibar_over_h.png"; + border: 25 25 25 25; + } + fill { + smooth: 0; } } description { - state: "default2" 0.0; - inherit: "default" 0.0; + state: "top" 0.0; rel1 { + relative: 0.0 0.0; offset: 0 0; } rel2 { + relative: 1.0 1.0; offset: -1 -1; } + image { + normal: "e17_ibar_over_h.png"; + border: 25 25 25 25; + } + fill { + smooth: 0; + } } description { - state: "vert" 0.0; - max: 6 16; + state: "left" 0.0; rel1 { - offset: -1 -1; - to: "h3"; + relative: 0.0 0.0; + offset: 0 o; } rel2 { - offset: -2 -2; - to: "h3"; + relative: 1.0 1.0; + offset: -1 -1; } image { - normal: "e17_ibar_handle_thumb_h.png"; + normal: "e17_ibar_over_v.png"; + border: 25 25 25 25; + } + fill { + smooth: 0; } } description { - state: "vert2" 0.0; - inherit: "vert" 0.0; + state: "right" 0.0; rel1 { + relative: 0.0 0.0; offset: 0 0; } rel2 { + relative: 1.0 1.0; offset: -1 -1; } - } - } - part { - name: "clp"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - description { - state: "on" 0.0; - visible: 1; - color: 255 255 255 255; + image { + normal: "e17_ibar_over_v.png"; + border: 25 25 25 25; + } + fill { + smooth: 0; + } } } part { @@ -1212,627 +227,25 @@ set_state(PART:"background", "vert", 0.0); set_state(PART:"overlay", "left", 0.0); set_state(PART:"items", "left", 0.0); - set_state(PART:"h1", "left", 0.0); - set_state(PART:"h2", "left", 0.0); - set_state(PART:"h1th", "vert", 0.0); - set_state(PART:"h2th", "vert", 0.0); - set_state(PART:"h1a1", "vert", 0.0); - set_state(PART:"h1a2", "vert", 0.0); - set_state(PART:"h1a3", "vert", 0.0); - set_state(PART:"h1a4", "vert", 0.0); - set_state(PART:"h2a1", "vert", 0.0); - set_state(PART:"h2a2", "vert", 0.0); - set_state(PART:"h2a3", "vert", 0.0); - set_state(PART:"h2a4", "vert", 0.0); - set_state(PART:"h3", "left", 0.0); - set_state(PART:"h3th", "vert", 0.0); } else if (!strcmp(src, "right")) { set_int(orient, 1); set_state(PART:"background", "vert", 0.0); set_state(PART:"overlay", "right", 0.0); set_state(PART:"items", "right", 0.0); - set_state(PART:"h1", "right", 0.0); - set_state(PART:"h2", "right", 0.0); - set_state(PART:"h1th", "vert", 0.0); - set_state(PART:"h2th", "vert", 0.0); - set_state(PART:"h1a1", "vert", 0.0); - set_state(PART:"h1a2", "vert", 0.0); - set_state(PART:"h1a3", "vert", 0.0); - set_state(PART:"h1a4", "vert", 0.0); - set_state(PART:"h2a1", "vert", 0.0); - set_state(PART:"h2a2", "vert", 0.0); - set_state(PART:"h2a3", "vert", 0.0); - set_state(PART:"h2a4", "vert", 0.0); - set_state(PART:"h3", "right", 0.0); - set_state(PART:"h3th", "vert", 0.0); } else if (!strcmp(src, "top")) { set_int(orient, 2); set_state(PART:"background", "default", 0.0); set_state(PART:"overlay", "top", 0.0); set_state(PART:"items", "top", 0.0); - set_state(PART:"h1", "top", 0.0); - set_state(PART:"h2", "top", 0.0); - set_state(PART:"h1th", "default", 0.0); - set_state(PART:"h2th", "default", 0.0); - set_state(PART:"h1a1", "default", 0.0); - set_state(PART:"h1a2", "default", 0.0); - set_state(PART:"h1a3", "default", 0.0); - set_state(PART:"h1a4", "default", 0.0); - set_state(PART:"h2a1", "default", 0.0); - set_state(PART:"h2a2", "default", 0.0); - set_state(PART:"h2a3", "default", 0.0); - set_state(PART:"h2a4", "default", 0.0); - set_state(PART:"h3", "top", 0.0); - set_state(PART:"h3th", "default", 0.0); } else if (!strcmp(src, "bottom")) { set_int(orient, 3); set_state(PART:"background", "default", 0.0); set_state(PART:"overlay", "default", 0.0); set_state(PART:"items", "default", 0.0); - set_state(PART:"h1", "default", 0.0); - set_state(PART:"h2", "default", 0.0); - set_state(PART:"h1th", "default", 0.0); - set_state(PART:"h2th", "default", 0.0); - set_state(PART:"h1a1", "default", 0.0); - set_state(PART:"h1a2", "default", 0.0); - set_state(PART:"h1a3", "default", 0.0); - set_state(PART:"h1a4", "default", 0.0); - set_state(PART:"h2a1", "default", 0.0); - set_state(PART:"h2a2", "default", 0.0); - set_state(PART:"h2a3", "default", 0.0); - set_state(PART:"h2a4", "default", 0.0); - set_state(PART:"h3", "default", 0.0); - set_state(PART:"h3th", "default", 0.0); - } - } - } - - program { - name: "inn_in"; - signal: "mouse,in"; - source: "inn"; - action: STATE_SET "on" 0.0; - transition: SINUSOIDAL 0.25; - target: "clp"; - } - program { - name: "inn_out"; - signal: "mouse,out"; - source: "inn"; - action: STATE_SET "default" 0.0; - transition: SINUSOIDAL 1.0; - target: "clp"; - } - - program { - name: "h1_in"; - signal: "mouse,in"; - source: "h1"; - script { - new ori = get_int(orient); - if ((ori == 0) || (ori == 1)) { - emit("h1_v_pulse", ""); - } - else { - emit("h1_h_pulse", ""); - } - } - } - program { - name: "h1_out"; - signal: "mouse,out"; - source: "h1"; - action: ACTION_STOP; - target: "h1_h_in1a"; - target: "h1_h_in1b"; - target: "h1_h_in2a"; - target: "h1_h_in2b"; - target: "h1_h_in3a"; - target: "h1_h_in3b"; - target: "h1_h_in4a"; - target: "h1_h_in4b"; - target: "h1_v_in1a"; - target: "h1_v_in1b"; - target: "h1_v_in2a"; - target: "h1_v_in2b"; - target: "h1_v_in3a"; - target: "h1_v_in3b"; - target: "h1_v_in4a"; - target: "h1_v_in4b"; - after: "h1_out2"; - } - program { - name: "h1_out2"; - script { - new ori = get_int(orient); - if ((ori == 0) || (ori == 1)) { - set_state(PART:"h1a1", "vert", 0.0); - set_state(PART:"h1a2", "vert", 0.0); - set_state(PART:"h1a3", "vert", 0.0); - set_state(PART:"h1a4", "vert", 0.0); - } - else { - set_state(PART:"h1a1", "default", 0.0); - set_state(PART:"h1a2", "default", 0.0); - set_state(PART:"h1a3", "default", 0.0); - set_state(PART:"h1a4", "default", 0.0); - } - } - } - - program { - name: "h1_h_0"; - signal: "h1_h_pulse"; - source: ""; - after: "h1_h_in1a"; - } - program { - name: "h1_h_in1a"; - action: STATE_SET "default2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h1a1"; - after: "h1_h_in2a"; - after: "h1_h_in2b"; - } - program { - name: "h1_h_in1b"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.75; - target: "h1a4"; - } - - program { - name: "h1_h_in2a"; - action: STATE_SET "default2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h1a2"; - after: "h1_h_in3a"; - after: "h1_h_in3b"; - } - program { - name: "h1_h_in2b"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.75; - target: "h1a1"; - } - - program { - name: "h1_h_in3a"; - action: STATE_SET "default2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h1a3"; - after: "h1_h_in4a"; - after: "h1_h_in4b"; - } - program { - name: "h1_h_in3b"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.75; - target: "h1a2"; - } - - program { - name: "h1_h_in4a"; - action: STATE_SET "default2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h1a4"; - after: "h1_h_in1a"; - after: "h1_h_in1b"; - } - program { - name: "h1_h_in4b"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.75; - target: "h1a3"; - } - - program { - name: "h1_v_0"; - signal: "h1_v_pulse"; - source: ""; - after: "h1_v_in1a"; - } - program { - name: "h1_v_in1a"; - action: STATE_SET "vert2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h1a1"; - after: "h1_v_in2a"; - after: "h1_v_in2b"; - } - program { - name: "h1_v_in1b"; - action: STATE_SET "vert" 0.0; - transition: DECELERATE 0.75; - target: "h1a4"; - } - - program { - name: "h1_v_in2a"; - action: STATE_SET "vert2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h1a2"; - after: "h1_v_in3a"; - after: "h1_v_in3b"; - } - program { - name: "h1_v_in2b"; - action: STATE_SET "vert" 0.0; - transition: DECELERATE 0.75; - target: "h1a1"; - } - - program { - name: "h1_v_in3a"; - action: STATE_SET "vert2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h1a3"; - after: "h1_v_in4a"; - after: "h1_v_in4b"; - } - program { - name: "h1_v_in3b"; - action: STATE_SET "vert" 0.0; - transition: DECELERATE 0.75; - target: "h1a2"; - } - - program { - name: "h1_v_in4a"; - action: STATE_SET "vert2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h1a4"; - after: "h1_v_in1a"; - after: "h1_v_in1b"; - } - program { - name: "h1_v_in4b"; - action: STATE_SET "vert" 0.0; - transition: DECELERATE 0.75; - target: "h1a3"; - } - - program { - name: "h1_click1"; - signal: "mouse,down,1"; - source: "h1"; - script { - new ori = get_int(orient); - if (ori == 0) { - set_state(PART:"h1", "left2", 0.0); - set_state(PART:"h1th", "vert2", 0.0); - } - else if (ori == 1) { - set_state(PART:"h1", "right2", 0.0); - set_state(PART:"h1th", "vert2", 0.0); - } - else if (ori == 2) { - set_state(PART:"h1", "top2", 0.0); - set_state(PART:"h1th", "default2", 0.0); - } - else { - set_state(PART:"h1", "default2", 0.0); - set_state(PART:"h1th", "default2", 0.0); - } - emit("resize1_start", ""); - } - } - program { - name: "h1_click2"; - signal: "mouse,up,1"; - source: "h1"; - script { - new ori = get_int(orient); - if (ori == 0) { - set_state(PART:"h1", "left", 0.0); - set_state(PART:"h1th", "vert", 0.0); - } - else if (ori == 1) { - set_state(PART:"h1", "right", 0.0); - set_state(PART:"h1th", "vert", 0.0); - } - else if (ori == 2) { - set_state(PART:"h1", "top", 0.0); - set_state(PART:"h1th", "default", 0.0); - } - else { - set_state(PART:"h1", "default", 0.0); - set_state(PART:"h1th", "default", 0.0); - } - emit("resize1_stop", ""); - } - } - - program { - name: "h2_in"; - signal: "mouse,in"; - source: "h2"; - script { - new ori = get_int(orient); - if ((ori == 0) || (ori == 1)) { - emit("h2_v_pulse", ""); - } - else { - emit("h2_h_pulse", ""); - } - } - } - program { - name: "h2_out"; - signal: "mouse,out"; - source: "h2"; - action: ACTION_STOP; - target: "h2_h_in1a"; - target: "h2_h_in1b"; - target: "h2_h_in2a"; - target: "h2_h_in2b"; - target: "h2_h_in3a"; - target: "h2_h_in3b"; - target: "h2_h_in4a"; - target: "h2_h_in4b"; - target: "h2_v_in1a"; - target: "h2_v_in1b"; - target: "h2_v_in2a"; - target: "h2_v_in2b"; - target: "h2_v_in3a"; - target: "h2_v_in3b"; - target: "h2_v_in4a"; - target: "h2_v_in4b"; - after: "h2_out2"; - } - program { - name: "h2_out2"; - script { - new ori = get_int(orient); - if ((ori == 0) || (ori == 1)) { - set_state(PART:"h2a1", "vert", 0.0); - set_state(PART:"h2a2", "vert", 0.0); - set_state(PART:"h2a3", "vert", 0.0); - set_state(PART:"h2a4", "vert", 0.0); - } - else { - set_state(PART:"h2a1", "default", 0.0); - set_state(PART:"h2a2", "default", 0.0); - set_state(PART:"h2a3", "default", 0.0); - set_state(PART:"h2a4", "default", 0.0); - } - } - } - - program { - name: "h2_h_0"; - signal: "h2_h_pulse"; - source: ""; - after: "h2_h_in1a"; - } - program { - name: "h2_h_in1a"; - action: STATE_SET "default2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h2a1"; - after: "h2_h_in2a"; - after: "h2_h_in2b"; - } - program { - name: "h2_h_in1b"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.75; - target: "h2a4"; - } - - program { - name: "h2_h_in2a"; - action: STATE_SET "default2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h2a2"; - after: "h2_h_in3a"; - after: "h2_h_in3b"; - } - program { - name: "h2_h_in2b"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.75; - target: "h2a1"; - } - - program { - name: "h2_h_in3a"; - action: STATE_SET "default2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h2a3"; - after: "h2_h_in4a"; - after: "h2_h_in4b"; - } - program { - name: "h2_h_in3b"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.75; - target: "h2a2"; - } - - program { - name: "h2_h_in4a"; - action: STATE_SET "default2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h2a4"; - after: "h2_h_in1a"; - after: "h2_h_in1b"; - } - program { - name: "h2_h_in4b"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.75; - target: "h2a3"; - } - - program { - name: "h2_v_0"; - signal: "h2_v_pulse"; - source: ""; - after: "h2_v_in1a"; - } - program { - name: "h2_v_in1a"; - action: STATE_SET "vert2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h2a1"; - after: "h2_v_in2a"; - after: "h2_v_in2b"; - } - program { - name: "h2_v_in1b"; - action: STATE_SET "vert" 0.0; - transition: DECELERATE 0.75; - target: "h2a4"; - } - - program { - name: "h2_v_in2a"; - action: STATE_SET "vert2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h2a2"; - after: "h2_v_in3a"; - after: "h2_v_in3b"; - } - program { - name: "h2_v_in2b"; - action: STATE_SET "vert" 0.0; - transition: DECELERATE 0.75; - target: "h2a1"; - } - - program { - name: "h2_v_in3a"; - action: STATE_SET "vert2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h2a3"; - after: "h2_v_in4a"; - after: "h2_v_in4b"; - } - program { - name: "h2_v_in3b"; - action: STATE_SET "vert" 0.0; - transition: DECELERATE 0.75; - target: "h2a2"; - } - - program { - name: "h2_v_in4a"; - action: STATE_SET "vert2" 0.0; - transition: SINUSOIDAL 0.25; - target: "h2a4"; - after: "h2_v_in1a"; - after: "h2_v_in1b"; - } - program { - name: "h2_v_in4b"; - action: STATE_SET "vert" 0.0; - transition: DECELERATE 0.75; - target: "h2a3"; - } - - program { - name: "h2_click1"; - signal: "mouse,down,1"; - source: "h2"; - script { - new ori = get_int(orient); - if (ori == 0) { - set_state(PART:"h2", "left2", 0.0); - set_state(PART:"h2th", "vert2", 0.0); - } - else if (ori == 1) { - set_state(PART:"h2", "right2", 0.0); - set_state(PART:"h2th", "vert2", 0.0); - } - else if (ori == 2) { - set_state(PART:"h2", "top2", 0.0); - set_state(PART:"h2th", "default2", 0.0); - } - else { - set_state(PART:"h2", "default2", 0.0); - set_state(PART:"h2th", "default2", 0.0); - } - emit("resize2_start", ""); - } - } - program { - name: "h2_click2"; - signal: "mouse,up,1"; - source: "h2"; - script { - new ori = get_int(orient); - if (ori == 0) { - set_state(PART:"h2", "left", 0.0); - set_state(PART:"h2th", "vert", 0.0); - } - else if (ori == 1) { - set_state(PART:"h2", "right", 0.0); - set_state(PART:"h2th", "vert", 0.0); - } - else if (ori == 2) { - set_state(PART:"h2", "top", 0.0); - set_state(PART:"h2th", "default", 0.0); - } - else { - set_state(PART:"h2", "default", 0.0); - set_state(PART:"h2th", "default", 0.0); - } - emit("resize2_stop", ""); - } - } - - program { - name: "h3_click1"; - signal: "mouse,down,1"; - source: "h3"; - script { - new ori = get_int(orient); - if (ori == 0) { - set_state(PART:"h3", "left2", 0.0); - set_state(PART:"h3th", "vert2", 0.0); - } - else if (ori == 1) { - set_state(PART:"h3", "right2", 0.0); - set_state(PART:"h3th", "vert2", 0.0); - } - else if (ori == 2) { - set_state(PART:"h3", "top2", 0.0); - set_state(PART:"h3th", "default2", 0.0); - } - else { - set_state(PART:"h3", "default2", 0.0); - set_state(PART:"h3th", "default2", 0.0); - } - emit("move_start", ""); - } - } - program { - name: "h3_click2"; - signal: "mouse,up,1"; - source: "h3"; - script { - new ori = get_int(orient); - if (ori == 0) { - set_state(PART:"h3", "left", 0.0); - set_state(PART:"h3th", "vert", 0.0); - } - else if (ori == 1) { - set_state(PART:"h3", "right", 0.0); - set_state(PART:"h3th", "vert", 0.0); - } - else if (ori == 2) { - set_state(PART:"h3", "top", 0.0); - set_state(PART:"h3th", "default", 0.0); - } - else { - set_state(PART:"h3", "default", 0.0); - set_state(PART:"h3th", "default", 0.0); } - emit("move_stop", ""); } } } @@ -1851,11 +264,11 @@ state: "default" 0.0; rel1 { relative: 0.0 0.0; - offset: 0 -13; + offset: 0 -18; } rel2 { relative: 1.0 0.0; - offset: -1 27; + offset: -1 22; } image { normal: "e17_ibar_lamp_d.png"; @@ -1865,11 +278,11 @@ state: "top" 0.0; rel1 { relative: 0.0 1.0; - offset: 0 -27; + offset: 0 -22; } rel2 { relative: 1.0 1.0; - offset: -1 13; + offset: -1 18; } image { normal: "e17_ibar_lamp_u.png"; @@ -1879,11 +292,11 @@ state: "right" 0.0; rel1 { relative: 0.0 0.0; - offset: -13 0; + offset: -18 0; } rel2 { relative: 0.0 1.0; - offset: 27 -1; + offset: 22 -1; } image { normal: "e17_ibar_lamp_r.png"; @@ -1893,11 +306,11 @@ state: "left" 0.0; rel1 { relative: 1.0 0.0; - offset: -27 0; + offset: -22 0; } rel2 { relative: 1.0 1.0; - offset: 13 -1; + offset: 18 -1; } image { normal: "e17_ibar_lamp_l.png"; |
From: <enl...@li...> - 2005-02-13 11:37:20
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/modules/ibar Modified Files: e_mod_main.c e_mod_main.h Log Message: Gadman ibar. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/modules/ibar/e_mod_main.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- e_mod_main.c 11 Jan 2005 13:43:00 -0000 1.8 +++ e_mod_main.c 13 Feb 2005 11:37:13 -0000 1.9 @@ -1,8 +1,15 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ #include "e.h" #include "e_mod_main.h" /* TODO List: - * + * + * * Create seperate config for each bar + * * Fix menu + * * How should the bar resize? Allow fixed width, or just autoresize. + * * * icon labels & label tooltips supported for the name of the app * * use part list to know how many icons & where to put in the overlay of an icon * * description bubbles/tooltips for icons @@ -12,72 +19,72 @@ * * emit signals on hide/show due to autohide/show * * virtualise autoshow/hide to later allow for key bindings, mouse events elsewhere, ipc and other singals to show/hide * * save and load config - * + * * BONUS Features (maybe do this later): - * + * * * allow ibar icons to be dragged around to re-order/delete - * + * */ +static int bar_count; +static E_Config_DD *conf_edd; + /* const strings */ static const char *_ibar_main_orientation[] = -{"bottom", "top", "left", "right"}; +{"left", "right", "top", "bottom"}; /* module private routines */ -static IBar *_ibar_init(E_Module *m); -static void _ibar_shutdown(IBar *ib); +static IBar *_ibar_new(); +static void _ibar_free(IBar *ib); static void _ibar_app_change(void *data, E_App *a, E_App_Change ch); -static E_Menu *_ibar_config_menu_new(IBar *ib); -static void _ibar_config_menu_del(IBar *ib, E_Menu *m); -static void _ibar_cb_width_fixed(void *data, E_Menu *m, E_Menu_Item *mi); -static void _ibar_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi); -static void _ibar_cb_width_fill(void *data, E_Menu *m, E_Menu_Item *mi); -static void _ibar_bar_iconsize_change(IBar_Bar *ibb); -static IBar_Icon *_ibar_bar_icon_find(IBar_Bar *ibb, E_App *a); -static void _ibar_bar_icon_del(IBar_Icon *ic); -static IBar_Icon *_ibar_bar_icon_new(IBar_Bar *ibb, E_App *a); -static void _ibar_bar_icon_resize(IBar_Icon *ic); -static void _ibar_bar_icon_reorder_before(IBar_Icon *ic, IBar_Icon *before); -static void _ibar_bar_icon_reorder_after(IBar_Icon *ic, IBar_Icon *after); -static void _ibar_bar_frame_resize(IBar_Bar *ibb); -static void _ibar_bar_init(IBar_Bar *ibb); +static void _ibar_config_menu_new(IBar *ib); + +static IBar_Bar *_ibar_bar_new(IBar *ib, E_Container *con); static void _ibar_bar_free(IBar_Bar *ibb); -static void _ibar_motion_handle(IBar_Bar *ibb, Evas_Coord mx, Evas_Coord my); -static void _ibar_timer_handle(IBar_Bar *ibb); -static void _ibar_bar_reconfigure(IBar_Bar *ibb); -static void _ibar_bar_follower_reset(IBar_Bar *ibb); -static void _ibar_bar_convert_move_resize_to_config(IBar_Bar *ibb); +static void _ibar_bar_frame_resize(IBar_Bar *ibb); static void _ibar_bar_edge_change(IBar_Bar *ibb, int edge); -static void _ibar_cb_intercept_icon_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); -static void _ibar_cb_intercept_icon_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h); -static void _ibar_cb_intercept_bar_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); -static void _ibar_cb_intercept_bar_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h); -static void _ibar_cb_icon_in(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibar_cb_icon_out(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibar_cb_icon_down(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibar_cb_icon_up(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibar_cb_bar_in(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibar_cb_bar_out(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibar_cb_bar_down(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibar_cb_bar_up(void *data, Evas *e, Evas_Object *obj, void *event_info); -static void _ibar_cb_bar_move(void *data, Evas *e, Evas_Object *obj, void *event_info); -static int _ibar_cb_bar_timer(void *data); -static int _ibar_cb_bar_animator(void *data); -static void _ibar_cb_bar_move_start(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibar_cb_bar_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibar_cb_bar_resize1_start(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibar_cb_bar_resize1_stop(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibar_cb_bar_resize2_start(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibar_cb_bar_resize2_stop(void *data, Evas_Object *obj, const char *emission, const char *source); -static void _ibar_cb_bar_move_go(void *data, Evas_Object *obj, const char *emission, const char *source); -static int _ibar_cb_event_container_resize(void *data, int type, void *event); +static void _ibar_bar_motion_handle(IBar_Bar *ibb, Evas_Coord mx, Evas_Coord my); +static void _ibar_bar_timer_handle(IBar_Bar *ibb); +static void _ibar_bar_follower_reset(IBar_Bar *ibb); + +static IBar_Icon *_ibar_icon_new(IBar_Bar *ibb, E_App *a); +static void _ibar_icon_free(IBar_Icon *ic); +static IBar_Icon *_ibar_icon_find(IBar_Bar *ibb, E_App *a); +static void _ibar_icon_reorder_after(IBar_Icon *ic, IBar_Icon *after); + +static void _ibar_bar_cb_gmc_change(void *data, E_Gadman_Client *gmc, E_Gadman_Change change); +static void _ibar_bar_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); +static void _ibar_bar_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h); +static void _ibar_bar_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibar_bar_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibar_bar_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibar_bar_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibar_bar_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static int _ibar_bar_cb_timer(void *data); +static int _ibar_bar_cb_animator(void *data); + +static void _ibar_icon_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y); +static void _ibar_icon_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h); +static void _ibar_icon_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibar_icon_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibar_icon_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _ibar_icon_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); + +#if 0 +static void _ibar_icon_resize(IBar_Icon *ic); +static void _ibar_icon_reorder_before(IBar_Icon *ic, IBar_Icon *before); +static void _ibar_bar_iconsize_change(IBar_Bar *ibb); +static void _ibar_bar_cb_width_fixed(void *data, E_Menu *m, E_Menu_Item *mi); +static void _ibar_bar_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi); +static void _ibar_bar_cb_width_fill(void *data, E_Menu *m, E_Menu_Item *mi); +#endif /* public module routines. all modules must have these */ void * init(E_Module *m) { IBar *ib; - + /* check module api version */ if (m->api->version < E_MODULE_API_VERSION) { @@ -91,8 +98,8 @@ return NULL; } /* actually init ibar */ - ib = _ibar_init(m); - m->config_menu = _ibar_config_menu_new(ib); + ib = _ibar_new(); + m->config_menu = ib->config_menu; return ib; } @@ -100,17 +107,13 @@ shutdown(E_Module *m) { IBar *ib; - + + if (m->config_menu) + m->config_menu = NULL; + ib = m->data; if (ib) - { - if (m->config_menu) - { - _ibar_config_menu_del(ib, m->config_menu); - m->config_menu = NULL; - } - _ibar_shutdown(ib); - } + _ibar_free(ib); return 1; } @@ -118,9 +121,9 @@ save(E_Module *m) { IBar *ib; - + ib = m->data; - e_config_domain_save("module.ibar", ib->conf_edd, ib->conf); + e_config_domain_save("module.ibar", conf_edd, ib->conf); return 1; } @@ -128,7 +131,7 @@ info(E_Module *m) { char buf[4096]; - + m->label = strdup("IBar"); snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m)); m->icon_file = strdup(buf); @@ -148,57 +151,64 @@ /* module private routines */ static IBar * -_ibar_init(E_Module *m) +_ibar_new() { IBar *ib; char buf[4096]; Evas_List *managers, *l, *l2; - - ib = calloc(1, sizeof(IBar)); + + bar_count = 0; + ib = E_NEW(IBar, 1); if (!ib) return NULL; - ib->conf_edd = E_CONFIG_DD_NEW("Ibar_Config", Config); + conf_edd = E_CONFIG_DD_NEW("Ibar_Config", Config); #undef T #undef D #define T Config -#define D ib->conf_edd +#define D conf_edd E_CONFIG_VAL(D, T, appdir, STR); + E_CONFIG_VAL(D, T, edge, INT); E_CONFIG_VAL(D, T, follow_speed, DOUBLE); E_CONFIG_VAL(D, T, autoscroll_speed, DOUBLE); - E_CONFIG_VAL(D, T, width, INT); E_CONFIG_VAL(D, T, iconsize, INT); - E_CONFIG_VAL(D, T, edge, INT); + E_CONFIG_VAL(D, T, width, INT); + /* E_CONFIG_VAL(D, T, anchor, DOUBLE); E_CONFIG_VAL(D, T, handle, DOUBLE); E_CONFIG_VAL(D, T, autohide, UCHAR); - - ib->conf = e_config_domain_load("module.ibar", ib->conf_edd); + */ + + ib->conf = e_config_domain_load("module.ibar", conf_edd); if (!ib->conf) { ib->conf = E_NEW(Config, 1); ib->conf->appdir = strdup("bar"); ib->conf->follow_speed = 0.9; ib->conf->autoscroll_speed = 0.95; - ib->conf->width = 400; ib->conf->iconsize = 32; - ib->conf->edge = EDGE_BOTTOM; + ib->conf->width = IBAR_WIDTH_AUTO; + /* ib->conf->anchor = 0.5; ib->conf->handle = 0.5; ib->conf->autohide = 0; + */ } E_CONFIG_LIMIT(ib->conf->follow_speed, 0.01, 1.0); E_CONFIG_LIMIT(ib->conf->autoscroll_speed, 0.01, 1.0); - E_CONFIG_LIMIT(ib->conf->width, -1, 4000); E_CONFIG_LIMIT(ib->conf->iconsize, 2, 400); - E_CONFIG_LIMIT(ib->conf->edge, EDGE_BOTTOM, EDGE_RIGHT); + E_CONFIG_LIMIT(ib->conf->width, -1, 4000); + /* E_CONFIG_LIMIT(ib->conf->anchor, 0.0, 1.0); E_CONFIG_LIMIT(ib->conf->handle, 0.0, 1.0); E_CONFIG_LIMIT(ib->conf->autohide, 0, 1); - + */ + + _ibar_config_menu_new(ib); + if (ib->conf->appdir[0] != '/') { char *homedir; - + homedir = e_user_homedir_get(); if (homedir) { @@ -208,52 +218,42 @@ } else strcpy(buf, ib->conf->appdir); - + ib->apps = e_app_new(buf, 0); if (ib->apps) e_app_subdir_scan(ib->apps, 0); e_app_change_callback_add(_ibar_app_change, ib); - + managers = e_manager_list(); for (l = managers; l; l = l->next) { E_Manager *man; - + man = l->data; for (l2 = man->containers; l2; l2 = l2->next) { E_Container *con; IBar_Bar *ibb; - + con = l2->data; - ibb = calloc(1, sizeof(IBar_Bar)); - if (ibb) - { - ibb->ibar = ib; - ibb->con = con; - ibb->evas = con->bg_evas; - ib->bars = evas_list_append(ib->bars, ibb); - _ibar_bar_init(ibb); - } + ibb = _ibar_bar_new(ib, con); } } return ib; } static void -_ibar_shutdown(IBar *ib) +_ibar_free(IBar *ib) { E_FREE(ib->conf->appdir); + + E_CONFIG_DD_FREE(conf_edd); free(ib->conf); - E_CONFIG_DD_FREE(ib->conf_edd); + + e_object_del(E_OBJECT(ib->config_menu)); + e_app_change_callback_del(_ibar_app_change, ib); while (ib->bars) - { - IBar_Bar *ibb; - - ibb = ib->bars->data; - ib->bars = evas_list_remove_list(ib->bars, ib->bars); - _ibar_bar_free(ibb); - } + _ibar_bar_free(ib->bars->data); e_object_unref(E_OBJECT(ib->apps)); free(ib); } @@ -263,13 +263,13 @@ { IBar *ib; Evas_List *l, *ll; - + ib = data; - + for (l = ib->bars; l; l = l->next) { IBar_Bar *ibb; - + ibb = l->data; switch (ch) { @@ -277,20 +277,19 @@ if (a->parent == ib->apps) { IBar_Icon *ic; - + e_box_freeze(ibb->box_object); - ic = _ibar_bar_icon_new(ibb, a); + ic = _ibar_icon_new(ibb, a); if (ic) { for (ll = ib->apps->subapps; ll; ll = ll->next) { E_App *a2; - + a2 = ll->data; - ic = _ibar_bar_icon_find(ibb, a2); - if (ic) _ibar_bar_icon_reorder_after(ic, NULL); + ic = _ibar_icon_find(ibb, a2); + if (ic) _ibar_icon_reorder_after(ic, NULL); } - _ibar_bar_convert_move_resize_to_config(ibb); _ibar_bar_frame_resize(ibb); } e_box_thaw(ibb->box_object); @@ -300,10 +299,9 @@ if (a->parent == ib->apps) { IBar_Icon *ic; - - ic = _ibar_bar_icon_find(ibb, a); - if (ic) _ibar_bar_icon_del(ic); - _ibar_bar_convert_move_resize_to_config(ibb); + + ic = _ibar_icon_find(ibb, a); + if (ic) _ibar_icon_free(ic); _ibar_bar_frame_resize(ibb); } break; @@ -311,24 +309,23 @@ if (a->parent == ib->apps) { IBar_Icon *ic; - + e_box_freeze(ibb->box_object); - ic = _ibar_bar_icon_find(ibb, a); - if (ic) _ibar_bar_icon_del(ic); + ic = _ibar_icon_find(ibb, a); + if (ic) _ibar_icon_free(ic); evas_image_cache_flush(ibb->evas); evas_image_cache_reload(ibb->evas); - ic = _ibar_bar_icon_new(ibb, a); + ic = _ibar_icon_new(ibb, a); if (ic) { for (ll = ib->apps->subapps; ll; ll = ll->next) { E_App *a2; - + a2 = ll->data; - ic = _ibar_bar_icon_find(ibb, a2); - if (ic) _ibar_bar_icon_reorder_after(ic, NULL); + ic = _ibar_icon_find(ibb, a2); + if (ic) _ibar_icon_reorder_after(ic, NULL); } - _ibar_bar_convert_move_resize_to_config(ibb); _ibar_bar_frame_resize(ibb); } e_box_thaw(ibb->box_object); @@ -342,10 +339,10 @@ { IBar_Icon *ic; E_App *a2; - + a2 = ll->data; - ic = _ibar_bar_icon_find(ibb, a2); - if (ic) _ibar_bar_icon_reorder_after(ic, NULL); + ic = _ibar_icon_find(ibb, a2); + if (ic) _ibar_icon_reorder_after(ic, NULL); } e_box_thaw(ibb->box_object); } @@ -362,246 +359,277 @@ } } -/* FIXME: none of these work runtime... only on restart */ -static void -_ibar_cb_iconsize_microscopic(void *data, E_Menu *m, E_Menu_Item *mi) +static IBar_Bar * +_ibar_bar_new(IBar *ib, E_Container *con) { - IBar *ib; + IBar_Bar *ibb; Evas_List *l; - - ib = data; - ib->conf->iconsize = 8; - for (l = ib->bars; l; l = l->next) + Evas_Object *o; + + ibb = E_NEW(IBar_Bar, 1); + if (!ibb) return NULL; + ibb->ibar = ib; + ib->bars = evas_list_append(ib->bars, ibb); + + ibb->con = con; + e_object_ref(E_OBJECT(con)); + ibb->evas = con->bg_evas; + + evas_event_freeze(ibb->evas); + o = edje_object_add(ibb->evas); + ibb->bar_object = o; + edje_object_file_set(o, + /* FIXME: "default.eet" needs to come from conf */ + e_path_find(path_themes, "default.eet"), + "modules/ibar/main"); + evas_object_show(o); + + o = edje_object_add(ibb->evas); + ibb->overlay_object = o; + evas_object_layer_set(o, 1); + edje_object_file_set(o, + /* FIXME: "default.eet" needs to come from conf */ + e_path_find(path_themes, "default.eet"), + "modules/ibar/follower"); + evas_object_show(o); + + o = evas_object_rectangle_add(ibb->evas); + ibb->event_object = o; + evas_object_layer_set(o, 2); + evas_object_repeat_events_set(o, 1); + evas_object_color_set(o, 0, 0, 0, 0); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibar_bar_cb_mouse_in, ibb); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibar_bar_cb_mouse_out, ibb); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibar_bar_cb_mouse_down, ibb); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibar_bar_cb_mouse_up, ibb); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _ibar_bar_cb_mouse_move, ibb); + evas_object_show(o); + + o = e_box_add(ibb->evas); + ibb->box_object = o; + evas_object_intercept_move_callback_add(o, _ibar_bar_cb_intercept_move, ibb); + evas_object_intercept_resize_callback_add(o, _ibar_bar_cb_intercept_resize, ibb); + e_box_freeze(o); + edje_object_part_swallow(ibb->bar_object, "items", o); + evas_object_show(o); + + if (ibb->ibar->apps) { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); + for (l = ibb->ibar->apps->subapps; l; l = l->next) + { + E_App *a; + IBar_Icon *ic; + + a = l->data; + ic = _ibar_icon_new(ibb, a); + } } - e_config_save_queue(); + ibb->align_req = 0.5; + ibb->align = 0.5; + e_box_align_set(ibb->box_object, 0.5, 0.5); + + e_box_thaw(ibb->box_object); + + ibb->gmc = e_gadman_client_new(ibb->con->gadman); + e_gadman_client_domain_set(ibb->gmc, "module.bar", bar_count++); + e_gadman_client_policy_set(ibb->gmc, + E_GADMAN_POLICY_EDGES | + E_GADMAN_POLICY_HMOVE | + E_GADMAN_POLICY_VMOVE | + E_GADMAN_POLICY_HSIZE); + e_gadman_client_min_size_set(ibb->gmc, 8, 8); + e_gadman_client_max_size_set(ibb->gmc, 800, 136); + e_gadman_client_auto_size_set(ibb->gmc, 400, 40); + e_gadman_client_align_set(ibb->gmc, 0.5, 1.0); + e_gadman_client_resize(ibb->gmc, 400, 40); + e_gadman_client_change_func_set(ibb->gmc, _ibar_bar_cb_gmc_change, ibb); + e_gadman_client_load(ibb->gmc); + + evas_event_thaw(ibb->evas); + + /* + edje_object_signal_emit(ibb->bar_object, "passive", ""); + edje_object_signal_emit(ibb->overlay_object, "passive", ""); + */ + + return ibb; } static void -_ibar_cb_iconsize_tiny(void *data, E_Menu *m, E_Menu_Item *mi) +_ibar_bar_free(IBar_Bar *ibb) { - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 12; - for (l = ib->bars; l; l = l->next) + e_object_unref(E_OBJECT(ibb->con)); + + while (ibb->icons) + _ibar_icon_free(ibb->icons->data); + + if (ibb->timer) ecore_timer_del(ibb->timer); + if (ibb->animator) ecore_animator_del(ibb->animator); + evas_object_del(ibb->bar_object); + evas_object_del(ibb->overlay_object); + evas_object_del(ibb->box_object); + evas_object_del(ibb->event_object); + + e_gadman_client_save(ibb->gmc); + e_object_del(E_OBJECT(ibb->gmc)); + + ibb->ibar->bars = evas_list_remove(ibb->ibar->bars, ibb); + + free(ibb); + bar_count--; +} + +static IBar_Icon * +_ibar_icon_new(IBar_Bar *ibb, E_App *a) +{ + IBar_Icon *ic; + char *str; + Evas_Object *o; + Evas_Coord bw, bh; + + ic = E_NEW(IBar_Icon, 1); + if (!ic) return NULL; + ic->ibb = ibb; + ic->app = a; + e_object_ref(E_OBJECT(a)); + ibb->icons = evas_list_append(ibb->icons, ic); + + o = evas_object_rectangle_add(ibb->evas); + ic->event_object = o; + evas_object_layer_set(o, 1); + evas_object_clip_set(o, evas_object_clip_get(ibb->box_object)); + evas_object_color_set(o, 0, 0, 0, 0); + evas_object_repeat_events_set(o, 1); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibar_icon_cb_mouse_in, ic); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibar_icon_cb_mouse_out, ic); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibar_icon_cb_mouse_down, ic); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibar_icon_cb_mouse_up, ic); + evas_object_show(o); + + o = edje_object_add(ibb->evas); + ic->bg_object = o; + evas_object_intercept_move_callback_add(o, _ibar_icon_cb_intercept_move, ic); + evas_object_intercept_resize_callback_add(o, _ibar_icon_cb_intercept_resize, ic); + edje_object_file_set(o, + /* FIXME: "default.eet" needs to come from conf */ + e_path_find(path_themes, "default.eet"), + "modules/ibar/icon"); + evas_object_show(o); + + o = edje_object_add(ibb->evas); + ic->icon_object = o; + edje_object_file_set(o, ic->app->path, "icon"); + edje_extern_object_min_size_set(o, ibb->ibar->conf->iconsize, ibb->ibar->conf->iconsize); + edje_object_part_swallow(ic->bg_object, "item", o); + edje_object_size_min_calc(ic->bg_object, &bw, &bh); + evas_object_pass_events_set(o, 1); + evas_object_show(o); + + o = edje_object_add(ibb->evas); + ic->overlay_object = o; + evas_object_intercept_move_callback_add(o, _ibar_icon_cb_intercept_move, ic); + evas_object_intercept_resize_callback_add(o, _ibar_icon_cb_intercept_resize, ic); + edje_object_file_set(o, + /* FIXME: "default.eet" needs to come from conf */ + e_path_find(path_themes, "default.eet"), + "modules/ibar/icon_overlay"); + evas_object_show(o); + + o = edje_object_add(ibb->evas); + ic->extra_icons = evas_list_append(ic->extra_icons, o); + edje_object_file_set(o, ic->app->path, "icon"); + edje_object_part_swallow(ic->overlay_object, "item", o); + evas_object_pass_events_set(o, 1); + evas_object_show(o); + + evas_object_raise(ic->event_object); + + e_box_pack_end(ibb->box_object, ic->bg_object); + e_box_pack_options_set(ic->bg_object, + 1, 1, /* fill */ + 0, 0, /* expand */ + 0.5, 0.5, /* align */ + bw, bh, /* min */ + bw, bh /* max */ + ); + + str = (char *)edje_object_data_get(ic->icon_object, "raise_on_hilight"); + if (str) { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); + if (atoi(str) == 1) ic->raise_on_hilight = 1; } - e_config_save_queue(); + + edje_object_signal_emit(ic->bg_object, "passive", ""); + edje_object_signal_emit(ic->overlay_object, "passive", ""); + return ic; } static void -_ibar_cb_iconsize_very_small(void *data, E_Menu *m, E_Menu_Item *mi) +_ibar_icon_free(IBar_Icon *ic) { - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 16; - for (l = ib->bars; l; l = l->next) + ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic); + if (ic->bg_object) evas_object_del(ic->bg_object); + if (ic->overlay_object) evas_object_del(ic->overlay_object); + if (ic->icon_object) evas_object_del(ic->icon_object); + if (ic->event_object) evas_object_del(ic->event_object); + while (ic->extra_icons) { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); + Evas_Object *o; + + o = ic->extra_icons->data; + ic->extra_icons = evas_list_remove_list(ic->extra_icons, ic->extra_icons); + evas_object_del(o); } - e_config_save_queue(); + e_object_unref(E_OBJECT(ic->app)); + free(ic); } -static void -_ibar_cb_iconsize_small(void *data, E_Menu *m, E_Menu_Item *mi) +static IBar_Icon * +_ibar_icon_find(IBar_Bar *ibb, E_App *a) { - IBar *ib; Evas_List *l; - - ib = data; - ib->conf->iconsize = 24; - for (l = ib->bars; l; l = l->next) + + for (l = ibb->icons; l; l = l->next) { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); + IBar_Icon *ic; + + ic = l->data; + if (ic->app == a) return ic; } - e_config_save_queue(); + return NULL; } -static void -_ibar_cb_iconsize_medium(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 32; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibar_cb_iconsize_large(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 40; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibar_cb_iconsize_very_large(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 48; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibar_cb_iconsize_extremely_large(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 56; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibar_cb_iconsize_huge(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 64; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibar_cb_iconsize_enormous(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 96; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static void -_ibar_cb_iconsize_gigantic(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - Evas_List *l; - - ib = data; - ib->conf->iconsize = 128; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_iconsize_change(ibb); - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - e_config_save_queue(); -} - -static E_Menu * -_ibar_config_menu_new(IBar *ib) +void +_ibar_config_menu_new(IBar *ib) { E_Menu *mn; E_Menu_Item *mi; /* FIXME: hook callbacks to each menu item */ mn = e_menu_new(); - + +#if 0 mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Fixed width"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (ib->conf->width > 0) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_width_fixed, ib); + e_menu_item_callback_set(mi, _ibar_bar_cb_width_fixed, ib); mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Auto fit icons"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (ib->conf->width < 0) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_width_auto, ib); + e_menu_item_callback_set(mi, _ibar_bar_cb_width_auto, ib); mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Fill edge"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 1); if (ib->conf->width == 0) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_width_fill, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_width_fill, ib); + mi = e_menu_item_new(mn); e_menu_item_separator_set(mi, 1); @@ -610,79 +638,79 @@ e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 8) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_microscopic, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_microscopic, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Tiny"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 12) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_tiny, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_tiny, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Very Small"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 16) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_very_small, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_very_small, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Small"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 24) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_small, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_small, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Medium"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 32) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_medium, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_medium, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Large"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 40) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_large, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_large, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Very Large"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 48) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_very_large, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_very_large, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Exteremely Large"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 56) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_extremely_large, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_extremely_large, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Huge"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 64) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_huge, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_huge, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Enormous"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 96) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_enormous, ib); - + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_enormous, ib); + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Gigantic"); e_menu_item_radio_set(mi, 1); e_menu_item_radio_group_set(mi, 2); if (ib->conf->iconsize == 128) e_menu_item_toggle_set(mi, 1); - e_menu_item_callback_set(mi, _ibar_cb_iconsize_gigantic, ib); - -/* + e_menu_item_callback_set(mi, _ibar_bar_cb_iconsize_gigantic, ib); + +/* mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "Auto hide"); e_menu_item_check_set(mi, 1); @@ -690,296 +718,106 @@ mi = e_menu_item_new(mn); e_menu_item_separator_set(mi, 1); - + mi = e_menu_item_new(mn); e_menu_item_label_set(mi, "More Options..."); */ +#endif + mi = e_menu_item_new(mn); + e_menu_item_label_set(mi, "(Unused)"); + ib->config_menu = mn; - - return mn; } +#if 0 static void -_ibar_config_menu_del(IBar *ib, E_Menu *m) +_ibar_bar_iconsize_change(IBar_Bar *ibb) { - e_object_del(E_OBJECT(m)); -} + Evas_List *l; -static void -_ibar_cb_width_fixed(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - - ib = data; - if (ib->conf->width <= 0) - { - Evas_List *l; - - ib->conf->width = 400; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - } - e_config_save_queue(); -} + _ibar_bar_frame_resize(ibb); -static void -_ibar_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi) -{ - IBar *ib; - - ib = data; - if (ib->conf->width >= 0) + for (l = ibb->icons; l; l = l->next) { - Evas_List *l; - - ib->conf->width = -1; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_edge_change(ibb, ib->conf->edge); - } + IBar_Icon *ic; + + ic = l->data; + _ibar_icon_resize(ic); } - e_config_save_queue(); + _ibar_bar_convert_move_resize_to_config(ibb); } +#endif +#if 0 static void -_ibar_cb_width_fill(void *data, E_Menu *m, E_Menu_Item *mi) +_ibar_icon_resize(IBar_Icon *ic) { - IBar *ib; - - ib = data; - if (ib->conf->width != 0) - { - Evas_List *l; - - ib->conf->width = 0; - ib->conf->anchor = 0.5; - ib->conf->handle = 0.5; - for (l = ib->bars; l; l = l->next) - { - IBar_Bar *ibb; - - ibb = l->data; - _ibar_bar_edge_change(ibb, ib->conf->edge); - } - } - e_config_save_queue(); + Evas_Object *o; + Evas_Coord bw, bh; + + e_box_freeze(ic->ibb->box_object); + o = ic->icon_object; + edje_extern_object_min_size_set(o, ic->ibb->ibar->conf->iconsize, ic->ibb->ibar->conf->iconsize); + + evas_object_resize(o, ic->ibb->ibar->conf->iconsize, ic->ibb->ibar->conf->iconsize); + + edje_object_part_swallow(ic->bg_object, "item", o); + edje_object_size_min_calc(ic->bg_object, &bw, &bh); + + e_box_pack_options_set(ic->bg_object, + 1, 1, /* fill */ + 0, 0, /* expand */ + 0.5, 0.5, /* align */ + bw, bh, /* min */ + bw, bh /* max */ + ); + e_box_thaw(ic->ibb->box_object); } +#endif +#if 0 static void -_ibar_bar_iconsize_change(IBar_Bar *ibb) +_ibar_icon_reorder_before(IBar_Icon *ic, IBar_Icon *before) { - Evas_List *l; + Evas_Coord bw, bh; - _ibar_bar_frame_resize(ibb); - - for (l = ibb->icons; l; l = l->next) + e_box_freeze(ic->ibb->box_object); + e_box_unpack(ic->bg_object); + ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic); + if (before) { - IBar_Icon *ic; - - ic = l->data; - _ibar_bar_icon_resize(ic); + ic->ibb->icons = evas_list_prepend_relative(ic->ibb->icons, ic, before); + e_box_pack_before(ic->ibb->box_object, ic->bg_object, before->bg_object); } - _ibar_bar_convert_move_resize_to_config(ibb); -} - -static IBar_Icon * -_ibar_bar_icon_find(IBar_Bar *ibb, E_App *a) -{ - Evas_List *l; - - for (l = ibb->icons; l; l = l->next) + else { - IBar_Icon *ic; - - ic = l->data; - if (ic->app == a) return ic; + ic->ibb->icons = evas_list_prepend(ic->ibb->icons, ic); + e_box_pack_start(ic->ibb->box_object, ic->bg_object); } - return NULL; + edje_object_size_min_calc(ic->bg_object, &bw, &bh); + e_box_pack_options_set(ic->bg_object, + 1, 1, /* fill */ + 0, 0, /* expand */ + 0.5, 0.5, /* align */ + bw, bh, /* min */ + bw, bh /* max */ + ); + e_box_thaw(ic->ibb->box_object); } +#endif static void -_ibar_bar_icon_del(IBar_Icon *ic) +_ibar_icon_reorder_after(IBar_Icon *ic, IBar_Icon *after) { + Evas_Coord bw, bh; + + e_box_freeze(ic->ibb->box_object); + e_box_unpack(ic->bg_object); ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic); - if (ic->bg_object) evas_object_del(ic->bg_object); - if (ic->overlay_object) evas_object_del(ic->overlay_object); - if (ic->icon_object) evas_object_del(ic->icon_object); - if (ic->event_object) evas_object_del(ic->event_object); - while (ic->extra_icons) + if (after) { - Evas_Object *o; - - o = ic->extra_icons->data; - ic->extra_icons = evas_list_remove_list(ic->extra_icons, ic->extra_icons); - evas_object_del(o); - } - e_object_unref(E_OBJECT(ic->app)); - free(ic); -} - -static IBar_Icon * -_ibar_bar_icon_new(IBar_Bar *ibb, E_App *a) -{ - IBar_Icon *ic; - char *str; - Evas_Object *o; - Evas_Coord bw, bh; - - ic = calloc(1, sizeof(IBar_Icon)); - if (!ic) return NULL; - ic->ibb = ibb; - ic->app = a; - e_object_ref(E_OBJECT(a)); - ibb->icons = evas_list_append(ibb->icons, ic); - - o = evas_object_rectangle_add(ibb->evas); - ic->event_object = o; - evas_object_layer_set(o, 1); - evas_object_clip_set(o, evas_object_clip_get(ibb->box_object)); - evas_object_color_set(o, 0, 0, 0, 0); - evas_object_repeat_events_set(o, 1); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibar_cb_icon_in, ic); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibar_cb_icon_out, ic); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibar_cb_icon_down, ic); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibar_cb_icon_up, ic); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->bg_object = o; - evas_object_intercept_move_callback_add(o, _ibar_cb_intercept_icon_move, ic); - evas_object_intercept_resize_callback_add(o, _ibar_cb_intercept_icon_resize, ic); - edje_object_file_set(o, - /* FIXME: "default.eet" needs to come from conf */ - e_path_find(path_themes, "default.eet"), - "modules/ibar/icon"); - edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf->edge]); - edje_object_message_signal_process(o); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->icon_object = o; - edje_object_file_set(o, ic->app->path, "icon"); - edje_extern_object_min_size_set(o, ibb->ibar->conf->iconsize, ibb->ibar->conf->iconsize); - edje_object_part_swallow(ic->bg_object, "item", o); - edje_object_size_min_calc(ic->bg_object, &bw, &bh); - evas_object_pass_events_set(o, 1); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->overlay_object = o; - evas_object_intercept_move_callback_add(o, _ibar_cb_intercept_icon_move, ic); - evas_object_intercept_resize_callback_add(o, _ibar_cb_intercept_icon_resize, ic); - edje_object_file_set(o, - /* FIXME: "default.eet" needs to come from conf */ - e_path_find(path_themes, "default.eet"), - "modules/ibar/icon_overlay"); - edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf->edge]); - edje_object_message_signal_process(o); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ic->extra_icons = evas_list_append(ic->extra_icons, o); - edje_object_file_set(o, ic->app->path, "icon"); - edje_object_part_swallow(ic->overlay_object, "item", o); - evas_object_pass_events_set(o, 1); - evas_object_show(o); - - evas_object_raise(ic->event_object); - - e_box_pack_end(ibb->box_object, ic->bg_object); - e_box_pack_options_set(ic->bg_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - bw, bh, /* min */ - bw, bh /* max */ - ); - - str = (char *)edje_object_data_get(ic->icon_object, "raise_on_hilight"); - if (str) - { - if (atoi(str) == 1) ic->raise_on_hilight = 1; - } - - edje_object_signal_emit(ic->bg_object, "passive", ""); - edje_object_signal_emit(ic->overlay_object, "passive", ""); - return ic; -} - -static void -_ibar_bar_icon_resize(IBar_Icon *ic) -{ - Evas_Object *o; - Evas_Coord bw, bh; - - e_box_freeze(ic->ibb->box_object); - o = ic->icon_object; - edje_extern_object_min_size_set(o, ic->ibb->ibar->conf->iconsize, ic->ibb->ibar->conf->iconsize); - - evas_object_resize(o, ic->ibb->ibar->conf->iconsize, ic->ibb->ibar->conf->iconsize); - - edje_object_part_swallow(ic->bg_object, "item", o); - edje_object_size_min_calc(ic->bg_object, &bw, &bh); - - e_box_pack_options_set(ic->bg_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - bw, bh, /* min */ - bw, bh /* max */ - ); - e_box_thaw(ic->ibb->box_object); -} - -static void -_ibar_bar_icon_reorder_before(IBar_Icon *ic, IBar_Icon *before) -{ - Evas_Coord bw, bh; - - e_box_freeze(ic->ibb->box_object); - e_box_unpack(ic->bg_object); - ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic); - if (before) - { - ic->ibb->icons = evas_list_prepend_relative(ic->ibb->icons, ic, before); - e_box_pack_before(ic->ibb->box_object, ic->bg_object, before->bg_object); - } - else - { - ic->ibb->icons = evas_list_prepend(ic->ibb->icons, ic); - e_box_pack_start(ic->ibb->box_object, ic->bg_object); - } - edje_object_size_min_calc(ic->bg_object, &bw, &bh); - e_box_pack_options_set(ic->bg_object, - 1, 1, /* fill */ - 0, 0, /* expand */ - 0.5, 0.5, /* align */ - bw, bh, /* min */ - bw, bh /* max */ - ); - e_box_thaw(ic->ibb->box_object); -} - -static void -_ibar_bar_icon_reorder_after(IBar_Icon *ic, IBar_Icon *after) -{ - Evas_Coord bw, bh; - - e_box_freeze(ic->ibb->box_object); - e_box_unpack(ic->bg_object); - ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic); - if (after) - { - ic->ibb->icons = evas_list_append_relative(ic->ibb->icons, ic, after); - e_box_pack_after(ic->ibb->box_object, ic->bg_object, after->bg_object); + ic->ibb->icons = evas_list_append_relative(ic->ibb->icons, ic, after); + e_box_pack_after(ic->ibb->box_object, ic->bg_object, after->bg_object); } else { @@ -1000,269 +838,63 @@ static void _ibar_bar_frame_resize(IBar_Bar *ibb) { - Evas_Coord ww, hh, bw, bh; - Evas_Object *o; - + Evas_Coord w, h; + evas_event_freeze(ibb->evas); e_box_freeze(ibb->box_object); - - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - o = ibb->bar_object; - if (ibb->ibar->conf->width < 0) - { - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - e_box_orientation_set(ibb->box_object, 1); - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) - e_box_orientation_set(ibb->box_object, 0); - - e_box_min_size_get(ibb->box_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->box_object, bw, bh); - edje_object_part_swallow(o, "items", ibb->box_object); - edje_object_size_min_calc(o, &bw, &bh); - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - { - if (bw > ww) bw = ww; - } - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) - { - if (bh > hh) bh = hh; - } - } - else if (ibb->ibar->conf->width == 0) + + e_box_min_size_get(ibb->box_object, &w, &h); + edje_extern_object_min_size_set(ibb->box_object, w, h); + edje_object_part_swallow(ibb->bar_object, "items", ibb->box_object); + edje_object_size_min_calc(ibb->bar_object, &w, &h); + + e_gadman_client_resize(ibb->gmc, w, h); +#if 0 + if (ibb->ibar->conf->width == IBAR_WIDTH_AUTO) { - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - { - e_box_orientation_set(ibb->box_object, 1); - e_box_min_size_get(ibb->box_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->box_object, ww, bh); - } - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) - { - e_box_orientation_set(ibb->box_object, 0); - e_box_min_size_get(ibb->box_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->box_object, bw, hh); - } - - edje_object_part_swallow(o, "items", ibb->box_object); - edje_object_size_min_calc(o, &bw, &bh); + e_gadman_client_resize(ibb->gmc, w, h); } else { - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - { - e_box_orientation_set(ibb->box_object, 1); - e_box_min_size_get(ibb->box_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->box_object, ibb->ibar->conf->width, bh); - edje_object_part_swallow(o, "items", ibb->box_object); - edje_object_size_min_calc(o, &bw, &bh); - edje_extern_object_min_size_set(ibb->box_object, 0, 0); - edje_object_part_swallow(o, "items", ibb->box_object); - } - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) - { - e_box_orientation_set(ibb->box_object, 0); - e_box_min_size_get(ibb->box_object, &bw, &bh); - edje_extern_object_min_size_set(ibb->box_object, bw, ibb->ibar->conf->width); - edje_object_part_swallow(o, "items", ibb->box_object); - edje_object_size_min_calc(o, &bw, &bh); - edje_extern_object_min_size_set(ibb->box_object, 0, 0); - edje_object_part_swallow(o, "items", ibb->box_object); - } - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - { - if (bw > ww) bw = bw; - } - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) + if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) + || (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT)) { - if (bh > hh) bh = hh; + /* h is the width of the bar */ + e_gadman_client_resize(ibb->gmc, w, ibb->ibar->conf->width); } - } - - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - ibb->maxsize = bh; - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) - ibb->maxsize = bw; - - ibb->w = bw; - ibb->h = bh; - if (ibb->ibar->conf->edge == EDGE_BOTTOM) - { - ibb->x = (ww * ibb->ibar->conf->anchor) - (bw * ibb->ibar->conf->handle); - ibb->y = hh - bh; - } - else if (ibb->ibar->conf->edge == EDGE_TOP) - { - ibb->x = (ww * ibb->ibar->conf->anchor) - (bw * ibb->ibar->conf->handle); - ibb->y = 0; - } - else if (ibb->ibar->conf->edge == EDGE_LEFT) - { - ibb->y = (hh * ibb->ibar->conf->anchor) - (bh * ibb->ibar->conf->handle); - ibb->x = 0; - } - else if (ibb->ibar->conf->edge == EDGE_RIGHT) - { - ibb->y = (hh * ibb->ibar->conf->anchor) - (bh * ibb->ibar->conf->handle); - ibb->x = ww - bw; - } - - _ibar_bar_reconfigure(ibb); - - e_box_thaw(ibb->box_object); - - _ibar_bar_follower_reset(ibb); - _ibar_timer_handle(ibb); - - evas_event_thaw(ibb->evas); -} - -static void -_ibar_bar_init(IBar_Bar *ibb) -{ - Evas_List *l; - Evas_Coord bw, bh; - Evas_Object *o; - - ibb->ev_handler_container_resize = - ecore_event_handler_add(E_EVENT_CONTAINER_RESIZE, - _ibar_cb_event_container_resize, - ibb); - evas_event_freeze(ibb->evas); - o = edje_object_add(ibb->evas); - ibb->bar_object = o; - edje_object_file_set(o, - /* FIXME: "default.eet" needs to come from conf */ - e_path_find(path_themes, "default.eet"), - "modules/ibar/main"); - edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf->edge]); - edje_object_message_signal_process(o); - edje_object_signal_callback_add(o, "move_start", "", _ibar_cb_bar_move_start, ibb); - edje_object_signal_callback_add(o, "move_stop", "", _ibar_cb_bar_move_stop, ibb); - edje_object_signal_callback_add(o, "resize1_start", "", _ibar_cb_bar_resize1_start, ibb); - edje_object_signal_callback_add(o, "resize1_stop", "", _ibar_cb_bar_resize1_stop, ibb); - edje_object_signal_callback_add(o, "resize2_start", "", _ibar_cb_bar_resize2_start, ibb); - edje_object_signal_callback_add(o, "resize2_stop", "", _ibar_cb_bar_resize2_stop, ibb); - edje_object_signal_callback_add(o, "mouse,move", "*", _ibar_cb_bar_move_go, ibb); - evas_object_show(o); - - o = edje_object_add(ibb->evas); - ibb->overlay_object = o; - evas_object_layer_set(o, 1); - edje_object_file_set(o, - /* FIXME: "default.eet" needs to come from conf */ - e_path_find(path_themes, "default.eet"), - "modules/ibar/follower"); - edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf->edge]); - edje_object_message_signal_process(o); - evas_object_show(o); - - o = evas_object_rectangle_add(ibb->evas); - ibb->event_object = o; - evas_object_layer_set(o, 2); - evas_object_repeat_events_set(o, 1); - evas_object_color_set(o, 0, 0, 0, 0); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibar_cb_bar_in, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibar_cb_bar_out, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibar_cb_bar_down, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibar_cb_bar_up, ibb); - evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _ibar_cb_bar_move, ibb); - evas_object_show(o); - - o = e_box_add(ibb->evas); - ibb->box_object = o; - evas_object_intercept_move_callback_add(o, _ibar_cb_intercept_bar_move, ibb); - evas_object_intercept_resize_callback_add(o, _ibar_cb_intercept_bar_resize, ibb); - e_box_freeze(o); - edje_object_part_swallow(ibb->bar_object, "items", o); - evas_object_show(o); - - edje_object_size_min_calc(ibb->bar_object, &bw, &bh); - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - ibb->minsize = bh; - else if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - ibb->minsize = bw; - - if (ibb->ibar->apps) - { - for (l = ibb->ibar->apps->subapps; l; l = l->next) + else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP) + || (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM)) { - E_App *a; - IBar_Icon *ic; - - a = l->data; - ic = _ibar_bar_icon_new(ibb, a); + /* w is the width of the bar */ + e_gadman_client_resize(ibb->gmc, ibb->ibar->conf->width, h); } } - ibb->align_req = 0.5; - ibb->align = 0.5; - e_box_align_set(ibb->box_object, 0.5, 0.5); +#endif - _ibar_bar_frame_resize(ibb); - e_box_thaw(ibb->box_object); - _ibar_bar_follower_reset(ibb); - _ibar_timer_handle(ibb); - evas_event_thaw(ibb->evas); - -// edje_object_signal_emit(ibb->bar_object, "passive", ""); -// edje_object_signal_emit(ibb->overlay_object, "passive", ""); -} - -static void -_ibar_bar_free(IBar_Bar *ibb) -{ - ecore_event_handler_del(ibb->ev_handler_container_resize); - while (ibb->icons) - { - IBar_Icon *ic; - - ic = ibb->icons->data; - _ibar_bar_icon_del(ic); - } - if (ibb->timer) ecore_timer_del(ibb->timer); - if (ibb->animator) ecore_animator_del(ibb->animator); - evas_object_del(ibb->bar_object); - evas_object_del(ibb->overlay_object); - evas_object_del(ibb->box_object); - evas_object_del(ibb->event_object); - free(ibb); } static void -_ibar_motion_handle(IBar_Bar *ibb, Evas_Coord mx, Evas_Coord my) +_ibar_bar_motion_handle(IBar_Bar *ibb, Evas_Coord mx, Evas_Coord my) { Evas_Coord x, y, w, h; double relx, rely; - + evas_object_geometry_get(ibb->box_object, &x, &y, &w, &h); if (w > 0) relx = (double)(mx - x) / (double)w; else relx = 0.0; if (h > 0) rely = (double)(my - y) / (double)h; else rely = 0.0; - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) + if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) || + (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP)) { ibb->align_req = 1.0 - relx; ibb->follow_req = relx; } - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) + else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) || + (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT)) { ibb->align_req = 1.0 - rely; ibb->follow_req = rely; @@ -1270,35 +902,28 @@ } static void -_ibar_timer_handle(IBar_Bar *ibb) +_ibar_bar_timer_handle(IBar_Bar *ibb) { if (!ibb->timer) - ibb->timer = ecore_timer_add(0.01, _ibar_cb_bar_timer, ibb); + ibb->timer = ecore_timer_add(0.01, _ibar_bar_cb_timer, ibb); if (!ibb->animator) - ibb->animator = ecore_animator_add(_ibar_cb_bar_animator, ibb); -} - -static void -_ibar_bar_reconfigure(IBar_Bar *ibb) -{ - evas_object_move(ibb->bar_object, ibb->x, ibb->y); - evas_object_resize(ibb->bar_object, ibb->w, ibb->h); - _ibar_timer_handle(ibb); + ibb->animator = ecore_animator_add(_ibar_bar_cb_animator, ibb); } static void _ibar_bar_follower_reset(IBar_Bar *ibb) { Evas_Coord ww, hh, bx, by, bw, bh, d1, d2, mw, mh; - + evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); evas_object_geometry_get(ibb->box_object, &bx, &by, &bw, &bh); edje_object_size_min_get(ibb->overlay_object, &mw, &mh); - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) + if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_BOTTOM) || + (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_TOP)) { d1 = bx; d2 = ww - (bx + bw); + printf("d1: %d, d2: %d\n", d1, d2); if (bw > 0) { if (d1 < d2) @@ -1307,8 +932,8 @@ ibb->follow_req = 1.0 + ((double)(d2 + (mw * 4)) / (double)bw); } } - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) + else if ((e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_LEFT) || + (e_gadman_client_edge_get(ibb->gmc) == E_GADMAN_EDGE_RIGHT)) { d1 = by; d2 = hh - (by + bh); @@ -1323,111 +948,38 @@ } static void -_ibar_bar_convert_move_resize_to_config(IBar_Bar *ibb) -{ - Evas_Coord bx, by, bw, bh, bbx, bby, bbw, bbh, ww, hh; - - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - evas_object_geometry_get(ibb->box_object, &bx, &by, &bw, &bh); - evas_object_geometry_get(ibb->bar_object, &bbx, &bby, &bbw, &bbh); - - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - { - double a = 0.5; - - if (ibb->ibar->conf->width < 0) /* auto size to fit */ - { - if ((ww - ibb->w) != 0) - a = (double)ibb->x / (double)(ww - ibb->w); - else - a = 0.5; - } - else if (ibb->ibar->conf->width == 0) /* full width */ - { - } - else - { - ibb->ibar->conf->width = ibb->w - (bbw - bw); - if ((ww - ibb->w) != 0) - a = (double)ibb->x / (double)(ww - ibb->w); - else - a = 0.5; - } - ibb->ibar->conf->anchor = a; - ibb->ibar->conf->handle = a; - } - else if ((ibb->ibar->conf->edge == EDGE_LEFT) || - (ibb->ibar->conf->edge == EDGE_RIGHT)) - { - double a = 0.5; - - if (ibb->ibar->conf->width < 0) /* auto size to fit */ - { - if ((hh - ibb->h) != 0) - a = (double)ibb->y / (double)(hh - ibb->h); - else - a = 0.5; - } - else if (ibb->ibar->conf->width == 0) /* full width */ - { - } - else - { - ibb->ibar->conf->width = ibb->h - (bbh - bh); - if ((hh - ibb->h) != 0) - a = (double)ibb->y / (double)(hh - ibb->h); - else - a = 0.5; - } - ibb->ibar->conf->anchor = a; - ibb->ibar->conf->handle = a; - } - e_config_save_queue(); -} - -static void -_ibar_bar_edge_change(IBar_Bar *ibb, int edge) +_ibar_bar_edge_change(IBar_Bar *ibb, int edge) { Evas_List *l; - Evas_Coord ww, hh, bw, bh; + Evas_Coord bw, bh; Evas_Object *o; - - ibb->ibar->conf->edge = edge; - + + evas_event_freeze(ibb->evas); o = ibb->bar_object; - edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf->edge]); + edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[edge]); edje_object_message_signal_process(o); - + o = ibb->overlay_object; - edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf->edge]); + edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[edge]); edje_object_message_signal_process(o); - + e_box_freeze(ibb->box_object); - edje_object_size_min_calc(ibb->bar_object, &bw, &bh); - if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - ibb->minsize = bh; - else if ((ibb->ibar->conf->edge == EDGE_BOTTOM) || - (ibb->ibar->conf->edge == EDGE_TOP)) - ibb->minsize = bw; - for (l = ibb->icons; l; l = l->next) { IBar_Icon *ic; - + ic = l->data; o = ic->bg_object; - edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf->edge]); + edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[edge]); edje_object_message_signal_process(o); edje_object_size_min_calc(ic->bg_object, &bw, &bh); - + o = ic->overlay_object; - edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf->edge]); + edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[edge]); edje_object_message_signal_process(o); - + e_box_pack_options_set(ic->bg_object, 1, 1, /* fill */ 0, 0, /* expand */ @@ -1436,24 +988,41 @@ bw, bh /* max */ ); } - evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh); - + ibb->align_req = 0.5; ibb->align = 0.5; e_box_align_set(ibb->box_object, 0.5, 0.5); + if ((edge == E_GADMAN_EDGE_BOTTOM) || + (edge == E_GADMAN_EDGE_TOP)) + { + e_box_orientation_set(ibb->box_object, 1); + e_gadman_client_policy_set(ibb->gmc, + E_GADMAN_POLICY_EDGES | + E_GADMAN_POLICY_HMOVE | + E_GADMAN_POLICY_VMOVE | + E_GADMAN_POLICY_HSIZE); + } + else if ((edge == E_GADMAN_EDGE_LEFT) || + (edge == E_GADMAN_EDGE_RIGHT)) + { + e_box_orientation_set(ibb->box_object, 0); + e_gadman_client_policy_set(ibb->gmc, + E_GADMAN_POLICY_EDGES | + E_GADMAN_POLICY_HMOVE | + E_GADMAN_POLICY_VMOVE | + E_GADMAN_POLICY_VSIZE); + } + _ibar_bar_frame_resize(ibb); - + e_box_thaw(ibb->box_object); - _ibar_bar_follower_reset(ibb); - _ibar_timer_handle(ibb); - evas_event_thaw(ibb->evas); } static void -_ibar_cb_intercept_icon_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y) +_ibar_icon_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y) { IBar_Icon *ic; @@ -1464,7 +1033,7 @@ } static void -_ibar_cb_intercept_icon_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h) +_ibar_icon_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h) { IBar_Icon *ic; @@ -1475,7 +1044,7 @@ } static void -_ibar_cb_intercept_bar_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y) +_ibar_bar_cb_intercept_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y) { IBar_Bar *ibb; @@ -1485,7 +1054,7 @@ } static void -_ibar_cb_intercept_bar_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h) +_ibar_bar_cb_intercept_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h) { IBar_Bar *ibb; @@ -1496,11 +1065,11 @@ } static void -_ibar_cb_icon_in(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ibar_icon_cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_In *ev; IBar_Icon *ic; - + ev = event_info; ic = data; evas_event_freeze(ic->ibb->evas); @@ -1515,11 +1084,11 @@ } static void -_ibar_cb_icon_out(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ibar_icon_cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_Out *ev; IBar_Icon *ic; - + ev = event_info; ic = data; edje_object_signal_emit(ic->bg_object, "passive", ""); @@ -1528,11 +1097,11 @@ } static void -_ibar_cb_icon_down(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ibar_icon_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_Down *ev; IBar_Icon *ic; - + ev = event_info; ic = data; if (ev->button == 1) @@ -1545,11 +1114,11 @@ } static void -_ibar_cb_icon_up(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ibar_icon_cb_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_Up *ev; IBar_Icon *ic; - ... [truncated message content] |
From: <enl...@li...> - 2005-02-13 11:57:04
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_init.c Log Message: Don't let extra screens overlap the main screen. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_init.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_init.c 7 Feb 2005 15:09:37 -0000 1.6 +++ e_init.c 13 Feb 2005 11:56:46 -0000 1.7 @@ -71,12 +71,19 @@ else { int i; + int mx, my, mw, mh; for (i = 0; i < n; i++) { ecore_x_xinerama_screen_geometry_get(i, &x, &y, &w, &h); if (i == 0) { + /* Remeber the size and placement of the first window */ + mx = x; + my = y; + mw = w; + mh = h; + /* Init splash */ o = edje_object_add(_e_init_evas); edje_object_file_set(o, /* FIXME: "init.eet" needs to come from config */ @@ -87,7 +94,11 @@ evas_object_show(o); _e_init_object = o; } - else + /* Only add extra screen if it doesn't overlap with the main screen */ + /* FIXME: What if extra screens overlap? Maybe zones should be + * initialized before we come here? */ + else if (!E_INTERSECTS(x, y, w, h, + mx, my, mw, mh)) { o = edje_object_add(_e_init_evas); edje_object_file_set(o, |
From: <enl...@li...> - 2005-02-13 12:31:46
|
Enlightenment CVS committal Author : sebastid Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_manager.h Log Message: Export function. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_manager.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- e_manager.h 13 Feb 2005 11:17:46 -0000 1.7 +++ e_manager.h 13 Feb 2005 12:31:31 -0000 1.8 @@ -28,6 +28,7 @@ EAPI Evas_List *e_manager_list(void); EAPI E_Manager *e_manager_new(Ecore_X_Window root); +EAPI void e_manager_manage_windows(E_Manager *man); EAPI void e_manager_show(E_Manager *man); EAPI void e_manager_hide(E_Manager *man); EAPI void e_manager_move(E_Manager *man, int x, int y); |