enlightenment/src/bin/e_zone.h

190 lines
5.6 KiB
C
Raw Normal View History

#ifdef E_TYPEDEFS
typedef enum _E_Zone_Edge
{
E_ZONE_EDGE_NONE,
2007-11-22 12:08:07 -08:00
E_ZONE_EDGE_LEFT,
E_ZONE_EDGE_RIGHT,
E_ZONE_EDGE_TOP,
E_ZONE_EDGE_BOTTOM,
E_ZONE_EDGE_TOP_LEFT,
E_ZONE_EDGE_TOP_RIGHT,
E_ZONE_EDGE_BOTTOM_RIGHT,
E_ZONE_EDGE_BOTTOM_LEFT
} E_Zone_Edge;
2012-05-31 03:12:03 -07:00
typedef struct _E_Zone E_Zone;
2015-01-08 18:50:35 -08:00
typedef struct _E_Event_Zone_Generic E_Event_Zone_Desk_Count_Set;
typedef struct _E_Event_Zone_Generic E_Event_Zone_Move_Resize;
typedef struct _E_Event_Zone_Generic E_Event_Zone_Add;
typedef struct _E_Event_Zone_Generic E_Event_Zone_Del;
/* TODO: Move this to a general place? */
2012-05-31 03:12:03 -07:00
typedef struct _E_Event_Pointer_Warp E_Event_Pointer_Warp;
typedef struct _E_Event_Zone_Edge E_Event_Zone_Edge;
2015-01-08 18:50:35 -08:00
typedef struct _E_Event_Zone_Generic E_Event_Zone_Stow;
typedef struct _E_Event_Zone_Generic E_Event_Zone_Unstow;
typedef struct _E_Zone_Obstacle E_Zone_Obstacle;
#else
#ifndef E_ZONE_H
#define E_ZONE_H
2012-05-31 03:12:03 -07:00
#define E_ZONE_TYPE (int)0xE0b0100d
#define E_ZONE_OBSTACLE_TYPE (int)0xE0b0110d
struct _E_Zone
{
2012-05-31 03:12:03 -07:00
E_Object e_obj_inherit;
2012-05-31 03:12:03 -07:00
int x, y, w, h;
const char *name;
/* num matches the id of the xinerama screen
* this zone belongs to. */
2012-05-31 03:12:03 -07:00
unsigned int num;
int fullscreen;
Evas_Object *bg_object;
Evas_Object *bg_event_object;
Evas_Object *bg_clip_object;
Evas_Object *prev_bg_object;
Evas_Object *transition_object;
int desk_x_count, desk_y_count;
int desk_x_current, desk_y_current;
int desk_x_prev, desk_y_prev;
2012-05-31 03:12:03 -07:00
E_Desk **desks;
Eina_Inlist *obstacles;
2012-05-31 03:12:03 -07:00
Eina_List *handlers;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
/* formerly E_Comp_Zone */
Evas_Object *base;
Evas_Object *over;
E_Backlight_Mode bl_mode;
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
double bl;
Eina_Bool bloff;
2012-05-31 03:12:03 -07:00
struct
{
E_Zone_Edge switching;
2012-05-31 03:12:03 -07:00
E_Shelf *es;
E_Event_Zone_Edge *ev;
E_Binding_Edge *bind;
2005-04-22 01:19:39 -07:00
} flip;
2012-05-31 03:12:03 -07:00
struct
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
Evas_Object *top, *right, *bottom, *left;
} edge;
2012-05-31 03:12:03 -07:00
struct
{
compositor rewrite / charlie-foxtrot situation huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once. * compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine. ** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes ** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects ** protocol-specific window management and compositor functionality is now kept exclusively in backend files ** e_pixmap api provides generic client finding and rendering api ** screen/xinerama screens are now provided directly by compositor on startup and re-set on change ** e_comp_render_update finally replaced with eina_tiler ** wayland compositor no longer creates X windows ** compositor e_layout removed entirely * e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra * e_manager is just for screensaver and keybind stuff now, possibly remove later? * e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor ** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed. *** do NOT set interceptors on a client's comp_object. seriously. * startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor * ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get * e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas * deskmirror is (more) broken for now * illume is totally fucked * Ecore_X_Window replaced with Ecore_Window in most cases * edge binding XWindows replaced with regular canvas objects * some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result comp files and descriptions: e_comp.c - overall compositor functions, rendering/update loop, shape cutting e_comp_x.c - X window management and compositor functionality e_comp_wl.c - Wayland surface management and compositor functionality e_comp_canvas.c - general compositor canvas functions and utilities e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems additional authors: ivan.briano@intel.com feature: new compositor removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
Evas_Object *left_top, *top_left, *top_right, *right_top,
*right_bottom, *bottom_right, *bottom_left, *left_bottom;
} corner;
2012-05-31 03:12:03 -07:00
E_Action *cur_mouse_action;
int id;
2016-06-20 11:43:05 -07:00
void *output;
Eina_Rectangle useful_geometry[2];
char *randr2_id; // same id we get from randr2 so look it up there
Eina_Bool useful_geometry_changed E_BITFIELD;
Eina_Bool useful_geometry_dirty E_BITFIELD;
Eina_Bool stowed E_BITFIELD;
Eina_Bool desk_flip_sync E_BITFIELD;
};
2015-01-08 18:50:35 -08:00
struct _E_Event_Zone_Generic
{
E_Zone *zone;
};
struct _E_Event_Pointer_Warp
{
2012-05-31 03:12:03 -07:00
struct
{
int x, y;
} prev;
2012-05-31 03:12:03 -07:00
struct
{
int x, y;
} curr;
};
2007-11-22 12:08:07 -08:00
struct _E_Event_Zone_Edge
{
2012-05-31 03:12:03 -07:00
E_Zone *zone;
E_Zone_Edge edge;
int x, y;
int modifiers;
int button;
Eina_Bool drag E_BITFIELD;
2007-11-22 12:08:07 -08:00
};
struct _E_Zone_Obstacle
{
E_Object e_obj_inherit;
EINA_INLIST;
int x, y, w, h;
E_Object *owner;
Eina_Bool vertical E_BITFIELD;
};
2012-05-31 03:12:03 -07:00
EINTERN int e_zone_init(void);
EINTERN int e_zone_shutdown(void);
E_API E_Zone *e_zone_new(int num, int id, int x, int y, int w, int h);
E_API void e_zone_name_set(E_Zone *zone, const char *name);
E_API void e_zone_move(E_Zone *zone, int x, int y);
E_API void e_zone_resize(E_Zone *zone, int w, int h);
E_API Eina_Bool e_zone_move_resize(E_Zone *zone, int x, int y, int w, int h);
E_API E_Zone *e_zone_current_get(void);
E_API void e_zone_bg_reconfigure(E_Zone *zone);
E_API void e_zone_flip_coords_handle(E_Zone *zone, int x, int y);
E_API void e_zone_desk_count_set(E_Zone *zone, int x_count, int y_count);
E_API void e_zone_desk_count_get(E_Zone *zone, int *x_count, int *y_count);
E_API void e_zone_desk_flip_by(E_Zone *zone, int dx, int dy);
E_API void e_zone_desk_flip_to(E_Zone *zone, int x, int y);
E_API void e_zone_desk_linear_flip_by(E_Zone *zone, int dx);
E_API void e_zone_desk_linear_flip_to(E_Zone *zone, int x);
E_API void e_zone_edge_flip_eval(E_Zone *zone);
E_API void e_zone_edge_new(E_Zone_Edge edge);
E_API void e_zone_edge_free(E_Zone_Edge edge);
E_API void e_zone_edge_enable(void);
E_API void e_zone_edge_disable(void);
E_API void e_zone_edges_desk_flip_capable(E_Zone *zone, Eina_Bool l, Eina_Bool r, Eina_Bool t, Eina_Bool b);
E_API Eina_Bool e_zone_exists_direction(E_Zone *zone, E_Zone_Edge edge);
E_API void e_zone_edge_win_layer_set(E_Zone *zone, E_Layer layer);
E_API void e_zone_useful_geometry_dirty(E_Zone *zone);
E_API Eina_Bool e_zone_useful_geometry_get(E_Zone *zone, int *x, int *y, int *w, int *h);
E_API void e_zone_desk_useful_geometry_get(const E_Zone *zone, const E_Desk *desk, int *x, int *y, int *w, int *h);
E_API void e_zone_stow(E_Zone *zone);
E_API void e_zone_unstow(E_Zone *zone);
E_API void e_zone_fade_handle(E_Zone *zone, int out, double tim);
E_API E_Zone_Obstacle *e_zone_obstacle_add(E_Zone *zone, E_Desk *desk, Eina_Rectangle *geom, Eina_Bool vertical);
E_API void e_zone_obstacle_modify(E_Zone_Obstacle *obs, Eina_Rectangle *geom, Eina_Bool vertical);
E_API E_Zone *e_zone_for_id_get(const char *id);
extern E_API int E_EVENT_ZONE_DESK_COUNT_SET;
extern E_API int E_EVENT_ZONE_MOVE_RESIZE;
extern E_API int E_EVENT_ZONE_USEFUL_GEOMETRY_CHANGED;
extern E_API int E_EVENT_ZONE_ADD;
extern E_API int E_EVENT_ZONE_DEL;
extern E_API int E_EVENT_POINTER_WARP;
extern E_API int E_EVENT_ZONE_EDGE_IN;
extern E_API int E_EVENT_ZONE_EDGE_OUT;
extern E_API int E_EVENT_ZONE_EDGE_MOVE;
extern E_API int E_EVENT_ZONE_STOW;
extern E_API int E_EVENT_ZONE_UNSTOW;
#endif
#endif