From 440285d1937f47b4c48db50c62d816eedd779bc7 Mon Sep 17 00:00:00 2001 From: "gs86.lee" Date: Tue, 19 Jan 2016 07:20:06 +0900 Subject: [PATCH] Remove appdata structure Change-Id: I98a9fc688496c7abb50ac8b3a6593cdc5cf2795b --- rule/project/inc/view.h | 2 +- rule/project/inc/view.h.tccr | 2 +- rule/project/src/view.c | 9 ++------- rule/project/src/view.c.tccr | 37 +++++++++++++++++-------------------- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/rule/project/inc/view.h b/rule/project/inc/view.h index 31a5307..796a42f 100644 --- a/rule/project/inc/view.h +++ b/rule/project/inc/view.h @@ -25,7 +25,7 @@ /* * Create a view */ -extern void view_create(appdata_s *ad); +extern void view_create(void); extern Evas_Object *view_create_win(const char *pkg_name); extern Evas_Object *view_create_conformant_without_indicator(Evas_Object *win); extern Evas_Object *view_create_layout(Evas_Object *parent, const char *edj_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data); diff --git a/rule/project/inc/view.h.tccr b/rule/project/inc/view.h.tccr index 230c356..e07533f 100644 --- a/rule/project/inc/view.h.tccr +++ b/rule/project/inc/view.h.tccr @@ -25,7 +25,7 @@ /* * Create a view */ -|R| extern void view_create(appdata_s *ad); +|R| extern void view_create(void); extern Evas_Object *view_create_win(const char *pkg_name); extern Evas_Object *view_create_conformant_without_indicator(Evas_Object *win); extern Evas_Object *view_create_layout(Evas_Object *parent, const char *edj_path, const char *group_name, Eext_Event_Cb cb_function, void *user_data); diff --git a/rule/project/src/view.c b/rule/project/src/view.c index 97121d6..2f6a4d9 100644 --- a/rule/project/src/view.c +++ b/rule/project/src/view.c @@ -25,7 +25,6 @@ static struct view_info { /* * @brief: Create Essential Object window, conformant and layout - * @param[ad]: Structure has some important information for managing this application */ void view_create(void) { @@ -49,7 +48,7 @@ void view_create(void) /* * @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) { @@ -231,11 +230,7 @@ Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *part, char * */ void view_destroy(void *user_data) { - 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; } diff --git a/rule/project/src/view.c.tccr b/rule/project/src/view.c.tccr index abdcee0..f250ac0 100644 --- a/rule/project/src/view.c.tccr +++ b/rule/project/src/view.c.tccr @@ -14,33 +14,35 @@ |R| * limitations under the License. |R| */ +|R| static struct view_info { +|R| Evas_Object *win; +|R| Evas_Object *conform; +|R| { s_info = { +|R| .win = NULL, +|R| .conform = NULL, +|R| }; + |R| /* |R| * @brief: Create Essential Object window, conformant and layout -|R| * @param[ad]: Structure has some important information for managing this application |R| */ -|R| void view_create(appdata_s *ad) +|R| void view_create(void) |R| { -|R| if (ad == NULL) { -|R| dlog_print(DLOG_ERROR, LOG_TAG, "appdata is NULL."); -|R| return; -|R| } - |R| /* Create window */ -|R| ad->win = view_create_win(PACKAGE); -|R| if (ad->win == NULL) { +|R| s_info.win = view_create_win(PACKAGE); +|R| if (s_info.win == NULL) { |R| dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a window."); |R| return; |R| } |R| /* Create conformant */ -|R| ad->conform = view_create_conformant_without_indicator(ad->win); -|R| if (ad->conform == NULL) { +|R| s_info.conform = view_create_conformant_without_indicator(s_info.win); +|R| if (s_info.conform == NULL) { |R| dlog_print(DLOG_ERROR, LOG_TAG, "failed to create a conformant"); |R| return; |R| } |R| /* Show window after main view is set up */ -|R| evas_object_show(ad->win); +|R| evas_object_show(s_info.win); |R| } /* @@ -222,19 +224,14 @@ Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *part, char * |R| /* |R| * @brief: Destroy window and free important data to finish this application -|R| * @param[user_data]: Structure has informations for managing this application |R| */ -|R| void view_destroy(void *user_data) +|R| void view_destroy(void) |R| { -|R| appdata_s *ad = NULL; - -|R| ad = user_data; -|R| if (ad == NULL) { -|R| dlog_print(DLOG_ERROR, LOG_TAG, "failed to destroy data."); +|R| if (s_info.win == NULL) { |R| return; |R| } -|R| evas_object_del(ad->win); +|R| evas_object_del(s_info.win); |R| } /* -- 2.7.4