Prepare for move callback.

SVN revision: 14530
This commit is contained in:
sebastid 2005-05-01 15:55:01 +00:00 committed by sebastid
parent 72707f1d9c
commit aa09ce4166
3 changed files with 22 additions and 7 deletions

View File

@ -197,9 +197,10 @@ e_drag_end(int x, int y)
h = l->data;
if ((x >= h->x) && (x < h->x + h->w) && (y >= h->y) && (y < h->y + h->h)
&& (!strcmp(h->type, drag_type)))
&& (!strcmp(h->type, drag_type))
&& (h->func.drop))
{
h->func(h->data, drag_type, ev);
h->func.drop(h->data, drag_type, ev);
}
}
@ -211,7 +212,10 @@ end:
}
E_Drop_Handler *
e_drop_handler_add(void *data, void (*func)(void *data, const char *type, void *drop), const char *type, int x, int y, int w, int h)
e_drop_handler_add(void *data,
void (*drop_func)(void *data, const char *type, void *event),
void (*move_func)(void *data, const char *type, void *event),
const char *type, int x, int y, int w, int h)
{
E_Drop_Handler *handler;
@ -219,7 +223,8 @@ e_drop_handler_add(void *data, void (*func)(void *data, const char *type, void *
if (!handler) return NULL;
handler->data = data;
handler->func = func;
handler->func.drop = drop_func;
handler->func.move = move_func;
handler->type = strdup(type);
handler->x = x;
handler->y = y;

View File

@ -6,6 +6,7 @@
typedef struct _E_Drop_Handler E_Drop_Handler;
typedef struct _E_Drop_Event E_Drop_Event;
typedef struct _E_Move_Event E_Move_Event;
#else
#ifndef E_DND_H
@ -14,7 +15,10 @@ typedef struct _E_Drop_Event E_Drop_Event;
struct _E_Drop_Handler
{
void *data;
void (*func)(void *data, const char *type, void *drop);
struct {
void (*drop)(void *data, const char *type, void *event);
void (*move)(void *data, const char *type, void *event);
} func;
char *type;
int x, y, w, h;
};
@ -25,6 +29,11 @@ struct _E_Drop_Event
int x, y;
};
struct _E_Move_Event
{
int x, y;
};
EAPI int e_dnd_init(void);
EAPI int e_dnd_shutdown(void);
@ -36,7 +45,8 @@ EAPI void e_drag_update(int x, int y);
EAPI void e_drag_end(int x, int y);
EAPI E_Drop_Handler *e_drop_handler_add(void *data,
void (*func)(void *data, const char *type, void *event_info),
void (*drop_func)(void *data, const char *type, void *event),
void (*move_func)(void *data, const char *type, void *event),
const char *type, int x, int y, int w, int h);
EAPI void e_drop_handler_del(E_Drop_Handler *handler);

View File

@ -341,7 +341,7 @@ _pager_face_new(E_Zone *zone)
edje_object_part_swallow(face->pager_object, "items", face->table_object);
evas_object_show(o);
face->drop_handler = e_drop_handler_add(face, _pager_drop_cb, "enlightenment/border",
face->drop_handler = e_drop_handler_add(face, _pager_drop_cb, NULL, "enlightenment/border",
face->fx, face->fy, face->fw, face->fh);
face->gmc = e_gadman_client_new(zone->container->gadman);