Flora License
-Version 1.0, April, 2013
+Version 1.1, April, 2013
http://floralicense.org/license/
Derivative Works; or, within a display generated by the Derivative Works,
if and wherever such third-party notices normally appear.
The contents of the NOTICE file are for informational purposes only
- and do not modify the License.
-
-You may add Your own attribution notices within Derivative Works
-that You distribute, alongside or as an addendum to the NOTICE text
-from the Work, provided that such additional attribution notices
-cannot be construed as modifying the License. You may add Your own
-copyright statement to Your modifications and may provide additional or
-different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works
-as a whole, provided Your use, reproduction, and distribution of
-the Work otherwise complies with the conditions stated in this License.
+ and do not modify the License. You may add Your own attribution notices
+ within Derivative Works that You distribute, alongside or as an addendum
+ to the NOTICE text from the Work, provided that such additional attribution
+ notices cannot be construed as modifying the License. You may add Your own
+ copyright statement to Your modifications and may provide additional or
+ different license terms and conditions for use, reproduction, or
+ distribution of Your modifications, or for any such Derivative Works
+ as a whole, provided Your use, reproduction, and distribution of
+ the Work otherwise complies with the conditions stated in this License
+ and your own copyright statement or terms and conditions do not conflict
+ the conditions stated in the License including section 3.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
Copyright [yyyy] [name of copyright owner]
- Licensed under the Flora License, Version 1.0 (the "License");
+ Licensed under the Flora License, Version 1.1 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
Name: org.tizen.data-provider-slave
Summary: Plugin type livebox service provider.
-Version: 0.10.4
+Version: 0.10.7
Release: 1
Group: HomeTF/Livebox
License: Flora License
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
arg->info.lb_create.width,
arg->info.lb_create.height);
+ if (!arg->info.lb_create.content || !strlen(arg->info.lb_create.content)) {
+ DbgPrint("Use default content: \"%s\"\n", DEFAULT_CONTENT);
+ arg->info.lb_create.content = DEFAULT_CONTENT;
+ }
+
ret = lb_create(arg->pkgname, arg->id,
arg->info.lb_create.content,
arg->info.lb_create.timeout,
arg->info.lb_recreate.category,
arg->info.lb_recreate.abi);
+ if (!arg->info.lb_recreate.content || !strlen(arg->info.lb_recreate.content)) {
+ DbgPrint("Use default content: \"%s\"\n", DEFAULT_CONTENT);
+ arg->info.lb_recreate.content = DEFAULT_CONTENT;
+ }
+
ret = lb_create(arg->pkgname, arg->id,
arg->info.lb_recreate.content,
arg->info.lb_recreate.timeout,
.pd_move = method_pd_moved,
.lb_pause = method_lb_pause,
.lb_resume = method_lb_resume,
- .pd_access = NULL,
- .lb_access = NULL,
};
return provider_init(ecore_x_display_get(), name, &table, NULL);
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
if (!s_info.fp)
return LB_STATUS_ERROR_IO;
- gettimeofday(&tv, NULL);
+ if (gettimeofday(&tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ }
fprintf(s_info.fp, "%d %lu.%lu [%s:%d] ", getpid(), tv.tv_sec, tv.tv_usec, util_basename((char *)func), line);
va_start(ap, fmt);
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
return;
}
- gettimeofday(&tv, NULL);
+ if (gettimeofday(&tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ }
timersub(&tv, &s_info.alarm_tv, &res_tv);
* Enable alarm for detecting infinite loop
*/
if (!noalarm) {
- gettimeofday(&s_info.alarm_tv, NULL);
+ if (gettimeofday(&s_info.alarm_tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ s_info.alarm_tv.tv_sec = 0;
+ s_info.alarm_tv.tv_usec = 0;
+ }
s_info.marked = 1;
alarm(life_time);
}
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
int heavy_updating; /* Only for debugging message */
int is_paused; /* 1 is paused, 0 is resumed */
double sleep_at;
+
+ int is_lb_show;
+ int is_pd_show;
+ int is_lb_updated;
};
static struct info {
if (ecore_timer_interval_get(item->timer) <= 1.0f)
return;
- gettimeofday(&tv, NULL);
+ if (gettimeofday(&tv, NULL) < 0) {
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ tv.tv_sec = 0;
+ tv.tv_usec = 0;
+ }
+
item->sleep_at = (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
}
item = data;
DbgPrint("DESC %s is updated\n", filename);
- provider_send_desc_updated(item->inst->item->pkgname, item->inst->id, filename);
+ if (item->is_pd_show) {
+ provider_send_desc_updated(item->inst->item->pkgname, item->inst->id, filename);
+ } else {
+ ErrPrint("But PD is not opened, Ignore this update (%s)\n", item->inst->id);
+ }
return EXIT_SUCCESS;
}
return EXIT_SUCCESS; /*!< To keep the callback */
}
- provider_send_updated(item->inst->item->pkgname, item->inst->id,
+ if (!item->inst->item->has_livebox_script || (item->inst->item->has_livebox_script && item->is_lb_show)) {
+ provider_send_updated(item->inst->item->pkgname, item->inst->id,
item->inst->w, item->inst->h, item->inst->priority, content, title);
+ } else {
+ DbgPrint("Livebox script is not ready yet\n");
+ item->is_lb_updated++;
+ }
return output_handler(item);
}
item = eina_list_data_get(l);
+ DbgPrint("source(%s) emission(%s) %d\n", source, emission, item->inst->item->has_livebox_script);
+ if (emission && source && !strcmp(source, util_uri_to_path(id))) {
+ if (item->inst->item->has_livebox_script) {
+ if (!strcmp(emission, "lb,show")) {
+ DbgPrint("Livebox(%s) script is ready now\n", id);
+ item->is_lb_show = 1;
+
+ DbgPrint("Updated %d times, (content: %s), (title: %s)\n", item->is_lb_updated, item->inst->content, item->inst->title);
+ if (item->is_lb_updated) {
+ provider_send_updated(item->inst->item->pkgname, item->inst->id,
+ item->inst->w, item->inst->h, item->inst->priority, item->inst->content, item->inst->title);
+ item->is_lb_updated = 0;
+ }
+ } else if (!strcmp(emission, "lb,hide")) {
+ DbgPrint("Livebox(%s) script is hide now\n", id);
+ item->is_lb_show = 0;
+ }
+ }
+
+ if (!strcmp(emission, "pd,show")) {
+ item->is_pd_show = 1;
+ } else if (!strcmp(emission, "pd,hide")) {
+ item->is_pd_show = 0;
+ }
+ }
+
ret = so_script_event(inst, emission, source, event_info);
if (ret < 0)
return ret;
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
#include "lb.h"
#define TEXT_CLASS "tizen"
-#define TEXT_SIZE -100
+#define DEFAULT_FONT_SIZE -100
#if !defined(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME)
#define VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME "db/setting/accessibility/font_name"
.property_handler = NULL,
.heap_monitor = 0,
.font_name = NULL,
- .font_size = 3,
+ .font_size = DEFAULT_FONT_SIZE,
};
static void update_font_cb(void *data)
char *text;
list = edje_text_class_list();
- EINA_LIST_FREE(list, text) {
- if (!strncasecmp(text, TEXT_CLASS, strlen(TEXT_CLASS))) {
- int size;
- switch (s_info.font_size) {
- case SYSTEM_SETTINGS_FONT_SIZE_SMALL:
- size = -80;
- break;
- case SYSTEM_SETTINGS_FONT_SIZE_NORMAL:
- size = -100;
- break;
- case SYSTEM_SETTINGS_FONT_SIZE_LARGE:
- size = -150;
- break;
- case SYSTEM_SETTINGS_FONT_SIZE_HUGE:
- size = -190;
- break;
- case SYSTEM_SETTINGS_FONT_SIZE_GIANT:
- size = -250;
- break;
- default:
- size = -100;
- break;
+ DbgPrint("List: %p\n", list);
+ if (list) {
+ EINA_LIST_FREE(list, text) {
+ if (!strncasecmp(text, TEXT_CLASS, strlen(TEXT_CLASS))) {
+ DbgPrint("Update text class %s (%s, %d)\n", text, s_info.font_name, DEFAULT_FONT_SIZE);
+ edje_text_class_del(text);
+ edje_text_class_set(text, s_info.font_name, DEFAULT_FONT_SIZE);
+ } else {
+ DbgPrint("Skip text class %s\n", text);
}
-
- DbgPrint("Update text class %s (%s, %d)\n", text, s_info.font_name, size);
- edje_text_class_del(text);
- edje_text_class_set(text, s_info.font_name, size);
- } else {
- DbgPrint("Skip text class %s\n", text);
}
+ } else {
+ DbgPrint("New (%s, %d)\n", s_info.font_name, DEFAULT_FONT_SIZE);
+ edje_text_class_set(TEXT_CLASS, s_info.font_name, DEFAULT_FONT_SIZE);
}
+ DbgPrint("Call system event\n");
lb_system_event_all(LB_SYS_EVENT_FONT_CHANGED);
}
-static void font_changed_cb(system_settings_key_e key, void *user_data)
+static void font_changed_cb(keynode_t *node, void *user_data)
{
- int ret;
char *font_name;
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &font_name);
- if (ret != SYSTEM_SETTINGS_ERROR_NONE || !font_name)
+ font_name = vconf_get_str("db/setting/accessibility/font_name");
+ if (!font_name) {
+ ErrPrint("Invalid font name (NULL)\n");
return;
+ }
if (s_info.font_name && !strcmp(s_info.font_name, font_name)) {
- DbgPrint("Font is not changed\n");
+ DbgPrint("Font is not changed (Old: %s(%p) <> New: %s(%p))\n", s_info.font_name, s_info.font_name, font_name, font_name);
free(font_name);
return;
}
if (s_info.font_name) {
+ DbgPrint("Release old font name: %s(%p)\n", s_info.font_name, s_info.font_name);
free(s_info.font_name);
s_info.font_name = NULL;
}
s_info.font_name = font_name;
- DbgPrint("Font name is changed to %s\n", s_info.font_name);
+ DbgPrint("Font name is changed to %s(%p)\n", s_info.font_name, s_info.font_name);
/*!
* \NOTE
update_font_cb(NULL);
}
+static inline int convert_font_size(int size)
+{
+ switch (size) {
+ case SYSTEM_SETTINGS_FONT_SIZE_SMALL:
+ size = -80;
+ break;
+ case SYSTEM_SETTINGS_FONT_SIZE_NORMAL:
+ size = -100;
+ break;
+ case SYSTEM_SETTINGS_FONT_SIZE_LARGE:
+ size = -150;
+ break;
+ case SYSTEM_SETTINGS_FONT_SIZE_HUGE:
+ size = -190;
+ break;
+ case SYSTEM_SETTINGS_FONT_SIZE_GIANT:
+ size = -250;
+ break;
+ default:
+ size = -100;
+ break;
+ }
+
+ DbgPrint("Return size: %d\n", size);
+ return size;
+}
+
static void font_size_cb(system_settings_key_e key, void *user_data)
{
int size;
if (system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &size) != SYSTEM_SETTINGS_ERROR_NONE)
return;
+ size = convert_font_size(size);
+
if (size == s_info.font_size) {
DbgPrint("Font size is not changed\n");
return;
static bool app_create(void *data)
{
int ret;
+ int size = DEFAULT_FONT_SIZE;
ret = conf_loader();
DbgPrint("Configureation manager is initiated: %d\n", ret);
ret = update_monitor_init();
DbgPrint("Content update monitor is initiated: %d\n", ret);
- ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE, font_changed_cb, NULL);
+ ret = vconf_notify_key_changed("db/setting/accessibility/font_name", font_changed_cb, NULL);
DbgPrint("System font is changed: %d\n", ret);
ret = system_settings_set_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE, font_size_cb, NULL);
ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, mmc_changed_cb, NULL);
DbgPrint("MMC status changed event callback added: %d\n", ret);
- ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, &s_info.font_name);
- if (ret == SYSTEM_SETTINGS_ERROR_NONE)
- DbgPrint("Current font: %s\n", s_info.font_name);
+ s_info.font_name = vconf_get_str("db/setting/accessibility/font_name");
+ DbgPrint("Current font: %s\n", s_info.font_name);
- ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &s_info.font_size);
- if (ret == SYSTEM_SETTINGS_ERROR_NONE)
- DbgPrint("Current size: %d\n", s_info.font_size);
+ ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_FONT_SIZE, &size);
+ s_info.font_size = convert_font_size(size);
+ DbgPrint("Current size: %d\n", s_info.font_size);
return TRUE;
}
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
/*
* Copyright 2013 Samsung Electronics Co., Ltd
*
- * Licensed under the Flora License, Version 1.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
{
struct timeval tv;
- gettimeofday(&tv, NULL);
+ if (gettimeofday(&tv, NULL) < 0) {
+ static unsigned long internal_count = 0;
+
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ tv.tv_sec = internal_count++;
+ tv.tv_usec = 0;
+ }
return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0f;
}
unsigned long long curtime;
unsigned long long _period;
unsigned long long remain;
- unsigned int sec;
- unsigned int usec;
double ret;
- gettimeofday(&tv, NULL);
- curtime = (unsigned long long)tv.tv_sec * 1000000llu + (unsigned long long)tv.tv_usec;
+ if (period == 0.0f) {
+ DbgPrint("Period is ZERO\n");
+ return 0.0f;
+ }
- sec = (unsigned int)period;
- usec = (period - sec) * 1000000;
- _period = (unsigned long long)sec * 1000000llu + usec;
+ if (gettimeofday(&tv, NULL) < 0){
+ ErrPrint("gettimeofday: %s\n", strerror(errno));
+ return period;
+ }
- remain = curtime % _period;
+ curtime = (unsigned long long)tv.tv_sec * 1000000llu + (unsigned long long)tv.tv_usec;
+ _period = (unsigned long long)(period * (double)1000000);
+ if (_period == 0llu) {
+ ErrPrint("%lf <> %llu\n", period, _period);
+ return period;
+ }
- sec = (unsigned int)(remain / 1000000llu);
- usec = (unsigned int)(remain % 1000000llu);
+ remain = curtime % _period;
- ret = (double)sec + (double)usec / 1000000.0f;
+ ret = (double)remain / (double)1000000;
+ DbgPrint("curtime: %llu, _period: %llu (%lf), remain: %llu, ret: %lf, result: %lf\n", curtime, _period, period, remain, ret, period - ret);
return period - ret;
}