diff options
-rw-r--r-- | doc/widget_service_doc.h | 60 | ||||
-rw-r--r-- | include/util.h | 13 | ||||
-rw-r--r-- | include/widget_conf.h | 181 | ||||
-rw-r--r-- | include/widget_service_internal.h | 4 | ||||
-rw-r--r-- | packaging/libwidget_service.spec | 2 | ||||
-rw-r--r-- | src/widget_conf.c | 73 |
6 files changed, 206 insertions, 127 deletions
diff --git a/doc/widget_service_doc.h b/doc/widget_service_doc.h index 1b45e6a..89aebcb 100644 --- a/doc/widget_service_doc.h +++ b/doc/widget_service_doc.h @@ -23,7 +23,7 @@ */ /** - * @defgroup CAPI_WIDGET_SERVICE_MODULE widget-service + * @defgroup CAPI_WIDGET_SERVICE_MODULE Widget Service * @brief To get the information of installed widgets * @ingroup CAPI_WIDGET_FRAMEWORK * @section CAPI_WIDGET_SERVICE_MODULE_HEADER Required Header @@ -35,13 +35,9 @@ Tizen supports various kinds of API set for retrieving information of widgets. Every widgets are installed via package manager utilities. The information of installed widgets are stored in the system DB. -In some cases, application developer needs to send update request to its widget. -To make it possible, this module providers such kinds of API set. - -Those APIs are for communicating with master service provider called data-provider-master. -When it receives request from applications, it will find the proper service provider called data-provider-slave or application widget Provider. -If master finds proper service provider, it will forward the requests to them. -Then each widget application can get update request. +In some cases, application developer needs to send update request to some widgets. +To make it possible, this module provides related API set. +But the API will only works if the widget and application are packaged in one. <H2>1.1 APIs for retrieving information of widgets</H2> @@ -53,43 +49,47 @@ To trigger the update event or send the updated content string to the widget. <H1>2. Size of widget</H1> -widget has predefined size types. +Widget has predefined size types. +1x1 is a square so its pixel size of width and height must has to be same. +2x2, 4x4 also sqaure. + +2x1, 4x1, 4x2, 4x3 is a rectangle. so its pixel size of width & height should not be same. +pixel size of width should be long than height. + +Pixel size can be differ between different devices. +It depends on its screen resolution. + +So widget developer should care various kinds of devices (has different screen resolution). <TABLE> <TR> <TD>Size Type</TD><TD>Size in pixels</TD><TD>Supported profile</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_1x1</TD><TD> - </TD><TD>Mobile, Wearable - Mandatory size</TD> -</TR> -<TR> -<TD>WIDGET_SIZE_TYPE_2x1</TD><TD> - </TD><TD>Mobile</TD> -</TR> -<TR> -<TD>WIDGET_SIZE_TYPE_2x2</TD><TD> - </TD><TD>Mobile, Wearable</TD> +<TD>WIDGET_SIZE_TYPE_1x1</TD><TD> - (SQUARE, depends on screen resolution) </TD><TD>No profile - This size type is not used. just defined for specifying a default cell size</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_4x1</TD><TD> - </TD><TD>Mobile - Extension</TD> +<TD>WIDGET_SIZE_TYPE_2x1</TD><TD> - (RECTANGLE, depends on screen resolution) </TD><TD>Mobile</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_4x2</TD><TD> - </TD><TD>Mobile - Since 2.3</TD> +<TD>WIDGET_SIZE_TYPE_2x2</TD><TD> - (SQUARE, depends on screen resolution) </TD><TD>Mobile, Wearable (Default size)</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_4x3</TD><TD> - </TD><TD>Mobile - Extension</TD> +<TD>WIDGET_SIZE_TYPE_4x1</TD><TD> - (RECTANGLE, depends on screen resolution) </TD><TD>Mobile</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_4x4</TD><TD> - </TD><TD>Mobile, Kiran - Since 2.3</TD> +<TD>WIDGET_SIZE_TYPE_4x2</TD><TD> - (RECTANGLE, depends on screen resolution) </TD><TD>Mobile</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_4x5</TD><TD> - </TD><TD>Mobile - Extension</TD> +<TD>WIDGET_SIZE_TYPE_4x3</TD><TD> - (RECTANGLE, depends on screen resolution) </TD><TD>Mobile</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_4x6</TD><TD> - </TD><TD>Mobile - Extension</TD> +<TD>WIDGET_SIZE_TYPE_4x4</TD><TD> - (SQUARE, depends on screen resolution) </TD><TD>Mobile</TD> </TR> </TABLE> -widget also handles Easy Mode. -For the easy mode, there are different size types. +Widget also works for Easy Mode. +For the Easy Mode, there are different size types. Called WIDGET_SIZE_TYPE_EASY_NxM <TABLE> @@ -97,19 +97,19 @@ Called WIDGET_SIZE_TYPE_EASY_NxM <TD>Size Type</TD><TD>Size in pixels</TD><TD>Supported profile</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_EASY_1x1</TD><TD> - </TD><TD>Mobile</TD> +<TD>WIDGET_SIZE_TYPE_EASY_1x1</TD><TD> - (SQUARE, depends on screen resolution) </TD><TD>Mobile</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_EASY_3x1</TD><TD> - </TD><TD>Mobile</TD> +<TD>WIDGET_SIZE_TYPE_EASY_3x1</TD><TD> - (RECTANGLE, depends on screen resolution) </TD><TD>Mobile</TD> </TR> <TR> -<TD>WIDGET_SIZE_TYPE_EASY_3x3</TD><TD> - </TD><TD>Mobile</TD> +<TD>WIDGET_SIZE_TYPE_EASY_3x3</TD><TD> - (SQARE - depends on screen resolution) </TD><TD>Mobile</TD> </TR> </TABLE> -However the easy mode is not officially supported. -So you will not be able to create your widgets using easy mode size types. -If you are developing the homescreen(or application which is related with widgets), +However the Easy Mode is not a mandatory requirements for viewer application development. +So you will not be able to create your widgets using Easy Mode size types. +But if you are developing the homescreen(or application which is related with widgets displaying), You should care these types too. * diff --git a/include/util.h b/include/util.h index 105ab87..54dee84 100644 --- a/include/util.h +++ b/include/util.h @@ -53,12 +53,17 @@ extern int util_screen_size_get(unsigned int *width, unsigned int *height); static inline bool is_widget_feature_enabled(void) { - bool feature = false; + static bool feature = false; + static bool retrieved = false; int ret; - ret = system_info_get_platform_bool("http://tizen.org/feature/shell.appwidget", &feature); - if (ret != SYSTEM_INFO_ERROR_NONE) { - ErrPrint("system_info: %d\n", ret); + if (retrieved == false) { + ret = system_info_get_platform_bool("http://tizen.org/feature/shell.appwidget", &feature); + if (ret != SYSTEM_INFO_ERROR_NONE) { + ErrPrint("system_info: %d\n", ret); + } else { + retrieved = true; + } } return feature; diff --git a/include/widget_conf.h b/include/widget_conf.h index 474fde5..446c4fc 100644 --- a/include/widget_conf.h +++ b/include/widget_conf.h @@ -268,6 +268,8 @@ extern const double const widget_conf_slave_ttl(void); */ extern const double const widget_conf_slave_activate_time(void); +extern const double const widget_conf_slave_terminate_time(void); + /** * @internal */ @@ -459,102 +461,109 @@ extern const char * const widget_conf_category_list(void); extern const char * const widget_conf_sdk_viewer(void); -extern double widget_conf_fault_detect_in_time(void); -extern int widget_conf_fault_detect_count(void); -extern int widget_conf_reactivate_on_pause(void); +/** + * @internal + */ +extern const int const widget_conf_force_to_terminate(void); + +extern const double const widget_conf_fault_detect_in_time(void); +extern const int const widget_conf_fault_detect_count(void); +extern const int const widget_conf_reactivate_on_pause(void); extern const char * const widget_conf_app_abi(void); -extern double widget_conf_visibility_change_delay(void); -extern int widget_conf_click_region(void); +extern const double const widget_conf_visibility_change_delay(void); +extern const int const widget_conf_click_region(void); extern void widget_conf_set_search_input_node(int flag); +extern const int const widget_conf_update_on_pause(void); -#define WIDGET_CONF_BASE_W widget_conf_base_width() -#define WIDGET_CONF_BASE_H widget_conf_base_height() +#define WIDGET_CONF_BASE_W widget_conf_base_width() +#define WIDGET_CONF_BASE_H widget_conf_base_height() -#define WIDGET_CONF_EMERGENCY_DISK widget_conf_emergency_disk() -#define WIDGET_CONF_SCALE_WIDTH_FACTOR widget_conf_scale_width_factor() -#define WIDGET_CONF_SCALE_HEIGHT_FACTOR widget_conf_scale_height_factor() +#define WIDGET_CONF_EMERGENCY_DISK widget_conf_emergency_disk() +#define WIDGET_CONF_SCALE_WIDTH_FACTOR widget_conf_scale_width_factor() +#define WIDGET_CONF_SCALE_HEIGHT_FACTOR widget_conf_scale_height_factor() -#define WIDGET_CONF_USE_SW_BACKEND widget_conf_use_sw_backend() -#define WIDGET_CONF_PROVIDER_METHOD widget_conf_provider_method() -#define WIDGET_CONF_DEBUG_MODE widget_conf_debug_mode() -#define WIDGET_CONF_OVERWRITE_CONTENT widget_conf_overwrite_content() -#define WIDGET_CONF_COM_CORE_THREAD widget_conf_com_core_thread() +#define WIDGET_CONF_USE_SW_BACKEND widget_conf_use_sw_backend() +#define WIDGET_CONF_PROVIDER_METHOD widget_conf_provider_method() +#define WIDGET_CONF_DEBUG_MODE widget_conf_debug_mode() +#define WIDGET_CONF_OVERWRITE_CONTENT widget_conf_overwrite_content() +#define WIDGET_CONF_COM_CORE_THREAD widget_conf_com_core_thread() -#define WIDGET_CONF_MINIMUM_PERIOD widget_conf_minimum_period() +#define WIDGET_CONF_MINIMUM_PERIOD widget_conf_minimum_period() -#define WIDGET_CONF_DEFAULT_SCRIPT widget_conf_default_script() -#define WIDGET_CONF_DEFAULT_ABI widget_conf_default_abi() -#define WIDGET_CONF_DEFAULT_GBAR_GROUP widget_conf_default_gbar_group() -#define WIDGET_CONF_DEFAULT_PERIOD widget_conf_default_period() -#define WIDGET_CONF_DEFAULT_PIXELS widget_conf_default_pixels() -#define WIDGET_CONF_PRIORITY_NO_CHANGE -1.0f +#define WIDGET_CONF_DEFAULT_SCRIPT widget_conf_default_script() +#define WIDGET_CONF_DEFAULT_ABI widget_conf_default_abi() +#define WIDGET_CONF_DEFAULT_GBAR_GROUP widget_conf_default_gbar_group() +#define WIDGET_CONF_DEFAULT_PERIOD widget_conf_default_period() +#define WIDGET_CONF_DEFAULT_PIXELS widget_conf_default_pixels() +#define WIDGET_CONF_PRIORITY_NO_CHANGE -1.0f -#define WIDGET_CONF_BUNDLE_SLAVE_NAME widget_conf_launch_key_name() -#define WIDGET_CONF_BUNDLE_SLAVE_SECURED widget_conf_launch_key_secured() -#define WIDGET_CONF_BUNDLE_SLAVE_ABI widget_conf_launch_key_abi() +#define WIDGET_CONF_BUNDLE_SLAVE_NAME widget_conf_launch_key_name() +#define WIDGET_CONF_BUNDLE_SLAVE_SECURED widget_conf_launch_key_secured() +#define WIDGET_CONF_BUNDLE_SLAVE_ABI widget_conf_launch_key_abi() #define WIDGET_CONF_BUNDLE_SLAVE_HW_ACCELERATION widget_conf_launch_key_hw_acceleration() -#define WIDGET_CONF_PACKET_TIME widget_conf_default_packet_time() -#define WIDGET_CONF_CONTENT_NO_CHANGE widget_conf_empty_content() -#define WIDGET_CONF_TITLE_NO_CHANGE widget_conf_empty_title() -#define WIDGET_CONF_DEFAULT_TITLE widget_conf_default_title() -#define WIDGET_CONF_DEFAULT_CONTENT widget_conf_default_content() -#define WIDGET_CONF_MINIMUM_SPACE widget_conf_minimum_space() - -#define WIDGET_CONF_IMAGE_PATH widget_conf_share_path() -#define WIDGET_CONF_SCRIPT_PATH widget_conf_script_path() -#define WIDGET_CONF_SCRIPT_PORT_PATH widget_conf_script_port() -#define WIDGET_CONF_CONF_PATH widget_conf_path() -#define WIDGET_CONF_ROOT_PATH widget_conf_root_path() -#define WIDGET_CONF_LOG_PATH widget_conf_log_path() -#define WIDGET_CONF_READER_PATH widget_conf_reader_path() -#define WIDGET_CONF_ALWAYS_PATH widget_conf_always_path() -#define WIDGET_CONF_INPUT_PATH widget_conf_input_path() - -#define WIDGET_CONF_REPLACE_TAG_APPID widget_conf_replace_tag() -#define WIDGET_CONF_SLAVE_TTL widget_conf_slave_ttl() -#define WIDGET_CONF_SLAVE_ACTIVATE_TIME widget_conf_slave_activate_time() -#define WIDGET_CONF_SLAVE_RELAUNCH_TIME widget_conf_slave_relaunch_time() -#define WIDGET_CONF_SLAVE_RELAUNCH_COUNT widget_conf_slave_relaunch_count() - -#define WIDGET_CONF_MAX_LOG_LINE widget_conf_max_log_line() -#define WIDGET_CONF_MAX_LOG_FILE widget_conf_max_log_file() -#define WIDGET_CONF_CATEGORY_LIST widget_conf_category_list() - -#define WIDGET_CONF_SQLITE_FLUSH_MAX widget_conf_sqlite_flush_max() -#define WIDGET_CONF_DBFILE widget_conf_db_path() - -#define WIDGET_CONF_GBAR_REQUEST_TIMEOUT widget_conf_gbar_request_timeout() - -#define WIDGET_CONF_SLAVE_MAX_LOAD widget_conf_slave_max_load() -#define WIDGET_CONF_DEFAULT_PING_TIME widget_conf_ping_time() -#define WIDGET_CONF_PREMULTIPLIED_COLOR widget_conf_premultiplied_alpha() -#define WIDGET_CONF_SERVICES widget_conf_services() -#define WIDGET_CONF_EXTRA_BUFFER_COUNT widget_conf_extra_buffer_count() - -#define WIDGET_CONF_SERVICE_WIDGET "[widget]" -#define WIDGET_CONF_SERVICE_NOTIFICATION "[notification]" -#define WIDGET_CONF_SERVICE_BADGE "[badge]" -#define WIDGET_CONF_SERVICE_SHORTCUT "[shortcut]" -#define WIDGET_CONF_SERVICE_UTILITY "[utility]" -#define WIDGET_CONF_SERVICE_FILE "[file]" - -#define WIDGET_CONF_PAUSED_FILE "/tmp/.live.paused" - -#define WIDGET_CONF_USE_XMONITOR widget_conf_use_xmonitor() -#define WIDGET_CONF_AUTO_ALIGN widget_conf_auto_align() -#define WIDGET_CONF_USE_EVENT_TIME widget_conf_use_event_time() -#define WIDGET_CONF_CHECK_LCD widget_conf_check_lcd() - -#define WIDGET_CONF_USE_GETTIMEOFDAY widget_conf_use_gettimeofday() - -#define WIDGET_CONF_DELAY_TIME 0.0000001f -#define WIDGET_CONF_DEFAULT_CLUSTER "user,created" +#define WIDGET_CONF_PACKET_TIME widget_conf_default_packet_time() +#define WIDGET_CONF_CONTENT_NO_CHANGE widget_conf_empty_content() +#define WIDGET_CONF_TITLE_NO_CHANGE widget_conf_empty_title() +#define WIDGET_CONF_DEFAULT_TITLE widget_conf_default_title() +#define WIDGET_CONF_DEFAULT_CONTENT widget_conf_default_content() +#define WIDGET_CONF_MINIMUM_SPACE widget_conf_minimum_space() + +#define WIDGET_CONF_IMAGE_PATH widget_conf_share_path() +#define WIDGET_CONF_SCRIPT_PATH widget_conf_script_path() +#define WIDGET_CONF_SCRIPT_PORT_PATH widget_conf_script_port() +#define WIDGET_CONF_CONF_PATH widget_conf_path() +#define WIDGET_CONF_ROOT_PATH widget_conf_root_path() +#define WIDGET_CONF_LOG_PATH widget_conf_log_path() +#define WIDGET_CONF_READER_PATH widget_conf_reader_path() +#define WIDGET_CONF_ALWAYS_PATH widget_conf_always_path() +#define WIDGET_CONF_INPUT_PATH widget_conf_input_path() + +#define WIDGET_CONF_REPLACE_TAG_APPID widget_conf_replace_tag() +#define WIDGET_CONF_SLAVE_TTL widget_conf_slave_ttl() +#define WIDGET_CONF_SLAVE_ACTIVATE_TIME widget_conf_slave_activate_time() +#define WIDGET_CONF_SLAVE_RELAUNCH_TIME widget_conf_slave_relaunch_time() +#define WIDGET_CONF_SLAVE_RELAUNCH_COUNT widget_conf_slave_relaunch_count() +#define WIDGET_CONF_SLAVE_TERMINATE_TIME widget_conf_slave_terminate_time() + +#define WIDGET_CONF_MAX_LOG_LINE widget_conf_max_log_line() +#define WIDGET_CONF_MAX_LOG_FILE widget_conf_max_log_file() +#define WIDGET_CONF_CATEGORY_LIST widget_conf_category_list() + +#define WIDGET_CONF_SQLITE_FLUSH_MAX widget_conf_sqlite_flush_max() +#define WIDGET_CONF_DBFILE widget_conf_db_path() + +#define WIDGET_CONF_GBAR_REQUEST_TIMEOUT widget_conf_gbar_request_timeout() + +#define WIDGET_CONF_SLAVE_MAX_LOAD widget_conf_slave_max_load() +#define WIDGET_CONF_DEFAULT_PING_TIME widget_conf_ping_time() +#define WIDGET_CONF_PREMULTIPLIED_COLOR widget_conf_premultiplied_alpha() +#define WIDGET_CONF_SERVICES widget_conf_services() +#define WIDGET_CONF_EXTRA_BUFFER_COUNT widget_conf_extra_buffer_count() + +#define WIDGET_CONF_SERVICE_WIDGET "[widget]" +#define WIDGET_CONF_SERVICE_NOTIFICATION "[notification]" +#define WIDGET_CONF_SERVICE_BADGE "[badge]" +#define WIDGET_CONF_SERVICE_SHORTCUT "[shortcut]" +#define WIDGET_CONF_SERVICE_UTILITY "[utility]" +#define WIDGET_CONF_SERVICE_FILE "[file]" + +#define WIDGET_CONF_PAUSED_FILE "/tmp/.live.paused" + +#define WIDGET_CONF_USE_XMONITOR widget_conf_use_xmonitor() +#define WIDGET_CONF_AUTO_ALIGN widget_conf_auto_align() +#define WIDGET_CONF_USE_EVENT_TIME widget_conf_use_event_time() +#define WIDGET_CONF_CHECK_LCD widget_conf_check_lcd() + +#define WIDGET_CONF_USE_GETTIMEOFDAY widget_conf_use_gettimeofday() + +#define WIDGET_CONF_DELAY_TIME 0.0000001f +#define WIDGET_CONF_DEFAULT_CLUSTER "user,created" #define WIDGET_CONF_MINIMUM_REACTIVATION_TIME 10 -#define WIDGET_CONF_SLAVE_EVENT_BOOST_ON widget_conf_slave_event_boost_on() -#define WIDGET_CONF_SLAVE_EVENT_BOOST_OFF widget_conf_slave_event_boost_off() -#define WIDGET_CONF_EVENT_FILTER widget_conf_event_filter() -#define WIDGET_CONF_SLAVE_LIMIT_TO_TTL widget_conf_slave_limit_to_ttl() +#define WIDGET_CONF_SLAVE_EVENT_BOOST_ON widget_conf_slave_event_boost_on() +#define WIDGET_CONF_SLAVE_EVENT_BOOST_OFF widget_conf_slave_event_boost_off() +#define WIDGET_CONF_EVENT_FILTER widget_conf_event_filter() +#define WIDGET_CONF_SLAVE_LIMIT_TO_TTL widget_conf_slave_limit_to_ttl() #define WIDGET_CONF_FRAME_SKIP widget_conf_frame_skip() #define WIDGET_CONF_SLAVE_AUTO_CACHE_FLUSH widget_conf_slave_auto_cache_flush() #define WIDGET_CONF_FAULT_DETECT_COUNT widget_conf_fault_detect_count() @@ -564,6 +573,8 @@ extern void widget_conf_set_search_input_node(int flag); #define WIDGET_CONF_VISIBILITY_CHANGE_DELAY widget_conf_visibility_change_delay() #define WIDGET_CONF_CLICK_REGION widget_conf_click_region() #define WIDGET_CONF_SDK_VIEWER widget_conf_sdk_viewer() +#define WIDGET_CONF_FORCE_TO_TERMINATE widget_conf_force_to_terminate() +#define WIDGET_CONF_UPDATE_ON_PAUSE widget_conf_update_on_pause() #if !defined(VCONFKEY_MASTER_STARTED) #define VCONFKEY_MASTER_STARTED "memory/data-provider-master/started" diff --git a/include/widget_service_internal.h b/include/widget_service_internal.h index bd52d34..c0b41a8 100644 --- a/include/widget_service_internal.h +++ b/include/widget_service_internal.h @@ -224,7 +224,9 @@ typedef enum widget_buffer_event { WIDGET_BUFFER_EVENT_ACCESS_OVER, /**< mouse over an object */ WIDGET_BUFFER_EVENT_ACCESS_READ, /**< highlight an object */ WIDGET_BUFFER_EVENT_ACCESS_ENABLE, /**< enable highlight and read ability */ - WIDGET_BUFFER_EVENT_ACCESS_DISABLE /**< disable highlight and read ability */ + WIDGET_BUFFER_EVENT_ACCESS_DISABLE, /**< disable highlight and read ability */ + + WIDGET_BUFFER_EVENT_FRAME_SKIP_CLEARED /**< Frame skip is cleared */ } widget_buffer_event_e; /** diff --git a/packaging/libwidget_service.spec b/packaging/libwidget_service.spec index 0368285..ea46aa2 100644 --- a/packaging/libwidget_service.spec +++ b/packaging/libwidget_service.spec @@ -5,7 +5,7 @@ Summary: Service API for gathering installed widget information Version: 1.1.2 Release: 1 Group: Applications/Core Applications -License: Flora License, Version 1.1 +License: Flora-1.1 Source0: %{name}-%{version}.tar.gz Source1001: %{name}.manifest Source2001: wayland-drm.xml diff --git a/src/widget_conf.c b/src/widget_conf.c index d2be70d..233c128 100644 --- a/src/widget_conf.c +++ b/src/widget_conf.c @@ -89,6 +89,7 @@ static const double CONF_DEFAULT_PACKET_TIME = 0.0001f; static const unsigned long CONF_DEFAULT_MINIMUM_SPACE = 5242880; static const double CONF_DEFAULT_SLAVE_TTL = 30.0f; static const double CONF_DEFAULT_SLAVE_ACTIVATE_TIME = 30.0f; +static const double CONF_DEFAULT_SLAVE_TERMINATE_TIME = 30.0f; static const double CONF_DEFAULT_SLAVE_RELAUNCH_TIME = 3.0f; static const int CONF_DEFAULT_SLAVE_RELAUNCH_COUNT = 3; static const int CONF_DEFAULT_MAX_LOG_LINE = 1000; @@ -121,6 +122,9 @@ static const double CONF_DEFAULT_FAULT_DETECT_IN_TIME = 0.0f; static const int CONF_DEFAULT_FAULT_DETECT_COUNT = 0; static const double CONF_DEFAULT_VISIBILITY_CHANGE_DELAY = 0.0f; static const int CONF_DEFAULT_CLICK_REGION = 22; +static const int CONF_DEFAULT_FORCE_TO_TERMINATE = 0; +static const int CONF_DEFAULT_UPDATE_ON_PAUSE = 0; +static const int CONF_DEFAULT_FRAME_SKIP = 0; #define CONF_PATH_FORMAT "/usr/share/data-provider-master/%dx%d/conf.ini" @@ -167,6 +171,7 @@ struct widget_conf { double slave_ttl; double slave_activate_time; + double slave_terminate_time; double slave_relaunch_time; int slave_relaunch_count; @@ -232,6 +237,9 @@ struct widget_conf { int click_region; char *sdk_viewer; + + int force_to_terminate; + int update_on_pause; }; static struct widget_conf s_conf; @@ -532,10 +540,18 @@ static void slave_activate_time_handler(char *buffer) DbgPrint("Slave activate time: %lf\n", s_conf.slave_activate_time); } +static void slave_terminate_time_handler(char *buffer) +{ + if (sscanf(buffer, "%lf", &s_conf.slave_terminate_time) != 1) { + ErrPrint("Failed to parse the slave_terminate_time\n"); + } + DbgPrint("Slave terminate time: %lf\n", s_conf.slave_terminate_time); +} + static void slave_relaunch_time_handler(char *buffer) { if (sscanf(buffer, "%lf", &s_conf.slave_relaunch_time) != 1) { - ErrPrint("Failed to parse the slave_activate_time\n"); + ErrPrint("Failed to parse the slave_relaunch_time\n"); } DbgPrint("Slave relaunch time: %lf\n", s_conf.slave_relaunch_time); } @@ -623,6 +639,16 @@ static void click_region_handler(char *buffer) } } +static void force_to_terminate_handler(char *buffer) +{ + s_conf.force_to_terminate = !strcasecmp(buffer, "true"); +} + +static void update_on_pause_handler(char *buffer) +{ + s_conf.update_on_pause = !strcasecmp(buffer, "true"); +} + static char *parse_handler(const char *buffer) { const char *node_prefix = NODE_PREFIX; @@ -959,6 +985,7 @@ EAPI void widget_conf_init(void) s_conf.default_packet_time = CONF_DEFAULT_PACKET_TIME; s_conf.slave_ttl = CONF_DEFAULT_SLAVE_TTL; s_conf.slave_activate_time = CONF_DEFAULT_SLAVE_ACTIVATE_TIME; + s_conf.slave_terminate_time = CONF_DEFAULT_SLAVE_TERMINATE_TIME; s_conf.slave_relaunch_time = CONF_DEFAULT_SLAVE_RELAUNCH_TIME; s_conf.slave_relaunch_count = CONF_DEFAULT_SLAVE_RELAUNCH_COUNT; s_conf.max_log_line = CONF_DEFAULT_MAX_LOG_LINE; @@ -1018,6 +1045,9 @@ EAPI void widget_conf_init(void) s_conf.visibility_change_delay = CONF_DEFAULT_VISIBILITY_CHANGE_DELAY; s_conf.click_region = CONF_DEFAULT_CLICK_REGION; s_conf.sdk_viewer = (char *)CONF_DEFAULT_SDK_VIEWER; + s_conf.force_to_terminate = CONF_DEFAULT_FORCE_TO_TERMINATE; + s_conf.update_on_pause = CONF_DEFAULT_UPDATE_ON_PAUSE; + s_conf.frame_skip = CONF_DEFAULT_FRAME_SKIP; } /* @@ -1140,6 +1170,10 @@ EAPI int widget_conf_load(void) .handler = slave_activate_time_handler, }, { + .name = "slave_terminate_time", + .handler = slave_terminate_time_handler, + }, + { .name = "slave_relaunch_time", .handler = slave_relaunch_time_handler, }, @@ -1308,6 +1342,14 @@ EAPI int widget_conf_load(void) .handler = click_region_handler, }, { + .name = "force_to_terminate", + .handler = force_to_terminate_handler, + }, + { + .name = "update_on_pause", + .handler = update_on_pause_handler, + }, + { .name = NULL, .handler = NULL, }, @@ -1516,6 +1558,7 @@ EAPI void widget_conf_reset(void) s_conf.default_packet_time = CONF_DEFAULT_PACKET_TIME; s_conf.slave_ttl = CONF_DEFAULT_SLAVE_TTL; s_conf.slave_activate_time = CONF_DEFAULT_SLAVE_ACTIVATE_TIME; + s_conf.slave_terminate_time = CONF_DEFAULT_SLAVE_TERMINATE_TIME; s_conf.slave_relaunch_time = CONF_DEFAULT_SLAVE_RELAUNCH_TIME; s_conf.slave_relaunch_count = CONF_DEFAULT_SLAVE_RELAUNCH_COUNT; s_conf.max_log_line = CONF_DEFAULT_MAX_LOG_LINE; @@ -1546,6 +1589,7 @@ EAPI void widget_conf_reset(void) s_conf.fault_detect_count = CONF_DEFAULT_FAULT_DETECT_COUNT; s_conf.fault_detect_in_time = CONF_DEFAULT_FAULT_DETECT_IN_TIME; s_conf.reactivate_on_pause = CONF_DEFAULT_REACTIVATE_ON_PAUSE; + s_conf.frame_skip = CONF_DEFAULT_FRAME_SKIP; if (s_conf.sdk_viewer != CONF_DEFAULT_SDK_VIEWER) { free(s_conf.sdk_viewer); @@ -1688,6 +1732,8 @@ EAPI void widget_conf_reset(void) } s_conf.click_region = CONF_DEFAULT_CLICK_REGION; + s_conf.force_to_terminate = CONF_DEFAULT_FORCE_TO_TERMINATE; + s_conf.update_on_pause = CONF_DEFAULT_UPDATE_ON_PAUSE; s_info.conf_loaded = 0; } @@ -1827,6 +1873,11 @@ EAPI const double const widget_conf_slave_activate_time(void) return s_conf.slave_activate_time; } +EAPI const double const widget_conf_slave_terminate_time(void) +{ + return s_conf.slave_terminate_time; +} + EAPI const double const widget_conf_slave_relaunch_time(void) { return s_conf.slave_relaunch_time; @@ -2007,17 +2058,17 @@ EAPI const char * const widget_conf_category_list(void) return s_conf.category_list; } -EAPI double widget_conf_fault_detect_in_time(void) +EAPI const double const widget_conf_fault_detect_in_time(void) { return s_conf.fault_detect_in_time; } -EAPI int widget_conf_fault_detect_count(void) +EAPI const int const widget_conf_fault_detect_count(void) { return s_conf.fault_detect_count; } -EAPI int widget_conf_reactivate_on_pause(void) +EAPI const int const widget_conf_reactivate_on_pause(void) { return s_conf.reactivate_on_pause; } @@ -2027,12 +2078,12 @@ EAPI const char * const widget_conf_app_abi(void) return s_conf.app_abi; } -EAPI double widget_conf_visibility_change_delay(void) +EAPI const double const widget_conf_visibility_change_delay(void) { return s_conf.visibility_change_delay; } -EAPI int widget_conf_click_region(void) +EAPI const int const widget_conf_click_region(void) { return s_conf.click_region; } @@ -2042,4 +2093,14 @@ EAPI const char * const widget_conf_sdk_viewer(void) return s_conf.sdk_viewer; } +EAPI const int const widget_conf_force_to_terminate(void) +{ + return s_conf.force_to_terminate; +} + +EAPI const int const widget_conf_update_on_pause(void) +{ + return s_conf.update_on_pause; +} + /* End of a file */ |