very early work on gravatar integration

devs/discomfitor/cc
Boris Faure 8 years ago
parent 32fb73b733
commit f3a0e92e56
  1. 1
      src/bin/Makefile.am
  2. 47
      src/bin/gravatar.c
  3. 9
      src/bin/gravatar.h
  4. 3
      src/bin/main.c
  5. 5
      src/bin/termio.c

@ -57,6 +57,7 @@ dbus.c dbus.h \
extns.c extns.h \
app_server.c app_server.h \
app_server_eet.c app_server_eet.h \
gravatar.c gravatar.h \
tty_keys.h
tybg_SOURCES = \

@ -0,0 +1,47 @@
#include "private.h"
#include <Elementary.h>
#include "gravatar.h"
/* specific log domain to help debug the gravatar module */
int _gravatar_log_dom = -1;
#undef CRITICAL
#undef ERR
#undef WRN
#undef INF
#undef DBG
#define CRIT(...) EINA_LOG_DOM_CRIT(_gravatar_log_dom, __VA_ARGS__)
#define ERR(...) EINA_LOG_DOM_ERR (_gravatar_log_dom, __VA_ARGS__)
#define WRN(...) EINA_LOG_DOM_WARN(_gravatar_log_dom, __VA_ARGS__)
#define INF(...) EINA_LOG_DOM_INFO(_gravatar_log_dom, __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG (_gravatar_log_dom, __VA_ARGS__)
void
gravatar_tooltip(const char *email)
{
DBG("need to show tooltip for email:%s", email);
/* TODO */
}
void
gravatar_init(void)
{
if (_gravatar_log_dom >= 0) return;
_gravatar_log_dom = eina_log_domain_register("gravatar", NULL);
if (_gravatar_log_dom < 0)
EINA_LOG_CRIT(_("Could not create logging domain '%s'."), "gravatar");
}
void
gravatar_shutdown(void)
{
if (_gravatar_log_dom < 0) return;
eina_log_domain_unregister(_gravatar_log_dom);
_gravatar_log_dom = -1;
}

@ -0,0 +1,9 @@
#ifndef _GRAVATAR_H__
#define _GRAVATAR_H__ 1
void gravatar_tooltip(const char *email);
void gravatar_init(void);
void gravatar_shutdown(void);
#endif

@ -19,6 +19,7 @@
#include "dbus.h"
#include "app_server.h"
#include "miniview.h"
#include "gravatar.h"
#include "keyin.h"
#if (ELM_VERSION_MAJOR == 1) && (ELM_VERSION_MINOR < 8)
@ -2330,6 +2331,7 @@ main_term_new(Win *wn, Config *config, const char *cmd,
termpty_init();
miniview_init();
gravatar_init();
term->wn = wn;
term->hold = hold;
@ -3392,6 +3394,7 @@ remote:
termpty_shutdown();
miniview_shutdown();
gravatar_shutdown();

@ -15,6 +15,7 @@
#include "media.h"
#include "dbus.h"
#include "miniview.h"
#include "gravatar.h"
#if defined (__MacOSX__) || (defined (__MACH__) && defined (__APPLE__))
# include <sys/proc_info.h>
@ -1146,6 +1147,10 @@ _update_link(Evas_Object *obj, Termio *sd,
#endif
ty_dbus_link_mousein(xwin, sd->link.string, _x, _y);
}
if ((!popup_exists) && link_is_email(sd->link.string))
{
gravatar_tooltip(sd->link.string);
}
for (y = sd->link.y1; y <= sd->link.y2; y++)
{
o = edje_object_add(evas_object_evas_get(obj));

Loading…
Cancel
Save