2005-04-23 06:13:57 -07:00
|
|
|
#ifdef E_TYPEDEFS
|
|
|
|
|
2006-09-16 23:12:48 -07:00
|
|
|
typedef enum _E_Drag_Type
|
|
|
|
{
|
|
|
|
E_DRAG_NONE,
|
|
|
|
E_DRAG_INTERNAL,
|
|
|
|
E_DRAG_XDND
|
|
|
|
} E_Drag_Type;
|
2005-10-08 06:10:20 -07:00
|
|
|
|
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;
|
2005-04-23 06:13:57 -07:00
|
|
|
|
|
|
|
#else
|
|
|
|
#ifndef E_DND_H
|
|
|
|
#define E_DND_H
|
|
|
|
|
2005-05-10 12:35:12 -07:00
|
|
|
#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;
|
2005-05-10 12:35:12 -07:00
|
|
|
|
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;
|
2005-10-08 06:10:20 -07:00
|
|
|
|
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;
|
|
|
|
|
|
|
|
E_Container *container;
|
|
|
|
Ecore_Evas *ecore_evas;
|
|
|
|
Evas *evas;
|
|
|
|
Ecore_X_Window evas_win;
|
2005-05-10 12:35:12 -07:00
|
|
|
E_Container_Shape *shape;
|
2012-09-11 02:07:54 -07:00
|
|
|
Evas_Object *object;
|
2005-05-10 12:35:12 -07:00
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
int x, y, w, h;
|
|
|
|
int dx, dy;
|
2005-05-10 12:35:12 -07:00
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
int shape_rects_num;
|
2005-06-27 03:08:53 -07:00
|
|
|
Ecore_X_Rectangle *shape_rects;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2012-10-02 01:54:35 -07:00
|
|
|
E_Layer layer;
|
2012-09-11 02:07:54 -07:00
|
|
|
unsigned char visible : 1;
|
|
|
|
unsigned char need_shape_export : 1;
|
|
|
|
unsigned char xy_update : 1;
|
2009-03-18 17:14:57 -07:00
|
|
|
|
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
|
2005-04-23 06:13:57 -07:00
|
|
|
{
|
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);
|
2012-10-18 01:04:03 -07:00
|
|
|
Eina_Bool (*xds)(void *data, const char *type);
|
2012-09-11 02:07:54 -07:00
|
|
|
void *data;
|
|
|
|
} cb;
|
2005-10-05 10:56:35 -07:00
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
E_Object *obj;
|
|
|
|
int x, y, w, h;
|
2007-01-02 22:17:45 -08:00
|
|
|
|
2009-05-26 07:44:19 -07:00
|
|
|
unsigned char active : 1;
|
|
|
|
unsigned char entered : 1;
|
2012-09-11 02:07:54 -07:00
|
|
|
const char *active_type;
|
|
|
|
unsigned int num_types;
|
|
|
|
const char *types[];
|
2005-04-23 06:13:57 -07:00
|
|
|
};
|
|
|
|
|
2005-05-10 11:15:16 -07:00
|
|
|
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;
|
2008-08-10 19:13:22 -07:00
|
|
|
Ecore_X_Atom action;
|
2005-04-25 11:02:26 -07:00
|
|
|
};
|
|
|
|
|
2005-05-10 11:15:16 -07:00
|
|
|
struct _E_Event_Dnd_Move
|
2005-05-01 08:55:01 -07:00
|
|
|
{
|
2012-09-11 02:07:54 -07:00
|
|
|
int x, y;
|
2008-08-10 19:13:22 -07:00
|
|
|
Ecore_X_Atom action;
|
2005-05-01 08:55:01 -07:00
|
|
|
};
|
|
|
|
|
2005-05-10 11:15:16 -07:00
|
|
|
struct _E_Event_Dnd_Leave
|
2005-05-03 10:27:42 -07:00
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
};
|
|
|
|
|
2005-05-10 11:15:16 -07:00
|
|
|
struct _E_Event_Dnd_Drop
|
2005-05-03 10:27:42 -07:00
|
|
|
{
|
|
|
|
void *data;
|
2012-09-11 02:07:54 -07:00
|
|
|
int x, y;
|
2005-05-03 10:27:42 -07:00
|
|
|
};
|
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
EINTERN int e_dnd_init(void);
|
|
|
|
EINTERN int e_dnd_shutdown(void);
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2012-09-11 02:07:54 -07:00
|
|
|
EAPI int e_dnd_active(void);
|
2005-04-26 02:36:18 -07:00
|
|
|
|
2005-05-14 22:20:18 -07:00
|
|
|
/* x and y are the top left coords of the object that is to be dragged */
|
2012-09-11 02:07:54 -07:00
|
|
|
EAPI E_Drag *e_drag_new(E_Container *container, int x, int y,
|
|
|
|
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_idler_before(void);
|
|
|
|
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
|
|
|
|
2005-05-14 22:20:18 -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);
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2012-09-11 09:17:24 -07:00
|
|
|
EAPI void e_drop_xds_update(Eina_Bool enable, const char *value);
|
2012-10-18 01:04:03 -07:00
|
|
|
EAPI void e_drop_handler_xds_set(E_Drop_Handler *handler, Eina_Bool (*cb)(void *data, const char *type));
|
2006-09-16 23:12:48 -07:00
|
|
|
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);
|
2009-05-26 07:44:19 -07:00
|
|
|
EAPI Ecore_X_Atom e_drop_handler_action_get(void);
|
2005-04-23 06:13:57 -07:00
|
|
|
|
2013-02-07 05:20:07 -08:00
|
|
|
EAPI Eina_List *e_dnd_util_text_uri_list_convert(char *data, int size);
|
2005-04-23 06:13:57 -07:00
|
|
|
#endif
|
|
|
|
#endif
|
2005-11-09 02:58:09 -08:00
|
|
|
|
|
|
|
#ifndef MIN
|
2009-05-26 07:44:19 -07:00
|
|
|
# define MIN(x, y) (((x) > (y)) ? (y) : (x))
|
2005-11-09 02:58:09 -08:00
|
|
|
#endif
|