formatting

SVN revision: 71577
This commit is contained in:
Mike Blumenkrantz 2012-05-31 10:12:03 +00:00
parent df6ccc8374
commit 89da028fe0
3 changed files with 182 additions and 175 deletions

View File

@ -2,7 +2,7 @@
static void _e_xinerama_clean(void); static void _e_xinerama_clean(void);
static void _e_xinerama_update(void); static void _e_xinerama_update(void);
static int _e_xinerama_cb_screen_sort(const void *data1, const void *data2); static int _e_xinerama_cb_screen_sort(const void *data1, const void *data2);
static Eina_List *all_screens = NULL; static Eina_List *all_screens = NULL;
static Eina_List *chosen_screens = NULL; static Eina_List *chosen_screens = NULL;
@ -78,111 +78,111 @@ _e_xinerama_update(void)
roots = ecore_x_window_root_list(&n); roots = ecore_x_window_root_list(&n);
if (roots) if (roots)
{ {
int i; int i;
int rw, rh; int rw, rh;
Ecore_X_Window root; Ecore_X_Window root;
/* more than 1 root window - xinerama wont be active */ /* more than 1 root window - xinerama wont be active */
if (n > 1) if (n > 1)
{ {
free(roots); free(roots);
return; return;
} }
/* first (and only) root window */ /* first (and only) root window */
root = roots[0]; root = roots[0];
free(roots); free(roots);
/* get root size */ /* get root size */
ecore_x_window_size_get(root, &rw, &rh); ecore_x_window_size_get(root, &rw, &rh);
/* get number of xinerama screens */ /* get number of xinerama screens */
n = ecore_x_xinerama_screen_count_get(); n = ecore_x_xinerama_screen_count_get();
if (n < 1) if (n < 1)
{ {
E_Screen *screen; E_Screen *screen;
screen = E_NEW(E_Screen, 1); screen = E_NEW(E_Screen, 1);
screen->screen = 0; screen->screen = 0;
screen->escreen = screen->screen; screen->escreen = screen->screen;
screen->x = 0; screen->x = 0;
screen->y = 0; screen->y = 0;
screen->w = rw; screen->w = rw;
screen->h = rh; screen->h = rh;
all_screens = eina_list_append(all_screens, screen); all_screens = eina_list_append(all_screens, screen);
} }
else else
{ {
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
int x, y, w, h; int x, y, w, h;
/* get each xinerama screen geometry */ /* get each xinerama screen geometry */
if (ecore_x_xinerama_screen_geometry_get(i, &x, &y, &w, &h)) if (ecore_x_xinerama_screen_geometry_get(i, &x, &y, &w, &h))
{ {
E_Screen *screen; E_Screen *screen;
printf("E17 INIT: XINERAMA SCREEN: [%i][%i], %ix%i+%i+%i\n", printf("E17 INIT: XINERAMA SCREEN: [%i][%i], %ix%i+%i+%i\n",
i, i, w, h, x, y); i, i, w, h, x, y);
/* add it to our list */ /* add it to our list */
screen = E_NEW(E_Screen, 1); screen = E_NEW(E_Screen, 1);
screen->screen = i; screen->screen = i;
screen->escreen = screen->screen; screen->escreen = screen->screen;
screen->x = x; screen->x = x;
screen->y = y; screen->y = y;
screen->w = w; screen->w = w;
screen->h = h; screen->h = h;
all_screens = eina_list_append(all_screens, screen); all_screens = eina_list_append(all_screens, screen);
} }
} }
} }
} }
/* now go through all_screens... and build a list of chosen screens */ /* now go through all_screens... and build a list of chosen screens */
EINA_LIST_FOREACH(all_screens, l, scr) EINA_LIST_FOREACH (all_screens, l, scr)
{ {
Eina_List *ll; Eina_List *ll;
E_Screen *scr2; E_Screen *scr2;
int add = 1; int add = 1;
Eina_List *removes; Eina_List *removes;
removes = NULL; removes = NULL;
/* does this screen intersect with any we have chosen? */ /* does this screen intersect with any we have chosen? */
EINA_LIST_FOREACH(chosen_screens, ll, scr2) EINA_LIST_FOREACH(chosen_screens, ll, scr2)
{ {
/* if they intersect */ /* if they intersect */
if (E_INTERSECTS(scr->x, scr->y, scr->w, scr->h, if (E_INTERSECTS(scr->x, scr->y, scr->w, scr->h,
scr2->x, scr2->y, scr2->w, scr2->h)) scr2->x, scr2->y, scr2->w, scr2->h))
{ {
int sz, sz2; int sz, sz2;
/* calculate pixel area */ /* calculate pixel area */
sz = scr->w * scr->h; sz = scr->w * scr->h;
sz2 = scr2->w * scr2->h; sz2 = scr2->w * scr2->h;
/* if the one we already have is bigger, DONT add the new */ /* if the one we already have is bigger, DONT add the new */
if (sz > sz2) if (sz > sz2)
removes = eina_list_append(removes, scr2); removes = eina_list_append(removes, scr2);
/* add the old to a list to remove */ /* add the old to a list to remove */
else else
add = 0; add = 0;
} }
} }
/* if there are screens to remove - remove them */ /* if there are screens to remove - remove them */
EINA_LIST_FREE(removes, scr2) EINA_LIST_FREE(removes, scr2)
{ {
chosen_screens = eina_list_remove(chosen_screens, scr2); chosen_screens = eina_list_remove(chosen_screens, scr2);
} }
/* if this screen is to be added, add it */ /* if this screen is to be added, add it */
if (add) if (add)
chosen_screens = eina_list_append(chosen_screens, scr); chosen_screens = eina_list_append(chosen_screens, scr);
} }
chosen_screens = eina_list_sort(chosen_screens, chosen_screens = eina_list_sort(chosen_screens,
eina_list_count(chosen_screens), eina_list_count(chosen_screens),
_e_xinerama_cb_screen_sort); _e_xinerama_cb_screen_sort);
printf("======================= screens:\n"); printf("======================= screens:\n");
n = 0; n = 0;
EINA_LIST_FOREACH(chosen_screens, l, scr) EINA_LIST_FOREACH(chosen_screens, l, scr)
{ {
scr->escreen = n; scr->escreen = n;
printf("E17 INIT: XINERAMA CHOSEN: [%i][%i], %ix%i+%i+%i\n", printf("E17 INIT: XINERAMA CHOSEN: [%i][%i], %ix%i+%i+%i\n",
scr->screen, scr->escreen, scr->w, scr->h, scr->x, scr->y); scr->screen, scr->escreen, scr->w, scr->h, scr->x, scr->y);
n++; n++;
} }
} }
@ -200,8 +200,9 @@ _e_xinerama_cb_screen_sort(const void *data1, const void *data2)
return scr->y - scr2->y; return scr->y - scr2->y;
else else
{ {
dif = (scr2->w * scr2->h) - (scr->w * scr->h); dif = (scr2->w * scr2->h) - (scr->w * scr->h);
if (dif == 0) return scr->screen - scr2->screen; if (dif == 0) return scr->screen - scr2->screen;
} }
return dif; return dif;
} }

