From: <enl...@li...> - 2005-07-02 13:34:00
|
Enlightenment CVS committal Author : raster Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_actions.c e_utils.c e_utils.h Log Message: todo-- =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_actions.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- e_actions.c 28 Jun 2005 04:00:09 -0000 1.15 +++ e_actions.c 2 Jul 2005 13:33:52 -0000 1.16 @@ -355,6 +355,105 @@ } } +#define ZONE_DESK_ACTION(con_num, zone_num, zone, act) \ +E_Zone *zone; \ +if ((con_num < 0) || (zone_num < 0)) { \ + Evas_List *l, *ll, *lll; \ + E_Container *con; \ + E_Manager *man; \ + if ((con_num >= 0) && (zone_num < 0)) /* con=1 zone=all */ { \ + con = e_util_container_number_get(con_num); \ + for (l = con->zones; l; l = l->next) { \ + zone = l->data; \ + act; \ + } } \ + else if ((con_num < 0) && (zone_num >= 0)) /* con=all zone=1 */ { \ + for (l = e_manager_list(); l; l = l->next) { \ + man = l->data; \ + for (ll = man->containers; ll; ll = ll->next) { \ + con = ll->data; \ + zone = e_container_zone_number_get(con, zone_num); \ + if (zone) \ + act; \ + } } } \ + else if ((con_num < 0) && (zone_num < 0)) /* con=all zone=all */ { \ + for (l = e_manager_list(); l; l = l->next) { \ + man = l->data; \ + for (ll = man->containers; ll; ll = ll->next) { \ + con = ll->data; \ + for (lll = con->zones; lll; lll = lll->next) { \ + zone = lll->data; \ + act; \ + } } } } } \ +else { \ + zone = e_util_container_zone_number_get(con_num, zone_num); \ + if (zone) act; \ +} + +/***************************************************************************/ +ACT_FN_GO(zone_desk_flip_by) +{ + if (params) + { + int con_num = 0, zone_num = 0; + int dx = 0, dy = 0; + + if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4) + { + ZONE_DESK_ACTION(con_num, zone_num, zone, + e_zone_desk_flip_by(zone, dx, dy)); + } + } +} + +/***************************************************************************/ +ACT_FN_GO(zone_desk_flip_to) +{ + if (params) + { + int con_num = 0, zone_num = 0; + int dx = 0, dy = 0; + + if (sscanf(params, "%i %i %i %i", &con_num, &zone_num, &dx, &dy) == 4) + { + ZONE_DESK_ACTION(con_num, zone_num, zone, + e_zone_desk_flip_to(zone, dx, dy)); + } + } +} + +/***************************************************************************/ +ACT_FN_GO(zone_desk_linear_flip_by) +{ + if (params) + { + int con_num = 0, zone_num = 0; + int dx = 0; + + if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3) + { + ZONE_DESK_ACTION(con_num, zone_num, zone, + e_zone_desk_linear_flip_by(zone, dx)); + } + } +} + +/***************************************************************************/ +ACT_FN_GO(zone_desk_linear_flip_to) +{ + if (params) + { + int con_num = 0, zone_num = 0; + int dx = 0; + + if (sscanf(params, "%i %i %i", &con_num, &zone_num, &dx) == 3) + { + ZONE_DESK_ACTION(con_num, zone_num, zone, + e_zone_desk_linear_flip_to(zone, dx)); + } + } +} + /***************************************************************************/ static void _e_actions_cb_menu_end(void *data, E_Menu *m) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_utils.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- e_utils.c 1 Jul 2005 04:09:30 -0000 1.11 +++ e_utils.c 2 Jul 2005 13:33:53 -0000 1.12 @@ -132,3 +132,30 @@ if (!fnmatch(glob, str, 0)) return 1; return 0; } + +E_Container * +e_util_container_number_get(int num) +{ + Evas_List *l; + + for (l = e_manager_list(); l; l = l->next) + { + E_Manager *man; + E_Container *con; + + man = l->data; + con = e_manager_container_number_get(man, num); + if (con) return con; + } + return NULL; +} + +E_Zone * +e_util_container_zone_number_get(int con_num, int zone_num) +{ + E_Container *con; + + con = e_util_container_number_get(con_num); + if (!con) return NULL; + return e_container_zone_number_get(con, zone_num); +} =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_utils.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- e_utils.h 1 Jul 2005 04:09:30 -0000 1.8 +++ e_utils.h 2 Jul 2005 13:33:53 -0000 1.9 @@ -6,14 +6,16 @@ #ifndef E_UTILS_H #define E_UTILS_H -EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button); -EAPI void e_util_container_fake_mouse_up_all_later(E_Container *con); -EAPI void e_util_wakeup(void); -EAPI void e_util_env_set(const char *var, const char *val); -EAPI E_Zone *e_util_zone_current_get(E_Manager *man); -EAPI int e_util_utils_installed(void); -EAPI int e_util_app_installed(char *app); -EAPI int e_util_glob_match(char *str, char *glob); - +EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button); +EAPI void e_util_container_fake_mouse_up_all_later(E_Container *con); +EAPI void e_util_wakeup(void); +EAPI void e_util_env_set(const char *var, const char *val); +EAPI E_Zone *e_util_zone_current_get(E_Manager *man); +EAPI int e_util_utils_installed(void); +EAPI int e_util_app_installed(char *app); +EAPI int e_util_glob_match(char *str, char *glob); +EAPI E_Container *e_util_container_number_get(int num); +EAPI E_Zone *e_util_container_zone_number_get(int con_num, int zone_num); + #endif #endif |