summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-05-20 14:10:49 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-05-20 15:37:55 -0400
commitf1e1a6edd8f5e80be5aa80d01845ae6054c1c4f4 (patch)
treefbd4e43790867c61e7961c30256e18d2dfb407d4
parent15fa7afaa5b6f33acb5889dd4136bf1b6c0faf27 (diff)
upgrade to teamwork v2, remove dbus (v1) usagedevs/discomfitor/teamwork
-rw-r--r--configure.ac10
-rw-r--r--src/bin/Makefile.am3
-rw-r--r--src/bin/dbus.c114
-rw-r--r--src/bin/dbus.h10
-rw-r--r--src/bin/main.c4
-rw-r--r--src/bin/termio.c42
-rw-r--r--src/bin/win.c5
7 files changed, 11 insertions, 177 deletions
diff --git a/configure.ac b/configure.ac
index 8a99fcf..b97ab3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,15 +87,6 @@ AM_CONDITIONAL([ENABLE_FUZZING], [test "${want_fuzzing}" = "yes"])
87 87
88PKG_CHECK_MODULES([TERMINOLOGY], [${requirements}]) 88PKG_CHECK_MODULES([TERMINOLOGY], [${requirements}])
89 89
90PKG_CHECK_MODULES([ELDBUS],
91 [eldbus],
92 [
93 AC_DEFINE(HAVE_ELDBUS, 1, [DBUS support])
94 have_eldbus="yes"
95 ],
96 [have_eldbus="no"]
97 )
98
99AC_CHECK_FUNCS(mkstemps) 90AC_CHECK_FUNCS(mkstemps)
100 91
101AC_MSG_CHECKING([for ecore_con_url_head]) 92AC_MSG_CHECKING([for ecore_con_url_head])
@@ -185,7 +176,6 @@ echo "Installation...............: make install (as root if needed, with 'su' or
185echo " prefix...................: $prefix" 176echo " prefix...................: $prefix"
186echo 177echo
187echo "Features:" 178echo "Features:"
188echo " dbus................: $have_eldbus"
189echo " gettext.............: $have_po" 179echo " gettext.............: $have_po"
190echo " fuzzing.............: $want_fuzzing" 180echo " fuzzing.............: $want_fuzzing"
191echo 181echo
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 7fb3a70..f34b168 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -10,7 +10,7 @@ terminology_CPPFLAGS = -I. \
10-DPACKAGE_BIN_DIR=\"$(bindir)\" -DPACKAGE_LIB_DIR=\"$(libdir)\" \ 10-DPACKAGE_BIN_DIR=\"$(bindir)\" -DPACKAGE_LIB_DIR=\"$(libdir)\" \
11-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" @TERMINOLOGY_CFLAGS@ 11-DPACKAGE_DATA_DIR=\"$(pkgdatadir)\" @TERMINOLOGY_CFLAGS@
12 12
13terminology_LDADD = @TERMINOLOGY_LIBS@ @ELDBUS_LIBS@ 13terminology_LDADD = @TERMINOLOGY_LIBS@
14if HAVE_PO 14if HAVE_PO
15terminology_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\" 15terminology_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"
16terminology_LDADD += @LIBINTL@ 16terminology_LDADD += @LIBINTL@
@@ -58,7 +58,6 @@ md5/md5.c md5/md5.h \
58utf8.c utf8.h \ 58utf8.c utf8.h \
59win.c win.h \ 59win.c win.h \
60utils.c utils.h \ 60utils.c utils.h \
61dbus.c dbus.h \
62extns.c extns.h \ 61extns.c extns.h \
63gravatar.c gravatar.h \ 62gravatar.c gravatar.h \
64tty_keys.h 63tty_keys.h
diff --git a/src/bin/dbus.c b/src/bin/dbus.c
deleted file mode 100644
index da24108..0000000
--- a/src/bin/dbus.c
+++ /dev/null
@@ -1,114 +0,0 @@
1#include "private.h"
2#include <Elementary.h>
3#include "dbus.h"
4#ifdef HAVE_ELDBUS
5#include <Eldbus.h>
6
7static Eldbus_Connection *ty_dbus_conn = NULL;
8static Eldbus_Object *ty_e_object = NULL;
9static Eina_Stringshare *_current_url = NULL;
10
11void
12ty_dbus_link_hide(void)
13{
14 Eldbus_Message *msg;
15
16 if ((!ty_e_object) || (!_current_url)) return;
17
18 msg = eldbus_message_method_call_new("org.enlightenment.wm.service",
19 "/org/enlightenment/wm/RemoteObject",
20 "org.enlightenment.wm.Teamwork",
21 "LinkHide");
22
23 eldbus_message_arguments_append(msg, "s", _current_url);
24 eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
25
26 eina_stringshare_replace(&_current_url, NULL);
27}
28
29void
30ty_dbus_link_mouseout(uint64_t win, const char *url, int x, int y)
31{
32 Eldbus_Message *msg;
33
34 if (!ty_e_object) return;
35
36 msg = eldbus_message_method_call_new("org.enlightenment.wm.service",
37 "/org/enlightenment/wm/RemoteObject",
38 "org.enlightenment.wm.Teamwork",
39 "LinkMouseOut");
40#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR > 8) // not a typo
41 eldbus_message_arguments_append(msg, "sutii", url, time(NULL), win, x, y);
42#else
43 eldbus_message_arguments_append(msg, "suxii", url, time(NULL), (int64_t)win, x, y);
44#endif
45 eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
46 eina_stringshare_replace(&_current_url, NULL);
47}
48
49
50void
51ty_dbus_link_mousein(uint64_t win, const char *url, int x, int y)
52{
53 Eldbus_Message *msg;
54 Eina_Stringshare *u;
55
56 if (!ty_e_object) return;
57
58 u = eina_stringshare_add(url);
59 /* if previous link exists, do MouseOut now */
60 if (_current_url && (u != _current_url))
61 ty_dbus_link_mouseout(win, _current_url, x, y);
62 eina_stringshare_del(_current_url);
63 _current_url = u;
64
65 msg = eldbus_message_method_call_new("org.enlightenment.wm.service",
66 "/org/enlightenment/wm/RemoteObject",
67 "org.enlightenment.wm.Teamwork",
68 "LinkMouseIn");
69
70#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR > 8) // not a typo
71 eldbus_message_arguments_append(msg, "sutii", _current_url, time(NULL), win, x, y);
72#else
73 eldbus_message_arguments_append(msg, "suxii", _current_url, time(NULL), (int64_t)win, x, y);
74#endif
75 eldbus_object_send(ty_e_object, msg, NULL, NULL, -1);
76}
77
78void
79ty_dbus_init(void)
80{
81 if (ty_dbus_conn) return;
82
83 eldbus_init();
84
85 if (!elm_need_sys_notify())
86 {
87 WRN("no elementary system notification support");
88 }
89
90 ty_dbus_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
91 ty_e_object = eldbus_object_get(ty_dbus_conn,
92 "org.enlightenment.wm.service",
93 "/org/enlightenment/wm/RemoteObject");
94}
95
96void
97ty_dbus_shutdown(void)
98{
99 ty_dbus_link_hide();
100 if (ty_dbus_conn) eldbus_connection_unref(ty_dbus_conn);
101 ty_dbus_conn = NULL;
102 ty_e_object = NULL;
103 eldbus_shutdown();
104}
105
106#else
107
108void ty_dbus_link_hide(void) {}
109void ty_dbus_link_mousein (uint64_t win EINA_UNUSED, const char *url EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED) {}
110void ty_dbus_link_mouseout(uint64_t win EINA_UNUSED, const char *url EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED) {}
111void ty_dbus_init(void) {}
112void ty_dbus_shutdown(void) {}
113
114#endif
diff --git a/src/bin/dbus.h b/src/bin/dbus.h
deleted file mode 100644
index 583539d..0000000
--- a/src/bin/dbus.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _DBUS_H__
2#define _DBUS_H__ 1
3
4void ty_dbus_link_hide(void);
5void ty_dbus_link_mousein(uint64_t win, const char *url, int x, int y);
6void ty_dbus_link_mouseout(uint64_t win, const char *url, int x, int y);
7void ty_dbus_init(void);
8void ty_dbus_shutdown(void);
9
10#endif
diff --git a/src/bin/main.c b/src/bin/main.c
index 5a76422..0dc43de 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -15,7 +15,6 @@
15#include "utils.h" 15#include "utils.h"
16#include "ipc.h" 16#include "ipc.h"
17#include "sel.h" 17#include "sel.h"
18#include "dbus.h"
19#include "miniview.h" 18#include "miniview.h"
20#include "gravatar.h" 19#include "gravatar.h"
21#include "keyin.h" 20#include "keyin.h"
@@ -974,8 +973,6 @@ remote:
974 ecore_evas_focus_set(ecore_evas_ecore_evas_get( 973 ecore_evas_focus_set(ecore_evas_ecore_evas_get(
975 evas_object_evas_get(win)), 1); 974 evas_object_evas_get(win)), 1);
976 975
977 ty_dbus_init();
978
979 ecore_con_init(); 976 ecore_con_init();
980 ecore_con_url_init(); 977 ecore_con_url_init();
981 978
@@ -986,7 +983,6 @@ remote:
986 ecore_con_url_shutdown(); 983 ecore_con_url_shutdown();
987 ecore_con_shutdown(); 984 ecore_con_shutdown();
988 985
989 ty_dbus_shutdown();
990 config = NULL; 986 config = NULL;
991 end: 987 end:
992#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) 988#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
diff --git a/src/bin/termio.c b/src/bin/termio.c
index f6434a4..0d77a03 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -14,7 +14,6 @@
14#include "config.h" 14#include "config.h"
15#include "utils.h" 15#include "utils.h"
16#include "media.h" 16#include "media.h"
17#include "dbus.h"
18#include "miniview.h" 17#include "miniview.h"
19#include "gravatar.h" 18#include "gravatar.h"
20 19
@@ -1138,21 +1137,9 @@ _update_link(Evas_Object *obj, Termio *sd,
1138 if ((!popup_exists) && 1137 if ((!popup_exists) &&
1139 ((sd->link.string[0] == '/') || (link_is_url(sd->link.string)))) 1138 ((sd->link.string[0] == '/') || (link_is_url(sd->link.string))))
1140 { 1139 {
1141 Evas_Coord _x = ox, _y = oy; 1140#ifdef EFL_VERSION_1_18
1142 uint64_t xwin; 1141 elm_win_teamwork_uri_show(win_evas_object_get(term_win_get(sd->term)), sd->link.string);
1143
1144 _x += sd->mouse.cx * sd->font.chw;
1145 _y += sd->mouse.cy * sd->font.chh;
1146#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR >= 8)
1147 xwin = elm_win_window_id_get(sd->win);
1148# if (ELM_VERSION_MAJOR > 1) || ((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR > 8)) // not a typo
1149 if (strstr(ecore_evas_engine_name_get(ecore_evas_ecore_evas_get(evas_object_evas_get(sd->win))), "wayland"))
1150 xwin = ((uint64_t)xwin << 32) + (uint64_t)getpid();
1151# endif
1152#else
1153 xwin = elm_win_xwindow_get(sd->win);
1154#endif 1142#endif
1155 ty_dbus_link_mousein(xwin, sd->link.string, _x, _y);
1156 } 1143 }
1157 for (y = sd->link.y1; y <= sd->link.y2; y++) 1144 for (y = sd->link.y1; y <= sd->link.y2; y++)
1158 { 1145 {
@@ -1210,26 +1197,9 @@ _remove_links(Termio *sd, Evas_Object *obj)
1210 1197
1211 if (sd->link.string) 1198 if (sd->link.string)
1212 { 1199 {
1213 if ((sd->link.string[0] == '/') || (link_is_url(sd->link.string))) 1200#ifdef EFL_VERSION_1_18
1214 { 1201 elm_win_teamwork_uri_hide(win_evas_object_get(term_win_get(sd->term)));
1215 Evas_Coord ox, oy;
1216 uint64_t xwin;
1217
1218 evas_object_geometry_get(obj, &ox, &oy, NULL, NULL);
1219
1220 ox += sd->mouse.cx * sd->font.chw;
1221 oy += sd->mouse.cy * sd->font.chh;
1222#if (ELM_VERSION_MAJOR > 1) || (ELM_VERSION_MINOR >= 8)
1223 xwin = elm_win_window_id_get(sd->win);
1224# if (ELM_VERSION_MAJOR > 1) || ((ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR > 8)) // not a typo
1225 if (strstr(ecore_evas_engine_name_get(ecore_evas_ecore_evas_get(evas_object_evas_get(sd->win))), "wayland"))
1226 xwin = ((uint64_t)xwin << 32) + (uint64_t)getpid();
1227# endif
1228#else
1229 xwin = elm_win_xwindow_get(sd->win);
1230#endif 1202#endif
1231 ty_dbus_link_mouseout(xwin, sd->link.string, ox, oy);
1232 }
1233 free(sd->link.string); 1203 free(sd->link.string);
1234 sd->link.string = NULL; 1204 sd->link.string = NULL;
1235 } 1205 }
@@ -4439,7 +4409,9 @@ _smart_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
4439 if (sd->ctxpopup) return; /* ctxp triggers mouse out we should ignore */ 4409 if (sd->ctxpopup) return; /* ctxp triggers mouse out we should ignore */
4440 4410
4441 termio_mouseover_suspend_pushpop(data, 1); 4411 termio_mouseover_suspend_pushpop(data, 1);
4442 ty_dbus_link_hide(); 4412#ifdef EFL_VERSION_1_18
4413 elm_win_teamwork_uri_hide(win_evas_object_get(term_win_get(sd->term)));
4414#endif
4443 if ((ev->canvas.x == 0) || (ev->canvas.y == 0)) 4415 if ((ev->canvas.x == 0) || (ev->canvas.y == 0))
4444 { 4416 {
4445 sd->mouse.cx = -1; 4417 sd->mouse.cx = -1;
diff --git a/src/bin/win.c b/src/bin/win.c
index 4eb85f8..3cdea68 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -10,7 +10,6 @@
10#include "termio.h" 10#include "termio.h"
11#include "utils.h" 11#include "utils.h"
12#include "private.h" 12#include "private.h"
13#include "dbus.h"
14#include "sel.h" 13#include "sel.h"
15#include "controls.h" 14#include "controls.h"
16#include "term_container.h" 15#include "term_container.h"
@@ -2981,7 +2980,9 @@ _popmedia_show(Term *term, const char *src, Media_Type type)
2981 Config *config = termio_config_get(term->termio); 2980 Config *config = termio_config_get(term->termio);
2982 2981
2983 EINA_SAFETY_ON_NULL_RETURN(config); 2982 EINA_SAFETY_ON_NULL_RETURN(config);
2984 ty_dbus_link_hide(); 2983#ifdef EFL_VERSION_1_18
2984 elm_win_teamwork_uri_hide(term->wn->win);
2985#endif
2985 if (term->popmedia) 2986 if (term->popmedia)
2986 { 2987 {
2987 const char *s; 2988 const char *s;