more accurate link mouse-out detection, fix teamwork signals, update teamwork to new api

devs/lucas/wip
Mike Blumenkrantz 10 years ago
parent 84ecbd67b1
commit b23fbc392b
  1. 44
      src/bin/dbus.c
  2. 5
      src/bin/dbus.h
  3. 49
      src/bin/termio.c

@ -9,7 +9,7 @@ static Eldbus_Object *ty_e_object = NULL;
static Eina_Stringshare *_current_url = NULL;
void
_cleanup_current_url(void)
ty_dbus_link_hide(void)
{
Eldbus_Message *msg;
@ -18,62 +18,54 @@ _cleanup_current_url(void)
msg = eldbus_message_method_call_new("org.enlightenment.wm.service",
"/org/enlightenment/wm/RemoteObject",
"org.enlightenment.wm.Teamwork",
"LinkMouseOut");
"LinkHide");
eldbus_message_arguments_append(msg, "suii",
_current_url, time(NULL), 0, 0);
eldbus_message_arguments_append(msg, "s", _current_url);
eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
eina_stringshare_del(_current_url);
_current_url = NULL;
eina_stringshare_replace(&_current_url, NULL);
}
void
ty_dbus_link_mouseout(const char *url, int x, int y)
ty_dbus_link_mouseout(int64_t win, const char *url, int x, int y)
{
Eldbus_Message *msg;
if (!ty_e_object) return;
if ((!url) ||
((_current_url) && (!strcmp(url, _current_url))))
{
_cleanup_current_url();
return;
}
_cleanup_current_url();
msg = eldbus_message_method_call_new("org.enlightenment.wm.service",
"/org/enlightenment/wm/RemoteObject",
"org.enlightenment.wm.Teamwork",
"LinkMouseOut");
eldbus_message_arguments_append(msg, "suii", url, time(NULL), x, y);
eldbus_message_arguments_append(msg, "suxii", url, time(NULL), win, x, y);
eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
eina_stringshare_replace(&_current_url, NULL);
}
void
ty_dbus_link_mousein(const char *url, int x, int y)
ty_dbus_link_mousein(int64_t win, const char *url, int x, int y)
{
Eldbus_Message *msg;
Eina_Stringshare *u;
if (!ty_e_object) return;
if ((_current_url) && (!strcmp(url, _current_url))) return;
u = eina_stringshare_add(url);
/* if previous link exists, do MouseOut now */
if (_current_url && (u != _current_url))
ty_dbus_link_mouseout(win, _current_url, x, y);
eina_stringshare_del(_current_url);
_current_url = u;
msg = eldbus_message_method_call_new("org.enlightenment.wm.service",
"/org/enlightenment/wm/RemoteObject",
"org.enlightenment.wm.Teamwork",
"LinkMouseIn");
_cleanup_current_url();
_current_url = eina_stringshare_add(url);
eldbus_message_arguments_append(msg, "suii",
_current_url, time(NULL), x, y);
eldbus_message_arguments_append(msg, "suxii",
_current_url, time(NULL), win, x, y);
eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
}
@ -93,7 +85,7 @@ ty_dbus_init(void)
void
ty_dbus_shutdown(void)
{
_cleanup_current_url();
ty_dbus_link_hide();
if (ty_dbus_conn) eldbus_connection_unref(ty_dbus_conn);
ty_dbus_conn = NULL;
ty_e_object = NULL;

@ -1,8 +1,9 @@
#ifndef _DBUS_H__
#define _DBUS_H__ 1
void ty_dbus_link_mousein(const char *url, int x, int y);
void ty_dbus_link_mouseout(const char *url, int x, int y);
void ty_dbus_link_hide(void);
void ty_dbus_link_mousein(int64_t win, const char *url, int x, int y);
void ty_dbus_link_mouseout(int64_t win, const char *url, int x, int y);
void ty_dbus_init(void);
void ty_dbus_shutdown(void);

@ -467,6 +467,18 @@ _update_link(Evas_Object *obj, Eina_Bool same_link, Eina_Bool same_geom)
}
if (sd->link.string)
{
if ((sd->link.string[0] == '/') || (link_is_url(sd->link.string)))
{
Evas_Coord ox, oy;
Ecore_X_Window xwin;
evas_object_geometry_get(obj, &ox, &oy, NULL, NULL);
ox += sd->mouse.cx * sd->font.chw;
oy += sd->mouse.cy * sd->font.chh;
xwin = elm_win_xwindow_get(sd->win);
ty_dbus_link_mousein(xwin, sd->link.string, ox, oy);
}
for (y = sd->link.y1; y <= sd->link.y2; y++)
{
o = edje_object_add(evas_object_evas_get(obj));
@ -533,14 +545,14 @@ _smart_mouseover_apply(Evas_Object *obj)
if ((sd->link.string[0] == '/') || (link_is_url(sd->link.string)))
{
Evas_Coord ox, oy;
int x, y;
Ecore_Window xwin;
evas_object_geometry_get(obj, &ox, &oy, NULL, NULL);
elm_win_screen_position_get(sd->win, &x, &y);
x += ox + sd->mouse.cx * sd->font.chw;
y += ox + sd->mouse.cy * sd->font.chh;
ty_dbus_link_mouseout(sd->link.string, x, y);
ox += sd->mouse.cx * sd->font.chw;
oy += sd->mouse.cy * sd->font.chh;
xwin = elm_win_xwindow_get(sd->win);
ty_dbus_link_mouseout(xwin, sd->link.string, ox, oy);
}
free(sd->link.string);
sd->link.string = NULL;
@ -558,19 +570,6 @@ _smart_mouseover_apply(Evas_Object *obj)
if (sd->link.string) free(sd->link.string);
sd->link.string = s;
if ((!same_link) && ((s[0] == '/') || (link_is_url(s))))
{
Evas_Coord ox, oy;
int x, y;
evas_object_geometry_get(obj, &ox, &oy, NULL, NULL);
elm_win_screen_position_get(sd->win, &x, &y);
x += ox + sd->mouse.cx * sd->font.chw;
y += ox + sd->mouse.cy * sd->font.chh;
ty_dbus_link_mousein(s, x, y);
}
if ((x1 == sd->link.x1) && (y1 == sd->link.y1) &&
(x2 == sd->link.x2) && (y2 == sd->link.y2))
same_geom = EINA_TRUE;
@ -3058,8 +3057,20 @@ _smart_cb_mouse_in(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
}
static void
_smart_cb_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
_smart_cb_mouse_out(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event)
{
Evas_Object *o;
Evas_Event_Mouse_Out *ev = event;
Termio *sd;
sd = evas_object_smart_data_get(data);
if (!sd) return;
if (!sd->link.down.dnd)
{
EINA_LIST_FREE(sd->link.objs, o)
evas_object_del(o);
}
ty_dbus_link_hide();
termio_mouseover_suspend_pushpop(data, 1);
}

Loading…
Cancel
Save