diff --git a/src/bin/e_container.c b/src/bin/e_container.c index 6b3036a75..af22e9225 100644 --- a/src/bin/e_container.c +++ b/src/bin/e_container.c @@ -8,22 +8,22 @@ */ /* local subsystem functions */ -static void _e_container_free(E_Container *con); +static void _e_container_free(E_Container *con); static E_Container *_e_container_find_by_event_window(Ecore_X_Window win); -static Eina_Bool _e_container_cb_mouse_in(void *data, int type, void *event); -static Eina_Bool _e_container_cb_mouse_out(void *data, int type, void *event); -static Eina_Bool _e_container_cb_mouse_down(void *data, int type, void *event); -static Eina_Bool _e_container_cb_mouse_up(void *data, int type, void *event); -static Eina_Bool _e_container_cb_mouse_move(void *data, int type, void *event); -static Eina_Bool _e_container_cb_mouse_wheel(void *data, int type, void *event); +static Eina_Bool _e_container_cb_mouse_in(void *data, int type, void *event); +static Eina_Bool _e_container_cb_mouse_out(void *data, int type, void *event); +static Eina_Bool _e_container_cb_mouse_down(void *data, int type, void *event); +static Eina_Bool _e_container_cb_mouse_up(void *data, int type, void *event); +static Eina_Bool _e_container_cb_mouse_move(void *data, int type, void *event); +static Eina_Bool _e_container_cb_mouse_wheel(void *data, int type, void *event); -static void _e_container_shape_del(E_Container_Shape *es); -static void _e_container_shape_free(E_Container_Shape *es); -static void _e_container_shape_change_call(E_Container_Shape *es, E_Container_Shape_Change ch); -static void _e_container_resize_handle(E_Container *con); -static void _e_container_event_container_resize_free(void *data, void *ev); +static void _e_container_shape_del(E_Container_Shape *es); +static void _e_container_shape_free(E_Container_Shape *es); +static void _e_container_shape_change_call(E_Container_Shape *es, E_Container_Shape_Change ch); +static void _e_container_resize_handle(E_Container *con); +static void _e_container_event_container_resize_free(void *data, void *ev); EAPI int E_EVENT_CONTAINER_RESIZE = 0; static Eina_List *handlers = NULL; @@ -70,13 +70,13 @@ e_container_new(E_Manager *man) con->win = con->manager->win; if (!e_config->null_container_win) - con->bg_ecore_evas = e_canvas_new(con->win, - 0, 0, con->w, con->h, 1, 1, - &(con->bg_win)); + con->bg_ecore_evas = e_canvas_new(con->win, + 0, 0, con->w, con->h, 1, 1, + &(con->bg_win)); else - con->bg_ecore_evas = e_canvas_new(con->win, - 0, 0, 1, 1, 1, 1, - &(con->bg_win)); + con->bg_ecore_evas = e_canvas_new(con->win, + 0, 0, 1, 1, 1, 1, + &(con->bg_win)); e_canvas_add(con->bg_ecore_evas); con->event_win = ecore_x_window_input_new(con->win, 0, 0, con->w, con->h); ecore_x_window_show(con->event_win); @@ -130,50 +130,49 @@ e_container_new(E_Manager *man) /* init layers */ for (i = 0; i < 10; i++) { - con->layers[i].win = ecore_x_window_input_new(con->win, 0, 0, 1, 1); - ecore_x_window_lower(con->layers[i].win); + con->layers[i].win = ecore_x_window_input_new(con->win, 0, 0, 1, 1); + ecore_x_window_lower(con->layers[i].win); - if (i > 0) - ecore_x_window_configure(con->layers[i].win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - con->layers[i - 1].win, ECORE_X_WINDOW_STACK_ABOVE); + if (i > 0) + ecore_x_window_configure(con->layers[i].win, + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + con->layers[i - 1].win, ECORE_X_WINDOW_STACK_ABOVE); } /* Put init win on top */ if (man->initwin) ecore_x_window_configure(man->initwin, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - con->layers[6].win, ECORE_X_WINDOW_STACK_ABOVE); - + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + con->layers[6].win, ECORE_X_WINDOW_STACK_ABOVE); /* Put menu win on top */ mwin = e_menu_grab_window_get(); if (mwin) ecore_x_window_configure(mwin, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - con->layers[6].win, ECORE_X_WINDOW_STACK_ABOVE); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + con->layers[6].win, ECORE_X_WINDOW_STACK_ABOVE); /* Put background win at the bottom */ ecore_x_window_configure(con->bg_win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW); screens = (Eina_List *)e_xinerama_screens_get(); if (screens) { - E_Screen *scr; - EINA_LIST_FOREACH(screens, l, scr) - { - e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); - } + E_Screen *scr; + EINA_LIST_FOREACH(screens, l, scr) + { + e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); + } } else e_zone_new(con, 0, 0, 0, 0, con->w, con->h); @@ -188,17 +187,17 @@ e_container_show(E_Container *con) if (con->visible) return; if (!e_config->null_container_win) - ecore_evas_show(con->bg_ecore_evas); + ecore_evas_show(con->bg_ecore_evas); ecore_x_window_configure(con->bg_win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW); ecore_x_window_configure(con->event_win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + con->layers[0].win, ECORE_X_WINDOW_STACK_BELOW); if (con->win != con->manager->win) ecore_x_window_show(con->win); ecore_x_icccm_state_set(con->bg_win, ECORE_X_WINDOW_STATE_HINT_NORMAL); @@ -229,7 +228,7 @@ e_container_current_get(E_Manager *man) EINA_LIST_FOREACH(man->containers, l, con) { if (!con) continue; - if (con->visible) return con; + if (con->visible) return con; } /* If no one is available, return the first */ @@ -248,7 +247,7 @@ e_container_number_get(E_Manager *man, int num) E_OBJECT_TYPE_CHECK_RETURN(man, E_MANAGER_TYPE, NULL); EINA_LIST_FOREACH(man->containers, l, con) { - if ((int) con->num == num) return con; + if ((int)con->num == num) return con; } return NULL; } @@ -277,7 +276,7 @@ e_container_resize(E_Container *con, int w, int h) ecore_x_window_resize(con->win, con->w, con->h); ecore_x_window_resize(con->event_win, con->w, con->h); if (!e_config->null_container_win) - ecore_evas_resize(con->bg_ecore_evas, con->w, con->h); + ecore_evas_resize(con->bg_ecore_evas, con->w, con->h); evas_object_resize(con->bg_blank_object, con->w, con->h); _e_container_resize_handle(con); } @@ -295,7 +294,7 @@ e_container_move_resize(E_Container *con, int x, int y, int w, int h) ecore_x_window_move_resize(con->win, con->x, con->y, con->w, con->h); ecore_x_window_move_resize(con->event_win, con->x, con->y, con->w, con->h); if (!e_config->null_container_win) - ecore_evas_resize(con->bg_ecore_evas, con->w, con->h); + ecore_evas_resize(con->bg_ecore_evas, con->w, con->h); evas_object_move(con->bg_blank_object, con->x, con->y); evas_object_resize(con->bg_blank_object, con->w, con->h); _e_container_resize_handle(con); @@ -325,8 +324,8 @@ e_container_zone_at_point_get(E_Container *con, int x, int y) E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL); EINA_LIST_FOREACH(con->zones, l, zone) { - if (E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h)) - return zone; + if (E_INSIDE(x, y, zone->x, zone->y, zone->w, zone->h)) + return zone; } return NULL; } @@ -341,7 +340,7 @@ e_container_zone_number_get(E_Container *con, int num) E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL); EINA_LIST_FOREACH(con->zones, l, zone) { - if ((int) zone->num == num) return zone; + if ((int)zone->num == num) return zone; } return NULL; } @@ -356,7 +355,7 @@ e_container_zone_id_get(E_Container *con, int id) E_OBJECT_TYPE_CHECK_RETURN(con, E_CONTAINER_TYPE, NULL); EINA_LIST_FOREACH(con->zones, l, zone) { - if (zone->id == id) return zone; + if (zone->id == id) return zone; } return NULL; } @@ -449,7 +448,7 @@ e_container_shape_container_get(E_Container_Shape *es) } EAPI void -e_container_shape_change_callback_add(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data) +e_container_shape_change_callback_add(E_Container *con, void (*func)(void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data) { E_Container_Shape_Callback *cb; @@ -463,7 +462,7 @@ e_container_shape_change_callback_add(E_Container *con, void (*func) (void *data } EAPI void -e_container_shape_change_callback_del(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data) +e_container_shape_change_callback_del(E_Container *con, void (*func)(void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data) { Eina_List *l = NULL; E_Container_Shape_Callback *cb = NULL; @@ -473,12 +472,12 @@ e_container_shape_change_callback_del(E_Container *con, void (*func) (void *data E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE); EINA_LIST_FOREACH(con->shape_change_cb, l, cb) { - if ((cb->func == func) && (cb->data == data)) - { - con->shape_change_cb = eina_list_remove_list(con->shape_change_cb, l); - free(cb); - return; - } + if ((cb->func == func) && (cb->data == data)) + { + con->shape_change_cb = eina_list_remove_list(con->shape_change_cb, l); + free(cb); + return; + } } } @@ -500,31 +499,31 @@ e_container_shape_rects_set(E_Container_Shape *es, Ecore_X_Rectangle *rects, int E_OBJECT_TYPE_CHECK(es, E_CONTAINER_SHAPE_TYPE); if (es->shape) { - E_FREE_LIST(es->shape, free); - es->shape = NULL; + E_FREE_LIST(es->shape, free); + es->shape = NULL; } if ((rects) && (num == 1) && (rects[0].x == 0) && (rects[0].y == 0) && - ((int) rects[0].width == es->w) && - ((int) rects[0].height == es->h)) + ((int)rects[0].width == es->w) && + ((int)rects[0].height == es->h)) { - /* do nothing */ + /* do nothing */ } else if (rects) { - for (i = 0; i < num; i++) - { - r = malloc(sizeof(E_Rect)); - if (r) - { - r->x = rects[i].x; - r->y = rects[i].y; - r->w = rects[i].width; - r->h = rects[i].height; - es->shape = eina_list_append(es->shape, r); - } - } + for (i = 0; i < num; i++) + { + r = malloc(sizeof(E_Rect)); + if (r) + { + r->x = rects[i].x; + r->y = rects[i].y; + r->w = rects[i].width; + r->h = rects[i].height; + es->shape = eina_list_append(es->shape, r); + } + } } _e_container_shape_change_call(es, E_CONTAINER_SHAPE_RECTS); } @@ -568,15 +567,19 @@ e_container_border_add(E_Border *bd) if (!bd->zone) return; if (bd->layer == 0) pos = 0; - else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1; - else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2; - else if ((bd->layer > 100) && (bd->layer <= 150)) pos = 3; - else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4; + else if ((bd->layer > 0) && (bd->layer <= 50)) + pos = 1; + else if ((bd->layer > 50) && (bd->layer <= 100)) + pos = 2; + else if ((bd->layer > 100) && (bd->layer <= 150)) + pos = 3; + else if ((bd->layer > 150) && (bd->layer <= 200)) + pos = 4; else pos = 5; bd->zone->container->clients++; bd->zone->container->layers[pos].clients = - eina_list_append(bd->zone->container->layers[pos].clients, bd); + eina_list_append(bd->zone->container->layers[pos].clients, bd); e_hints_client_list_set(); } @@ -590,8 +593,8 @@ e_container_border_remove(E_Border *bd) * with pos now. */ for (i = 0; i < 10; i++) { - bd->zone->container->layers[i].clients = - eina_list_remove(bd->zone->container->layers[i].clients, bd); + bd->zone->container->layers[i].clients = + eina_list_remove(bd->zone->container->layers[i].clients, bd); } bd->zone->container->clients--; bd->zone = NULL; @@ -604,17 +607,21 @@ e_container_window_raise(E_Container *con, Ecore_X_Window win, int layer) int pos = 0; if (layer <= 0) pos = 0; - else if ((layer > 0) && (layer <= 50)) pos = 1; - else if ((layer > 50) && (layer <= 100)) pos = 2; - else if ((layer > 100) && (layer <= 150)) pos = 3; - else if ((layer > 150) && (layer <= 200)) pos = 4; + else if ((layer > 0) && (layer <= 50)) + pos = 1; + else if ((layer > 50) && (layer <= 100)) + pos = 2; + else if ((layer > 100) && (layer <= 150)) + pos = 3; + else if ((layer > 150) && (layer <= 200)) + pos = 4; else pos = 5; ecore_x_window_configure(win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - con->layers[pos + 1].win, ECORE_X_WINDOW_STACK_BELOW); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + con->layers[pos + 1].win, ECORE_X_WINDOW_STACK_BELOW); } EAPI void @@ -623,17 +630,21 @@ e_container_window_lower(E_Container *con, Ecore_X_Window win, int layer) int pos = 0; if (layer <= 0) pos = 0; - else if ((layer > 0) && (layer <= 50)) pos = 1; - else if ((layer > 50) && (layer <= 100)) pos = 2; - else if ((layer > 100) && (layer <= 150)) pos = 3; - else if ((layer > 150) && (layer <= 200)) pos = 4; + else if ((layer > 0) && (layer <= 50)) + pos = 1; + else if ((layer > 50) && (layer <= 100)) + pos = 2; + else if ((layer > 100) && (layer <= 150)) + pos = 3; + else if ((layer > 150) && (layer <= 200)) + pos = 4; else pos = 5; ecore_x_window_configure(win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - con->layers[pos].win, ECORE_X_WINDOW_STACK_ABOVE); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + con->layers[pos].win, ECORE_X_WINDOW_STACK_ABOVE); } EAPI E_Border * @@ -647,26 +658,30 @@ e_container_border_raise(E_Border *bd) /* Remove from old layer */ for (i = 0; i < 10; i++) { - bd->zone->container->layers[i].clients = - eina_list_remove(bd->zone->container->layers[i].clients, bd); + bd->zone->container->layers[i].clients = + eina_list_remove(bd->zone->container->layers[i].clients, bd); } /* Add to new layer */ if (bd->layer <= 0) pos = 0; - else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1; - else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2; - else if ((bd->layer > 100) && (bd->layer <= 150)) pos = 3; - else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4; + else if ((bd->layer > 0) && (bd->layer <= 50)) + pos = 1; + else if ((bd->layer > 50) && (bd->layer <= 100)) + pos = 2; + else if ((bd->layer > 100) && (bd->layer <= 150)) + pos = 3; + else if ((bd->layer > 150) && (bd->layer <= 200)) + pos = 4; else pos = 5; ecore_x_window_configure(bd->win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - bd->zone->container->layers[pos + 1].win, ECORE_X_WINDOW_STACK_BELOW); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + bd->zone->container->layers[pos + 1].win, ECORE_X_WINDOW_STACK_BELOW); bd->zone->container->layers[pos].clients = - eina_list_append(bd->zone->container->layers[pos].clients, bd); + eina_list_append(bd->zone->container->layers[pos].clients, bd); /* Find the window below this one */ l = eina_list_data_find_list(bd->zone->container->layers[pos].clients, bd); @@ -674,16 +689,16 @@ e_container_border_raise(E_Border *bd) above = eina_list_data_get(eina_list_prev(l)); else { - /* Need to check the layers below */ - for (i = pos - 1; i >= 0; i--) - { - if ((bd->zone->container->layers[i].clients) && - (l = eina_list_last(bd->zone->container->layers[i].clients))) - { - above = eina_list_data_get(l); - break; - } - } + /* Need to check the layers below */ + for (i = pos - 1; i >= 0; i--) + { + if ((bd->zone->container->layers[i].clients) && + (l = eina_list_last(bd->zone->container->layers[i].clients))) + { + above = eina_list_data_get(l); + break; + } + } } e_hints_client_stacking_set(); @@ -701,26 +716,30 @@ e_container_border_lower(E_Border *bd) /* Remove from old layer */ for (i = 0; i < 10; i++) { - bd->zone->container->layers[i].clients = - eina_list_remove(bd->zone->container->layers[i].clients, bd); + bd->zone->container->layers[i].clients = + eina_list_remove(bd->zone->container->layers[i].clients, bd); } /* Add to new layer */ if (bd->layer <= 0) pos = 0; - else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1; - else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2; - else if ((bd->layer > 100) && (bd->layer <= 150)) pos = 3; - else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4; + else if ((bd->layer > 0) && (bd->layer <= 50)) + pos = 1; + else if ((bd->layer > 50) && (bd->layer <= 100)) + pos = 2; + else if ((bd->layer > 100) && (bd->layer <= 150)) + pos = 3; + else if ((bd->layer > 150) && (bd->layer <= 200)) + pos = 4; else pos = 5; ecore_x_window_configure(bd->win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - bd->zone->container->layers[pos].win, ECORE_X_WINDOW_STACK_ABOVE); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + bd->zone->container->layers[pos].win, ECORE_X_WINDOW_STACK_ABOVE); bd->zone->container->layers[pos].clients = - eina_list_prepend(bd->zone->container->layers[pos].clients, bd); + eina_list_prepend(bd->zone->container->layers[pos].clients, bd); /* Find the window above this one */ l = eina_list_data_find_list(bd->zone->container->layers[pos].clients, bd); @@ -728,15 +747,15 @@ e_container_border_lower(E_Border *bd) below = eina_list_data_get(eina_list_next(l)); else { - /* Need to check the layers above */ - for (i = pos + 1; i < 10; i++) - { - if (bd->zone->container->layers[i].clients) - { - below = eina_list_data_get(bd->zone->container->layers[i].clients); - break; - } - } + /* Need to check the layers above */ + for (i = pos + 1; i < 10; i++) + { + if (bd->zone->container->layers[i].clients) + { + below = eina_list_data_get(bd->zone->container->layers[i].clients); + break; + } + } } e_hints_client_stacking_set(); @@ -752,28 +771,32 @@ e_container_border_stack_above(E_Border *bd, E_Border *above) /* Remove from old layer */ for (i = 0; i < 10; i++) { - bd->zone->container->layers[i].clients = - eina_list_remove(bd->zone->container->layers[i].clients, bd); + bd->zone->container->layers[i].clients = + eina_list_remove(bd->zone->container->layers[i].clients, bd); } /* Add to new layer */ bd->layer = above->layer; if (bd->layer <= 0) pos = 0; - else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1; - else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2; - else if ((bd->layer > 100) && (bd->layer <= 150)) pos = 3; - else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4; + else if ((bd->layer > 0) && (bd->layer <= 50)) + pos = 1; + else if ((bd->layer > 50) && (bd->layer <= 100)) + pos = 2; + else if ((bd->layer > 100) && (bd->layer <= 150)) + pos = 3; + else if ((bd->layer > 150) && (bd->layer <= 200)) + pos = 4; else pos = 5; ecore_x_window_configure(bd->win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - above->win, ECORE_X_WINDOW_STACK_ABOVE); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + above->win, ECORE_X_WINDOW_STACK_ABOVE); bd->zone->container->layers[pos].clients = - eina_list_append_relative(bd->zone->container->layers[pos].clients, bd, above); + eina_list_append_relative(bd->zone->container->layers[pos].clients, bd, above); } EAPI void @@ -785,28 +808,32 @@ e_container_border_stack_below(E_Border *bd, E_Border *below) /* Remove from old layer */ for (i = 0; i < 10; i++) { - bd->zone->container->layers[i].clients = - eina_list_remove(bd->zone->container->layers[i].clients, bd); + bd->zone->container->layers[i].clients = + eina_list_remove(bd->zone->container->layers[i].clients, bd); } /* Add to new layer */ bd->layer = below->layer; if (bd->layer <= 0) pos = 0; - else if ((bd->layer > 0) && (bd->layer <= 50)) pos = 1; - else if ((bd->layer > 50) && (bd->layer <= 100)) pos = 2; - else if ((bd->layer > 100) && (bd->layer <= 150)) pos = 3; - else if ((bd->layer > 150) && (bd->layer <= 200)) pos = 4; + else if ((bd->layer > 0) && (bd->layer <= 50)) + pos = 1; + else if ((bd->layer > 50) && (bd->layer <= 100)) + pos = 2; + else if ((bd->layer > 100) && (bd->layer <= 150)) + pos = 3; + else if ((bd->layer > 150) && (bd->layer <= 200)) + pos = 4; else pos = 5; ecore_x_window_configure(bd->win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - below->win, ECORE_X_WINDOW_STACK_BELOW); + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + below->win, ECORE_X_WINDOW_STACK_BELOW); bd->zone->container->layers[pos].clients = - eina_list_prepend_relative(bd->zone->container->layers[pos].clients, bd, below); + eina_list_prepend_relative(bd->zone->container->layers[pos].clients, bd, below); } static E_Border_List * @@ -824,7 +851,7 @@ _e_container_border_list_new(E_Container *con) for (i = 0; i < 10; i++) { EINA_LIST_FOREACH(con->layers[i].clients, l, bd) - eina_array_push(&(list->client_array), bd); + eina_array_push(&(list->client_array), bd); } return list; } @@ -836,7 +863,7 @@ _e_container_border_list_jump(E_Border_List *list, int dir) if ((list->pos < 0) || (list->pos >= (int)eina_array_count(&(list->client_array)))) - return NULL; + return NULL; bd = eina_array_data_get(&(list->client_array), list->pos); list->pos += dir; return bd; @@ -891,10 +918,10 @@ e_container_all_freeze(void) EINA_LIST_FOREACH(e_manager_list(), l, man) { - EINA_LIST_FOREACH(man->containers, ll, con) - { - evas_event_freeze(con->bg_evas); - } + EINA_LIST_FOREACH(man->containers, ll, con) + { + evas_event_freeze(con->bg_evas); + } } } @@ -907,10 +934,10 @@ e_container_all_thaw(void) EINA_LIST_FOREACH(e_manager_list(), l, man) { - EINA_LIST_FOREACH(man->containers, ll, con) - { - evas_event_thaw(con->bg_evas); - } + EINA_LIST_FOREACH(man->containers, ll, con) + { + evas_event_thaw(con->bg_evas); + } } } @@ -932,10 +959,10 @@ _e_container_free(E_Container *con) * looping (particularly remember/lock config dialogs). this is just * disabled until we put in some special handling for this * - EINA_LiST_FOREACH(con->layers[i].clients, l, tmp) - { - e_object_free(E_OBJECT(tmp)); - } + EINA_LiST_FOREACH(con->layers[i].clients, l, tmp) + { + e_object_free(E_OBJECT(tmp)); + } */ } l = con->zones; @@ -946,7 +973,7 @@ _e_container_free(E_Container *con) ecore_evas_free(con->bg_ecore_evas); if (con->manager->win != con->win) { - ecore_x_window_free(con->win); + ecore_x_window_free(con->win); } if (con->name) eina_stringshare_del(con->name); free(con); @@ -961,10 +988,10 @@ _e_container_find_by_event_window(Ecore_X_Window win) EINA_LIST_FOREACH(e_manager_list(), l, man) { - EINA_LIST_FOREACH(man->containers, ll, con) - { - if (con->event_win == win) return con; - } + EINA_LIST_FOREACH(man->containers, ll, con) + { + if (con->event_win == win) return con; + } } return NULL; } @@ -980,10 +1007,10 @@ _e_container_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event con = _e_container_find_by_event_window(ev->event_win); if (con) { - bd = e_border_focused_get(); - if (bd) e_focus_event_mouse_out(bd); - ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); - evas_event_feed_mouse_in(con->bg_evas, ev->time, NULL); + bd = e_border_focused_get(); + if (bd) e_focus_event_mouse_out(bd); + ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); + evas_event_feed_mouse_in(con->bg_evas, ev->time, NULL); } return ECORE_CALLBACK_PASS_ON; } @@ -998,9 +1025,9 @@ _e_container_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *even con = _e_container_find_by_event_window(ev->event_win); if (con) { - ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); - if (ev->mode == ECORE_X_EVENT_MODE_GRAB) - evas_event_feed_mouse_cancel(con->bg_evas, ev->time, NULL); + ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); + if (ev->mode == ECORE_X_EVENT_MODE_GRAB) + evas_event_feed_mouse_cancel(con->bg_evas, ev->time, NULL); evas_event_feed_mouse_out(con->bg_evas, ev->time, NULL); } return ECORE_CALLBACK_PASS_ON; @@ -1018,12 +1045,12 @@ _e_container_cb_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *eve { Evas_Button_Flags flags = EVAS_BUTTON_NONE; - e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_CONTAINER, - E_OBJECT(con), ev); - if (ev->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK; - if (ev->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK; - ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); - evas_event_feed_mouse_down(con->bg_evas, ev->buttons, flags, ev->timestamp, NULL); + e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_CONTAINER, + E_OBJECT(con), ev); + if (ev->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK; + if (ev->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK; + ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); + evas_event_feed_mouse_down(con->bg_evas, ev->buttons, flags, ev->timestamp, NULL); } return ECORE_CALLBACK_PASS_ON; } @@ -1039,9 +1066,9 @@ _e_container_cb_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event if (con) { evas_event_feed_mouse_up(con->bg_evas, ev->buttons, EVAS_BUTTON_NONE, ev->timestamp, NULL); - ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); - e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_CONTAINER, - E_OBJECT(con), ev); + ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); + e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_CONTAINER, + E_OBJECT(con), ev); } return ECORE_CALLBACK_PASS_ON; } @@ -1056,7 +1083,7 @@ _e_container_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *eve con = _e_container_find_by_event_window(ev->event_window); if (con) { - ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); + ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); evas_event_feed_mouse_move(con->bg_evas, ev->x, ev->y, ev->timestamp, NULL); } return 1; @@ -1072,12 +1099,12 @@ _e_container_cb_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *ev con = _e_container_find_by_event_window(ev->event_window); if (con) { - if (!e_bindings_wheel_event_handle(E_BINDING_CONTEXT_CONTAINER, - E_OBJECT(con), ev)) - { - ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); - evas_event_feed_mouse_wheel(con->bg_evas, ev->direction, ev->z, ev->timestamp, NULL); - } + if (!e_bindings_wheel_event_handle(E_BINDING_CONTEXT_CONTAINER, + E_OBJECT(con), ev)) + { + ecore_event_evas_modifier_lock_update(con->bg_evas, ev->modifiers); + evas_event_feed_mouse_wheel(con->bg_evas, ev->direction, ev->z, ev->timestamp, NULL); + } } return ECORE_CALLBACK_PASS_ON; } @@ -1105,8 +1132,8 @@ _e_container_shape_change_call(E_Container_Shape *es, E_Container_Shape_Change c if ((!es) || (!es->con) || (!es->con->shape_change_cb)) return; EINA_LIST_FOREACH(es->con->shape_change_cb, l, cb) { - if (!cb) continue; - cb->func(cb->data, es, ch); + if (!cb) continue; + cb->func(cb->data, es, ch); } } @@ -1139,11 +1166,11 @@ _e_container_resize_handle(E_Container *con) if (screens) { - EINA_LIST_FOREACH(con->zones, l, zone) - zones = eina_list_append(zones, zone); + EINA_LIST_FOREACH(con->zones, l, zone) + zones = eina_list_append(zones, zone); con->zones = NULL; - EINA_LIST_FOREACH(screens, l, scr) - { + EINA_LIST_FOREACH(screens, l, scr) + { zone = NULL; printf("@@@ SCREENS: %i %i | %i %i %ix%i\n", @@ -1153,77 +1180,77 @@ _e_container_resize_handle(E_Container *con) if (zone->id == scr->escreen) break; zone = NULL; } - if (zone) - { + if (zone) + { printf("@@@ FOUND ZONE %i %i [%p]\n", zone->num, zone->id, zone); - e_zone_move_resize(zone, scr->x, scr->y, scr->w, scr->h); - zones = eina_list_remove(zones, zone); + e_zone_move_resize(zone, scr->x, scr->y, scr->w, scr->h); + zones = eina_list_remove(zones, zone); con->zones = eina_list_append(con->zones, zone); zone->num = scr->screen; - e_shelf_zone_move_resize_handle(zone); - } - else - { - E_Config_Shelf *cf_es; + e_shelf_zone_move_resize_handle(zone); + } + else + { + E_Config_Shelf *cf_es; - zone = e_zone_new(con, scr->screen, scr->escreen, + zone = e_zone_new(con, scr->screen, scr->escreen, scr->x, scr->y, scr->w, scr->h); printf("@@@ NEW ZONE = %p\n", zone); - /* find any shelves configured for this zone and add them in */ - EINA_LIST_FOREACH(e_config->shelves, ll, cf_es) - { - if (e_util_container_zone_id_get(cf_es->container, + /* find any shelves configured for this zone and add them in */ + EINA_LIST_FOREACH(e_config->shelves, ll, cf_es) + { + if (e_util_container_zone_id_get(cf_es->container, cf_es->zone) == zone) e_shelf_config_new(zone, cf_es); - } - } - } + } + } + } con->zones = eina_list_sort(con->zones, eina_list_count(con->zones), _e_container_cb_zone_sort); - if (zones) - { - E_Zone *spare_zone = NULL; + if (zones) + { + E_Zone *spare_zone = NULL; if (con->zones) spare_zone = con->zones->data; - EINA_LIST_FREE(zones, zone) - { - Eina_List *shelves, *ll2, *del_shelves; - E_Shelf *es; - E_Border_List *bl; - E_Border *bd; + EINA_LIST_FREE(zones, zone) + { + Eina_List *shelves, *ll2, *del_shelves; + E_Shelf *es; + E_Border_List *bl; + E_Border *bd; - /* delete any shelves on this zone */ - shelves = e_shelf_list(); - del_shelves = NULL; - EINA_LIST_FOREACH(shelves, ll2, es) - { - if (es->zone == zone) - del_shelves = eina_list_append(del_shelves, es); - } - E_FREE_LIST(del_shelves, e_object_del); - bl = e_container_border_list_first(zone->container); - while ((bd = e_container_border_list_next(bl))) - { - if (bd->zone == zone) - { - if (spare_zone) e_border_zone_set(bd, spare_zone); - else - printf("EEEK! should not be here - but no\n" - "spare zones exist to move this\n" - "window to!!! help!\n"); - } - } - e_container_border_list_free(bl); - e_object_del(E_OBJECT(zone)); - } - } + /* delete any shelves on this zone */ + shelves = e_shelf_list(); + del_shelves = NULL; + EINA_LIST_FOREACH(shelves, ll2, es) + { + if (es->zone == zone) + del_shelves = eina_list_append(del_shelves, es); + } + E_FREE_LIST(del_shelves, e_object_del); + bl = e_container_border_list_first(zone->container); + while ((bd = e_container_border_list_next(bl))) + { + if (bd->zone == zone) + { + if (spare_zone) e_border_zone_set(bd, spare_zone); + else + printf("EEEK! should not be here - but no\n" + "spare zones exist to move this\n" + "window to!!! help!\n"); + } + } + e_container_border_list_free(bl); + e_object_del(E_OBJECT(zone)); + } + } } else { - E_Zone *z; + E_Zone *z; - z = e_container_zone_number_get(con, 0); + z = e_container_zone_number_get(con, 0); if (z) { e_zone_move_resize(z, 0, 0, con->w, con->h); @@ -1235,21 +1262,21 @@ _e_container_resize_handle(E_Container *con) for (i = 0; i < 10; i++) { - Eina_List *tmp = NULL; - E_Border *bd; + Eina_List *tmp = NULL; + E_Border *bd; - /* Make temporary list as e_border_res_change_geometry_restore - * rearranges the order. */ - EINA_LIST_FOREACH(con->layers[i].clients, l, bd) - tmp = eina_list_append(tmp, bd); + /* Make temporary list as e_border_res_change_geometry_restore + * rearranges the order. */ + EINA_LIST_FOREACH(con->layers[i].clients, l, bd) + tmp = eina_list_append(tmp, bd); - EINA_LIST_FOREACH(tmp, l, bd) - { - e_border_res_change_geometry_save(bd); - e_border_res_change_geometry_restore(bd); - } + EINA_LIST_FOREACH(tmp, l, bd) + { + e_border_res_change_geometry_save(bd); + e_border_res_change_geometry_restore(bd); + } - eina_list_free(tmp); + eina_list_free(tmp); } } @@ -1262,3 +1289,4 @@ _e_container_event_container_resize_free(void *data __UNUSED__, void *ev) e_object_unref(E_OBJECT(e->container)); free(e); } +