3 typedef enum _E_Drag_Type
10 typedef struct _E_Drag E_Drag;
11 typedef struct _E_Drop_Handler E_Drop_Handler;
12 typedef struct _E_Event_Dnd_Enter E_Event_Dnd_Enter;
13 typedef struct _E_Event_Dnd_Move E_Event_Dnd_Move;
14 typedef struct _E_Event_Dnd_Leave E_Event_Dnd_Leave;
15 typedef struct _E_Event_Dnd_Drop E_Event_Dnd_Drop;
21 #define E_DRAG_TYPE 0xE0b0100f
25 E_Object e_obj_inherit;
34 void *(*convert)(E_Drag * drag, const char *type);
35 void (*finished)(E_Drag *drag, int dropped);
36 void (*key_down)(E_Drag *drag, Ecore_Event_Key *e);
37 void (*key_up)(E_Drag *drag, Ecore_Event_Key *e);
40 E_Container *container;
41 Ecore_Evas *ecore_evas;
43 Ecore_X_Window evas_win;
44 E_Container_Shape *shape;
51 Ecore_X_Rectangle *shape_rects;
54 unsigned char visible : 1;
55 unsigned char need_shape_export : 1;
56 unsigned char xy_update : 1;
58 unsigned int num_types;
62 struct _E_Drop_Handler
66 void (*enter)(void *data, const char *type, void *event);
67 void (*move)(void *data, const char *type, void *event);
68 void (*leave)(void *data, const char *type, void *event);
69 void (*drop)(void *data, const char *type, void *event);
77 unsigned char active : 1;
78 unsigned char entered : 1;
79 const char *active_type;
80 unsigned int num_types;
84 struct _E_Event_Dnd_Enter
91 struct _E_Event_Dnd_Move
97 struct _E_Event_Dnd_Leave
102 struct _E_Event_Dnd_Drop
108 EINTERN int e_dnd_init(void);
109 EINTERN int e_dnd_shutdown(void);
111 EAPI int e_dnd_active(void);
113 /* x and y are the top left coords of the object that is to be dragged */
114 EAPI E_Drag *e_drag_new(E_Container *container, int x, int y,
115 const char **types, unsigned int num_types,
116 void *data, int size,
117 void *(*convert_cb)(E_Drag * drag, const char *type),
118 void (*finished_cb)(E_Drag *drag, int dropped));
119 EAPI Evas *e_drag_evas_get(const E_Drag *drag);
120 EAPI void e_drag_object_set(E_Drag *drag, Evas_Object *object);
121 EAPI void e_drag_move(E_Drag *drag, int x, int y);
122 EAPI void e_drag_resize(E_Drag *drag, int w, int h);
123 EAPI void e_drag_idler_before(void);
124 EAPI void e_drag_key_down_cb_set(E_Drag *drag, void (*func)(E_Drag *drag, Ecore_Event_Key *e));
125 EAPI void e_drag_key_up_cb_set(E_Drag *drag, void (*func)(E_Drag *drag, Ecore_Event_Key *e));
127 /* x and y are the coords where the mouse is when dragging starts */
128 EAPI int e_drag_start(E_Drag *drag, int x, int y);
129 EAPI int e_drag_xdnd_start(E_Drag *drag, int x, int y);
131 EAPI void e_drop_xds_update(Eina_Bool enable, const char *value);
132 EAPI void e_drop_handler_xds_set(E_Drop_Handler *handler, Ecore_Task_Cb cb);
133 EAPI E_Drop_Handler *e_drop_handler_add(E_Object *obj,
135 void (*enter_cb)(void *data, const char *type, void *event),
136 void (*move_cb)(void *data, const char *type, void *event),
137 void (*leave_cb)(void *data, const char *type, void *event),
138 void (*drop_cb)(void *data, const char *type, void *event),
139 const char **types, unsigned int num_types,
140 int x, int y, int w, int h);
141 EAPI void e_drop_handler_geometry_set(E_Drop_Handler *handler, int x, int y, int w, int h);
142 EAPI int e_drop_inside(const E_Drop_Handler *handler, int x, int y);
143 EAPI void e_drop_handler_del(E_Drop_Handler *handler);
144 EAPI int e_drop_xdnd_register_set(Ecore_X_Window win, int reg);
145 EAPI void e_drop_handler_responsive_set(E_Drop_Handler *handler);
146 EAPI int e_drop_handler_responsive_get(const E_Drop_Handler *handler);
147 EAPI void e_drop_handler_action_set(Ecore_X_Atom action);
148 EAPI Ecore_X_Atom e_drop_handler_action_get(void);
154 # define MIN(x, y) (((x) > (y)) ? (y) : (x))