upgrade to teamwork v2, remove dbus (v1) usage

This commit is contained in:
Mike Blumenkrantz 2016-05-20 14:10:49 -04:00
parent 15fa7afaa5
commit f1e1a6edd8
7 changed files with 11 additions and 177 deletions

View File

@ -87,15 +87,6 @@ AM_CONDITIONAL([ENABLE_FUZZING], [test "${want_fuzzing}" = "yes"])
PKG_CHECK_MODULES([TERMINOLOGY], [${requirements}]) PKG_CHECK_MODULES([TERMINOLOGY], [${requirements}])
PKG_CHECK_MODULES([ELDBUS],
[eldbus],
[
AC_DEFINE(HAVE_ELDBUS, 1, [DBUS support])
have_eldbus="yes"
],
[have_eldbus="no"]
)
AC_CHECK_FUNCS(mkstemps) AC_CHECK_FUNCS(mkstemps)
AC_MSG_CHECKING([for ecore_con_url_head]) AC_MSG_CHECKING([for ecore_con_url_head])
@ -185,7 +176,6 @@ echo "Installation...............: make install (as root if needed, with 'su' or
echo " prefix...................: $prefix" echo " prefix...................: $prefix"
echo echo
echo "Features:" echo "Features:"
echo " dbus................: $have_eldbus"
echo " gettext.............: $have_po" echo " gettext.............: $have_po"
echo " fuzzing.............: $want_fuzzing" echo " fuzzing.............: $want_fuzzing"
echo echo

View File

@ -10,7 +10,7 @@ terminology_CPPFLAGS = -I. \
-DPACKAGE_BIN_DIR=\"$(bindir)\" -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_BIN_DIR=\"$(bindir)\" -DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" @TERMINOLOGY_CFLAGS@ -DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" @TERMINOLOGY_CFLAGS@
terminology_LDADD = @TERMINOLOGY_LIBS@ @ELDBUS_LIBS@ terminology_LDADD = @TERMINOLOGY_LIBS@
if HAVE_PO if HAVE_PO
terminology_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\" terminology_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"
terminology_LDADD += @LIBINTL@ terminology_LDADD += @LIBINTL@
@ -58,7 +58,6 @@ md5/md5.c md5/md5.h \
utf8.c utf8.h \ utf8.c utf8.h \
win.c win.h \ win.c win.h \
utils.c utils.h \ utils.c utils.h \
dbus.c dbus.h \
extns.c extns.h \ extns.c extns.h \
gravatar.c gravatar.h \ gravatar.c gravatar.h \
tty_keys.h tty_keys.h

View File

@ -1,114 +0,0 @@
#include "private.h"
#include <Elementary.h>
#include "dbus.h"
#ifdef HAVE_ELDBUS
#include <Eldbus.h>
static Eldbus_Connection *ty_dbus_conn = NULL;
static Eldbus_Object *ty_e_object = NULL;
static Eina_Stringshare *_current_url = NULL;
void
ty_dbus_link_hide(void)
{
Eldbus_Message *msg;
if ((!ty_e_object) || (!_current_url)) return;
msg = eldbus_message_method_call_new("org.enlightenment.wm.service",
"/org/enlightenment/wm/RemoteObject",
"org.enlightenment.wm.Teamwork",
"LinkHide");
eldbus_message_arguments_append(msg, "s", _current_url);
eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
eina_stringshare_replace(&_current_url, NULL);
}
void
ty_dbus_link_mouseout(uint64_t win, const char *url, int x, int y)
{
Eldbus_Message *msg;
if (!ty_e_object) return;
msg = eldbus_message_method_call_new("org.enlightenment.wm.service",
"/org/enlightenment/wm/RemoteObject",
"org.enlightenment.wm.Teamwork",
"LinkMouseOut");
#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR > 8) // not a typo
eldbus_message_arguments_append(msg, "sutii", url, time(NULL), win, x, y);
#else
eldbus_message_arguments_append(msg, "suxii", url, time(NULL), (int64_t)win, x, y);
#endif
eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
eina_stringshare_replace(&_current_url, NULL);
}
void
ty_dbus_link_mousein(uint64_t win, const char *url, int x, int y)
{
Eldbus_Message *msg;
Eina_Stringshare *u;
if (!ty_e_object) 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");
#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR > 8) // not a typo
eldbus_message_arguments_append(msg, "sutii", _current_url, time(NULL), win, x, y);
#else
eldbus_message_arguments_append(msg, "suxii", _current_url, time(NULL), (int64_t)win, x, y);
#endif
eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
}
void
ty_dbus_init(void)
{
if (ty_dbus_conn) return;
eldbus_init();
if (!elm_need_sys_notify())
{
WRN("no elementary system notification support");
}
ty_dbus_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
ty_e_object = eldbus_object_get(ty_dbus_conn,
"org.enlightenment.wm.service",
"/org/enlightenment/wm/RemoteObject");
}
void
ty_dbus_shutdown(void)
{
ty_dbus_link_hide();
if (ty_dbus_conn) eldbus_connection_unref(ty_dbus_conn);
ty_dbus_conn = NULL;
ty_e_object = NULL;
eldbus_shutdown();
}
#else
void ty_dbus_link_hide(void) {}
void ty_dbus_link_mousein (uint64_t win EINA_UNUSED, const char *url EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED) {}
void ty_dbus_link_mouseout(uint64_t win EINA_UNUSED, const char *url EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED) {}
void ty_dbus_init(void) {}
void ty_dbus_shutdown(void) {}
#endif

View File

@ -1,10 +0,0 @@
#ifndef _DBUS_H__
#define _DBUS_H__ 1
void ty_dbus_link_hide(void);
void ty_dbus_link_mousein(uint64_t win, const char *url, int x, int y);
void ty_dbus_link_mouseout(uint64_t win, const char *url, int x, int y);
void ty_dbus_init(void);
void ty_dbus_shutdown(void);
#endif

