EAPI int elm_main(int argc, char **argv) { int i; int activate = 0; int repeat = 0; for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-activate")) activate = 1; } load_alarm(); if (activate) { clear_alarm(); alm.job = 0; if (alm.on) { if (alm.repeat) set_alarm(); else alm.on = 0; } save_alarm(); create_alarm_win(); alarm_sound(); } else create_main_win(); elm_run(); elm_shutdown(); return 0; }
// press ok to save time and set up alarm static void on_button_activate(void *data, Evas_Object *obj, void *event_info) { clear_alarm(); if (alm.on) set_alarm(); save_alarm(); elm_exit(); }
void alarm_set_date_time(ALARM_STRUCT &p_alarm,uint8_t year,uint8_t mon,uint8_t date,uint8_t hour,uint8_t min,uint8_t sec) { p_alarm.dt.year = year; p_alarm.dt.month = mon; p_alarm.dt.date = date; p_alarm.dt.hour = hour; p_alarm.dt.min = min; p_alarm.dt.sec = sec; p_alarm.id = 1; save_alarm(); }
static void on_set_button_activate(void *data, Evas_Object *obj, void *event_info) { if (!alarm_win) return; evas_object_del(alarm_win); alarm_win = NULL; alarm_sound_end(); clear_alarm(); alm.on = 1; save_alarm(); create_main_win(); }