View File

@ -12,12 +12,12 @@ struct _E_Screen
int x, y, w, h; int x, y, w, h;
}; };
EINTERN int e_xinerama_init(void); EINTERN int e_xinerama_init(void);
EINTERN int e_xinerama_shutdown(void); EINTERN int e_xinerama_shutdown(void);
EAPI void e_xinerama_update(void); EAPI void e_xinerama_update(void);
EAPI const Eina_List *e_xinerama_screens_get(void); EAPI const Eina_List *e_xinerama_screens_get(void);
EAPI const Eina_List *e_xinerama_screens_all_get(void); EAPI const Eina_List *e_xinerama_screens_all_get(void);
EAPI void e_xinerama_fake_screen_add(int x, int y, int w, int h); EAPI void e_xinerama_fake_screen_add(int x, int y, int w, int h);
#endif #endif
#endif #endif

View File

@ -13,72 +13,76 @@ typedef enum _E_Zone_Edge
E_ZONE_EDGE_BOTTOM_LEFT E_ZONE_EDGE_BOTTOM_LEFT
} E_Zone_Edge; } E_Zone_Edge;
typedef struct _E_Zone E_Zone; typedef struct _E_Zone E_Zone;
typedef struct _E_Event_Zone_Desk_Count_Set E_Event_Zone_Desk_Count_Set; typedef struct _E_Event_Zone_Desk_Count_Set E_Event_Zone_Desk_Count_Set;
typedef struct _E_Event_Zone_Move_Resize E_Event_Zone_Move_Resize; typedef struct _E_Event_Zone_Move_Resize E_Event_Zone_Move_Resize;
typedef struct _E_Event_Zone_Add E_Event_Zone_Add; typedef struct _E_Event_Zone_Add E_Event_Zone_Add;
typedef struct _E_Event_Zone_Del E_Event_Zone_Del; typedef struct _E_Event_Zone_Del E_Event_Zone_Del;
/* TODO: Move this to a general place? */ /* TODO: Move this to a general place? */
typedef struct _E_Event_Pointer_Warp E_Event_Pointer_Warp; typedef struct _E_Event_Pointer_Warp E_Event_Pointer_Warp;
typedef struct _E_Event_Zone_Edge E_Event_Zone_Edge; typedef struct _E_Event_Zone_Edge E_Event_Zone_Edge;
#else #else
#ifndef E_ZONE_H #ifndef E_ZONE_H
#define E_ZONE_H #define E_ZONE_H
#define E_ZONE_TYPE (int) 0xE0b0100d #define E_ZONE_TYPE (int)0xE0b0100d
struct _E_Zone struct _E_Zone
{ {
E_Object e_obj_inherit; E_Object e_obj_inherit;
int x, y, w, h; int x, y, w, h;
const char *name; const char *name;
/* num matches the id of the xinerama screen /* num matches the id of the xinerama screen
* this zone belongs to. */ * this zone belongs to. */
unsigned int num; unsigned int num;
E_Container *container; E_Container *container;
int fullscreen; int fullscreen;
Evas_Object *bg_object; Evas_Object *bg_object;
Evas_Object *bg_event_object; Evas_Object *bg_event_object;
Evas_Object *bg_clip_object; Evas_Object *bg_clip_object;
Evas_Object *prev_bg_object; Evas_Object *prev_bg_object;
Evas_Object *transition_object; Evas_Object *transition_object;
int desk_x_count, desk_y_count;
int desk_x_current, desk_y_current;
E_Desk **desks;
Eina_List *handlers; int desk_x_count, desk_y_count;
int desk_x_current, desk_y_current;
E_Desk **desks;
struct { Eina_List *handlers;
unsigned char switching : 1;
E_Shelf *es; struct
E_Event_Zone_Edge *ev; {
E_Binding_Edge *bind; unsigned char switching : 1;
E_Shelf *es;
E_Event_Zone_Edge *ev;
E_Binding_Edge *bind;
} flip; } flip;
struct { struct
Ecore_X_Window top, right, bottom, left; {
Ecore_X_Window top, right, bottom, left;
} edge; } edge;
struct { struct
Ecore_X_Window left_top, top_left, top_right, right_top, {
right_bottom, bottom_right, bottom_left, left_bottom; Ecore_X_Window left_top, top_left, top_right, right_top,
right_bottom, bottom_right, bottom_left, left_bottom;
} corner; } corner;
E_Action *cur_mouse_action;
Eina_List *popups;
Ecore_Evas *black_ecore_evas; E_Action *cur_mouse_action;
Evas *black_evas; Eina_List *popups;
Ecore_X_Window black_win;
int black_need;
int id;
struct { Ecore_Evas *black_ecore_evas;
int x, y, w, h; Evas *black_evas;
Ecore_X_Window black_win;
int black_need;
int id;
struct
{
int x, y, w, h;
Eina_Bool dirty : 1; Eina_Bool dirty : 1;
} useful_geometry; } useful_geometry;
}; };
@ -88,7 +92,7 @@ struct _E_Event_Zone_Desk_Count_Set
E_Zone *zone; E_Zone *zone;
}; };
struct _E_Event_Zone_Move_Resize struct _E_Event_Zone_Move_Resize
{ {
E_Zone *zone; E_Zone *zone;
}; };
@ -105,50 +109,52 @@ struct _E_Event_Zone_Del
struct _E_Event_Pointer_Warp struct _E_Event_Pointer_Warp
{ {
struct { struct
int x, y; {
int x, y;
} prev; } prev;
struct { struct
int x, y; {
int x, y;
} curr; } curr;
}; };
struct _E_Event_Zone_Edge struct _E_Event_Zone_Edge
{ {
E_Zone *zone; E_Zone *zone;
E_Zone_Edge edge; E_Zone_Edge edge;
int x, y; int x, y;
int modifiers; int modifiers;
}; };
EINTERN int e_zone_init(void); EINTERN int e_zone_init(void);
EINTERN int e_zone_shutdown(void); EINTERN int e_zone_shutdown(void);
EAPI E_Zone *e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h); EAPI E_Zone *e_zone_new(E_Container *con, int num, int id, int x, int y, int w, int h);
EAPI void e_zone_name_set(E_Zone *zone, const char *name); EAPI void e_zone_name_set(E_Zone *zone, const char *name);
EAPI void e_zone_move(E_Zone *zone, int x, int y); EAPI void e_zone_move(E_Zone *zone, int x, int y);
EAPI void e_zone_resize(E_Zone *zone, int w, int h); EAPI void e_zone_resize(E_Zone *zone, int w, int h);
EAPI void e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h); EAPI void e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h);
EAPI void e_zone_fullscreen_set(E_Zone *zone, int on); EAPI void e_zone_fullscreen_set(E_Zone *zone, int on);
EAPI E_Zone *e_zone_current_get(E_Container *con); EAPI E_Zone *e_zone_current_get(E_Container *con);
EAPI void e_zone_bg_reconfigure(E_Zone *zone); EAPI void e_zone_bg_reconfigure(E_Zone *zone);
EAPI void e_zone_flip_coords_handle(E_Zone *zone, int x, int y); EAPI void e_zone_flip_coords_handle(E_Zone *zone, int x, int y);
EAPI void e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count); EAPI void e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count);
EAPI void e_zone_desk_count_get(E_Zone *zone, int *x_count, int *y_count); EAPI void e_zone_desk_count_get(E_Zone *zone, int *x_count, int *y_count);
EAPI void e_zone_desk_flip_by(E_Zone *zone, int dx, int dy); EAPI void e_zone_desk_flip_by(E_Zone *zone, int dx, int dy);
EAPI void e_zone_desk_flip_to(E_Zone *zone, int x, int y); EAPI void e_zone_desk_flip_to(E_Zone *zone, int x, int y);
EAPI void e_zone_desk_linear_flip_by(E_Zone *zone, int dx); EAPI void e_zone_desk_linear_flip_by(E_Zone *zone, int dx);
EAPI void e_zone_desk_linear_flip_to(E_Zone *zone, int x); EAPI void e_zone_desk_linear_flip_to(E_Zone *zone, int x);
EAPI void e_zone_edge_flip_eval(E_Zone *zone); EAPI void e_zone_edge_flip_eval(E_Zone *zone);
EAPI void e_zone_edge_new(E_Zone_Edge edge); EAPI void e_zone_edge_new(E_Zone_Edge edge);
EAPI void e_zone_edge_free(E_Zone_Edge edge); EAPI void e_zone_edge_free(E_Zone_Edge edge);
EAPI void e_zone_edge_enable(void); EAPI void e_zone_edge_enable(void);
EAPI void e_zone_edge_disable(void); EAPI void e_zone_edge_disable(void);
EAPI void e_zone_edges_desk_flip_capable(E_Zone *zone, Eina_Bool l, Eina_Bool r, Eina_Bool t, Eina_Bool b); EAPI void e_zone_edges_desk_flip_capable(E_Zone *zone, Eina_Bool l, Eina_Bool r, Eina_Bool t, Eina_Bool b);
EAPI Eina_Bool e_zone_exists_direction(E_Zone *zone, E_Zone_Edge edge); EAPI Eina_Bool e_zone_exists_direction(E_Zone *zone, E_Zone_Edge edge);
EAPI void e_zone_edge_win_layer_set(E_Zone *zone, int layer); EAPI void e_zone_edge_win_layer_set(E_Zone *zone, int layer);
EAPI void e_zone_useful_geometry_dirty(E_Zone *zone); EAPI void e_zone_useful_geometry_dirty(E_Zone *zone);
EAPI void e_zone_useful_geometry_get(E_Zone *zone, int *x, int *y, int *w, int *h); EAPI void e_zone_useful_geometry_get(E_Zone *zone, int *x, int *y, int *w, int *h);
extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET; extern EAPI int E_EVENT_ZONE_DESK_COUNT_SET;
extern EAPI int E_EVENT_ZONE_MOVE_RESIZE; extern EAPI int E_EVENT_ZONE_MOVE_RESIZE;