parent
7ec3dd0f41
commit
2a048b5005
|
@ -1251,6 +1251,36 @@ e_gadcon_client_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *
|
|||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
e_gadcon_client_viewport_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *h)
|
||||
{
|
||||
if (gcc->o_box) evas_object_geometry_get(gcc->o_base, x, y, w, h);
|
||||
else if (gcc->o_base) evas_object_geometry_get(gcc->o_base, x, y, w, h);
|
||||
else
|
||||
{
|
||||
if (x) *x = 0;
|
||||
if (y) *y = 0;
|
||||
if (w) *w = 0;
|
||||
if (h) *h = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* position x, y is in viewport coords, return is in object coords
|
||||
*/
|
||||
EAPI int
|
||||
e_gadcon_client_object_position_get(E_Gadcon_Client *gcc, int x, int y, int *rx, int *ry)
|
||||
{
|
||||
int xx = 0, yy = 0;
|
||||
|
||||
if (gcc->o_box) evas_object_geometry_get(gcc->o_box, &xx, &yy, NULL, NULL);
|
||||
else if (gcc->o_base) evas_object_geometry_get(gcc->o_base, &xx, &yy, NULL, NULL);
|
||||
if (rx) *rx = x + xx;
|
||||
if (ry) *ry = y + yy;
|
||||
return 1;
|
||||
}
|
||||
|
||||
EAPI E_Zone *
|
||||
e_gadcon_client_zone_get(E_Gadcon_Client *gcc)
|
||||
{
|
||||
|
|
|
@ -285,6 +285,8 @@ EAPI void e_gadcon_client_autoscroll_update(E_Gadcon_Client *gcc, in
|
|||
EAPI void e_gadcon_client_autoscroll_cb_set(E_Gadcon_Client *gcc, void (*func)(void *data), void *data);
|
||||
EAPI void e_gadcon_client_resizable_set(E_Gadcon_Client *gcc, int resizable);
|
||||
EAPI int e_gadcon_client_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *h);
|
||||
EAPI int e_gadcon_client_viewport_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *h);
|
||||
EAPI int e_gadcon_client_object_position_get(E_Gadcon_Client *gcc, int x, int y, int *rx, int *ry);
|
||||
EAPI E_Zone *e_gadcon_client_zone_get(E_Gadcon_Client *gcc);
|
||||
EAPI void e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu_main, E_Menu *menu_gadget, int flags);
|
||||
EAPI void e_gadcon_client_util_menu_attach(E_Gadcon_Client *gcc);
|
||||
|
|
|
@ -107,6 +107,7 @@ static void _ibar_inst_cb_enter(void *data, const char *type, void *event_info);
|
|||
static void _ibar_inst_cb_move(void *data, const char *type, void *event_info);
|
||||
static void _ibar_inst_cb_leave(void *data, const char *type, void *event_info);
|
||||
static void _ibar_inst_cb_drop(void *data, const char *type, void *event_info);
|
||||
static void _ibar_cb_drag_finished(E_Drag *data, int dropped);
|
||||
static void _ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y);
|
||||
static void _ibar_inst_cb_scroll(void *data);
|
||||
static Eina_Bool _ibar_cb_config_icon_theme(void *data, int ev_type, void *ev);
|
||||
|
@ -429,10 +430,7 @@ _ibar_instance_drop_zone_recalc(Instance *inst)
|
|||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
|
||||
if (inst->gcc->o_box)
|
||||
evas_object_geometry_get(inst->gcc->o_box, &x, &y, &w, &h);
|
||||
else
|
||||
evas_object_geometry_get(inst->o_ibar, &x, &y, &w, &h);
|
||||
e_gadcon_client_viewport_geometry_get(inst->gcc, &x, &y, &w, &h);
|
||||
e_drop_handler_geometry_set(inst->drop_handler, x, y, w, h);
|
||||
}
|
||||
|
||||
|
@ -906,7 +904,8 @@ _ibar_cb_icon_mouse_move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
|
|||
evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
|
||||
d = e_drag_new(ic->ibar->inst->gcc->gadcon->zone->container,
|
||||
x, y, drag_types, 1,
|
||||
ic->app, -1, NULL, NULL);
|
||||
ic->app, -1, NULL, _ibar_cb_drag_finished);
|
||||
efreet_desktop_ref(ic->app);
|
||||
size = MAX(w, h);
|
||||
o = e_util_desktop_icon_add(ic->app, size, e_drag_evas_get(d));
|
||||
e_drag_object_set(d, o);
|
||||
|
@ -969,6 +968,12 @@ _ibar_cb_drop_resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__
|
|||
evas_object_resize(b->o_drop_over, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
_ibar_cb_drag_finished(E_Drag *drag, int dropped)
|
||||
{
|
||||
efreet_desktop_unref(drag->data);
|
||||
}
|
||||
|
||||
static void
|
||||
_ibar_inst_cb_scroll(void *data)
|
||||
{
|
||||
|
@ -984,16 +989,15 @@ static void
|
|||
_ibar_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Evas_Coord xx, yy;
|
||||
int ox, oy;
|
||||
Evas_Coord ox, oy;
|
||||
IBar_Icon *ic;
|
||||
|
||||
inst->ibar->dnd_x = x;
|
||||
inst->ibar->dnd_y = y;
|
||||
|
||||
if (inst->ibar->o_drop) e_box_unpack(inst->ibar->o_drop);
|
||||
evas_object_geometry_get(inst->ibar->o_box, &xx, &yy, NULL, NULL);
|
||||
e_box_align_pixel_offset_get(inst->gcc->o_box, &ox, &oy);
|
||||
ic = _ibar_icon_at_coord(inst->ibar, x + xx + ox, y + yy + oy);
|
||||
e_gadcon_client_object_position_get(inst->gcc, x, y, &xx, &yy);
|
||||
ic = _ibar_icon_at_coord(inst->ibar, xx, yy);
|
||||
|
||||
/* This handles autoscrolling bars that would otherwise prevent us
|
||||
* from dropping in the very last spot in the ibar. This is not
|
||||
|
|
|
@ -449,10 +449,7 @@ _ibox_instance_drop_zone_recalc(Instance *inst)
|
|||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
|
||||
if (inst->gcc->o_box)
|
||||
evas_object_geometry_get(inst->gcc->o_box, &x, &y, &w, &h);
|
||||
else
|
||||
evas_object_geometry_get(inst->o_ibox, &x, &y, &w, &h);
|
||||
e_gadcon_client_viewport_geometry_get(inst->gcc, &x, &y, &w, &h);
|
||||
e_drop_handler_geometry_set(inst->drop_handler, x, y, w, h);
|
||||
}
|
||||
|
||||
|
@ -845,7 +842,6 @@ static void
|
|||
_ibox_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Evas_Coord xx, yy;
|
||||
int ox, oy;
|
||||
IBox_Icon *ic;
|
||||
|
||||
inst->ibox->dnd_x = x;
|
||||
|
@ -853,9 +849,8 @@ _ibox_drop_position_update(Instance *inst, Evas_Coord x, Evas_Coord y)
|
|||
|
||||
if (inst->ibox->o_drop)
|
||||
e_box_unpack(inst->ibox->o_drop);
|
||||
evas_object_geometry_get(inst->ibox->o_box, &xx, &yy, NULL, NULL);
|
||||
e_box_align_pixel_offset_get(inst->gcc->o_box, &ox, &oy);
|
||||
ic = _ibox_icon_at_coord(inst->ibox, x + xx + ox, y + yy + oy);
|
||||
e_gadcon_client_object_position_get(inst->gcc, x, y, &xx, &yy);
|
||||
ic = _ibox_icon_at_coord(inst->ibox, xx, yy);
|
||||
inst->ibox->ic_drop_before = ic;
|
||||
if (ic)
|
||||
{
|
||||
|
|
|
@ -857,10 +857,7 @@ _pager_instance_drop_zone_recalc(Instance *inst)
|
|||
{
|
||||
Evas_Coord x, y, w, h;
|
||||
|
||||
if (inst->gcc->o_box)
|
||||
evas_object_geometry_get(inst->gcc->o_box, &x, &y, &w, &h);
|
||||
else
|
||||
evas_object_geometry_get(inst->o_pager, &x, &y, &w, &h);
|
||||
e_gadcon_client_viewport_geometry_get(inst->gcc, &x, &y, &w, &h);
|
||||
e_drop_handler_geometry_set(inst->pager->drop_handler, x, y, w, h);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue