* edje: Oops, fix drag.

SVN revision: 41691
This commit is contained in:
Cedric BAIL 2009-08-11 14:55:26 +00:00
parent 2ba87c1129
commit 8170df024a
3 changed files with 54 additions and 53 deletions

View File

@ -89,12 +89,12 @@ _edje_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
_edje_emit(ed, buf, rp->part->name);
}
if (rp->drag && rp->drag->events_to)
if (rp->events_to)
{
int x = 0, y = 0;
Edje_Real_Part *events;
events = rp->drag->events_to;
events = rp->events_to;
evas_object_geometry_get(rp->object, &x, &y, NULL, NULL);
if ((events->part->dragable.x) || (events->part->dragable.y))
@ -121,12 +121,12 @@ _edje_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
#endif
}
_edje_recalc_do(ed);
/*
/*
_edje_thaw(ed);
_edje_unref(ed);
_edje_ref(ed);
_edje_freeze(ed);
*/
*/
rp = events;
{
double dx = 0.0, dy = 0.0;
@ -150,7 +150,7 @@ _edje_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
}
}
if ((rp->part->dragable.x) || (rp->part->dragable.y))
if (rp->drag)
{
if (rp->drag->down.count == 0)
{
@ -163,6 +163,7 @@ _edje_mouse_down_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
}
rp->drag->down.count++;
}
if (rp->clicked_button == 0)
{
rp->clicked_button = ev->button;
@ -200,11 +201,9 @@ _edje_mouse_up_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
_edje_emit(ed, buf, rp->part->name);
}
if (rp->drag)
if (rp->events_to)
{
if (rp->drag->events_to)
{
rp = rp->drag->events_to;
rp = rp->events_to;
if (!ignored)
{
snprintf(buf, sizeof(buf), "mouse,up,%i", ev->button);
@ -212,6 +211,8 @@ _edje_mouse_up_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
}
}
if (rp->drag)
{
if (rp->drag->down.count > 0)
{
rp->drag->down.count--;
@ -255,7 +256,7 @@ _edje_mouse_move_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
ed = data;
rp = evas_object_data_get(obj, "real_part");
if (!rp) return;
if (rp->drag && rp->drag->events_to) rp = rp->drag->events_to;
if (rp->events_to) rp = rp->events_to;
ignored = rp->part->ignore_flags & ev->event_flags;

View File

@ -479,17 +479,17 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
{
if (rp->part->dragable.confine_id >= 0)
rp->drag->confine_to = ed->table_parts[rp->part->dragable.confine_id % ed->table_parts_size];
}
/* replay events for dragable */
if (rp->part->dragable.events_id >= 0)
{
rp->drag->events_to =
rp->events_to =
ed->table_parts[rp->part->dragable.events_id % ed->table_parts_size];
/* events_to may be used only with dragable */
if (!rp->drag->events_to->part->dragable.x &&
!rp->drag->events_to->part->dragable.y)
rp->drag->events_to = NULL;
}
if (!rp->events_to->part->dragable.x &&
!rp->events_to->part->dragable.y)
rp->events_to = NULL;
}
rp->swallow_params.min.w = 0;

View File

@ -785,9 +785,8 @@ struct _Edje_Real_Part_Drag
int x, y; // 8
} tmp;
unsigned char need_reset : 1; // 4
Edje_Real_Part *events_to; // 4
Edje_Real_Part *confine_to; // 4
}; // 104 // FIME: make drag pointer to struct optional
}; // 104
struct _Edje_Real_Part
{
@ -809,6 +808,7 @@ struct _Edje_Real_Part
} swallow_params; // 28 // FIXME: only if type SWALLOW
Edje_Real_Part_Drag *drag; // 4
Edje_Real_Part *events_to; // 4
struct {
Edje_Real_Part *source; // 4
@ -856,8 +856,8 @@ struct _Edje_Real_Part
#ifdef EDJE_CALC_CACHE
unsigned char invalidate : 1;
#endif
}; // 294
// WITH EDJE_CALC_CACHE: 774
}; // 298
// WITH EDJE_CALC_CACHE: 778
struct _Edje_Running_Program
{