enlightenment/src/bin/e_dnd.h

167 lines
5.0 KiB
C
Raw Normal View History

#ifdef E_TYPEDEFS
typedef enum _E_Drag_Type
{
E_DRAG_NONE,
E_DRAG_INTERNAL,
E_DRAG_XDND
} E_Drag_Type;
2012-09-11 02:07:54 -07:00
typedef struct _E_Drag E_Drag;
typedef struct _E_Drop_Handler E_Drop_Handler;
typedef struct _E_Event_Dnd_Enter E_Event_Dnd_Enter;
typedef struct _E_Event_Dnd_Move E_Event_Dnd_Move;
typedef struct _E_Event_Dnd_Leave E_Event_Dnd_Leave;
typedef struct _E_Event_Dnd_Drop E_Event_Dnd_Drop;
typedef struct E_Dnd_X_Moz_Url E_Dnd_X_Moz_Url;
#else
#ifndef E_DND_H
#define E_DND_H
#define E_DRAG_TYPE 0xE0b0100f
2005-05-04 05:16:16 -07:00
struct _E_Drag
{
2012-09-11 02:07:54 -07:00
E_Object e_obj_inherit;
2012-09-11 02:07:54 -07:00
void *data;
int data_size;
2005-10-05 12:35:13 -07:00
2012-09-11 02:07:54 -07:00
E_Drag_Type type;
2012-06-20 23:19:43 -07:00
struct
2012-09-11 02:07:54 -07:00
{
void *(*convert)(E_Drag * drag, const char *type);
void (*finished)(E_Drag *drag, int dropped);
void (*key_down)(E_Drag *drag, Ecore_Event_Key *e);
void (*key_up)(E_Drag *drag, Ecore_Event_Key *e);
} cb;
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
E_Comp *comp;
2012-09-11 02:07:54 -07:00
Evas *evas;
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 *comp_object;
2012-09-11 02:07:54 -07:00
Evas_Object *object;
2012-09-11 02:07:54 -07:00
int x, y, w, h;
int dx, dy;
E_Layer layer;
2012-09-11 02:07:54 -07:00
unsigned char visible : 1;
2012-09-11 02:07:54 -07:00
unsigned int num_types;
const char *types[];
2005-05-04 05:16:16 -07:00
};
2005-04-24 09:04:20 -07:00
struct _E_Drop_Handler
{
2012-06-20 23:19:43 -07:00
struct
2012-09-11 02:07:54 -07:00
{
void (*enter)(void *data, const char *type, void *event);
void (*move)(void *data, const char *type, void *event);
void (*leave)(void *data, const char *type, void *event);
void (*drop)(void *data, const char *type, void *event);
Eina_Bool (*xds)(void *data, const char *type);
2012-09-11 02:07:54 -07:00
void *data;
} cb;
2012-09-11 02:07:54 -07:00
E_Object *obj;
Evas_Object *base;
2012-09-11 02:07:54 -07:00
int x, y, w, h;
2012-09-11 02:07:54 -07:00
const char *active_type;
Eina_Bool active : 1;
Eina_Bool entered : 1;
Eina_Bool hidden : 1;
2012-09-11 02:07:54 -07:00
unsigned int num_types;
Eina_Stringshare *types[];
};
struct _E_Event_Dnd_Enter
2005-04-25 11:02:26 -07:00
{
2012-09-11 02:07:54 -07:00
void *data;
int x, y;
Ecore_X_Atom action;
2005-04-25 11:02:26 -07:00
};
struct _E_Event_Dnd_Move
{
2012-09-11 02:07:54 -07:00
int x, y;
Ecore_X_Atom action;
};
struct _E_Event_Dnd_Leave
{
int x, y;
};
struct _E_Event_Dnd_Drop
{
void *data;
2012-09-11 02:07:54 -07:00
int x, y;
};
struct E_Dnd_X_Moz_Url
{
Eina_Inarray *links;
Eina_Inarray *link_names;
};
2012-09-11 02:07:54 -07:00
EINTERN int e_dnd_init(void);
EINTERN int e_dnd_shutdown(void);
2012-09-11 02:07:54 -07:00
EAPI int e_dnd_active(void);
/* x and y are the top left coords of the object that is to be dragged */
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
EAPI E_Drag *e_drag_new(E_Comp *comp, int x, int y,
2012-09-11 02:07:54 -07:00
const char **types, unsigned int num_types,
void *data, int size,
void *(*convert_cb)(E_Drag * drag, const char *type),
void (*finished_cb)(E_Drag *drag, int dropped));
EAPI Evas *e_drag_evas_get(const E_Drag *drag);
EAPI void e_drag_object_set(E_Drag *drag, Evas_Object *object);
EAPI void e_drag_move(E_Drag *drag, int x, int y);
EAPI void e_drag_resize(E_Drag *drag, int w, int h);
EAPI void e_drag_key_down_cb_set(E_Drag *drag, void (*func)(E_Drag *drag, Ecore_Event_Key *e));
EAPI void e_drag_key_up_cb_set(E_Drag *drag, void (*func)(E_Drag *drag, Ecore_Event_Key *e));
2005-05-04 05:16:16 -07:00
/* x and y are the coords where the mouse is when dragging starts */
2012-09-11 02:07:54 -07:00
EAPI int e_drag_start(E_Drag *drag, int x, int y);
EAPI int e_drag_xdnd_start(E_Drag *drag, int x, int y);
EAPI void e_drop_xds_update(Eina_Bool enable, const char *value);
EAPI void e_drop_handler_xds_set(E_Drop_Handler *handler, Eina_Bool (*cb)(void *data, const char *type));
EAPI E_Drop_Handler *e_drop_handler_add(E_Object *obj,
2012-09-11 02:07:54 -07:00
void *data,
void (*enter_cb)(void *data, const char *type, void *event),
void (*move_cb)(void *data, const char *type, void *event),
void (*leave_cb)(void *data, const char *type, void *event),
void (*drop_cb)(void *data, const char *type, void *event),
const char **types, unsigned int num_types,
int x, int y, int w, int h);
EAPI void e_drop_handler_geometry_set(E_Drop_Handler *handler, int x, int y, int w, int h);
EAPI int e_drop_inside(const E_Drop_Handler *handler, int x, int y);
EAPI void e_drop_handler_del(E_Drop_Handler *handler);
EAPI int e_drop_xdnd_register_set(Ecore_X_Window win, int reg);
EAPI void e_drop_handler_responsive_set(E_Drop_Handler *handler);
EAPI int e_drop_handler_responsive_get(const E_Drop_Handler *handler);
EAPI void e_drop_handler_action_set(Ecore_X_Atom action);
EAPI Ecore_X_Atom e_drop_handler_action_get(void);
EAPI Eina_List *e_dnd_util_text_uri_list_convert(char *data, int size);
static inline void
e_drag_show(E_Drag *drag)
{
drag->visible = 1;
}
static inline void
e_drag_hide(E_Drag *drag)
{
drag->visible = 0;
}
#endif
#endif