Added more verbose error to view_set_image.
[apps/native/sample/sample-core-components.git] / rule / project / src / view.c
index 9b7c3cd..bcade0c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
+static struct view_info {
+       Evas_Object *win;
+       Evas_Object *conform;
+} s_info = {
+       .win = NULL,
+       .conform = NULL,
+};
+
 /*
  * @brief: Create Essential Object window, conformant and layout
- * @param[ad]: Structure has some important information for managing this application
  */
-void view_create(appdata_s *ad)
+void view_create(void)
 {
-       if (ad == NULL) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "appdata is NULL.");
-               return;
-       }
-
        /* Create window */
-       ad->win = view_create_win(PACKAGE);
-       if (ad->win == NULL) {
+       s_info.win = view_create_win(PACKAGE);
+       if (s_info.win == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window.");
                return;
        }
 
        /* Create conformant */
-       ad->conform = view_create_conformant_without_indicator(ad->win);
-       if (ad->conform == NULL) {
+       s_info.conform = view_create_conformant_without_indicator(s_info.win);
+       if (s_info.conform == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant");
                return;
        }
 
        /* Show window after main view is set up */
-       evas_object_show(ad->win);
+       evas_object_show(s_info.win);
 }
 
 /*
  * @brief: Make a basic window named package
- * @param[package]: Name of the window
+ * @param[pkg_name]: Name of the window
  */
 Evas_Object *view_create_win(const char *pkg_name)
 {
        Evas_Object *win = NULL;
 
-       /* Window */
-       /* Create and initialize elm_win.
-          elm_win is mandatory to manipulate window. */
-
+       /*
+        * Window
+        * Create and initialize elm_win.
+        * elm_win is mandatory to manipulate window
+        */
        win = elm_win_util_standard_add(pkg_name, pkg_name);
        elm_win_conformant_set(win, EINA_TRUE);
        elm_win_autodel_set(win, EINA_TRUE);
@@ -73,11 +76,12 @@ Evas_Object *view_create_win(const char *pkg_name)
 /*
  * @brief: Make a conformant without indicator for wearable app
  * @param[win]: The object to which you want to set this conformant
- * Confromant is mandatory for base GUI to have proper size
+ * Conformant is mandatory for base GUI to have proper size
  */
 Evas_Object *view_create_conformant_without_indicator(Evas_Object *win)
 {
-       /* Conformant
+       /*
+        * Conformant
         * Create and initialize elm_conformant.
         * elm_conformant is mandatory for base GUI to have proper size
         * when indicator or virtual keypad is visible.
@@ -101,12 +105,12 @@ Evas_Object *view_create_conformant_without_indicator(Evas_Object *win)
 /*
  * @brief: Make a layout to target parent object with edje file
  * @param[parent]: The object to which you want to add this layout
- * @param[file_name]: File path of EDJ
+ * @param[file_path]: File path of EDJ file will be used
  * @param[group_name]: Name of group in EDJ you want to set to
- * @param[Evas_Object_Event_Cb]: File path of EDJ
+ * @param[cb_function]: The function will be called when back event is detected
  * @param[user_data]: The user data to be passed to the callback functions
  */
-Evas_Object *view_create_layout(Evas_Object *parent, const char *edj_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
+Evas_Object *view_create_layout(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
 {
        Evas_Object *layout = NULL;
 
@@ -117,7 +121,7 @@ Evas_Object *view_create_layout(Evas_Object *parent, const char *edj_path, const
 
        /* Create layout by EDC(edje file) */
        layout = elm_layout_add(parent);
-       elm_layout_file_set(layout, edj_path, group_name);
+       elm_layout_file_set(layout, file_path, group_name);
 
        /* Layout size setting */
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -133,12 +137,12 @@ Evas_Object *view_create_layout(Evas_Object *parent, const char *edj_path, const
 /*
  * @brief: Make and set a layout to conformant
  * @param[parent]: Target conformant object
- * @param[file_name]: File path of EDJ used
+ * @param[file_path]: File path of EDJ will be used
  * @param[group_name]: Group name in EDJ you want to set to layout
- * @param[cb_function]: Callback for back event handling
+ * @param[cb_function]: The function will be called when the back event is detected
  * @param[user_data]: The user data to be passed to the callback functions
  */
-Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, const char *file_name, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
+Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, const char *file_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data)
 {
        Evas_Object *layout = NULL;
 
@@ -148,10 +152,10 @@ Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, const char *
        }
 
        /* Create layout for conformant */
-       if (!file_name) {
+       if (file_path == NULL) {
                layout = view_create_layout_by_theme(parent, "layout", "application", "default");
        } else {
-               layout = view_create_layout(parent, file_name, group_name, cb_function, user_data);
+               layout = view_create_layout(parent, file_path, group_name, cb_function, user_data);
        }
 
        if (layout == NULL) {
@@ -167,11 +171,11 @@ Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, const char *
 /*
  * @brief: Make a layout with theme.
  * @param[parent]: Object to which you want to add this layout
- * @param[class]: The class of the group
- * @param[group_name]: Group name in EDJ you want to set to layout
+ * @param[class_name]: The class of the group
+ * @param[group_name]: Group name in EDJ that you want to set to layout
  * @param[style]: The style to use
  */
-Evas_Object *view_create_layout_by_theme(Evas_Object *parent, const char *classname, const char *group, const char *style)
+Evas_Object *view_create_layout_by_theme(Evas_Object *parent, const char *class_name, const char *group_name, const char *style)
 {
        /*
         * Layout
@@ -186,7 +190,7 @@ Evas_Object *view_create_layout_by_theme(Evas_Object *parent, const char *classn
        }
 
        layout = elm_layout_add(parent);
-       elm_layout_theme_set(layout, classname, group, style);
+       elm_layout_theme_set(layout, class_name, group_name, style);
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        evas_object_show(layout);
@@ -197,11 +201,11 @@ Evas_Object *view_create_layout_by_theme(Evas_Object *parent, const char *classn
 /*
  * @brief: Make and set a layout to the part
  * @param[parent]: Object to which you want to set this layout
- * @param[file_name]: File path of EDJ used
- * @param[group_name]: Group name in EDJ you want to set to layout
- * @param[part]: Part name to which you want to set this layout
+ * @param[file_path]: File path of EDJ will be used
+ * @param[group_name]: Group name in EDJ that you want to set to layout
+ * @param[part_name]: Part name to which you want to set this layout
  */
-Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *part, char *file_name, char *group_name)
+Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *file_path, char *group_name, char *part_name)
 {
        Evas_Object *layout = NULL;
 
@@ -211,31 +215,26 @@ Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *part, char *
        }
 
        layout = elm_layout_add(parent);
-       elm_layout_file_set(layout, file_name, group_name);
+       elm_layout_file_set(layout, file_path, group_name);
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        evas_object_show(layout);
 
-       elm_object_part_content_set(parent, part, layout);
+       elm_object_part_content_set(parent, part_name, layout);
 
        return layout;
 }
 
 /*
  * @brief: Destroy window and free important data to finish this application
- * @param[user_data]: Structure has informations for managing this application
  */
-void view_destroy(void *user_data)
+void view_destroy(void)
 {
-       appdata_s *ad = NULL;
-
-       ad = user_data;
-       if (ad == NULL) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "failed to destroy data.");
+       if (s_info.win == NULL) {
                return;
        }
 
-       evas_object_del(ad->win);
+       evas_object_del(s_info.win);
 }
 
 /*
@@ -249,11 +248,11 @@ void view_destroy_layout(Evas_Object *layout)
 
 /*
  * @brief: Set image to given part
- * @param[parent]: object has part to which you want to set this image
- * @param[part]: part name to which you want to set this image
- * @param[image_path]: path of image file
+ * @param[parent]: Object has part to which you want to set this image
+ * @param[part_name]: Part name to which you want to set this image
+ * @param[image_path]: Path of the image file
  */
-void view_set_image(Evas_Object *parent, const char *part, const char *image_path)
+void view_set_image(Evas_Object *parent, const char *part_name, const char *image_path)
 {
        Evas_Object *image = NULL;
 
@@ -262,26 +261,22 @@ void view_set_image(Evas_Object *parent, const char *part, const char *image_pat
                return;
        }
 
-       image = elm_object_part_content_get(parent, part);
+       image = elm_object_part_content_get(parent, part_name);
        if (image == NULL) {
                image = elm_image_add(parent);
-               if (!image) {
+               if (image == NULL) {
                        dlog_print(DLOG_ERROR, LOG_TAG, "failed to create an image object.");
                        return;
                }
+
+               elm_object_part_content_set(parent, part_name, image);
        }
 
        if (EINA_FALSE == elm_image_file_set(image, image_path, NULL)) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "failed to set image.");
+               dlog_print(DLOG_ERROR, LOG_TAG, "failed to set image: %s", image_path);
                return;
        }
 
-       if (part) {
-               elm_object_part_content_set(parent, part, image);
-       } else {
-               elm_object_content_set(parent, image);
-       }
-
        evas_object_show(image);
 
        return;
@@ -290,10 +285,10 @@ void view_set_image(Evas_Object *parent, const char *part, const char *image_pat
 /*
  * @brief: Set text to the part
  * @param[parent]: Object has part to which you want to set text
- * @param[part]: Part name to which you want to set text
- * @param[text]: text you want to set to the part
+ * @param[part_name]: Part name to which you want to set the text
+ * @param[text]: Text you want to set to the part
  */
-void view_set_text(Evas_Object *parent, const char *part, const char *text)
+void view_set_text(Evas_Object *parent, const char *part_name, const char *text)
 {
        if (parent == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
@@ -301,19 +296,19 @@ void view_set_text(Evas_Object *parent, const char *part, const char *text)
        }
 
        /* Set text of target part object */
-       elm_object_part_text_set(parent, part, text);
+       elm_object_part_text_set(parent, part_name, text);
 }
 
 /*
  * @brief: Set color of the part
  * @param[parent]: Object has part to which you want to set color
- * @param[part]: Name of part to which you want to set color
+ * @param[part_name]: Name of part to which you want to set color
  * @param[r]: R of RGBA you want to set to the part
  * @param[g]: G of RGBA you want to set to the part
  * @param[b]: B of RGBA you want to set to the part
  * @param[a]: A of RGBA you want to set to the part
  */
-void view_set_color(Evas_Object *parent, const char *part, int r, int g, int b, int a)
+void view_set_color(Evas_Object *parent, const char *part_name, int r, int g, int b, int a)
 {
        Evas_Object *obj = NULL;
 
@@ -322,7 +317,7 @@ void view_set_color(Evas_Object *parent, const char *part, int r, int g, int b,
                return;
        }
 
-       obj = elm_object_part_content_get(parent, part);
+       obj = elm_object_part_content_get(parent, part_name);
        if (obj == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
                return;
@@ -333,6 +328,35 @@ void view_set_color(Evas_Object *parent, const char *part, int r, int g, int b,
 }
 
 /*
+ * @brief: Set the color of circle line and font in a given circle object
+ * @param[parent]: Object has part to which you want to set color
+ * @param[part_name]: Name of part to which you want to set color
+ * @param[r] The red component of the given color
+ * @param[g] The green component of the given color
+ * @param[b] The blue component of the given color
+ * @param[a] The alpha component of the given color
+ */
+void view_set_color_of_circle_object(Evas_Object *parent, const char *part_name, int r, int g, int b, int a)
+{
+       Evas_Object *obj = NULL;
+
+       if (parent == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
+               return;
+       }
+
+       /* if the "part" is NULL, this function will get the content from "default" part */
+       obj = elm_object_part_content_get(parent, part_name);
+       if (obj == NULL) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
+               return;
+       }
+
+       /* Set color of target part object */
+       eext_circle_object_color_set(obj, r, g, b, a);
+}
+
+/*
  * @brief: Make a naviframe and set to parent
  * @param[parent]: Object to which you want to set naviframe
  * @Add callback function will be operated when back key is pressed
@@ -364,13 +388,13 @@ Evas_Object *view_create_naviframe(Evas_Object *parent)
 
 /*
  * @brief: Push item to naviframe
- * @param[nf]: naviframe
- * @param[item]: object will be added to naviframe
- * @param[_pop_cb]: function will be operated when this item is poped from naviframe
- * @param[cb_data]: data needed to operate '_pop_cb' function
+ * @param[nf]: Naviframe has several views
+ * @param[item]: Object will be added to naviframe
+ * @param[pop_cb]: Function will be operated when this item is popped from naviframe
+ * @param[user_data]: Data passed to the 'pop_cb' function
  * Naviframe make changing of view is easy and effectively
  */
-Elm_Object_Item* view_push_item_to_naviframe(Evas_Object *nf, Evas_Object *item, Elm_Naviframe_Item_Pop_Cb _pop_cb, void *cb_data)
+Elm_Object_Item* view_push_item_to_naviframe(Evas_Object *nf, Evas_Object *item, Elm_Naviframe_Item_Pop_Cb pop_cb, void *user_data)
 {
        Elm_Object_Item* nf_it = NULL;
 
@@ -386,17 +410,26 @@ Elm_Object_Item* view_push_item_to_naviframe(Evas_Object *nf, Evas_Object *item,
 
        nf_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, item, "empty");
 
-       if (_pop_cb != NULL)
-               elm_naviframe_item_pop_cb_set(nf_it, _pop_cb, cb_data);
+       if (pop_cb != NULL)
+               elm_naviframe_item_pop_cb_set(nf_it, pop_cb, user_data);
 
        return nf_it;
 }
 
-void view_set_more_button(Evas_Object *parent, const char *part)
+/*
+ * @brief: Set a more button
+ * @param[parent]: Object has part to which you want to set
+ * @param[part]: Part name to which you want to set
+ * @param[opened_cb]: Function will be operated when the more button is opened
+ * @param[closed_cb]: Function will be operated when the more button is closed
+ * @param[seleted_cb]: Function will be operated when the more button item is selected
+ * @param[user_data]: Data needed in this function
+ */
+void view_set_more_button(Evas_Object *parent, const char *part, Evas_Smart_Cb opened_cb, Evas_Smart_Cb closed_cb, Evas_Smart_Cb seleted_cb, void *user_data)
 {
        Evas_Object *more_btn = NULL;
 
-       if (pirent == NULL) {
+       if (parent == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
                return;
        }
@@ -408,27 +441,27 @@ void view_set_more_button(Evas_Object *parent, const char *part)
        }
 
        /* Add smart callback */
-       evas_object_smart_callback_add(more_btn, "more,option,opened", _more_option_opened, NULL);
-       evas_object_smart_callback_add(more_btn, "more,option,closed", _more_option_closed, NULL);
-       evas_object_smart_callback_add(more_btn, "item,selected", _item_selected, NULL);
+       evas_object_smart_callback_add(more_btn, "more,option,opened", opened_cb, user_data);
+       evas_object_smart_callback_add(more_btn, "more,option,closed", closed_cb, user_data);
+       evas_object_smart_callback_add(more_btn, "item,selected", seleted_cb, user_data);
 
        elm_object_part_content_set(parent, part, more_btn);
 }
 
 /*
  * @brief: Make and set button.
- * @param[parent]: object to which you want to set the button
- * @param[style]: style of the button
- * @param[text]: text will be written on the button
- * @param[image_path]: path of image file will be used as button icon
- * @param[part]: part name in EDJ to which you want to set the button
- * @param[down_cb]: function will be operated when the button is pressed
- * @param[up_cb]: function will be operated when the button is released
- * @param[clicked_cb]: function will be operated when the button is clicked
- * @param[data]: data needed in this function
- */
-void view_set_button(Evas_Object *parent, const char *part, const char *style, const char *image_path, const char *text,
-               Evas_Object_Event_Cb down_cb, Evas_Object_Event_Cb up_cb, Evas_Smart_Cb clicked_cb, void *data)
+ * @param[parent]: Object to which you want to set the button
+ * @param[part_name]: Name of part to which you want to set the button
+ * @param[style]: Style of the button
+ * @param[image_path]: Path of image file will be used as button icon
+ * @param[text]: The text will be written on the button
+ * @param[down_cb]: Function will be operated when the button is pressed
+ * @param[up_cb]: Function will be operated when the button is released
+ * @param[clicked_cb]: Function will be operated when the button is clicked
+ * @param[user_data]: Data passed to the 'clicked_cb' function
+ */
+void view_set_button(Evas_Object *parent, const char *part_name, const char *style, const char *image_path, const char *text,
+               Evas_Object_Event_Cb down_cb, Evas_Object_Event_Cb up_cb, Evas_Smart_Cb clicked_cb, void *user_data)
 {
        Evas_Object *btn = NULL;
 
@@ -438,7 +471,7 @@ void view_set_button(Evas_Object *parent, const char *part, const char *style, c
        }
 
        btn = elm_button_add(parent);
-       if (!btn) {
+       if (btn == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "failed to create button.");
                return;
        }
@@ -446,8 +479,8 @@ void view_set_button(Evas_Object *parent, const char *part, const char *style, c
        if (style)
                elm_object_style_set(btn, style);
 
-       evas_object_size_hint_weight_set(btn ,EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_object_part_content_set(parent, part, btn);
+       evas_object_size_hint_weight_set(btnEVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_part_content_set(parent, part_name, btn);
 
        if (text)
                elm_object_text_set(btn, text);
@@ -456,11 +489,11 @@ void view_set_button(Evas_Object *parent, const char *part, const char *style, c
                view_set_image(btn, NULL, image_path);
 
        if (down_cb)
-               evas_object_event_callback_add(btn , EVAS_CALLBACK_MOUSE_DOWN, down_cb, data);
+               evas_object_event_callback_add(btn , EVAS_CALLBACK_MOUSE_DOWN, down_cb, user_data);
        if (up_cb)
-               evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, up_cb, data);
+               evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, up_cb, user_data);
        if (clicked_cb)
-               evas_object_smart_callback_add(btn, "clicked", clicked_cb, data);
+               evas_object_smart_callback_add(btn, "clicked", clicked_cb, user_data);
 
        evas_object_show(btn);
 }
@@ -468,15 +501,16 @@ void view_set_button(Evas_Object *parent, const char *part, const char *style, c
 /*
  * @brief: Add a more button item
  * @param[parent]: object that contains more button
+ * @param[part_name]: Name of the part has more option
  * @param[main_txt]: text will be written in the middle of the selector
  * @param[sub_txt] Text will be written under the main_txt
- * @param[img_path]: path of image file will be used as more button item icon
+ * @param[image_path]: path of image file will be used as more button item icon
  * @param[clicked_cb]: function will be operated when the more button item is clicked
  * @param[user_data]: data needed in this function
  */
-void view_add_more_button_item(Evas_Object *parent, const char *part, const char *main_txt, const char *sub_txt, const char *img_path, Evas_Smart_Cb clicked_cb, void *user_data)
+void view_add_more_button_item(Evas_Object *parent, const char *part_name, const char *main_txt, const char *sub_txt, const char *image_path, Evas_Smart_Cb clicked_cb, void *user_data)
 {
-       Evas_Object *img = NULL;
+       Evas_Object *image = NULL;
        Evas_Object *more_btn = NULL;
        char full_path[PATH_MAX] = { 0, };
 
@@ -485,7 +519,7 @@ void view_add_more_button_item(Evas_Object *parent, const char *part, const char
                return;
        }
 
-       more_btn = elm_object_part_content_get(parent, part);
+       more_btn = elm_object_part_content_get(parent, part_name);
        if (more_btn == NULL) {
                return;
        }
@@ -497,12 +531,12 @@ void view_add_more_button_item(Evas_Object *parent, const char *part, const char
        eext_more_option_item_part_text_set(item, "selector,main_text", main_txt);
        eext_more_option_item_part_text_set(item, "selector,sub_text", sub_txt);
 
-       img = elm_image_add(more_btn);
-       _get_resource(img_path, full_path, sizeof(full_path));
-       elm_image_file_set(img, full_path, NULL);
+       image = elm_image_add(more_btn);
+       _get_resource(image_path, full_path, sizeof(full_path));
+       elm_image_file_set(image, full_path, NULL);
 
        /* Set the content in item content part */
-       eext_more_option_item_part_content_set(item, "item,icon", img);
+       eext_more_option_item_part_content_set(item, "item,icon", image);
 
        evas_object_smart_callback_add(more_btn, "item,clicked", clicked_cb, user_data);
 }
@@ -510,11 +544,12 @@ void view_add_more_button_item(Evas_Object *parent, const char *part, const char
 /*
  * @brief: Make a Entry Object to target window
  * @param[parent]: Object to which you want to set Entry
- * @param[part]: Part of the layout which you want to locate Entry
- * @param[data]: The user data to be passed to the callback function
+ * @param[part_name]: Part of the layout which you want to locate Entry
+ * @param[clicked_cb]: The function will be called when the entry is clicked
+ * @param[user_data]: The user data passed to the callback function
  * @Add callback function will be operated when mouse clicked event is triggered
  */
-Evas_Object *view_set_entry(Evas_Object *parent, const char *part, void (*_clicked_cb)(void *data, Evas_Object *obj, void *event_info), void *data)
+Evas_Object *view_create_entry(Evas_Object *parent, const char *part_name, Evas_Smart_Cb clicked_cb, void *user_data)
 {
        Evas_Object *entry = NULL;
 
@@ -543,24 +578,23 @@ Evas_Object *view_set_entry(Evas_Object *parent, const char *part, void (*_click
        elm_entry_select_allow_set(entry, EINA_FALSE);
 
        /* Set Entry text style using predefined style description */
-    elm_entry_text_style_user_push(entry, DIAL_TEXT_STYLE_NORMAL);
+       elm_entry_text_style_user_push(entry, DIAL_TEXT_STYLE_NORMAL);
 
-    elm_object_part_content_set(parent, part, entry);
+       elm_object_part_content_set(parent, part_name, entry);
 
        /* Set callback for event about Entry */
-    if (_clicked_cb) {
-               evas_object_smart_callback_add(entry, "clicked", _clicked_cb, data);
+       if (clicked_cb) {
+               evas_object_smart_callback_add(entry, "clicked", clicked_cb, user_data);
        }
 
        return entry;
 }
 
 /*
- * @brief: make genlist for circular shape.
+ * @brief: make genlist for circular shape
  * @param[parent]: object to which you want to set genlist
- * @param[circle_surface]: object render a connected circle object
  */
-Evas_Object *view_create_circle_genlist(Evas_Object *parent, Eext_Circle_Surface *circle_surface)
+Evas_Object *view_create_circle_genlist(Evas_Object *parent)
 {
        Evas_Object *genlist = NULL;
        Evas_Object *circle_genlist = NULL;
@@ -570,18 +604,22 @@ Evas_Object *view_create_circle_genlist(Evas_Object *parent, Eext_Circle_Surface
                return NULL;
        }
 
-       if (circle_surface == NULL) {
+       if (s_info.circle_surface == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "circle surface is NULL.");
                return NULL;
        }
 
        genlist = elm_genlist_add(parent);
-    /* this make selected list item is shown compressed */
+       /*
+        * This make selected list item is shown compressed.
+        */
        elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
        evas_object_smart_callback_add(genlist, "selected", _gl_selected_cb, NULL);
 
-       /* this make genlist style circular */
-       circle_genlist = eext_circle_object_genlist_add(genlist, circle_surface);
+       /*
+        * This make genlist style circular.
+        */
+       circle_genlist = eext_circle_object_genlist_add(genlist, s_info.circle_surface);
        eext_circle_object_genlist_scroller_policy_set(circle_genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
        eext_rotary_object_event_activated_set(circle_genlist, EINA_TRUE);
 
@@ -592,15 +630,15 @@ Evas_Object *view_create_circle_genlist(Evas_Object *parent, Eext_Circle_Surface
 
 /*
  * @brief: Add item to genlist.
- * @param[genlist]: genlist
- * @param[style]: style of item determine how to show this item, such as "1text", "1text1icon" and so on
- * @param[data]: item data that use item's callback function
- * @param[_clicked_cb]: function will be operated when the item is clicked
- * @param[cb_data]: data needed in '_clicked_cb' function
+ * @param[genlist]: Genlist shows several items
+ * @param[style]: Style of item determine how to show this item, such as "1text", "1text1icon" and so on
+ * @param[gen_data]: Item data that use item's callback function
+ * @param[clicked_cb]: function will be operated when the item is clicked
+ * @param[user_data]: Data passed to 'clicked_cb' function
  * This make item's class and add item to genlist.
  */
 Elm_Object_Item *view_append_item_to_genlist(Evas_Object *genlist, const char *style,
-               const void *data, Evas_Smart_Cb _clicked_cb, const void *cb_data)
+               const void *gen_data, Evas_Smart_Cb clicked_cb, const void *user_data)
 {
        Elm_Genlist_Item_Class *item_class;
        Elm_Object_Item *item;
@@ -617,7 +655,7 @@ Elm_Object_Item *view_append_item_to_genlist(Evas_Object *genlist, const char *s
 
        item_class = _set_genlist_item_class(style);
 
-       item = elm_genlist_item_append(genlist, item_class, data, NULL, ELM_GENLIST_ITEM_NONE, _clicked_cb, cb_data);
+       item = elm_genlist_item_append(genlist, item_class, gen_data, NULL, ELM_GENLIST_ITEM_NONE, clicked_cb, user_data);
 
        elm_genlist_item_class_free(item_class);
 
@@ -626,8 +664,8 @@ Elm_Object_Item *view_append_item_to_genlist(Evas_Object *genlist, const char *s
 
 /*
  * @brief: Find item from genlist.
- * @param[genlist]: genlist
- * @param[val]: value determine which of the itmes has to remove
+ * @param[genlist]: Genlist shows several items
+ * @param[val]: value determine which of the items has to remove
  */
 Elm_Object_Item *view_find_item_from_genlist(Evas_Object *genlist, const char *val)
 {
@@ -636,7 +674,7 @@ Elm_Object_Item *view_find_item_from_genlist(Evas_Object *genlist, const char *v
        Elm_Object_Item *item = NULL;
        struct genlist_data *gendata = NULL;
 
-       if (!genlist) {
+       if (genlist == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "genlist is NULL.");
                return NULL;
        }
@@ -646,7 +684,7 @@ Elm_Object_Item *view_find_item_from_genlist(Evas_Object *genlist, const char *v
        /*
         * The fist item and the last item are "padding".
         */
-       for(i = 1; i < item_count-1; i++) {
+       for (i = 1; i < item_count-1; i++) {
                item = elm_genlist_nth_item_get(genlist, i);
                gendata = elm_object_item_data_get(item);
 
@@ -669,8 +707,8 @@ void view_delete_item(Elm_Object_Item *item)
 
 /*
  * @brief: Make popup with theme.
- * @param[popup_style]: style of the popup's layout
- * @param[data]: data needed in this function
+ * @param[timeout]: Duration that popup is showing
+ * @param[text]: Text displayed on the popup
  */
 void view_create_text_popup(Evas_Object *parent, double timeout, const char *text)
 {
@@ -705,26 +743,45 @@ void view_create_text_popup(Evas_Object *parent, double timeout, const char *tex
        evas_object_show(popup);
 }
 
-void view_set_content_to_part(Evas_Object *layout, const char *part, Evas_Object *content)
+/*
+ * @brief: Set the content to the given part
+ * @param[part_name]: Name of the part to which you want to set
+ * @param[content]: The object will be set to the given part
+ */
+void view_set_content_to_part(Evas_Object *layout, const char *part_name, Evas_Object *content)
 {
-       elm_object_part_content_set(layout, part, content);
+       elm_object_part_content_set(layout, part_name, content);
 }
 
+/*
+ * @brief: Send signal with source to the EDJ object
+ * @param[layout]: The layout object will receive the signal
+ * @param[signal]: The appointed signal to trigger the function
+ * @param[source]: The appointed source that normally indicate the object triggered the event
+ */
 void view_send_signal_to_edje(Evas_Object *layout, const char *signal, const char *source)
 {
        elm_object_signal_emit(layout, signal, source);
 }
 
-void view_set_customized_event_callback(Evas_Object *item, char *signal, char *source, void (*signal_cb)(void *data, Evas_Object *obj, const char *emission, const char *source), void *user_data)
+/*
+ * @brief: Set the function will be called when the appointed signal is occurred
+ * @param[item]: The object triggered the signal
+ * @param[signal]: The appointed signal to trigger the function
+ * @param[source]: The appointed source that normally indicate the object triggered the event
+ * @param[signal_cb]: The function will be called when the signal is detected
+ * @param[user_data]: The data passed to the 'signal_cb' function
+ */
+void view_set_customized_event_callback(Evas_Object *item, char *signal, char *source, Edje_Signal_Cb signal_cb, void *user_data)
 {
        elm_object_signal_callback_add(item, signal, source, signal_cb, user_data);
 }
 
 /*
- * @brief: Register roatry event callback function.
+ * @brief: Register rotary event callback function.
  * @param[obj]: object that will receive rotary event
  * @param[rotary_cb]: function will be operated when rotary event happens
- * @param[user_data]: data needed in this function
+ * @param[user_data]: Data passed to the 'rotary_cb' function
  */
 void view_set_rotary_event_callback(Evas_Object *obj, Eext_Rotary_Event_Cb rotary_cb, void *user_data)
 {
@@ -764,10 +821,10 @@ Evas_Object *view_create_label(Evas_Object *parent)
 /*
  * @brief: Set a text to label object
  * @param[parent]: Object has part to which you want to set text
- * @param[part]: Part name to which you want to set text
+ * @param[part_name]: Part name to which you want to set text
  * @param[text]: text you want to set to the part
  */
-void view_set_label_text(Evas_Object *parent, const char *part, const char *text)
+void view_set_label_text(Evas_Object *parent, const char *part_name, const char *text)
 {
        Evas_Object *label = NULL;
        char *markup_text = NULL;
@@ -782,7 +839,7 @@ void view_set_label_text(Evas_Object *parent, const char *part, const char *text
        snprintf(buf, sizeof(buf), "%s%s%s", LABEL_STYLE_START, markup_text, LABEL_STYLE_END);
        free(markup_text);
 
-       label = elm_object_part_content_get(parent, part);
+       label = elm_object_part_content_get(parent, part_name);
        if (label == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "label is NULL.");
                return;
@@ -793,10 +850,10 @@ void view_set_label_text(Evas_Object *parent, const char *part, const char *text
 
 /*
  * @brief: Set a label to given part
- * @param[parent]: object has part to which you want to set this label
- * @param[part]: part name to which you want to set this label
+ * @param[parent]: Object has part to which you want to set this label
+ * @param[part_name]: Part name to which you want to set this label
  */
-void view_set_label(Evas_Object *parent, const char *part)
+void view_set_label(Evas_Object *parent, const char *part_name)
 {
        Evas_Object *label = NULL;
 
@@ -811,14 +868,16 @@ void view_set_label(Evas_Object *parent, const char *part)
                return;
        }
 
-       elm_object_part_content_set(parent, part, label);
+       elm_object_part_content_set(parent, part_name, label);
 }
 
 /*
  * @brief: Create a progressbar
- * @param[parent]: object has part to which you want to set this progressbar
+ * @param[parent]: Object has part to which you want to set this progressbar
+ * @param[radius]: Radius The radius value of a given circle object
+ * @param[line_width]: Line_width The line width value of the circle object
  */
-Evas_Object *view_create_progressbar(Evas_Object *parent)
+Evas_Object *view_create_progressbar(Evas_Object *parent, int radius, int line_width)
 {
        Evas_Object *progressbar = NULL;
 
@@ -830,8 +889,8 @@ Evas_Object *view_create_progressbar(Evas_Object *parent)
        progressbar = eext_circle_object_progressbar_add(parent, NULL);
 
        eext_circle_object_value_min_max_set(progressbar, 0.0, 100.0);
-       eext_circle_object_radius_set(progressbar, 53);
-       eext_circle_object_line_width_set(progressbar, 5);
+       eext_circle_object_radius_set(progressbar, radius);
+       eext_circle_object_line_width_set(progressbar, line_width);
        evas_object_show(progressbar);
 
        return progressbar;
@@ -839,10 +898,12 @@ Evas_Object *view_create_progressbar(Evas_Object *parent)
 
 /*
  * @brief: Set a progressbar to given part
- * @param[parent]: object has part to which you want to set this progressbar
- * @param[part]: part name to which you want to set this progressbar
+ * @param[parent]: Object has part to which you want to set
+ * @param[part_name]: Part name to which you want to set
+ * @param[radius]: Radius The radius value of a given circle object
+ * @param[line_width]: Line_width The line width value of the circle object
  */
-void view_set_progressbar(Evas_Object *parent, const char *part)
+void view_set_progressbar(Evas_Object *parent, const char *part_name, int radius, int line_width)
 {
        Evas_Object *progressbar = NULL;
 
@@ -851,22 +912,22 @@ void view_set_progressbar(Evas_Object *parent, const char *part)
                return;
        }
 
-       progressbar = view_create_progressbar(parent);
+       progressbar = view_create_progressbar(parent, radius, line_width);
        if (progressbar == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
                return;
        }
 
-       elm_object_part_content_set(parent, part, progressbar);
+       elm_object_part_content_set(parent, part_name, progressbar);
 }
 
 /*
  * @brief: Set value to a progressbar
- * @param[parent]: object has part to which you want to set
- * @param[part]: part name to which you want to set
- * @param[val]: value to which you want to set
+ * @param[parent]: Object has part to which you want to set
+ * @param[part_name]: Part name to which you want to set
+ * @param[val]: Value to which you want to set
  */
-void view_set_progressbar_val(Evas_Object *parent, const char *part, int val)
+void view_set_progressbar_val(Evas_Object *parent, const char *part_name, int val)
 {
        Evas_Object *progressbar = NULL;
 
@@ -875,14 +936,14 @@ void view_set_progressbar_val(Evas_Object *parent, const char *part, int val)
                return;
        }
 
-       if (part == NULL) {
+       if (part_name == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "part is NULL.");
                return;
        }
 
-       progressbar = elm_object_part_content_get(parent, part);
+       progressbar = elm_object_part_content_get(parent, part_name);
        if (progressbar == NULL) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "prgressbar is NULL.");
+               dlog_print(DLOG_ERROR, LOG_TAG, "progressbar is NULL.");
                return;
        }
 
@@ -890,8 +951,8 @@ void view_set_progressbar_val(Evas_Object *parent, const char *part, int val)
 }
 
 /*
- * @brief: Make a checkbox
- * @param[parent]: The object to which you want to add this checkbox
+ * @brief: Make a check box
+ * @param[parent]: The object to which you want to add this check box
  */
 Evas_Object *view_create_checkbox(Evas_Object *parent)
 {
@@ -911,17 +972,17 @@ Evas_Object *view_create_checkbox(Evas_Object *parent)
 }
 
 /*
- * @brief: Make no voice memo view
- * @param[parent]: naviframe
- * @param[title]: titile of this view
+ * @brief: Make no content view
+ * @param[parent]: Naviframe has several views
+ * @param[title]: title of this view
  * @param[detail]: detail text of this view
- * @param[image_file]: image file name will be used in this view
+ * @param[image_path]: Image file path will be used in this view
  * This function make a view consists of one title, one center image and one detail text at the bottom
  */
-Evas_Object *view_create_layout_no_content(Evas_Object *parent, char *title, char *detail, char *image_file)
+Evas_Object *view_create_layout_no_content(Evas_Object *parent, char *title, char *detail, char *image_path)
 {
        Evas_Object *layout = NULL;
-       Evas_Object *img;
+       Evas_Object *image;
        Elm_Object_Item *it;
 
        if (parent == NULL) {
@@ -932,14 +993,14 @@ Evas_Object *view_create_layout_no_content(Evas_Object *parent, char *title, cha
        layout = elm_layout_add(parent);
        /* this make you can use layout consists of one title, one image and one detail text */
        elm_layout_theme_set(layout, "layout", "nocontents", "default");
-       evas_object_size_hint_weight_set (layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
-       if (image_file) {
-               img = elm_image_add(parent);
-               elm_image_file_set(img, image_file, NULL);
-               elm_object_part_content_set(layout, "elm.swallow.icon", img);
-               evas_object_show(img);
+       if (image_path) {
+               image = elm_image_add(parent);
+               elm_image_file_set(image, image_path, NULL);
+               elm_object_part_content_set(layout, "elm.swallow.icon", image);
+               evas_object_show(image);
        }
 
        if (detail) {
@@ -967,35 +1028,33 @@ Evas_Object *view_create_layout_no_content(Evas_Object *parent, char *title, cha
 }
 
 /*
- * @brief: Set datetime to the part.
+ * @brief: Set datetime to the part
  * @param[parent]: object to which you want to set datetime
- * @param[circle_surface]: object render a connected circle object
- * @param[part]: part name to which you want to set this datetime
  * @param[style]: style of the datetime
  */
-Evas_Object *view_create_datetime(Evas_Object *parent, Eext_Circle_Surface *circle_surface, const char *style)
+Evas_Object *view_create_datetime(Evas_Object *parent, const char *style)
 {
-       Evas_Object *datetime = NULL;
        Evas_Object *circle_datetime = NULL;
 
        if (parent == NULL) {
-               dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL.");
+               dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent.");
                return NULL;
        }
 
-       if (circle_surface == NULL) {
+       if (s_info.circle_surface == NULL) {
                dlog_print(DLOG_ERROR, LOG_TAG, "failed to get circle_surface.");
                return NULL;
        }
 
-       datetime = elm_datetime_add(parent);
-       circle_datetime = eext_circle_object_datetime_add(datetime, circle_surface);
+       s_info.datetime = elm_datetime_add(parent);
+       circle_datetime = eext_circle_object_datetime_add(s_info.datetime, s_info.circle_surface);
 
-       eext_rotary_object_event_activated_set(datetime, EINA_TRUE);
-       elm_datetime_format_set(datetime, FORMAT);
+       eext_rotary_object_event_activated_set(s_info.datetime, EINA_TRUE);
+       elm_datetime_format_set(s_info.datetime, FORMAT);
 
-       elm_object_style_set(datetime, style);
+       elm_object_style_set(s_info.datetime, style);
 
-       return datetime;
-}
+       elm_object_part_content_set(parent, "elm.swallow.content", s_info.datetime);
 
+       return s_info.datetime;
+}