summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranirudha_r.c <anirudha_r.c@samsung.com>2017-01-06 13:05:21 +0530
committerVijay Tiwari <vijay.tiwari@samsung.com>2017-01-06 04:37:21 -0800
commit6cd93b9be7ab988f82eb3dc3a96b557ca75d4bed (patch)
treeb31f1d53439c35dfafa9027879d9ba961ac3b6cd
parentbda988f2883f064053acc98f0b8018efc28fcae8 (diff)
downloadstopwatch-6cd93b9be7ab988f82eb3dc3a96b557ca75d4bed.tar.gz
stopwatch-6cd93b9be7ab988f82eb3dc3a96b557ca75d4bed.tar.bz2
stopwatch-6cd93b9be7ab988f82eb3dc3a96b557ca75d4bed.zip
[Stopwatch] Code commentssubmit/tizen/20170110.054341
Change-Id: I38e04917acb4d47ada9615b505a1fdd6cec5d370 (cherry picked from commit 976f285aa2ff058d538289041cf863070f2e45e1)
-rw-r--r--inc/stopwatch_new.h143
-rw-r--r--src/stopwatch_new.c307
2 files changed, 422 insertions, 28 deletions
diff --git a/inc/stopwatch_new.h b/inc/stopwatch_new.h
index 3b67b3b..1c2b224 100644
--- a/inc/stopwatch_new.h
+++ b/inc/stopwatch_new.h
@@ -145,37 +145,178 @@ typedef struct {
} appdata;
-void _stw_insert_log(char *uri, char *cAppid, char *cFeature, char *cExtra, char *cValue);
+/*
+ * @brief: Function used to manage state of the buttons in stopwatch layout
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_update_button(void *data);
+
+/*
+ * @brief: Function used to update the time in the laplist panel
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[show_time]: in, The system time value
+ */
void _stw_update_panel_time(void *data, double show_time);
+
+/*
+ * @brief: Function used to update "second" marker position
+ * @param[obj]: in, Evas object of the "second" marker
+ * @param[type]: in, The offset degree value to be set to the image
+ */
void _stw_update_rotation_img(Evas_Object* obj, double degree);
+/*
+ * @brief: Function used to change system time format from string to double
+ * @param[uptime]: in, The system time string
+ */
double stw_change_atof(char *uptime_str);
+
+/*
+ * @brief: Function used to extract particular component from system time
+ * @param[dval]: in, The system time
+ * @param[type]: in, The content type to be extracted from the system time (second, millisecond, etc.)
+ */
time_t stw_change_systime_to_time_t(double dval, STW_TIME_TYPE type);
+/*
+ * @brief: Function used to get the current system time
+ */
double stw_get_systime();
+
+/*
+ * @brief: Function used to prepare laptitle string
+ * @param[count]: in, The count of current number of laps
+ */
char *_stw_get_num_str(unsigned int count);
+/*
+ * @brief: The callback is triggered when clicked on start button
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_start_cb(void *data);
+
+/*
+ * @brief: The callback triggered when clicked on stop button
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_stop_cb(void *data);
+
+/*
+ * @brief: The callback triggered when clicked on lap button
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_lap_cb(void *data);
+
+/*
+ * @brief: The callback triggered when clicked on reset button
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_reset_cb(void *data);
+
+/*
+ * @brief: The callback triggered when clicked on top button
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
void _stw_top_cb(void *data, Evas_Object * obj, void *event_info);
+
+/*
+ * @brief: The callback triggered when clicked on bottom button
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
void _stw_bottom_cb(void *data, Evas_Object * obj, void *event_info);
+
+/*
+ * @brief: This callback function is used to set the title of laplist in stopwatch
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ */
char* _title_set_cb(void *data, Evas_Object *obj);
+
+/*
+ * @brief: This callback function is used to set the time of stopwatch
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ */
char* _time_set_cb(void *data, Evas_Object *obj);
+/*
+ * @brief: This callback function is used to trigger tap on top button for screen reader
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ * @param[event_info]: in, The information about the event triggerign the callback
+ */
Eina_Bool _stw_top_double_cb(void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info);
+
+/*
+ * @brief: This callback function is used to trigger tap on bottom button for screen reader
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ * @param[event_info]: in, The information about the event triggerign the callback
+ */
Eina_Bool _stw_bottom_double_cb(void *data, Evas_Object * obj, void *event_info);
+
+/*
+ * @brief: This callback function is used to trigger laplist panel view for screen reader
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ * @param[event_info]: in, The information about the event triggerign the callback
+ */
Eina_Bool _stw_indicator_double_cb(void *data, Evas_Object * obj, void *event_info);
+/*
+ * @brief: Function to load or set the edje file to layout
+ * @param[parent]: in, evas object of the parent
+ * @param[file]: in, The file path for the edje file
+ * @param[group]: in, The name of the group which is being loaded
+ */
Evas_Object *load_edj(Evas_Object * parent, const char *file, const char *group);
+
+/*
+ * @brief: Function to create laplist panel and initialize properties to it
+ * @param[parent]: in, evas object of the parent
+ * @param[data]: in, The app data structure to be passed to the function
+ */
Evas_Object *_stw_create_panel(Evas_Object *parent, void *data);
+
+/*
+ * @brief: Function to create circular progressbar
+ * @param[parent]: in, evas object of the parent
+ * @param[circle_eo]: in, evas object of circular surface in layout
+ */
Evas_Object *_stw_create_progressbar(Evas_Object *parent, Evas_Object *circle_eo);
+
+/*
+ * @brief: Function to create a drawer
+ * @param[parent]: in, evas object of the parent
+ */
Evas_Object *_stw_create_drawer(Evas_Object *parent);
+
+/*
+ * @brief: Function to create a naviframe
+ * @param[parent]: in, evas object of the parent
+ */
Evas_Object *_stw_create_naviframe(Evas_Object *parent);
+
+/*
+ * @brief: Function to create a layout
+ * @param[parent]: in, evas object of the parent
+ */
Evas_Object *_stw_create_layout(Evas_Object *parent);
+
+/*
+ * @brief: Function to create a conformant window
+ * @param[parent]: in, evas object of the parent
+ */
Evas_Object *_stw_create_conform(Evas_Object *parent);
+
+/*
+ * @brief: Function to create a window
+ * @param[name]: in, Value of window title
+ */
Evas_Object *_stw_create_win(const char *name);
#endif /* __APP_COMMON_H__ */
diff --git a/src/stopwatch_new.c b/src/stopwatch_new.c
index 79c00c9..71a94a2 100644
--- a/src/stopwatch_new.c
+++ b/src/stopwatch_new.c
@@ -95,6 +95,10 @@ static Elm_Genlist_Item_Class itc_padding = {
.func.del = NULL,
};
+/*
+ * @brief: Function used to manage state of the buttons in stopwatch layout
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_update_button(void *data)
{
appdata *ad = (appdata *)data;
@@ -233,6 +237,11 @@ void _stw_update_button(void *data)
}
}
+/*
+ * @brief: Function used to update the time in the laplist panel
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[show_time]: in, The system time value
+ */
void _stw_update_panel_time(void *data, double show_time)
{
if (!data) {
@@ -344,6 +353,11 @@ void _stw_update_panel_time(void *data, double show_time)
ad->pastMin = (int)tmShowTime.tm_min;
}
+/*
+ * @brief: Function used to update "second" marker position
+ * @param[obj]: in, Evas object of the "second" marker
+ * @param[type]: in, The offset degree value to be set to the image
+ */
void _stw_update_rotation_img(Evas_Object* obj, double degree)
{
Evas_Map* map = evas_map_new(4);
@@ -359,6 +373,10 @@ void _stw_update_rotation_img(Evas_Object* obj, double degree)
evas_map_free(map);
}
+/*
+ * @brief: Function used to change system time format from string to double
+ * @param[uptime]: in, The system time string
+ */
double stw_change_atof(char *uptime_str)
{
int i = 0, flag = 0, idx = 0;
@@ -384,6 +402,11 @@ double stw_change_atof(char *uptime_str)
return res;
}
+/*
+ * @brief: Function used to extract particular component from system time
+ * @param[dval]: in, The system time
+ * @param[type]: in, The content type to be extracted from the system time (second, millisecond, etc.)
+ */
time_t stw_change_systime_to_time_t(double dval, STW_TIME_TYPE type)
{
if (0 == dval)
@@ -405,6 +428,10 @@ time_t stw_change_systime_to_time_t(double dval, STW_TIME_TYPE type)
}
}
+/*
+ * @brief: Function used to change the string from lower case to upper case
+ * @param[text]: in-out, The input text and output text
+ */
static void _stw_change_string_to_upper(char *text)
{
gchar *strLower = (gchar *)text;
@@ -414,6 +441,12 @@ static void _stw_change_string_to_upper(char *text)
g_free(goodUpper);
}
+/*
+ * @brief: Function used to change the position of colon in laplist (genlist) item
+ * @param[str]: in-out, The input string and the new formatted string
+ * @param[old_text]: in, The string which has to be shifted
+ * @param[new_text]: in, The new template according to which string should be changed
+ */
static void _stw_change_semicolon_position(char *str, char *old_text, char *new_text)
{
char *pch = NULL;
@@ -430,6 +463,10 @@ static void _stw_change_semicolon_position(char *str, char *old_text, char *new_
}
}
+/*
+ * @brief: Function used to set state of device display lock
+ * @param[isLock]: in, The boolean value of the state
+ */
static void _stw_set_pm_state(Eina_Bool isLock)
{
int ret = 0;
@@ -442,6 +479,9 @@ static void _stw_set_pm_state(Eina_Bool isLock)
}
}
+/*
+ * @brief: Function used to get the current system time
+ */
double stw_get_systime()
{
double sys_time = 0;
@@ -459,6 +499,10 @@ double stw_get_systime()
return 0;
}
+/*
+ * @brief: Function used to prepare laptitle string
+ * @param[count]: in, The count of current number of laps
+ */
char *_stw_get_num_str(unsigned int count)
{
char *ret_str = NULL;
@@ -485,6 +529,12 @@ char *_stw_get_num_str(unsigned int count)
return ret_str;
}
+/*
+ * @brief: The function is attached to the lap genlist to get text of selected item
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, Evas object of the parent
+ * @param[part]: in, The part name of the selected component in genlist
+ */
static char *_stw_gls_label_get(void *data, Evas_Object * obj, const char *part)
{
struct lap_data *items = (struct lap_data *)data;
@@ -506,22 +556,46 @@ static char *_stw_gls_label_get(void *data, Evas_Object * obj, const char *part)
return NULL;
}
+/*
+ * @brief: The function is attached to the lap genlist to get content of selected item
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, Evas object of the parent
+ * @param[part]: in, The part name of the selected component in genlist
+ */
static Evas_Object *_stw_gls_icon_get(void *data, Evas_Object * obj, const char *part)
{
return NULL;
}
+/*
+ * @brief: The function is attached to the lap genlist to get state of selected item
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, Evas object of the parent
+ * @param[part]: in, The part name of the selected component in genlist
+ */
static Eina_Bool _stw_gls_state_get(void *data, Evas_Object * obj, const char *part)
{
return EINA_FALSE;
}
+/*
+ * @brief: The function is attached to the lap genlist to set item as selected
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, Evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
void _stw_gls_sel(void *data, Evas_Object * obj, void *event_info)
{
Elm_Object_Item *gli = (Elm_Object_Item *) (event_info);
elm_genlist_item_selected_set(gli, 0);
}
+/*
+ * @brief: The callback is called when state of the bottom panel is toggled
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, Evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
void _stw_panel_toggle_cb(void *data, Evas_Object *obj, void *event_info)
{
//_STW_ENTER_;
@@ -613,6 +687,12 @@ void _stw_panel_toggle_cb(void *data, Evas_Object *obj, void *event_info)
}
}
+/*
+ * @brief: The callback is attached to the bottom panel when state is hold
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, Evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
static void _stw_panel_hold_cb(void *data, Evas_Object *obj, void *event_info)
{
//_STW_ENTER_;
@@ -627,6 +707,12 @@ static void _stw_panel_hold_cb(void *data, Evas_Object *obj, void *event_info)
ad->isBackBtnCb = EINA_FALSE;
}
+/*
+ * @brief: The callback is attached to the bottom panel when state is unhold
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, Evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
void _stw_panel_unhold_cb(void *data, Evas_Object *obj, void *event_info)
{
//_STW_ENTER_;
@@ -671,6 +757,12 @@ void _stw_panel_unhold_cb(void *data, Evas_Object *obj, void *event_info)
}
}
+/*
+ * @brief: The callback is attached to the bottom panel for scroll event
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, Evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
static void _stw_panel_scroll_cb(void *data, Evas_Object *obj, void *event_info)
{
if (!data) {
@@ -720,7 +812,14 @@ static void _stw_panel_scroll_cb(void *data, Evas_Object *obj, void *event_info)
}
}
-static void _stw_panel_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_infofo)
+/*
+ * @brief: The callback is attached to the bottom panel on mouse up
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[e]:in, An opaque handle to an Evas canvas.
+ * @param[obj]: in, Evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
+static void _stw_panel_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
if (!data) {
STW_ERR("data is NULL !!");
@@ -740,6 +839,11 @@ static void _stw_panel_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_
}
}
+/*
+ * @brief: The callback is used to delete the zoomin transition
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[transit]:in, The transition type applied to the object
+ */
static void _stw_zoomin_del_cb(void *data, Elm_Transit *transit)
{
if (!data) {
@@ -752,6 +856,11 @@ static void _stw_zoomin_del_cb(void *data, Elm_Transit *transit)
ad->tr = NULL;
}
+/*
+ * @brief: The callback is used to delete the zoomout transition
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[transit]:in, The transition type applied to the object
+ */
static void _stw_zoomout_del_cb(void *data, Elm_Transit *transit)
{
if (!data) {
@@ -764,6 +873,10 @@ static void _stw_zoomout_del_cb(void *data, Elm_Transit *transit)
ad->tr = NULL;
}
+/*
+ * @brief: The callback is used to update the animator progress
+ * @param[data]: in, The app data structure to be passed to the function
+ */
static Eina_Bool _stw_animator_cb(void *data)
{
if (!data)
@@ -785,6 +898,10 @@ static Eina_Bool _stw_animator_cb(void *data)
}
}
+/*
+ * @brief: The callback is used to update the progressbar progress
+ * @param[data]: in, The app data structure to be passed to the function
+ */
static Eina_Bool _stw_vi_timer_cb(void *data)
{
if (!data)
@@ -815,6 +932,12 @@ static Eina_Bool _stw_vi_timer_cb(void *data)
}
}
+/*
+ * @brief: The callback is attached to the naviframe
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
static void _pop_cb(void *data, Evas_Object *obj, void *event_info)
{
if (!data)
@@ -831,6 +954,10 @@ static void _pop_cb(void *data, Evas_Object *obj, void *event_info)
}
}
+/*
+ * @brief: The callback is triggered when clicked on start button
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_start_cb(void *data)
{
if (!data)
@@ -863,7 +990,10 @@ void _stw_start_cb(void *data)
_stw_update_button(ad);
}
-
+/*
+ * @brief: The callback triggered when clicked on stop button
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_stop_cb(void *data)
{
if (!data)
@@ -893,6 +1023,10 @@ void _stw_stop_cb(void *data)
}
}
+/*
+ * @brief: The callback triggered when clicked on lap button
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_lap_cb(void *data)
{
STW_INFO("Laps update");
@@ -1077,6 +1211,10 @@ void _stw_lap_cb(void *data)
}
}
+/*
+ * @brief: The callback triggered when clicked on reset button
+ * @param[data]: in, The app data structure to be passed to the function
+ */
void _stw_reset_cb(void *data)
{
if (!data)
@@ -1147,6 +1285,12 @@ void _stw_reset_cb(void *data)
_stw_update_button(ad);
}
+/*
+ * @brief: The callback triggered when clicked on top button
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
void _stw_top_cb(void *data, Evas_Object * obj, void *event_info)
{
if (!data)
@@ -1173,6 +1317,12 @@ void _stw_top_cb(void *data, Evas_Object * obj, void *event_info)
}
}
+/*
+ * @brief: The callback triggered when clicked on bottom button
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
void _stw_bottom_cb(void *data, Evas_Object * obj, void *event_info)
{
if (!data)
@@ -1203,30 +1353,23 @@ void _stw_bottom_cb(void *data, Evas_Object * obj, void *event_info)
}
}
-void _stw_insert_log(char *uri, char *cAppid, char *cFeature, char *cExtra, char *cValue)
-{
- STW_INFO("[Logging] Feature:%s, Extra:%s", cFeature, cExtra);
-
- bundle *log_data;
- log_data = bundle_create();
- bundle_add_str(log_data, "app_id", cAppid);
- bundle_add_str(log_data, "feature", cFeature);
-
- if (cExtra)
- bundle_add_str(log_data, "extra", cExtra);
-
- if (cValue)
- bundle_add_str(log_data, "value", cValue);
-
- bundle_free(log_data);
- log_data = NULL;
-}
-
+/*
+ * @brief: Function delete window
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, evas object of the parent
+ * @param[event_info]: in, The information of the event which triggered the function
+ */
static void _win_del(void *data, Evas_Object * obj, void *event_info)
{
elm_exit();
}
+/*
+ * @brief: Function to load or set the edje file to layout
+ * @param[parent]: in, evas object of the parent
+ * @param[file]: in, The file path for the edje file
+ * @param[group]: in, The name of the group which is being loaded
+ */
Evas_Object *load_edj(Evas_Object * parent, const char *file, const char *group)
{
Evas_Object *eo;
@@ -1243,6 +1386,11 @@ Evas_Object *load_edj(Evas_Object * parent, const char *file, const char *group)
return eo;
}
+/*
+ * @brief: Function to create the "mark" animation - line
+ * @param[parent]: in, evas object of the parent
+ * @param[data]: in, The app data structure to be passed to the function
+ */
static void _stw_create_animator_mark(Evas_Object *parent, void *data)
{
appdata *ad = (appdata *)data;
@@ -1261,6 +1409,11 @@ static void _stw_create_animator_mark(Evas_Object *parent, void *data)
}
+/*
+ * @brief: Function to create the "second" animation - line
+ * @param[parent]: in, evas object of the parent
+ * @param[data]: in, The app data structure to be passed to the function
+ */
static void _stw_create_animator_sec(Evas_Object *parent, void *data)
{
appdata *ad = (appdata *)data;
@@ -1279,12 +1432,22 @@ static void _stw_create_animator_sec(Evas_Object *parent, void *data)
}
+/*
+ * @brief: The callback called when start button is clicked, for logging
+ * @param[data]: in, The app data structure to be passed to the function
+ * @param[obj]: in, evas object of the parent
+ */
static void
start_button_cb(void *data, Evas_Object *obj, const char *emission, const char *source) {
dlog_print(DLOG_INFO, LOG_TAG, "start clicked");
};
+/*
+ * @brief: Function to create laplist panel and initialize properties to it
+ * @param[parent]: in, evas object of the parent
+ * @param[data]: in, The app data structure to be passed to the function
+ */
Evas_Object *_stw_create_panel(Evas_Object *parent, void *data)
{
STW_INFO("create panel: %s", data);
@@ -1351,6 +1514,11 @@ Evas_Object *_stw_create_panel(Evas_Object *parent, void *data)
return eo;
}
+/*
+ * @brief: Function to create circular progressbar
+ * @param[parent]: in, evas object of the parent
+ * @param[circle_eo]: in, evas object of circular surface in layout
+ */
Evas_Object *_stw_create_progressbar(Evas_Object *parent, Evas_Object *circle_eo)
{
Evas_Object *eo = NULL;
@@ -1372,6 +1540,10 @@ Evas_Object *_stw_create_progressbar(Evas_Object *parent, Evas_Object *circle_eo
return eo;
}
+/*
+ * @brief: Function to create a drawer
+ * @param[parent]: in, evas object of the parent
+ */
Evas_Object *_stw_create_drawer(Evas_Object *parent)
{
Evas_Object *eo = NULL;
@@ -1383,6 +1555,10 @@ Evas_Object *_stw_create_drawer(Evas_Object *parent)
return eo;
}
+/*
+ * @brief: Function to create a naviframe
+ * @param[parent]: in, evas object of the parent
+ */
Evas_Object *_stw_create_naviframe(Evas_Object *parent)
{
Evas_Object *eo = NULL;
@@ -1394,6 +1570,10 @@ Evas_Object *_stw_create_naviframe(Evas_Object *parent)
return eo;
}
+/*
+ * @brief: Function to create a layout
+ * @param[parent]: in, evas object of the parent
+ */
Evas_Object *_stw_create_layout(Evas_Object *parent)
{
Evas_Object *eo = NULL;
@@ -1407,6 +1587,10 @@ Evas_Object *_stw_create_layout(Evas_Object *parent)
return eo;
}
+/*
+ * @brief: Function to create a conformant window
+ * @param[parent]: in, evas object of the parent
+ */
Evas_Object *_stw_create_conform(Evas_Object *parent)
{
Evas_Object *eo = NULL;
@@ -1424,6 +1608,10 @@ Evas_Object *_stw_create_conform(Evas_Object *parent)
return eo;
}
+/*
+ * @brief: Function to create a window
+ * @param[name]: in, Value of window title
+ */
Evas_Object *_stw_create_win(const char *name)
{
Evas_Object *eo;
@@ -1441,6 +1629,12 @@ Evas_Object *_stw_create_win(const char *name)
return eo;
}
+/*
+ * @brief: This callback function is used to trigger tap on top button for screen reader
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ * @param[event_info]: in, The information about the event triggerign the callback
+ */
Eina_Bool _stw_top_double_cb(void *data, Evas_Object *obj, Elm_Access_Action_Info *action_info)
{
if (!data) {
@@ -1471,6 +1665,12 @@ Eina_Bool _stw_top_double_cb(void *data, Evas_Object *obj, Elm_Access_Action_Inf
return EINA_TRUE;
}
+/*
+ * @brief: This callback function is used to trigger tap on bottom button for screen reader
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ * @param[event_info]: in, The information about the event triggerign the callback
+ */
Eina_Bool _stw_bottom_double_cb(void *data, Evas_Object * obj, void *event_info)
{
if (!data) {
@@ -1505,6 +1705,12 @@ Eina_Bool _stw_bottom_double_cb(void *data, Evas_Object * obj, void *event_info)
return EINA_TRUE;
}
+/*
+ * @brief: This callback function is used to trigger laplist panel view for screen reader
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ * @param[event_info]: in, The information about the event triggerign the callback
+ */
Eina_Bool _stw_indicator_double_cb(void *data, Evas_Object * obj, void *event_info)
{
appdata *ad = (appdata *)data;
@@ -1514,6 +1720,11 @@ Eina_Bool _stw_indicator_double_cb(void *data, Evas_Object * obj, void *event_in
return EINA_TRUE;
}
+/*
+ * @brief: This callback function is used to set the title of laplist in stopwatch
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ */
char* _title_set_cb(void *data, Evas_Object *obj)
{
appdata *ad = (appdata *)data;
@@ -1526,6 +1737,11 @@ char* _title_set_cb(void *data, Evas_Object *obj)
return strdup(buf);
}
+/*
+ * @brief: This callback function is used to set the time of stopwatch
+ * @param[data]: in, The app structure data to be passed to the functions
+ * @param[obj]:in, The parent evas object passed to the callback
+ */
char* _time_set_cb(void *data, Evas_Object *obj)
{
appdata *ad = (appdata *)data;
@@ -1536,6 +1752,12 @@ char* _time_set_cb(void *data, Evas_Object *obj)
return strdup(buf);
}
+/*
+ * @brief: This callback function is called when another application
+ * sends the launch request to the application
+ * @param[service]: in, App Control handle
+ * @param[data]: in, The app structure data to be passed to the functions
+ */
static void app_control(app_control_h service, void *data)
{
STW_INFO("[START] app_control");
@@ -1625,9 +1847,6 @@ static void app_control(app_control_h service, void *data)
ad->isBackBtnCb = EINA_FALSE;
ad->tr = NULL;
-
-
-
// Swallow Image.
ad->animator_img = load_edj(ad->ly_main, edje_file_path, "clock_img_swallow");
elm_object_part_content_set(ad->ly_main, "elm.swallow.body", ad->animator_img);
@@ -1636,9 +1855,7 @@ static void app_control(app_control_h service, void *data)
_stw_create_animator_sec(ad->animator_img, ad);
_stw_create_animator_mark(ad->animator_img, ad);
-
// Set Naviframe.
-
ad->it = elm_naviframe_item_push(ad->naviframe, NULL, NULL, NULL, ad->drawer, NULL);
elm_naviframe_item_title_enabled_set(ad->it, EINA_FALSE, EINA_FALSE);
//elm_naviframe_item_pop_cb_set(ad->it, _pop_cb, ad);
@@ -1713,6 +1930,11 @@ static void app_control(app_control_h service, void *data)
STW_INFO("[END] app_control");
}
+/*
+ * @brief: This callback function is called each time
+ * the application becomes visible to the user
+ * @param[data]: in, The app structure data to be passed to the functions
+ */
static void app_resume(void *data)
{
STW_INFO("app_resume");
@@ -1740,7 +1962,12 @@ static void app_resume(void *data)
}
}
-
+/*
+ * @brief: This callback function is called each time
+ * the application is completely obscured by another application
+ * and becomes invisible to the user
+ * @param[data]: in, The app structure data to be passed to the functions
+ */
static void app_pause(void *data)
{
STW_INFO("app_pause");
@@ -1762,6 +1989,10 @@ static void app_pause(void *data)
}
}
+/*
+ * @brief: This callback function is called once after the main loop of the application exits
+ * @param[data]: in, The app structure data to be passed to the functions
+ */
static void app_terminate(void *data)
{
STW_INFO("app_terminate");
@@ -1770,6 +2001,13 @@ static void app_terminate(void *data)
feedback_deinitialize();
}
+/*
+ * @brief: Hook to take necessary actions before main event loop starts
+ * Initialize UI resources and application's data
+ * If this function returns true, the main loop of application starts
+ * If this function returns false, the application is terminated
+ * @param[data]: in, The app structure data to be passed to the functions
+ */
static bool app_create(void *data)
{
STW_INFO("[START] app_create");
@@ -1835,6 +2073,10 @@ static bool app_create(void *data)
return TRUE; //EXIT_SUCCESS
}
+/*
+ * @brief: This function will be called when the language is changed
+ * @param[data]: in, The app structure data to be passed to the functions
+ */
static void _stw_lang_changed(void *data)
{
STW_INFO("_stw_lang_changed");
@@ -1903,6 +2145,10 @@ static void _stw_lang_changed(void *data)
}
}
+/*
+ * @brief: This function will be called when the language is changed
+ * @param[data]: in, The app structure data to be passed to the functions
+ */
static void ui_app_lang_changed(void *data)
{
STW_INFO("language changed");
@@ -1912,11 +2158,18 @@ static void ui_app_lang_changed(void *data)
_stw_lang_changed(data);
}
+/*
+ * @brief: This function will be called when the region is changed
+ * @param[data]: in, The app structure data to be passed to the functions
+ */
static void ui_app_region_changed(void *data)
{
STW_INFO("region changed");
}
+/*
+* @brief: main function of the application
+*/
int main(int argc, char *argv[])
{
int ret;