View File

@ -15,7 +15,6 @@
#include "utils.h" #include "utils.h"
#include "ipc.h" #include "ipc.h"
#include "sel.h" #include "sel.h"
#include "dbus.h"
#include "miniview.h" #include "miniview.h"
#include "gravatar.h" #include "gravatar.h"
#include "keyin.h" #include "keyin.h"
@ -974,8 +973,6 @@ remote:
ecore_evas_focus_set(ecore_evas_ecore_evas_get( ecore_evas_focus_set(ecore_evas_ecore_evas_get(
evas_object_evas_get(win)), 1); evas_object_evas_get(win)), 1);
ty_dbus_init();
ecore_con_init(); ecore_con_init();
ecore_con_url_init(); ecore_con_url_init();
@ -986,7 +983,6 @@ remote:
ecore_con_url_shutdown(); ecore_con_url_shutdown();
ecore_con_shutdown(); ecore_con_shutdown();
ty_dbus_shutdown();
config = NULL; config = NULL;
end: end:
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)

View File

@ -14,7 +14,6 @@
#include "config.h" #include "config.h"
#include "utils.h" #include "utils.h"
#include "media.h" #include "media.h"
#include "dbus.h"
#include "miniview.h" #include "miniview.h"
#include "gravatar.h" #include "gravatar.h"
@ -1138,21 +1137,9 @@ _update_link(Evas_Object *obj, Termio *sd,
if ((!popup_exists) && if ((!popup_exists) &&
((sd->link.string[0] == '/') || (link_is_url(sd->link.string)))) ((sd->link.string[0] == '/') || (link_is_url(sd->link.string))))
{ {
Evas_Coord _x = ox, _y = oy; #ifdef EFL_VERSION_1_18
uint64_t xwin; elm_win_teamwork_uri_show(win_evas_object_get(term_win_get(sd->term)), sd->link.string);
_x += sd->mouse.cx * sd->font.chw;
_y += sd->mouse.cy * sd->font.chh;
#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR >= 8)
xwin = elm_win_window_id_get(sd->win);
# if (ELM_VERSION_MAJOR > 1) || ((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR > 8)) // not a typo
if (strstr(ecore_evas_engine_name_get(ecore_evas_ecore_evas_get(evas_object_evas_get(sd->win))), "wayland"))
xwin = ((uint64_t)xwin << 32) + (uint64_t)getpid();
# endif
#else
xwin = elm_win_xwindow_get(sd->win);
#endif #endif
ty_dbus_link_mousein(xwin, sd->link.string, _x, _y);
} }
for (y = sd->link.y1; y <= sd->link.y2; y++) for (y = sd->link.y1; y <= sd->link.y2; y++)
{ {
@ -1210,26 +1197,9 @@ _remove_links(Termio *sd, Evas_Object *obj)
if (sd->link.string) if (sd->link.string)
{ {
if ((sd->link.string[0] == '/') || (link_is_url(sd->link.string))) #ifdef EFL_VERSION_1_18
{ elm_win_teamwork_uri_hide(win_evas_object_get(term_win_get(sd->term)));
Evas_Coord ox, oy;
uint64_t xwin;
evas_object_geometry_get(obj, &ox, &oy, NULL, NULL);
ox += sd->mouse.cx * sd->font.chw;
oy += sd->mouse.cy * sd->font.chh;
#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR >= 8)
xwin = elm_win_window_id_get(sd->win);
# if (ELM_VERSION_MAJOR > 1) || ((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR > 8)) // not a typo
if (strstr(ecore_evas_engine_name_get(ecore_evas_ecore_evas_get(evas_object_evas_get(sd->win))), "wayland"))
xwin = ((uint64_t)xwin << 32) + (uint64_t)getpid();
# endif
#else
xwin = elm_win_xwindow_get(sd->win);
#endif #endif
ty_dbus_link_mouseout(xwin, sd->link.string, ox, oy);
}
free(sd->link.string); free(sd->link.string);
sd->link.string = NULL; sd->link.string = NULL;
} }
@ -4439,7 +4409,9 @@ _smart_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
if (sd->ctxpopup) return; /* ctxp triggers mouse out we should ignore */ if (sd->ctxpopup) return; /* ctxp triggers mouse out we should ignore */
termio_mouseover_suspend_pushpop(data, 1); termio_mouseover_suspend_pushpop(data, 1);
ty_dbus_link_hide(); #ifdef EFL_VERSION_1_18
elm_win_teamwork_uri_hide(win_evas_object_get(term_win_get(sd->term)));
#endif
if ((ev->canvas.x == 0) || (ev->canvas.y == 0)) if ((ev->canvas.x == 0) || (ev->canvas.y == 0))
{ {
sd->mouse.cx = -1; sd->mouse.cx = -1;

View File

@ -10,7 +10,6 @@
#include "termio.h" #include "termio.h"
#include "utils.h" #include "utils.h"
#include "private.h" #include "private.h"
#include "dbus.h"
#include "sel.h" #include "sel.h"
#include "controls.h" #include "controls.h"
#include "term_container.h" #include "term_container.h"
@ -2981,7 +2980,9 @@ _popmedia_show(Term *term, const char *src, Media_Type type)
Config *config = termio_config_get(term->termio); Config *config = termio_config_get(term->termio);
EINA_SAFETY_ON_NULL_RETURN(config); EINA_SAFETY_ON_NULL_RETURN(config);
ty_dbus_link_hide(); #ifdef EFL_VERSION_1_18
elm_win_teamwork_uri_hide(term->wn->win);
#endif
if (term->popmedia) if (term->popmedia)
{ {
const char *s; const char *s;