return ret;
}
+static int __instance_change_period(const char *id, double period)
+{
+ widget_context_s *wc = __find_context_by_id(id);
+
+ if (!wc) {
+ _E("could not find widget obj: %s", id);
+ return -1;
+ }
+
+ if (wc->periodic_timer) {
+ _D("Remove timer!");
+ g_source_remove(wc->periodic_timer);
+ wc->periodic_timer = 0;
+ }
+
+ wc->period = period;
+ if (wc->period > 0) {
+ _D("Restart timer!");
+ wc->periodic_timer = g_timeout_add_seconds(wc->period,
+ __timeout_cb, wc);
+ }
+
+ return 0;
+}
+
static widget_class_h __find_class_handler(const char *class_id,
widget_class_h handle)
{
__instance_pause(handle, id, UPDATE_ALL);
} else if (strcmp(operation, "terminate") == 0) {
__instance_destroy(handle, id, WIDGET_APP_DESTROY_TYPE_TEMPORARY, UPDATE_ALL);
+ } else if (strcmp(operation, "period") == 0) {
+ __instance_change_period(id, update_period);
}
return;