2004-11-26 02:53:38 -08:00
|
|
|
#include "e.h"
|
|
|
|
#include "e_mod_main.h"
|
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
#include <sys/time.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
/* actual module specifics */
|
|
|
|
typedef struct _Instance Instance;
|
2004-11-26 02:53:38 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
struct _Instance
|
|
|
|
{
|
|
|
|
E_Gadcon_Client *gcc;
|
2011-05-28 22:09:50 -07:00
|
|
|
Evas_Object *o_clock, *o_table, *o_popclock, *o_cal;
|
2011-05-27 23:53:44 -07:00
|
|
|
E_Gadcon_Popup *popup;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2012-09-21 01:16:50 -07:00
|
|
|
int madj;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2012-09-21 01:16:50 -07:00
|
|
|
char year[8];
|
2012-11-11 20:32:59 -08:00
|
|
|
char month[64];
|
2012-09-21 01:16:50 -07:00
|
|
|
const char *daynames[7];
|
|
|
|
unsigned char daynums[7][6];
|
|
|
|
Eina_Bool dayweekends[7][6];
|
|
|
|
Eina_Bool dayvalids[7][6];
|
|
|
|
Eina_Bool daytoday[7][6];
|
|
|
|
Config_Item *cfg;
|
2011-06-03 22:40:48 -07:00
|
|
|
};
|
2005-02-09 03:48:55 -08:00
|
|
|
|
2012-09-13 06:21:31 -07:00
|
|
|
/* gadcon requirements */
|
|
|
|
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
|
2012-09-21 01:16:50 -07:00
|
|
|
static void _gc_shutdown(E_Gadcon_Client *gcc);
|
|
|
|
static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
|
|
|
|
static const char *_gc_label(const E_Gadcon_Client_Class *client_class);
|
|
|
|
static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas);
|
|
|
|
static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class);
|
|
|
|
static Config_Item *_conf_item_get(const char *id);
|
|
|
|
static void _clock_popup_free(Instance *inst);
|
2012-09-13 06:21:31 -07:00
|
|
|
|
2012-09-21 01:37:04 -07:00
|
|
|
static Eio_Monitor *clock_tz_monitor = NULL;
|
2013-02-07 00:14:03 -08:00
|
|
|
static Eio_Monitor *clock_tz2_monitor = NULL;
|
2013-10-21 23:53:57 -07:00
|
|
|
static Eio_Monitor *clock_tzetc_monitor = NULL;
|
2012-09-21 01:37:04 -07:00
|
|
|
static Eina_List *clock_eio_handlers = NULL;
|
2011-08-14 15:27:46 -07:00
|
|
|
Config *clock_config = NULL;
|
2011-06-05 00:42:10 -07:00
|
|
|
|
2011-08-14 15:27:46 -07:00
|
|
|
static E_Config_DD *conf_edd = NULL;
|
|
|
|
static E_Config_DD *conf_item_edd = NULL;
|
2011-06-05 00:42:10 -07:00
|
|
|
static Eina_List *clock_instances = NULL;
|
2011-06-07 07:34:24 -07:00
|
|
|
static E_Action *act = NULL;
|
2011-08-17 13:13:23 -07:00
|
|
|
static Ecore_Timer *update_today = NULL;
|
2006-05-09 06:02:48 -07:00
|
|
|
|
2012-09-13 06:21:31 -07:00
|
|
|
/* and actually define the gadcon class that this module provides (just 1) */
|
|
|
|
static const E_Gadcon_Client_Class _gadcon_class =
|
|
|
|
{
|
|
|
|
GADCON_CLIENT_CLASS_VERSION,
|
2012-09-21 01:16:50 -07:00
|
|
|
"clock",
|
|
|
|
{
|
|
|
|
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL, NULL
|
|
|
|
},
|
2012-09-13 06:21:31 -07:00
|
|
|
E_GADCON_CLIENT_STYLE_PLAIN
|
|
|
|
};
|
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
static void
|
|
|
|
_clear_timestrs(Instance *inst)
|
|
|
|
{
|
|
|
|
int x;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
for (x = 0; x < 7; x++)
|
|
|
|
{
|
|
|
|
if (inst->daynames[x])
|
|
|
|
{
|
|
|
|
eina_stringshare_del(inst->daynames[x]);
|
|
|
|
inst->daynames[x] = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-11-11 20:32:59 -08:00
|
|
|
static void
|
|
|
|
_todaystr_eval(Instance *inst, char *buf, int bufsz)
|
|
|
|
{
|
|
|
|
if (!inst->cfg->show_date)
|
|
|
|
{
|
|
|
|
buf[0] = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
struct timeval timev;
|
|
|
|
struct tm *tm;
|
|
|
|
time_t tt;
|
|
|
|
|
|
|
|
tzset();
|
|
|
|
gettimeofday(&timev, NULL);
|
|
|
|
tt = (time_t)(timev.tv_sec);
|
|
|
|
tm = localtime(&tt);
|
|
|
|
if (tm)
|
|
|
|
{
|
|
|
|
if (inst->cfg->show_date == 1)
|
2012-12-25 10:05:10 -08:00
|
|
|
strftime(buf, bufsz, _("%a, %e %b, %Y"), (const struct tm *)tm);
|
2012-11-11 20:32:59 -08:00
|
|
|
else if (inst->cfg->show_date == 2)
|
2012-12-25 08:43:23 -08:00
|
|
|
strftime(buf, bufsz, _("%a, %x"), (const struct tm *)tm);
|
2012-11-20 19:10:41 -08:00
|
|
|
else if (inst->cfg->show_date == 3)
|
2012-12-25 10:05:10 -08:00
|
|
|
strftime(buf, bufsz, "%x", (const struct tm *)tm);
|
2012-11-11 20:32:59 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
buf[0] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
static void
|
|
|
|
_time_eval(Instance *inst)
|
|
|
|
{
|
2012-09-21 01:16:50 -07:00
|
|
|
struct timeval timev;
|
|
|
|
struct tm *tm, tms, tmm, tm2;
|
|
|
|
time_t tt;
|
|
|
|
int started = 0, num, i;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
tzset();
|
|
|
|
gettimeofday(&timev, NULL);
|
|
|
|
tt = (time_t)(timev.tv_sec);
|
|
|
|
tm = localtime(&tt);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
_clear_timestrs(inst);
|
|
|
|
if (tm)
|
|
|
|
{
|
|
|
|
int day;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
// tms == current date time "saved"
|
|
|
|
// tm2 == date to look at adjusting for madj
|
|
|
|
// tm2 == month baseline @ 1st
|
|
|
|
memcpy(&tms, tm, sizeof(struct tm));
|
|
|
|
num = 0;
|
2011-06-04 21:30:39 -07:00
|
|
|
for (day = (0 - 6); day < (31 + 16); day++)
|
2011-06-03 22:40:48 -07:00
|
|
|
{
|
|
|
|
memcpy(&tmm, &tms, sizeof(struct tm));
|
|
|
|
tmm.tm_sec = 0;
|
|
|
|
tmm.tm_min = 0;
|
|
|
|
tmm.tm_hour = 10;
|
|
|
|
tmm.tm_mon += inst->madj;
|
|
|
|
tmm.tm_mday = 1; // start at the 1st of the month
|
|
|
|
tmm.tm_wday = 0; // ignored by mktime
|
|
|
|
tmm.tm_yday = 0; // ignored by mktime
|
|
|
|
tmm.tm_isdst = 0; // ignored by mktime
|
|
|
|
tt = mktime(&tmm);
|
|
|
|
tm = localtime(&tt);
|
|
|
|
memcpy(&tm2, tm, sizeof(struct tm));
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
tt = mktime(&tmm);
|
|
|
|
tt += (day * 60 * 60 * 24);
|
|
|
|
tm = localtime(&tt);
|
|
|
|
memcpy(&tmm, tm, sizeof(struct tm));
|
|
|
|
if (!started)
|
|
|
|
{
|
2012-06-16 23:39:13 -07:00
|
|
|
if (tm->tm_wday == inst->cfg->week.start)
|
|
|
|
{
|
|
|
|
char buf[32];
|
|
|
|
|
|
|
|
for (i = 0; i < 7; i++, tm->tm_wday = (tm->tm_wday + 1) % 7)
|
|
|
|
{
|
|
|
|
strftime(buf, sizeof(buf), "%a", tm);
|
|
|
|
inst->daynames[i] = eina_stringshare_add(buf);
|
|
|
|
}
|
|
|
|
started = 1;
|
|
|
|
}
|
2011-06-03 22:40:48 -07:00
|
|
|
}
|
|
|
|
if (started)
|
|
|
|
{
|
|
|
|
int y = num / 7;
|
|
|
|
int x = num % 7;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-04 21:30:39 -07:00
|
|
|
if (y < 6)
|
2011-06-03 22:40:48 -07:00
|
|
|
{
|
|
|
|
inst->daynums[x][y] = tmm.tm_mday;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
inst->dayvalids[x][y] = 0;
|
|
|
|
if (tmm.tm_mon == tm2.tm_mon) inst->dayvalids[x][y] = 1;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
inst->daytoday[x][y] = 0;
|
|
|
|
if ((tmm.tm_mon == tms.tm_mon) &&
|
|
|
|
(tmm.tm_year == tms.tm_year) &&
|
|
|
|
(tmm.tm_mday == tms.tm_mday))
|
2012-09-21 01:16:50 -07:00
|
|
|
inst->daytoday[x][y] = 1;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
inst->dayweekends[x][y] = 0;
|
2011-08-14 15:27:46 -07:00
|
|
|
for (i = inst->cfg->weekend.start;
|
|
|
|
i < (inst->cfg->weekend.start + inst->cfg->weekend.len);
|
2011-06-03 22:40:48 -07:00
|
|
|
i++)
|
|
|
|
{
|
|
|
|
if (tmm.tm_wday == (i % 7))
|
|
|
|
{
|
|
|
|
inst->dayweekends[x][y] = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
num++;
|
|
|
|
}
|
|
|
|
}
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
memcpy(&tmm, &tms, sizeof(struct tm));
|
|
|
|
tmm.tm_sec = 0;
|
|
|
|
tmm.tm_min = 0;
|
|
|
|
tmm.tm_hour = 10;
|
|
|
|
tmm.tm_mon += inst->madj;
|
|
|
|
tmm.tm_mday = 1; // start at the 1st of the month
|
|
|
|
tmm.tm_wday = 0; // ignored by mktime
|
|
|
|
tmm.tm_yday = 0; // ignored by mktime
|
|
|
|
tmm.tm_isdst = 0; // ignored by mktime
|
|
|
|
tt = mktime(&tmm);
|
|
|
|
tm = localtime(&tt);
|
|
|
|
memcpy(&tm2, tm, sizeof(struct tm));
|
|
|
|
inst->year[sizeof(inst->year) - 1] = 0;
|
|
|
|
strftime(inst->year, sizeof(inst->year) - 1, "%Y", (const struct tm *)&tm2);
|
|
|
|
inst->month[sizeof(inst->month) - 1] = 0;
|
|
|
|
strftime(inst->month, sizeof(inst->month) - 1, "%B", (const struct tm *)&tm2); // %b for short month
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-27 23:53:44 -07:00
|
|
|
static void
|
2011-06-06 14:30:51 -07:00
|
|
|
_clock_month_update(Instance *inst)
|
2011-05-27 23:53:44 -07:00
|
|
|
{
|
2011-06-04 21:30:39 -07:00
|
|
|
Evas_Object *od, *oi;
|
2011-06-03 22:40:48 -07:00
|
|
|
int x, y;
|
2011-05-28 22:09:50 -07:00
|
|
|
|
2015-01-15 04:09:28 -08:00
|
|
|
oi = elm_layout_edje_get(inst->o_cal);
|
2011-06-03 22:40:48 -07:00
|
|
|
edje_object_part_text_set(oi, "e.text.month", inst->month);
|
|
|
|
edje_object_part_text_set(oi, "e.text.year", inst->year);
|
|
|
|
for (x = 0; x < 7; x++)
|
|
|
|
{
|
|
|
|
od = edje_object_part_table_child_get(oi, "e.table.daynames", x, 0);
|
|
|
|
edje_object_part_text_set(od, "e.text.label", inst->daynames[x]);
|
2012-04-30 04:02:45 -07:00
|
|
|
edje_object_message_signal_process(od);
|
2012-11-04 03:52:35 -08:00
|
|
|
if (inst->dayweekends[x][0])
|
|
|
|
edje_object_signal_emit(od, "e,state,weekend", "e");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(od, "e,state,weekday", "e");
|
2011-06-03 22:40:48 -07:00
|
|
|
}
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-04 21:30:39 -07:00
|
|
|
for (y = 0; y < 6; y++)
|
2011-06-03 22:40:48 -07:00
|
|
|
{
|
|
|
|
for (x = 0; x < 7; x++)
|
|
|
|
{
|
|
|
|
char buf[32];
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-03 22:40:48 -07:00
|
|
|
od = edje_object_part_table_child_get(oi, "e.table.days", x, y);
|
|
|
|
snprintf(buf, sizeof(buf), "%i", (int)inst->daynums[x][y]);
|
|
|
|
edje_object_part_text_set(od, "e.text.label", buf);
|
|
|
|
if (inst->dayweekends[x][y])
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(od, "e,state,weekend", "e");
|
2011-06-03 22:40:48 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(od, "e,state,weekday", "e");
|
2011-06-03 22:40:48 -07:00
|
|
|
if (inst->dayvalids[x][y])
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(od, "e,state,visible", "e");
|
2011-06-03 22:40:48 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(od, "e,state,hidden", "e");
|
2011-06-03 22:40:48 -07:00
|
|
|
if (inst->daytoday[x][y])
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(od, "e,state,today", "e");
|
2011-06-03 22:40:48 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(od, "e,state,someday", "e");
|
2012-04-30 04:02:45 -07:00
|
|
|
edje_object_message_signal_process(od);
|
2011-06-03 22:40:48 -07:00
|
|
|
}
|
|
|
|
}
|
2012-04-30 04:02:45 -07:00
|
|
|
edje_object_message_signal_process(oi);
|
2011-06-04 21:30:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_month_prev_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
2011-06-04 21:30:39 -07:00
|
|
|
{
|
|
|
|
Instance *inst = data;
|
|
|
|
inst->madj--;
|
|
|
|
_time_eval(inst);
|
2011-06-06 14:30:51 -07:00
|
|
|
_clock_month_update(inst);
|
2011-06-04 21:30:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_month_next_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
2011-06-04 21:30:39 -07:00
|
|
|
{
|
|
|
|
Instance *inst = data;
|
|
|
|
inst->madj++;
|
|
|
|
_time_eval(inst);
|
2011-06-06 14:30:51 -07:00
|
|
|
_clock_month_update(inst);
|
2011-06-04 21:30:39 -07:00
|
|
|
}
|
|
|
|
|
2011-06-05 00:42:10 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_settings_cb(void *d1, void *d2 EINA_UNUSED)
|
2011-06-05 00:42:10 -07:00
|
|
|
{
|
|
|
|
Instance *inst = d1;
|
2014-11-02 18:35:13 -08:00
|
|
|
e_int_config_clock_module(NULL, inst->cfg);
|
2012-10-04 03:05:40 -07:00
|
|
|
e_object_del(E_OBJECT(inst->popup));
|
2011-06-05 00:42:10 -07:00
|
|
|
inst->popup = NULL;
|
2013-03-30 19:58:41 -07:00
|
|
|
inst->o_popclock = NULL;
|
2012-09-13 06:21:31 -07:00
|
|
|
}
|
|
|
|
|
2013-03-30 19:58:41 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_popclock_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *info EINA_UNUSED)
|
2013-03-30 19:58:41 -07:00
|
|
|
{
|
|
|
|
Instance *inst = data;
|
|
|
|
if (inst->o_popclock == obj)
|
|
|
|
{
|
|
|
|
inst->o_popclock = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-04 21:30:39 -07:00
|
|
|
static void
|
|
|
|
_clock_popup_new(Instance *inst)
|
|
|
|
{
|
|
|
|
Evas *evas;
|
|
|
|
Evas_Object *o, *oi;
|
2012-11-11 20:32:59 -08:00
|
|
|
char todaystr[128];
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-04 21:30:39 -07:00
|
|
|
if (inst->popup) return;
|
2011-06-05 00:42:10 -07:00
|
|
|
|
2012-11-11 20:32:59 -08:00
|
|
|
_todaystr_eval(inst, todaystr, sizeof(todaystr) - 1);
|
|
|
|
|
2011-06-05 00:42:10 -07:00
|
|
|
inst->madj = 0;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-04 21:30:39 -07:00
|
|
|
_time_eval(inst);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
inst->popup = e_gadcon_popup_new(inst->gcc, 0);
|
2015-03-13 12:12:20 -07:00
|
|
|
evas = e_comp->evas;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2015-04-20 12:17:05 -07:00
|
|
|
inst->o_table = elm_table_add(e_comp->elm);
|
2011-06-04 21:30:39 -07:00
|
|
|
|
2015-04-20 12:17:05 -07:00
|
|
|
oi = elm_layout_add(inst->o_table);
|
2011-06-04 21:30:39 -07:00
|
|
|
inst->o_popclock = oi;
|
2015-01-15 04:09:28 -08:00
|
|
|
evas_object_size_hint_weight_set(oi, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
|
|
|
evas_object_size_hint_align_set(oi, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
2013-03-30 19:58:41 -07:00
|
|
|
evas_object_event_callback_add(oi, EVAS_CALLBACK_DEL, _popclock_del_cb, inst);
|
2015-01-15 04:09:28 -08:00
|
|
|
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->digital_clock)
|
2012-09-21 01:16:50 -07:00
|
|
|
e_theme_edje_object_set(oi, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/digital");
|
2011-06-05 05:15:44 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
e_theme_edje_object_set(oi, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/main");
|
2012-11-11 20:32:59 -08:00
|
|
|
if (inst->cfg->show_date)
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_signal_emit(oi, "e,state,date,on", "e");
|
2012-11-11 20:32:59 -08:00
|
|
|
else
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_signal_emit(oi, "e,state,date,off", "e");
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->digital_24h)
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_signal_emit(oi, "e,state,24h,on", "e");
|
2011-06-05 05:15:44 -07:00
|
|
|
else
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_signal_emit(oi, "e,state,24h,off", "e");
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->show_seconds)
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_signal_emit(oi, "e,state,seconds,on", "e");
|
2011-06-05 05:15:44 -07:00
|
|
|
else
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_signal_emit(oi, "e,state,seconds,off", "e");
|
2011-08-17 13:13:23 -07:00
|
|
|
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_part_text_set(oi, "e.text.today", todaystr);
|
2011-08-17 13:13:23 -07:00
|
|
|
|
2015-01-15 04:09:28 -08:00
|
|
|
elm_layout_sizing_eval(oi);
|
|
|
|
elm_table_pack(inst->o_table, oi, 0, 0, 1, 1);
|
2011-06-04 21:30:39 -07:00
|
|
|
evas_object_show(oi);
|
2015-01-15 04:09:28 -08:00
|
|
|
|
|
|
|
o = evas_object_rectangle_add(evas);
|
|
|
|
evas_object_size_hint_min_set(o, 80 * e_scale, 80 * e_scale);
|
|
|
|
elm_table_pack(inst->o_table, o, 0, 0, 1, 1);
|
2011-06-05 00:42:10 -07:00
|
|
|
|
|
|
|
o = e_widget_button_add(evas, _("Settings"), "preferences-system",
|
|
|
|
_clock_settings_cb, inst, NULL);
|
2015-01-15 04:09:28 -08:00
|
|
|
elm_table_pack(inst->o_table, o, 0, 2, 1, 1);
|
|
|
|
evas_object_show(o);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2015-04-20 12:17:05 -07:00
|
|
|
oi = elm_layout_add(inst->o_table);
|
2011-06-04 21:30:39 -07:00
|
|
|
inst->o_cal = oi;
|
|
|
|
e_theme_edje_object_set(oi, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/calendar");
|
2011-06-06 14:30:51 -07:00
|
|
|
_clock_month_update(inst);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_signal_callback_add(oi, "e,action,prev", "*",
|
2011-06-04 21:30:39 -07:00
|
|
|
_clock_month_prev_cb, inst);
|
2015-01-15 09:04:38 -08:00
|
|
|
elm_object_signal_callback_add(oi, "e,action,next", "*",
|
2011-06-04 21:30:39 -07:00
|
|
|
_clock_month_next_cb, inst);
|
2015-01-15 04:09:28 -08:00
|
|
|
edje_object_message_signal_process(elm_layout_edje_get(oi));
|
|
|
|
elm_layout_sizing_eval(oi);
|
|
|
|
elm_table_pack(inst->o_table, oi, 0, 1, 1, 1);
|
2011-06-03 19:47:42 -07:00
|
|
|
evas_object_show(oi);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2015-01-15 04:09:28 -08:00
|
|
|
evas_smart_objects_calculate(evas);
|
2011-05-28 22:09:50 -07:00
|
|
|
e_gadcon_popup_content_set(inst->popup, inst->o_table);
|
2011-05-27 23:53:44 -07:00
|
|
|
e_gadcon_popup_show(inst->popup);
|
|
|
|
}
|
|
|
|
|
2011-08-20 18:59:09 -07:00
|
|
|
static void
|
|
|
|
_eval_instance_size(Instance *inst)
|
|
|
|
{
|
|
|
|
Evas_Coord mw, mh, omw, omh;
|
|
|
|
|
|
|
|
edje_object_size_min_get(inst->o_clock, &mw, &mh);
|
|
|
|
omw = mw;
|
|
|
|
omh = mh;
|
|
|
|
|
|
|
|
if ((mw < 1) || (mh < 1))
|
|
|
|
{
|
|
|
|
Evas_Coord x, y, sw = 0, sh = 0, ow, oh;
|
|
|
|
Eina_Bool horiz;
|
|
|
|
const char *orient;
|
|
|
|
|
|
|
|
switch (inst->gcc->gadcon->orient)
|
|
|
|
{
|
|
|
|
case E_GADCON_ORIENT_TOP:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_TR:
|
|
|
|
case E_GADCON_ORIENT_BOTTOM:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BL:
|
|
|
|
case E_GADCON_ORIENT_CORNER_BR:
|
|
|
|
case E_GADCON_ORIENT_HORIZ:
|
2012-09-21 01:16:50 -07:00
|
|
|
horiz = EINA_TRUE;
|
|
|
|
orient = "e,state,horizontal";
|
|
|
|
break;
|
2011-08-20 18:59:09 -07:00
|
|
|
|
|
|
|
case E_GADCON_ORIENT_LEFT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_LT:
|
|
|
|
case E_GADCON_ORIENT_RIGHT:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RB:
|
|
|
|
case E_GADCON_ORIENT_CORNER_RT:
|
|
|
|
case E_GADCON_ORIENT_VERT:
|
2012-09-21 01:16:50 -07:00
|
|
|
horiz = EINA_FALSE;
|
|
|
|
orient = "e,state,vertical";
|
|
|
|
break;
|
2011-08-20 18:59:09 -07:00
|
|
|
|
|
|
|
default:
|
2012-09-21 01:16:50 -07:00
|
|
|
horiz = EINA_TRUE;
|
|
|
|
orient = "e,state,float";
|
2011-08-20 18:59:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (inst->gcc->gadcon->shelf)
|
|
|
|
{
|
|
|
|
if (horiz)
|
|
|
|
sh = inst->gcc->gadcon->shelf->h;
|
|
|
|
else
|
|
|
|
sw = inst->gcc->gadcon->shelf->w;
|
|
|
|
}
|
|
|
|
|
|
|
|
evas_object_geometry_get(inst->o_clock, NULL, NULL, &ow, &oh);
|
|
|
|
if (orient)
|
|
|
|
edje_object_signal_emit(inst->o_clock, orient, "e");
|
|
|
|
evas_object_resize(inst->o_clock, sw, sh);
|
|
|
|
edje_object_message_signal_process(inst->o_clock);
|
|
|
|
|
|
|
|
edje_object_parts_extends_calc(inst->o_clock, &x, &y, &mw, &mh);
|
|
|
|
evas_object_resize(inst->o_clock, ow, oh);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mw < 4) mw = 4;
|
|
|
|
if (mh < 4) mh = 4;
|
|
|
|
|
|
|
|
if (mw < omw) mw = omw;
|
|
|
|
if (mh < omh) mh = omh;
|
|
|
|
|
|
|
|
e_gadcon_client_aspect_set(inst->gcc, mw, mh);
|
|
|
|
e_gadcon_client_min_size_set(inst->gcc, mw, mh);
|
|
|
|
}
|
|
|
|
|
2011-06-05 00:42:10 -07:00
|
|
|
void
|
2012-11-13 05:40:31 -08:00
|
|
|
e_int_clock_instances_redo(Eina_Bool all)
|
2011-06-05 00:42:10 -07:00
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Instance *inst;
|
2012-11-11 20:32:59 -08:00
|
|
|
char todaystr[128];
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-05 00:42:10 -07:00
|
|
|
EINA_LIST_FOREACH(clock_instances, l, inst)
|
|
|
|
{
|
|
|
|
Evas_Object *o = inst->o_clock;
|
2011-08-17 13:13:23 -07:00
|
|
|
|
2012-11-13 05:40:31 -08:00
|
|
|
if ((!all) && (!inst->cfg->changed)) continue;
|
2012-11-11 20:32:59 -08:00
|
|
|
_todaystr_eval(inst, todaystr, sizeof(todaystr) - 1);
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->digital_clock)
|
2012-09-21 01:16:50 -07:00
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/digital");
|
2011-06-05 00:42:10 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/main");
|
2012-11-11 20:32:59 -08:00
|
|
|
if (inst->cfg->show_date)
|
|
|
|
edje_object_signal_emit(o, "e,state,date,on", "e");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(o, "e,state,date,off", "e");
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->digital_24h)
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(o, "e,state,24h,on", "e");
|
2011-06-05 00:42:10 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(o, "e,state,24h,off", "e");
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->show_seconds)
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(o, "e,state,seconds,on", "e");
|
2011-06-05 00:42:10 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(o, "e,state,seconds,off", "e");
|
2011-08-17 13:13:23 -07:00
|
|
|
|
|
|
|
edje_object_part_text_set(o, "e.text.today", todaystr);
|
2012-04-30 04:02:45 -07:00
|
|
|
edje_object_message_signal_process(o);
|
2011-08-20 18:59:09 -07:00
|
|
|
_eval_instance_size(inst);
|
2012-11-11 20:32:59 -08:00
|
|
|
|
2011-08-17 13:13:23 -07:00
|
|
|
if (inst->o_popclock)
|
|
|
|
{
|
|
|
|
o = inst->o_popclock;
|
|
|
|
|
|
|
|
if (inst->cfg->digital_clock)
|
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/digital");
|
|
|
|
else
|
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/main");
|
2012-11-11 20:32:59 -08:00
|
|
|
if (inst->cfg->show_date)
|
|
|
|
edje_object_signal_emit(o, "e,state,date,on", "e");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(o, "e,state,date,off", "e");
|
2011-08-17 13:13:23 -07:00
|
|
|
if (inst->cfg->digital_24h)
|
|
|
|
edje_object_signal_emit(o, "e,state,24h,on", "e");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(o, "e,state,24h,off", "e");
|
|
|
|
if (inst->cfg->show_seconds)
|
|
|
|
edje_object_signal_emit(o, "e,state,seconds,on", "e");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(o, "e,state,seconds,off", "e");
|
|
|
|
|
|
|
|
edje_object_part_text_set(o, "e.text.today", todaystr);
|
2012-04-30 04:02:45 -07:00
|
|
|
edje_object_message_signal_process(o);
|
2011-08-17 13:13:23 -07:00
|
|
|
}
|
2011-06-05 00:42:10 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-17 13:13:23 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_update_today_timer(void *data EINA_UNUSED)
|
2011-08-17 13:13:23 -07:00
|
|
|
{
|
|
|
|
time_t t, t_tomorrow;
|
|
|
|
const struct tm *now;
|
|
|
|
struct tm today;
|
|
|
|
|
2012-11-13 05:40:31 -08:00
|
|
|
e_int_clock_instances_redo(EINA_TRUE);
|
2011-08-17 13:13:23 -07:00
|
|
|
if (!clock_instances)
|
|
|
|
{
|
|
|
|
update_today = NULL;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
t = time(NULL);
|
|
|
|
now = localtime(&t);
|
|
|
|
memcpy(&today, now, sizeof(today));
|
|
|
|
today.tm_sec = 1;
|
|
|
|
today.tm_min = 0;
|
|
|
|
today.tm_hour = 0;
|
|
|
|
|
|
|
|
t_tomorrow = mktime(&today) + 24 * 60 * 60;
|
2012-06-08 03:25:17 -07:00
|
|
|
if (update_today) ecore_timer_interval_set(update_today, t_tomorrow - t);
|
|
|
|
else update_today = ecore_timer_add(t_tomorrow - t, _update_today_timer, NULL);
|
2012-06-08 00:47:08 -07:00
|
|
|
return EINA_TRUE;
|
2011-08-17 13:13:23 -07:00
|
|
|
}
|
|
|
|
|
2012-10-04 03:05:40 -07:00
|
|
|
static void
|
|
|
|
_clock_popup_free(Instance *inst)
|
|
|
|
{
|
|
|
|
if (!inst->popup) return;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
E_FREE_FUNC(inst->popup, e_object_del);
|
2012-10-04 03:05:40 -07:00
|
|
|
inst->o_popclock = NULL;
|
|
|
|
}
|
|
|
|
|
2011-06-05 05:27:00 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_menu_cb_cfg(void *data, E_Menu *menu EINA_UNUSED, E_Menu_Item *mi EINA_UNUSED)
|
2011-06-05 05:27:00 -07:00
|
|
|
{
|
|
|
|
Instance *inst = data;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
E_FREE_FUNC(inst->popup, e_object_del);
|
|
|
|
e_int_config_clock_module(NULL, inst->cfg);
|
2011-06-05 05:27:00 -07:00
|
|
|
}
|
|
|
|
|
2011-05-27 23:53:44 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
|
2011-05-27 23:53:44 -07:00
|
|
|
{
|
|
|
|
Instance *inst = data;
|
|
|
|
Evas_Event_Mouse_Down *ev = event;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-05 05:27:00 -07:00
|
|
|
if (ev->button == 1)
|
|
|
|
{
|
|
|
|
if (inst->popup) _clock_popup_free(inst);
|
|
|
|
else _clock_popup_new(inst);
|
|
|
|
}
|
2012-08-15 00:22:04 -07:00
|
|
|
else if (ev->button == 3)
|
2011-06-05 05:27:00 -07:00
|
|
|
{
|
|
|
|
E_Zone *zone;
|
|
|
|
E_Menu *m;
|
|
|
|
E_Menu_Item *mi;
|
|
|
|
int x, y;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2015-03-13 14:47:36 -07:00
|
|
|
zone = e_zone_current_get();
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-05 05:27:00 -07:00
|
|
|
m = e_menu_new();
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-05 05:27:00 -07:00
|
|
|
mi = e_menu_item_new(m);
|
|
|
|
e_menu_item_label_set(mi, _("Settings"));
|
|
|
|
e_util_menu_item_theme_icon_set(mi, "configure");
|
|
|
|
e_menu_item_callback_set(mi, _clock_menu_cb_cfg, inst);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-05 05:27:00 -07:00
|
|
|
m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-05 05:27:00 -07:00
|
|
|
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, NULL, NULL);
|
|
|
|
e_menu_activate_mouse(m, zone, x + ev->output.x, y + ev->output.y,
|
|
|
|
1, 1, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
|
|
|
|
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
|
|
|
|
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
|
|
|
}
|
2011-05-27 23:53:44 -07:00
|
|
|
}
|
2011-08-20 18:59:09 -07:00
|
|
|
|
2011-06-05 09:09:23 -07:00
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_sizing_changed_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
|
2011-06-05 09:09:23 -07:00
|
|
|
{
|
2011-08-20 18:59:09 -07:00
|
|
|
_eval_instance_size(data);
|
2011-06-05 09:09:23 -07:00
|
|
|
}
|
2011-05-27 23:53:44 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static E_Gadcon_Client *
|
2006-05-31 09:19:11 -07:00
|
|
|
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
E_Gadcon_Client *gcc;
|
|
|
|
Instance *inst;
|
2012-11-11 20:32:59 -08:00
|
|
|
char todaystr[128];
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst = E_NEW(Instance, 1);
|
2011-08-14 15:27:46 -07:00
|
|
|
inst->cfg = _conf_item_get(id);
|
|
|
|
|
2012-11-11 20:32:59 -08:00
|
|
|
_todaystr_eval(inst, todaystr, sizeof(todaystr) - 1);
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
o = edje_object_add(gc->evas);
|
2011-08-14 15:27:46 -07:00
|
|
|
edje_object_signal_callback_add(o, "e,state,sizing,changed", "*",
|
2011-06-05 09:09:23 -07:00
|
|
|
_clock_sizing_changed_cb, inst);
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->digital_clock)
|
2012-09-21 01:16:50 -07:00
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/digital");
|
2011-06-05 00:42:10 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
e_theme_edje_object_set(o, "base/theme/modules/clock",
|
|
|
|
"e/modules/clock/main");
|
2012-11-11 20:32:59 -08:00
|
|
|
if (inst->cfg->show_date)
|
|
|
|
edje_object_signal_emit(o, "e,state,date,on", "e");
|
|
|
|
else
|
|
|
|
edje_object_signal_emit(o, "e,state,date,off", "e");
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->digital_24h)
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(o, "e,state,24h,on", "e");
|
2011-06-05 00:42:10 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(o, "e,state,24h,off", "e");
|
2011-08-14 15:27:46 -07:00
|
|
|
if (inst->cfg->show_seconds)
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(o, "e,state,seconds,on", "e");
|
2011-06-05 00:42:10 -07:00
|
|
|
else
|
2012-09-21 01:16:50 -07:00
|
|
|
edje_object_signal_emit(o, "e,state,seconds,off", "e");
|
2011-08-17 13:13:23 -07:00
|
|
|
|
|
|
|
edje_object_part_text_set(o, "e.text.today", todaystr);
|
2012-04-30 04:03:21 -07:00
|
|
|
edje_object_message_signal_process(o);
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_show(o);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2006-12-30 15:32:25 -08:00
|
|
|
gcc = e_gadcon_client_new(gc, name, id, style, o);
|
2006-04-20 04:30:25 -07:00
|
|
|
gcc->data = inst;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst->gcc = gcc;
|
2010-12-09 05:15:57 -08:00
|
|
|
inst->o_clock = o;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
|
|
|
evas_object_event_callback_add(inst->o_clock,
|
2011-05-27 23:53:44 -07:00
|
|
|
EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_clock_cb_mouse_down,
|
|
|
|
inst);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2011-06-05 00:42:10 -07:00
|
|
|
clock_instances = eina_list_append(clock_instances, inst);
|
2011-08-17 13:13:23 -07:00
|
|
|
|
|
|
|
if (!update_today) _update_today_timer(NULL);
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
return gcc;
|
|
|
|
}
|
2005-02-10 03:54:18 -08:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static void
|
|
|
|
_gc_shutdown(E_Gadcon_Client *gcc)
|
|
|
|
{
|
|
|
|
Instance *inst;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
inst = gcc->data;
|
2011-06-05 00:42:10 -07:00
|
|
|
clock_instances = eina_list_remove(clock_instances, inst);
|
2006-04-20 04:30:25 -07:00
|
|
|
evas_object_del(inst->o_clock);
|
2011-05-27 23:53:44 -07:00
|
|
|
_clock_popup_free(inst);
|
2011-06-03 22:40:48 -07:00
|
|
|
_clear_timestrs(inst);
|
2006-04-20 04:30:25 -07:00
|
|
|
free(inst);
|
2011-08-17 13:13:23 -07:00
|
|
|
|
|
|
|
if ((!clock_instances) && (update_today))
|
|
|
|
{
|
|
|
|
ecore_timer_del(update_today);
|
|
|
|
update_today = NULL;
|
|
|
|
}
|
2006-04-20 04:30:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient EINA_UNUSED)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
2011-08-20 18:59:09 -07:00
|
|
|
_eval_instance_size(gcc->data);
|
2006-04-20 04:30:25 -07:00
|
|
|
}
|
2006-05-09 06:02:48 -07:00
|
|
|
|
2011-11-14 13:46:57 -08:00
|
|
|
static const char *
|
2015-03-18 15:09:09 -07:00
|
|
|
_gc_label(const E_Gadcon_Client_Class *client_class EINA_UNUSED)
|
2006-05-09 06:02:48 -07:00
|
|
|
{
|
|
|
|
return _("Clock");
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2015-03-18 15:09:09 -07:00
|
|
|
_gc_icon(const E_Gadcon_Client_Class *client_class EINA_UNUSED, Evas *evas)
|
2006-05-09 06:02:48 -07:00
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
char buf[4096];
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2006-05-09 06:02:48 -07:00
|
|
|
o = edje_object_add(evas);
|
2007-03-24 16:12:23 -07:00
|
|
|
snprintf(buf, sizeof(buf), "%s/e-module-clock.edj",
|
2012-09-21 01:16:50 -07:00
|
|
|
e_module_dir_get(clock_config->module));
|
2006-05-09 06:02:48 -07:00
|
|
|
edje_object_file_set(o, buf, "icon");
|
|
|
|
return o;
|
|
|
|
}
|
2007-09-15 17:02:53 -07:00
|
|
|
|
|
|
|
static const char *
|
2015-03-18 15:09:09 -07:00
|
|
|
_gc_id_new(const E_Gadcon_Client_Class *client_class EINA_UNUSED)
|
2007-09-15 17:02:53 -07:00
|
|
|
{
|
2012-06-22 00:21:51 -07:00
|
|
|
Config_Item *ci = NULL;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2012-06-22 00:21:51 -07:00
|
|
|
ci = _conf_item_get(NULL);
|
|
|
|
return ci->id;
|
2011-08-14 15:27:46 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Config_Item *
|
|
|
|
_conf_item_get(const char *id)
|
|
|
|
{
|
2011-09-03 07:39:28 -07:00
|
|
|
Config_Item *ci;
|
|
|
|
|
|
|
|
GADCON_CLIENT_CONFIG_GET(Config_Item, clock_config->items, _gadcon_class, id);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
|
|
|
ci = E_NEW(Config_Item, 1);
|
|
|
|
ci->id = eina_stringshare_add(id);
|
|
|
|
ci->weekend.start = 6;
|
|
|
|
ci->weekend.len = 2;
|
|
|
|
ci->week.start = 1;
|
2013-10-06 20:01:29 -07:00
|
|
|
ci->digital_clock = 1;
|
2011-08-14 15:27:46 -07:00
|
|
|
ci->digital_24h = 0;
|
2013-10-06 20:01:29 -07:00
|
|
|
ci->show_seconds = 0;
|
2012-11-11 20:32:59 -08:00
|
|
|
ci->show_date = 0;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
|
|
|
clock_config->items = eina_list_append(clock_config->items, ci);
|
|
|
|
e_config_save_queue();
|
|
|
|
|
|
|
|
return ci;
|
2007-09-15 17:02:53 -07:00
|
|
|
}
|
|
|
|
|
2011-06-07 07:34:24 -07:00
|
|
|
static void
|
|
|
|
_e_mod_action(const char *params)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Instance *inst;
|
|
|
|
|
2012-09-21 01:16:50 -07:00
|
|
|
if (!params) return;
|
|
|
|
if (strcmp(params, "show_calendar")) return;
|
2011-06-07 07:34:24 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(clock_instances, l, inst)
|
|
|
|
if (inst->popup)
|
|
|
|
_clock_popup_free(inst);
|
|
|
|
else
|
|
|
|
_clock_popup_new(inst);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_mod_action_cb_edge(E_Object *obj EINA_UNUSED, const char *params, E_Event_Zone_Edge *ev EINA_UNUSED)
|
2011-06-07 07:34:24 -07:00
|
|
|
{
|
|
|
|
_e_mod_action(params);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_mod_action_cb(E_Object *obj EINA_UNUSED, const char *params)
|
2011-06-07 07:34:24 -07:00
|
|
|
{
|
|
|
|
_e_mod_action(params);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_mod_action_cb_key(E_Object *obj EINA_UNUSED, const char *params, Ecore_Event_Key *ev EINA_UNUSED)
|
2011-06-07 07:34:24 -07:00
|
|
|
{
|
|
|
|
_e_mod_action(params);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-03-18 15:09:09 -07:00
|
|
|
_e_mod_action_cb_mouse(E_Object *obj EINA_UNUSED, const char *params, E_Binding_Event_Mouse_Button *ev EINA_UNUSED)
|
2011-06-07 07:34:24 -07:00
|
|
|
{
|
|
|
|
_e_mod_action(params);
|
|
|
|
}
|
|
|
|
|
2012-09-21 01:37:04 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_eio_update(void *d EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-09-21 01:37:04 -07:00
|
|
|
{
|
2013-10-21 23:53:57 -07:00
|
|
|
Eio_Monitor_Event *ev = event;
|
2012-09-21 01:37:04 -07:00
|
|
|
|
2013-10-21 23:53:57 -07:00
|
|
|
if ((ev->monitor == clock_tz_monitor) ||
|
|
|
|
(ev->monitor == clock_tz2_monitor) ||
|
|
|
|
(ev->monitor == clock_tzetc_monitor))
|
|
|
|
{
|
|
|
|
if ((ev->filename) &&
|
|
|
|
((!strcmp(ev->filename, "/etc/localtime")) ||
|
|
|
|
(!strcmp(ev->filename, "/etc/timezone"))))
|
|
|
|
{
|
|
|
|
e_int_clock_instances_redo(EINA_TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2012-09-21 01:37:04 -07:00
|
|
|
}
|
|
|
|
|
2012-09-21 01:55:22 -07:00
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_eio_error(void *d EINA_UNUSED, int type EINA_UNUSED, void *event)
|
2012-09-21 01:55:22 -07:00
|
|
|
{
|
2013-10-21 23:53:57 -07:00
|
|
|
Eio_Monitor_Event *ev = event;
|
2012-09-21 01:55:22 -07:00
|
|
|
|
2013-10-21 23:53:57 -07:00
|
|
|
if ((ev->monitor == clock_tz_monitor) ||
|
|
|
|
(ev->monitor == clock_tz2_monitor) ||
|
|
|
|
(ev->monitor == clock_tzetc_monitor))
|
2013-07-14 19:45:19 -07:00
|
|
|
{
|
2014-07-01 00:35:58 -07:00
|
|
|
if (clock_tz_monitor)
|
|
|
|
{
|
|
|
|
eio_monitor_del(clock_tz_monitor);
|
|
|
|
clock_tz_monitor = NULL;
|
|
|
|
}
|
|
|
|
if (ecore_file_exists("/etc/localtime"))
|
|
|
|
clock_tz_monitor = eio_monitor_add("/etc/localtime");
|
|
|
|
|
|
|
|
if (clock_tz2_monitor)
|
|
|
|
{
|
|
|
|
eio_monitor_del(clock_tz2_monitor);
|
|
|
|
clock_tz2_monitor = NULL;
|
|
|
|
}
|
|
|
|
if (ecore_file_exists("/etc/timezone"))
|
|
|
|
clock_tz2_monitor = eio_monitor_add("/etc/timezone");
|
|
|
|
if (clock_tzetc_monitor)
|
|
|
|
{
|
|
|
|
eio_monitor_del(clock_tzetc_monitor);
|
|
|
|
clock_tzetc_monitor = NULL;
|
|
|
|
}
|
|
|
|
if (ecore_file_is_dir("/etc"))
|
|
|
|
clock_tzetc_monitor = eio_monitor_add("/etc");
|
2013-07-14 19:45:19 -07:00
|
|
|
}
|
2013-10-21 23:53:57 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2015-03-18 15:09:09 -07:00
|
|
|
_clock_time_update(void *d EINA_UNUSED, int type EINA_UNUSED, void *event EINA_UNUSED)
|
2013-10-21 23:53:57 -07:00
|
|
|
{
|
2012-11-13 05:40:31 -08:00
|
|
|
e_int_clock_instances_redo(EINA_TRUE);
|
2013-10-21 23:53:57 -07:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2012-09-21 01:55:22 -07:00
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
/* module setup */
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API E_Module_Api e_modapi =
|
2005-09-23 10:13:47 -07:00
|
|
|
{
|
|
|
|
E_MODULE_API_VERSION,
|
2012-09-21 01:16:50 -07:00
|
|
|
"Clock"
|
2005-09-23 10:13:47 -07:00
|
|
|
};
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void *
|
2006-05-09 06:02:48 -07:00
|
|
|
e_modapi_init(E_Module *m)
|
2004-11-26 02:53:38 -08:00
|
|
|
{
|
2011-08-14 15:27:46 -07:00
|
|
|
conf_item_edd = E_CONFIG_DD_NEW("Config_Item", Config_Item);
|
2011-06-05 00:42:10 -07:00
|
|
|
#undef T
|
|
|
|
#undef D
|
2011-08-14 15:27:46 -07:00
|
|
|
#define T Config_Item
|
|
|
|
#define D conf_item_edd
|
|
|
|
E_CONFIG_VAL(D, T, id, STR);
|
2011-06-05 00:42:10 -07:00
|
|
|
E_CONFIG_VAL(D, T, weekend.start, INT);
|
|
|
|
E_CONFIG_VAL(D, T, weekend.len, INT);
|
|
|
|
E_CONFIG_VAL(D, T, week.start, INT);
|
|
|
|
E_CONFIG_VAL(D, T, digital_clock, INT);
|
|
|
|
E_CONFIG_VAL(D, T, digital_24h, INT);
|
|
|
|
E_CONFIG_VAL(D, T, show_seconds, INT);
|
2012-11-11 20:32:59 -08:00
|
|
|
E_CONFIG_VAL(D, T, show_date, INT);
|
2011-06-05 00:42:10 -07:00
|
|
|
|
2011-08-14 15:27:46 -07:00
|
|
|
conf_edd = E_CONFIG_DD_NEW("Config", Config);
|
|
|
|
#undef T
|
|
|
|
#undef D
|
|
|
|
#define T Config
|
|
|
|
#define D conf_edd
|
|
|
|
E_CONFIG_LIST(D, T, items, conf_item_edd);
|
|
|
|
|
|
|
|
clock_config = e_config_domain_load("module.clock", conf_edd);
|
|
|
|
|
|
|
|
if (!clock_config)
|
|
|
|
clock_config = E_NEW(Config, 1);
|
2011-06-07 07:34:24 -07:00
|
|
|
|
|
|
|
act = e_action_add("clock");
|
|
|
|
if (act)
|
|
|
|
{
|
2012-09-21 01:16:50 -07:00
|
|
|
act->func.go = _e_mod_action_cb;
|
|
|
|
act->func.go_key = _e_mod_action_cb_key;
|
|
|
|
act->func.go_mouse = _e_mod_action_cb_mouse;
|
|
|
|
act->func.go_edge = _e_mod_action_cb_edge;
|
2011-06-07 07:34:24 -07:00
|
|
|
|
2012-12-16 08:58:17 -08:00
|
|
|
e_action_predef_name_set(N_("Clock"), N_("Toggle calendar"), "clock", "show_calendar", NULL, 0);
|
2011-06-07 07:34:24 -07:00
|
|
|
}
|
|
|
|
|
2011-08-14 15:27:46 -07:00
|
|
|
clock_config->module = m;
|
2014-07-01 00:35:58 -07:00
|
|
|
if (ecore_file_exists("/etc/localtime"))
|
|
|
|
clock_tz_monitor = eio_monitor_add("/etc/localtime");
|
|
|
|
if (ecore_file_exists("/etc/timezone"))
|
|
|
|
clock_tz2_monitor = eio_monitor_add("/etc/timezone");
|
|
|
|
if (ecore_file_is_dir("/etc"))
|
|
|
|
clock_tzetc_monitor = eio_monitor_add("/etc");
|
2012-09-21 02:23:07 -07:00
|
|
|
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_ERROR, _clock_eio_error, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_FILE_CREATED, _clock_eio_update, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_FILE_MODIFIED, _clock_eio_update, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_FILE_DELETED, _clock_eio_update, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_SELF_DELETED, _clock_eio_update, NULL);
|
|
|
|
E_LIST_HANDLER_APPEND(clock_eio_handlers, EIO_MONITOR_SELF_RENAME, _clock_eio_update, NULL);
|
2013-10-23 02:03:56 -07:00
|
|
|
E_LIST_HANDLER_APPEND(clock_eio_handlers, E_EVENT_SYS_RESUME, _clock_time_update, NULL);
|
2013-10-21 23:53:57 -07:00
|
|
|
E_LIST_HANDLER_APPEND(clock_eio_handlers, ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED, _clock_time_update, NULL);
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
e_gadcon_provider_register(&_gadcon_class);
|
2012-09-21 01:55:22 -07:00
|
|
|
|
2006-07-24 21:11:41 -07:00
|
|
|
return m;
|
2004-11-26 02:53:38 -08:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2015-03-18 15:09:09 -07:00
|
|
|
e_modapi_shutdown(E_Module *m EINA_UNUSED)
|
2004-11-26 02:53:38 -08:00
|
|
|
{
|
2011-06-13 01:05:26 -07:00
|
|
|
if (act)
|
|
|
|
{
|
2012-12-16 08:58:17 -08:00
|
|
|
e_action_predef_name_del("Clock", "Toggle calendar");
|
2011-06-13 01:05:26 -07:00
|
|
|
e_action_del("clock");
|
|
|
|
act = NULL;
|
|
|
|
}
|
2011-06-05 00:42:10 -07:00
|
|
|
if (clock_config)
|
|
|
|
{
|
2012-09-21 01:16:50 -07:00
|
|
|
Config_Item *ci;
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2012-09-21 01:16:50 -07:00
|
|
|
if (clock_config->config_dialog)
|
|
|
|
e_object_del(E_OBJECT(clock_config->config_dialog));
|
2011-08-14 15:27:46 -07:00
|
|
|
|
2012-09-21 01:16:50 -07:00
|
|
|
EINA_LIST_FREE(clock_config->items, ci)
|
|
|
|
{
|
|
|
|
eina_stringshare_del(ci->id);
|
|
|
|
free(ci);
|
|
|
|
}
|
2011-08-14 15:27:46 -07:00
|
|
|
|
|
|
|
free(clock_config);
|
2011-06-05 00:42:10 -07:00
|
|
|
clock_config = NULL;
|
|
|
|
}
|
2011-08-14 15:27:46 -07:00
|
|
|
E_CONFIG_DD_FREE(conf_edd);
|
|
|
|
E_CONFIG_DD_FREE(conf_item_edd);
|
|
|
|
conf_item_edd = NULL;
|
|
|
|
conf_edd = NULL;
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
e_gadcon_provider_unregister(&_gadcon_class);
|
2011-08-17 13:13:23 -07:00
|
|
|
|
|
|
|
if (update_today)
|
|
|
|
{
|
|
|
|
ecore_timer_del(update_today);
|
|
|
|
update_today = NULL;
|
|
|
|
}
|
2014-07-01 00:35:58 -07:00
|
|
|
if (clock_tz_monitor) eio_monitor_del(clock_tz_monitor);
|
|
|
|
if (clock_tz2_monitor) eio_monitor_del(clock_tz2_monitor);
|
|
|
|
if (clock_tzetc_monitor) eio_monitor_del(clock_tzetc_monitor);
|
2012-09-21 01:37:04 -07:00
|
|
|
clock_tz_monitor = NULL;
|
2013-02-07 00:14:03 -08:00
|
|
|
clock_tz2_monitor = NULL;
|
2013-10-21 23:53:57 -07:00
|
|
|
clock_tzetc_monitor = NULL;
|
2011-08-17 13:13:23 -07:00
|
|
|
|
2004-11-26 02:53:38 -08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2015-03-18 15:09:09 -07:00
|
|
|
e_modapi_save(E_Module *m EINA_UNUSED)
|
2004-11-26 02:53:38 -08:00
|
|
|
{
|
2011-08-14 15:27:46 -07:00
|
|
|
e_config_domain_save("module.clock", conf_edd, clock_config);
|
2004-11-26 02:53:38 -08:00
|
|
|
return 1;
|
|
|
|
}
|
2012-09-21 01:16:50 -07:00
|
|
|
|