From 983258c7d8a94ed9fcab4e15ccca0d605551762d Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Thu, 18 Jun 2015 11:00:58 +0900 Subject: [PATCH 01/16] add notification badge in home edc Change-Id: Idce89816a1b88385b25ea2f823505063650b7b5d Signed-off-by: Soohye Shin --- edje/view/home.edc | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ images/badge_bg.png | Bin 0 -> 15329 bytes include/defs.h | 4 ++++ 3 files changed, 53 insertions(+) create mode 100644 images/badge_bg.png diff --git a/edje/view/home.edc b/edje/view/home.edc index 9fd5e12..326edc0 100644 --- a/edje/view/home.edc +++ b/edje/view/home.edc @@ -468,6 +468,55 @@ group { visible, 1; } } + part { + name, "pad.badge"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + min, 42 15; + rel1.relative, 1.0 0.0; + rel2.relative, 1.0 0.0; + align, 1.0 0.0; + fixed, 1 1; + visible, 0; + } + } + part { + name, PART_HOME_ITEM_BADGE; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + min, 36 36; + rel1 { + to, "pad.badge"; + relative, 0.0 1.0; + } + rel2 { + to, "pad.badge"; + relative, 0.0 1.0; + } + align, 1.0 0.0; + fixed, 1 1; + } + } + part { + name, PART_HOME_ITEM_BADGE_COUNT; + type, TEXT; + scale, 1; + description { + state, "default" 0.0; + rel1.to, PART_HOME_ITEM_BADGE; + rel2.to, PART_HOME_ITEM_BADGE; + fixed, 1 1; + text { + size, 24; + font, "TizenSans"; + } + color, 255 255 255 255; + } + } } programs { program { diff --git a/images/badge_bg.png b/images/badge_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..0da3ca2da2b02a01a07bcc44ed1031cbde8b2b29 GIT binary patch literal 15329 zcmeI3eQXnD9LI0GxH-WD1zCWEQV>*V@2>B6wnbcrYoH9a$u{NfcK2+%(DusRb?qj> z0Y)I2h!}$b0un?80wE-51cAj&6r&*#h*2UE3`E`(3E^GwxwdP&XWQe9_=m}J$=3d! z@ALgV_k5n;^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q&`kYF?*pMSX7PSY*-3qR}cDUf-e!GVS=LL_CSwJsaJkGKFr{*JPMz{UVA)@zMA&Zt literal 0 HcmV?d00001 diff --git a/include/defs.h b/include/defs.h index e932b53..3c7f608 100644 --- a/include/defs.h +++ b/include/defs.h @@ -40,6 +40,8 @@ #define PART_HOME_ITEM_BG "part.home.item.bg" #define PART_HOME_ITEM_TITLE "part.home.item.title" #define PART_HOME_ITEM_TITLE_FOCUS "part.home.item.focus" +#define PART_HOME_ITEM_BADGE "part.home.item.badge" +#define PART_HOME_ITEM_BADGE_COUNT "part.home.item.badge.count" #define PART_RECENT_DELETE_ICON "part.recent.delete.icon" #define PART_RECENT_CONTENTS "part.recent.contents" #define PART_RECENT_NO_CONTENTS "part.recent.no.contents" @@ -73,4 +75,6 @@ #define COLOR_DEFAULT_B 224 #define COLOR_DEFAULT_A 255 +#define IMAGE_BADGE IMAGEDIR"/badge_bg.png" + #endif /* __AIR_HOME_DEFS_H__ */ -- 2.7.4 From 932d1a715103c225d55833de08fe1d65aeae2cf2 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Thu, 18 Jun 2015 12:40:44 +0900 Subject: [PATCH 02/16] add utils for creating widget and launch app Change-Id: I5f4718f69182f90832321b593c5de31ec00506c1 Signed-off-by: Soohye Shin --- CMakeLists.txt | 1 + include/utils.h | 34 ++++++++++ src/utils.c | 197 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 232 insertions(+) create mode 100644 include/utils.h create mode 100644 src/utils.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fe857a..b980692 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ SET(DEFCONFIG "${PROJECT_NAME}.json") SET(THEME_EDJ "${PROJECT_NAME}-theme.edj") SET(SRCS src/main.c + src/utils.c src/data/datamgr.c src/data/data_home.c src/view/view_recent.c diff --git a/include/utils.h b/include/utils.h new file mode 100644 index 0000000..4d34d14 --- /dev/null +++ b/include/utils.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __AIR_HOME_UTILS_H__ +#define __AIR_HOME_UTILS_H__ + +#include +#include + +Evas_Object *utils_add_layout(Evas_Object *base, const char *group, bool focus_allow, + const char *part); +Evas_Object *utils_add_icon(Evas_Object *base, const char *file, const char *part); +Evas_Object *utils_add_label(Evas_Object *base, char *text, const char *style, + const char *part); +Evas_Object *utils_add_bg(Evas_Object *base, int r, int g, int b, int a, + const char *part); +Evas_Object *utils_add_scroller(Evas_Object *base); +Evas_Object *utils_add_box(Evas_Object *base, bool horizon); +bool utils_launch_app(const char *pkg); + +#endif /* __AIR_HOME_UTILS_H__ */ diff --git a/src/utils.c b/src/utils.c new file mode 100644 index 0000000..ae84a88 --- /dev/null +++ b/src/utils.c @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "utils.h" +#include "defs.h" + +Evas_Object *utils_add_layout(Evas_Object *base, const char *group, + bool focus_allow, const char *part) +{ + Evas_Object *ly; + + if (!base || !group) { + _ERR("Invalid argument"); + return NULL; + } + + ly = elm_layout_add(base); + if (!ly) { + _ERR("failed to add layout"); + return false; + } + elm_layout_file_set(ly, EDJEFILE, group); + + if (focus_allow) + elm_object_focus_allow_set(ly, EINA_TRUE); + if (part) + elm_object_part_content_set(base, part, ly); + + evas_object_show(ly); + + return ly; +} + +Evas_Object *utils_add_icon(Evas_Object *base, const char *file, + const char *part) +{ + Evas_Object *ic; + + if (!base || !file) { + _ERR("Invalid argument"); + return NULL; + } + + ic = elm_icon_add(base); + if (!ic) { + _ERR("failed to add icon"); + return NULL; + } + + elm_image_file_set(ic, file, NULL); + + if (part) + elm_object_part_content_set(base, part, ic); + + evas_object_show(ic); + + return ic; +} + +Evas_Object *utils_add_label(Evas_Object *base, char *text, + const char *style, const char *part) +{ + Evas_Object *lbl; + const char *s; + + if (!base || !text) { + _ERR("Invalid argument"); + return NULL; + } + + lbl = elm_label_add(base); + if (!lbl) { + _ERR("failed to add label"); + return NULL; + } + + if (style) + elm_object_style_set(lbl, style); + + s = edje_object_data_get(elm_layout_edje_get(base), TITLE_WIDTH); + if (s) + elm_label_wrap_width_set(lbl, atoi(s)); + + elm_object_text_set(lbl, text); + + if (part) + elm_object_part_content_set(base, part, lbl); + + evas_object_show(lbl); + + return lbl; +} + +Evas_Object *utils_add_bg(Evas_Object *base, int r, int g, int b, int a, + const char *part) +{ + Evas_Object *bg; + + if (!base) { + _ERR("Invalid argument"); + return NULL; + } + + bg = evas_object_rectangle_add(evas_object_evas_get(base)); + if (!bg) { + _ERR("failed to add label"); + return NULL; + } + + evas_object_color_set(bg, r, g, b, a); + + if (part) + elm_object_part_content_set(base, part, bg); + + evas_object_show(bg); + + return bg; +} + +Evas_Object *utils_add_scroller(Evas_Object *base) +{ + Evas_Object *scr; + + scr = elm_scroller_add(base); + if (!scr) { + _ERR("failed to add scroller"); + return NULL; + } + + elm_scroller_policy_set(scr, ELM_SCROLLER_POLICY_OFF, + ELM_SCROLLER_POLICY_OFF); + evas_object_show(scr); + + return scr; +} + +Evas_Object *utils_add_box(Evas_Object *base, bool horizon) +{ + Evas_Object *box; + + box = elm_box_add(base); + if (!box) { + _ERR("failed to add box"); + return NULL; + } + + if (horizon) + elm_box_horizontal_set(box, EINA_TRUE); + + evas_object_show(box); + + return box; +} + +bool utils_launch_app(const char *pkg) +{ + app_control_h app_control; + int r; + + if (!pkg) { + _ERR("Invalid argument"); + return false; + } + + app_control_create(&app_control); + app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT); + app_control_set_app_id(app_control, pkg); + + r = app_control_send_launch_request(app_control, NULL, NULL); + if (r != APP_CONTROL_ERROR_NONE) { + _ERR("failed to launch pkg"); + app_control_destroy(app_control); + return false; + } + + app_control_destroy(app_control); + + return true; +} -- 2.7.4 From f403832563b037b85634de6aefbe27b3349d224c Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Thu, 18 Jun 2015 15:17:37 +0900 Subject: [PATCH 03/16] apply utils to view_home for creating widget Change-Id: Ie19d6032d542ce77a935e98457071af835b61e5a Signed-off-by: Soohye Shin --- src/view/view_home.c | 122 ++++++--------------------------------------------- 1 file changed, 13 insertions(+), 109 deletions(-) diff --git a/src/view/view_home.c b/src/view/view_home.c index f01ad53..c21af95 100644 --- a/src/view/view_home.c +++ b/src/view/view_home.c @@ -24,6 +24,7 @@ #include "view_home.h" #include "data_home.h" #include "datamgr.h" +#include "utils.h" struct _priv { Evas_Object *win; @@ -40,98 +41,6 @@ struct bar_item { struct _priv *priv; }; -static inline Evas_Object *_add_layout(Evas_Object *base, const char *group, - bool focus_allow) -{ - Evas_Object *ly; - - if (!base || !group) { - _ERR("Invalid argument"); - return NULL; - } - - ly = elm_layout_add(base); - if (!ly) { - _ERR("failed to add layout"); - return false; - } - elm_layout_file_set(ly, EDJEFILE, group); - if (focus_allow) - elm_object_focus_allow_set(ly, EINA_TRUE); - evas_object_show(ly); - - return ly; -} - -static inline Evas_Object *_add_icon(Evas_Object *eo, const char *file, const char *part) -{ - Evas_Object *ic; - - if (!eo || !file || !part) { - _ERR("Invalid argument"); - return NULL; - } - - ic = elm_icon_add(eo); - if (!ic) { - _ERR("failed to add icon"); - return NULL; - } - - elm_image_file_set(ic, file, NULL); - elm_object_part_content_set(eo, part, ic); - - return ic; -} - -static inline Evas_Object *_add_label(Evas_Object *eo, char *name, - const char *style, const char *part) -{ - Evas_Object *lbl; - const char *s; - - if (!eo || !name || !style || !part) { - _ERR("Invalid argument"); - return NULL; - } - - lbl = elm_label_add(eo); - if (!lbl) { - _ERR("failed to add label"); - return NULL; - } - elm_object_style_set(lbl, style); - s = edje_object_data_get(elm_layout_edje_get(eo), TITLE_WIDTH); - if (s) - elm_label_wrap_width_set(lbl, atoi(s)); - elm_object_text_set(lbl, name); - elm_object_part_content_set(eo, part, lbl); - - return lbl; -} - -static inline Evas_Object *_add_bg(Evas_Object *eo, const char *part) -{ - Evas_Object *bg; - - if (!eo || !part) { - _ERR("Invalid argument"); - return NULL; - } - - bg = evas_object_rectangle_add(evas_object_evas_get(eo)); - if (!bg) { - _ERR("failed to add label"); - return NULL; - } - - evas_object_color_set(bg, COLOR_DEFAULT_R, COLOR_DEFAULT_G, - COLOR_DEFAULT_B, COLOR_DEFAULT_A); - elm_object_part_content_set(eo, part, bg); - - return bg; -} - static bool _add_navigations(Evas_Object *base) { Evas_Object *ly; @@ -141,19 +50,17 @@ static bool _add_navigations(Evas_Object *base) return false; } - ly = _add_layout(base, GRP_HOME_DOWN_ARROW, true); + ly = utils_add_layout(base, GRP_HOME_DOWN_ARROW, true, PART_HOME_DOWN_ARROW); if (!ly) { _ERR("failed to add layout"); return false; } - elm_object_part_content_set(base, PART_HOME_DOWN_ARROW, ly); - ly = _add_layout(base, GRP_HOME_UP_ARROW, true); + ly = utils_add_layout(base, GRP_HOME_UP_ARROW, true, PART_HOME_UP_ARROW); if (!ly) { _ERR("failed to add layout"); return false; } - elm_object_part_content_set(base, PART_HOME_UP_ARROW, ly); return true; } @@ -202,31 +109,32 @@ static struct bar_item *_pack_bar_item(struct _priv *priv, Evas_Object *box, return NULL; } - eo = _add_layout(box, GRP_HOME_ITEM, true); + eo = utils_add_layout(box, GRP_HOME_ITEM, true, NULL); if (!eo) { _ERR("failed to add layout"); free(bi); return NULL; } - ic = _add_icon(eo, di->icon, PART_HOME_ITEM_ICON); + ic = utils_add_icon(eo, di->icon, PART_HOME_ITEM_ICON); if (!ic) goto err; - focus_ic = _add_icon(eo, di->focus_icon, PART_HOME_ITEM_ICON_FOCUS); + focus_ic = utils_add_icon(eo, di->focus_icon, PART_HOME_ITEM_ICON_FOCUS); if (!focus_ic) goto err; - lbl = _add_label(eo, di->title, STYLE_LABEL_TITLE, PART_HOME_ITEM_TITLE); + lbl = utils_add_label(eo, di->title, STYLE_LABEL_TITLE, PART_HOME_ITEM_TITLE); if (!lbl) goto err; - focus_lbl = _add_label(eo, di->title, STYLE_LABEL_TITLE_FOCUS, + focus_lbl = utils_add_label(eo, di->title, STYLE_LABEL_TITLE_FOCUS, PART_HOME_ITEM_TITLE_FOCUS); if (!focus_lbl) goto err; - bg = _add_bg(eo, PART_HOME_ITEM_BG); + bg = utils_add_bg(eo, COLOR_DEFAULT_R, COLOR_DEFAULT_G, COLOR_DEFAULT_B, + COLOR_DEFAULT_A, PART_HOME_ITEM_BG); if (!bg) goto err; @@ -257,24 +165,20 @@ static bool _add_home_menu(struct _priv *priv, Evas_Object *base) return false; } - scr = elm_scroller_add(base); + scr = utils_add_scroller(base); if (!scr) { _ERR("failed to add scroller"); return false; } - elm_scroller_policy_set(scr, ELM_SCROLLER_POLICY_OFF, - ELM_SCROLLER_POLICY_OFF); - box = elm_box_add(scr); + box = utils_add_box(scr, true); if (!box) { _ERR("failed to add box"); evas_object_del(scr); return false; } - evas_object_show(box); elm_object_content_set(scr, box); elm_object_part_content_set(base, PART_HOME_MENU_BAR, scr); - elm_box_horizontal_set(box, EINA_TRUE); list = datamgr_get_items(priv->dm); if (!list) { @@ -363,7 +267,7 @@ static Evas_Object *_create(Evas_Object *win, void *data) return NULL; } - base =_add_layout(win, GRP_HOME, false); + base = utils_add_layout(win, GRP_HOME, false, NULL); if (!base) { _ERR("failed to create base"); datamgr_fini(dm); -- 2.7.4 From 7e0973ce958d48cd429fe90ac00a2cba8efa17ea Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Thu, 18 Jun 2015 18:31:50 +0900 Subject: [PATCH 04/16] add initial data_recent Change-Id: I8df19a703a20f4fee390b17a53453ed3881a2478 Signed-off-by: Soohye Shin --- CMakeLists.txt | 1 + include/data_recent.h | 24 +++++++++++++++++++++ src/data/data_recent.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/view/view_recent.c | 17 ++++++++++++++- 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 include/data_recent.h create mode 100644 src/data/data_recent.c diff --git a/CMakeLists.txt b/CMakeLists.txt index b980692..e8f16d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ SET(SRCS src/utils.c src/data/datamgr.c src/data/data_home.c + src/data/data_recent.c src/view/view_recent.c src/view/view_home.c) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/include/data_recent.h b/include/data_recent.h new file mode 100644 index 0000000..be7fa8f --- /dev/null +++ b/include/data_recent.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __AIR_HOME_DATA_RECENT_H__ +#define __AIR_HOME_DATA_RECENT_H__ + +#include + +struct data_class *datamgr_recent_get_dclass(void); + +#endif /* __AIR_HOME_DATA_RECENT_H__ */ diff --git a/src/data/data_recent.c b/src/data/data_recent.c new file mode 100644 index 0000000..5bad2b3 --- /dev/null +++ b/src/data/data_recent.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "data_recent.h" +#include "datamgr.h" + +static Eina_List *_get_items(struct datamgr *dm) +{ + if (!dm) { + _ERR("Invalid argument"); + return NULL; + } + + return dm->list; +} + +static void _fini(struct datamgr *dm) +{ + /* It should be implemented later */ +} + +static bool _init(struct datamgr *dm) +{ + /* It should be implemented later */ + + return true; +} + +static struct data_class dclass = { + .init = _init, + .fini = _fini, + .get_items = _get_items +}; + +struct data_class *datamgr_recent_get_dclass(void) +{ + return &dclass; +} + diff --git a/src/view/view_recent.c b/src/view/view_recent.c index 6fe5fc7..3978df7 100644 --- a/src/view/view_recent.c +++ b/src/view/view_recent.c @@ -22,15 +22,21 @@ #include "defs.h" #include "view_recent.h" +#include "data_recent.h" +#include "datamgr.h" +#include "utils.h" struct _priv { Evas_Object *win; Evas_Object *base; + + struct datamgr *dm; }; static Evas_Object *_create(Evas_Object *win, void *data) { struct _priv *priv; + struct datamgr *dm; Evas_Object *base; if (!win) { @@ -44,9 +50,17 @@ static Evas_Object *_create(Evas_Object *win, void *data) return NULL; } + dm = datamgr_init(datamgr_recent_get_dclass(), VIEW_RECENT); + if (!dm) { + _ERR("failed to initialize datamgr"); + free(priv); + return NULL; + } + base = elm_layout_add(win); if (!base) { _ERR("failed to create base"); + datamgr_fini(dm); free(priv); return NULL; } @@ -56,6 +70,7 @@ static Evas_Object *_create(Evas_Object *win, void *data) priv->win = win; priv->base = base; + priv->dm = dm; viewmgr_set_view_data(VIEW_RECENT, priv); @@ -101,7 +116,7 @@ static void _destroy(void *data) } priv = data; - + datamgr_fini(priv->dm); evas_object_del(priv->base); free(priv); } -- 2.7.4 From ee2498df0181281e5b4f412f2bb2e06205ca3f00 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Fri, 19 Jun 2015 10:27:24 +0900 Subject: [PATCH 05/16] add initial view_user Change-Id: I9d1e4eaa4a2463a55e15a3d837cf84ba02a66088 Signed-off-by: Soohye Shin --- CMakeLists.txt | 1 + edje/home.edc | 1 + edje/view/user.edc | 22 ++++++++++ include/defs.h | 7 +-- include/view_user.h | 22 ++++++++++ src/main.c | 2 + src/view/view_user.c | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 edje/view/user.edc create mode 100644 include/view_user.h create mode 100644 src/view/view_user.c diff --git a/CMakeLists.txt b/CMakeLists.txt index e8f16d7..77c56f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ SET(SRCS src/data/datamgr.c src/data/data_home.c src/data/data_recent.c + src/view/view_user.c src/view/view_recent.c src/view/view_home.c) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) diff --git a/edje/home.edc b/edje/home.edc index 0071986..cf65362 100644 --- a/edje/home.edc +++ b/edje/home.edc @@ -19,4 +19,5 @@ collections { #include "view/home.edc" #include "view/recent.edc" + #include "view/user.edc" } diff --git a/edje/view/user.edc b/edje/view/user.edc new file mode 100644 index 0000000..ff790e1 --- /dev/null +++ b/edje/view/user.edc @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "../../include/defs.h" +group { + name, GRP_USER; + parts { + } +} diff --git a/include/defs.h b/include/defs.h index 3c7f608..42f66ab 100644 --- a/include/defs.h +++ b/include/defs.h @@ -28,9 +28,10 @@ #define GRP_HOME_DOWN_ARROW "group.home.down.arrow" #define GRP_HOME_ITEM "group.home.item" #define GRP_RECENT "group.recent" -#define GRP_RECENT_DELETE "grp.recent.delete" -#define GRP_RECENT_ICON "grp.recent.icon" -#define GRP_RECENT_PREVIEW "grp.recent.preview" +#define GRP_RECENT_DELETE "group.recent.delete" +#define GRP_RECENT_ICON "group.recent.icon" +#define GRP_RECENT_PREVIEW "group.recent.preview" +#define GRP_USER "group.user" #define PART_HOME_MENU_BAR "part.home.menu.bar" #define PART_HOME_UP_ARROW "part.home.up.arrow" diff --git a/include/view_user.h b/include/view_user.h new file mode 100644 index 0000000..c9c622c --- /dev/null +++ b/include/view_user.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __AIR_HOME_VIEW_USER_H__ +#define __AIR_HOME_VIEW_USER_H__ + +view_class *view_user_get_vclass(void); + +#endif /* __AIR_HOME_VIEW_USER_H__ */ diff --git a/src/main.c b/src/main.c index c4e1027..e00a82c 100644 --- a/src/main.c +++ b/src/main.c @@ -22,6 +22,7 @@ #include "defs.h" #include "view_home.h" #include "view_recent.h" +#include "view_user.h" SET_TAG(PACKAGE); @@ -74,6 +75,7 @@ static bool _create(void *user_data) viewmgr_add_view(view_home_get_vclass(), NULL); viewmgr_add_view(view_recent_get_vclass(), NULL); + viewmgr_add_view(view_user_get_vclass(), NULL); ad->win = win; diff --git a/src/view/view_user.c b/src/view/view_user.c new file mode 100644 index 0000000..3f9c282 --- /dev/null +++ b/src/view/view_user.c @@ -0,0 +1,120 @@ +/* + + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "defs.h" +#include "view_user.h" +#include "datamgr.h" +#include "utils.h" + +struct _priv { + Evas_Object *win; + Evas_Object *base; +}; + +static Evas_Object *_create(Evas_Object *win, void *data) +{ + struct _priv *priv; + Evas_Object *base; + + if (!win) { + _ERR("Invalid argument"); + return NULL; + } + + priv = calloc(1, sizeof(*priv)); + if (!priv) { + _ERR("failed to calloc priv"); + return NULL; + } + + base = utils_add_layout(win, GRP_USER, false, NULL); + if (!base) { + _ERR("failed to create base"); + free(priv); + return NULL; + } + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, base); + + priv->win = win; + priv->base = base; + + viewmgr_set_view_data(VIEW_USER, priv); + + return base; +} + +static void _show(void *data) +{ + struct _priv *priv; + + if (!data) { + _ERR("Invalid argument"); + return; + } + + priv = data; + + evas_object_show(priv->base); +} + +static void _hide(void *data) +{ + struct _priv *priv; + + if (!data) { + _ERR("Invalid argument"); + return; + } + + priv = data; + + evas_object_hide(priv->base); +} + +static void _destroy(void *data) +{ + struct _priv *priv; + + if (!data) { + _ERR("Invalid argument"); + return; + } + + priv = data; + evas_object_del(priv->base); + free(priv); +} + +static view_class vclass = { + .view_id = VIEW_USER, + .create = _create, + .show = _show, + .hide = _hide, + .destroy = _destroy +}; + +view_class *view_user_get_vclass(void) +{ + return &vclass; +} + -- 2.7.4 From aaf3549d2115e12b0b43b368e108ab8fcd79f052 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Fri, 19 Jun 2015 19:55:32 +0900 Subject: [PATCH 06/16] add useredit edc Change-Id: I14b6103bf75bf426fd1932f59166bcf2e5d39112 Signed-off-by: Soohye Shin --- edje/home.edc | 1 + edje/images/btn_user_del.png | Bin 0 -> 1337 bytes edje/images/ic_user_require_01.png | Bin 0 -> 2995 bytes edje/images/ic_user_require_02.png | Bin 0 -> 2943 bytes edje/view/useredit.edc | 792 +++++++++++++++++++++++++++++++++++++ include/defs.h | 12 + 6 files changed, 805 insertions(+) create mode 100644 edje/images/btn_user_del.png create mode 100644 edje/images/ic_user_require_01.png create mode 100644 edje/images/ic_user_require_02.png create mode 100644 edje/view/useredit.edc diff --git a/edje/home.edc b/edje/home.edc index cf65362..c5304b9 100644 --- a/edje/home.edc +++ b/edje/home.edc @@ -20,4 +20,5 @@ collections { #include "view/home.edc" #include "view/recent.edc" #include "view/user.edc" + #include "view/useredit.edc" } diff --git a/edje/images/btn_user_del.png b/edje/images/btn_user_del.png new file mode 100644 index 0000000000000000000000000000000000000000..3c4fa041192b0ea8e12a2c77695aa094ea90e2d4 GIT binary patch literal 1337 zcmeAS@N?(olHy`uVBq!ia0vp^VLDSr z1<%~X^wgl##FWaylc_cg49sbnArU1JzCKpT`MG+DAT@dwxdlMo3=B5*6$OdO*{LN8 zNvY|XdA3ULckfqH$V{%1*XSQL?vFu&J;D8jzb> zlBiITo0C^;Rbi_HHrEQs1_|pcDS(xfWZNo192Makpx~Tel&WB=XRMoSU}&gdW~OIo zVrph)sH0$HU}&Uo07PcGh9*{~W>!Y#3Q(W~w5=#5%__*n4QdyVXRDM^Qc_^0uU}qX zu2*iXmtT~wZ)j<02{OaTNEfI=x41H|B(Xv_uUHvof=g;~a#3bMNoIbY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+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0002qNkl&W*a3WW_LPiJ| zS1KU>CAeTIdXW>^@4Z;bQc8Rh6F!XJ7nt5Vv=S;{1vK87{W}bDpj7;V2Udc!5{d`1 z3Y7*xHq3#QFb9sB?}3ft7FYs>`cVMUJ2Sg1kn4p~aU5~vLkH}D&N~ycTa#!dlt8N; zJ7D9T*}Y=oK)2ET{OMP)5*$zg;++xoVy&$17qAjmO1%d})3xGOy?Q7i0=0K00;u+Z p$+?u2($!kDhy2-m_Wut!4FFT6coX47+&usQ002ovPDHLkV1gdriirRK literal 0 HcmV?d00001 diff --git a/edje/images/ic_user_require_02.png b/edje/images/ic_user_require_02.png new file mode 100644 index 0000000000000000000000000000000000000000..9c26bc9f814782964c11843486048c38092b2a47 GIT binary patch literal 2943 zcmV-_3xM>AP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8ne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t^nAbo8?m&uq84&XXC{T5p4?r2&(%ObL phF<`k<_%DV&uWI_z5fn;2LKH`H?3&hj)4FG002ovPDHLkV1f$yZy5jp literal 0 HcmV?d00001 diff --git a/edje/view/useredit.edc b/edje/view/useredit.edc new file mode 100644 index 0000000..a8d780f --- /dev/null +++ b/edje/view/useredit.edc @@ -0,0 +1,792 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "../../include/defs.h" +group { + name, GRP_USER_EDIT; + parts { + part { + name, "title"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel2.relative, 1.0 0.0; + min, 0 104; + fixed, 0 1; + align, 0.5 0.0; + } + } + part { + name, PART_USER_EDIT_TITLE; + type, TEXT; + scale, 1; + description { + rel1.to, "title"; + rel2.to, "title"; + fixed, 1 1; + text { + font, 46; + font, "TizenSans"; + } + color, 51 51 51 255; + } + } + part { + name, "divider.up"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "title"; + relative, 0.0 1.0; + } + rel2.to, "title"; + min, 0 1; + fixed, 0 1; + align, 0.5 0.0; + color, 210 219 230 255; + } + } + part { + name, "function.btn"; + type, RECT; + scale, 1; + description { + rel1 { + to, "divider.up"; + relative, 0.0 1.0; + } + rel2.to, "divider.up"; + min, 0 114; + fixed, 0 1; + align, 0.5 0.0; + color, 221 231 242 255; + } + } + part { + name, "divider.down"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "function.btn"; + relative, 0.0 1.0; + } + rel2.to, "function.btn"; + min, 0 1; + fixed, 0 1; + align, 0.5 0.0; + color, 210 219 230 255; + } + } + part { + name, "action.btn"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1.relative, 0.0 1.0; + min, 0 148; + fixed, 0 1; + align, 0.5 1.0; + } + } + part { + name, "pad.action.btn"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "action.btn"; + relative, 0.5 0.5; + } + rel2 { + to, "action.btn"; + relative, 0.5 0.5; + } + min, 24 64; + fixed, 1 1; + visible, 0; + } + } + part { + name, PART_USER_EDIT_BTN_CACEL; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1.to, "pad.action.btn"; + rel2 { + to, "pad.action.btn"; + relative, 0.0 1.0; + } + min, 308 0; + fixed, 1 0; + align, 1.0 0.5; + } + } + part { + name, PART_USER_EDIT_BTN_DONE; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.action.btn"; + relative, 1.0 0.0; + } + rel2.to, "pad.action.btn"; + min, 308 0; + fixed, 1 0; + align, 0.0 0.5; + } + } + part { + name, "contents"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "divider.down"; + relative, 0.0 1.0; + } + rel2 { + to, "action.btn"; + relative, 1.0 0.0; + } + fixed, 1 1; + color, 244 244 244 255; + } + } + part { + name, PART_USER_EDIT_CONTENTS; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "contents"; + relative, 0.5 0.5; + } + rel2 { + to, "contents"; + relative, 0.5 0.5; + } + min, 1036 552; + fixed, 1 1; + } + } + } +} + +group { + name, GRP_USER_EDIT_CONTENTS; + images { + image, "ic_user_require_01.png" COMP; + image, "ic_user_require_02.png" COMP; + image, "btn_user_del.png" COMP; + } + parts { + part { + name, "bg"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + min, 1036 552; + visible, 0; + } + } + part { + name, "pad"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + min, 138 0; + rel2.relative, 0.0 1.0; + fixed, 1 0; + align, 0.0 0.5; + visible, 0; + } + } + part { + name, "photo"; + type, TEXT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad"; + relative, 1.0 0.0; + } + rel2 { + to, "pad"; + relative, 1.0 0.0; + } + min, 90 32; + fixed, 1 1; + align, 0.0 0.0; + text { + font, "TizenSans"; + size, 32; + text, "Photo"; + align, 0.0 0.5; + } + color, 77 77 77 255; + } + } + part { + name, "pad.photo.require"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "photo"; + relative, 1.0 0.0; + } + rel2 { + to, "photo"; + relative, 1.0 0.0; + } + min, 6 0; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, "photo.require"; + type, IMAGE; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.photo.require"; + relative, 1.0 0.0; + } + rel2 { + to, "pad.photo.require"; + relative, 1.0 0.0; + } + min, 16 20; + fixed, 1 1; + align, 0.0 0.0; + image.normal, "ic_user_require_01.png"; + } + } + part { + name, "pad.photo"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "photo"; + relative, 0.0 1.0; + } + rel2 { + to, "photo"; + relative, 0.0 1.0; + } + min, 0 22; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, PART_USER_EDIT_CONTENTS_PHOTO; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.photo"; + relative, 0.0 1.0; + } + rel2 { + to, "pad.photo"; + relative, 0.0 1.0; + } + min, 294 294; + fixed, 1 1; + align, 0.0 0.0; + } + } + part { + name, "pad.profile"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, PART_USER_EDIT_CONTENTS_PHOTO; + relative, 1.0 0.0; + } + rel2 { + to, PART_USER_EDIT_CONTENTS_PHOTO; + relative, 1.0 0.0; + } + min, 72 54; + fixed, 1 1; + align, 0.0 1.0; + visible, 0; + } + } + part { + name, "information"; + type, TEXT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.profile"; + relative, 1.0 0.0; + } + rel2 { + to, "pad.profile"; + relative, 1.0 0.0; + } + min, 180 32; + fixed, 1 1; + align, 0.0 0.0; + text { + font, "TizenSans"; + size, 32; + text, "Information"; + align, 0.0 0.5; + } + color, 77 77 77 255; + } + } + part { + name, "information.require"; + type, IMAGE; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "information"; + relative, 1.0 0.0; + } + rel2 { + to, "information"; + relative, 1.0 0.0; + } + min, 16 20; + fixed, 1 1; + align, 0.0 0.0; + image.normal, "ic_user_require_01.png"; + } + } + part { + name, "pad.name"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "information"; + relative, 0.0 1.0; + } + rel2 { + to, "information"; + relative, 0.0 1.0; + } + min, 0 22; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, PART_USER_EDIT_CONTENTS_NAME; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.name"; + relative, 1.0 1.0; + } + rel2.to, "pad.name"; + min, 436 64; + fixed, 1 1; + align, 0.0 0.0; + fixed, 1 1; + } + } + part { + name, "pad.pin"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, PART_USER_EDIT_CONTENTS_NAME; + relative, 0.0 1.0; + } + rel2 { + to, PART_USER_EDIT_CONTENTS_NAME; + relative, 0.0 1.0; + } + min, 0 16; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, PART_USER_EDIT_CONTENTS_PIN; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.pin"; + relative, 1.0 1.0; + } + rel2.to, "pad.pin"; + min, 436 64; + fixed, 1 1; + align, 0.0 0.0; + } + } + part { + name, "pad.account"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, PART_USER_EDIT_CONTENTS_PIN; + relative, 0.0 1.0; + } + rel2 { + to, PART_USER_EDIT_CONTENTS_PIN; + relative, 0.0 1.0; + } + min, 0 32; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, "account"; + type, TEXT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.account"; + relative, 1.0 1.0; + } + rel2.to, "pad.account"; + min, 436 32; + fixed, 1 1; + align, 0.0 0.0; + text { + font, "TizenSans"; + size, 32; + text, "Account"; + align, 0.0 0.5; + } + color, 77 77 77 255; + } + } + part { + name, "pad.account.down"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "account"; + relative, 0.0 1.0; + } + rel2 { + to, "account"; + relative, 0.0 1.0; + } + min, 0 22; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, PART_USER_EDIT_CONTENTS_ACCOUNT; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.account.down"; + relative, 1.0 1.0; + } + rel2.to, "pad.account.down"; + min, 436 64; + fixed, 1 1; + align, 0.0 0.0; + } + } + part { + name, "pad.lock"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, PART_USER_EDIT_CONTENTS_ACCOUNT; + relative, 0.0 1.0; + } + rel2 { + to, PART_USER_EDIT_CONTENTS_ACCOUNT; + relative, 0.0 1.0; + } + min, 0 32; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, "lock"; + type, TEXT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.lock"; + relative, 1.0 1.0; + } + rel2.to, "pad.lock"; + min, 436 32; + fixed, 1 1; + align, 0.0 0.0; + text { + font, "TizenSans"; + size, 32; + text, "Privacy lock"; + align, 0.0 0.5; + } + color, 77 77 77 255; + } + } + part { + name, "pad.lock.down"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "lock"; + relative, 0.0 1.0; + } + rel2 { + to, "lock"; + relative, 0.0 1.0; + } + min, 0 22; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, PART_USER_EDIT_CONTENTS_LOCK; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.lock.down"; + relative, 1.0 1.0; + } + rel2.to, "pad.lock.down"; + min, 104 54; + fixed, 1 1; + align, 0.0 0.0; + } + } + part { + name, "pad.require"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, PART_USER_EDIT_CONTENTS_LOCK; + relative, 0.0 1.0; + } + rel2 { + to, PART_USER_EDIT_CONTENTS_LOCK; + relative, 0.0 1.0; + } + min, 0 22; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, "icon.require"; + type, IMAGE; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.require"; + relative, 1.0 1.0; + } + rel2.to, "pad.require"; + min, 12 24; + fixed, 1 1; + align, 0.0 0.0; + image.normal, "ic_user_require_02.png"; + } + } + part { + name, "pad.require.text"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "icon.require"; + relative, 1.0 0.0; + } + rel2 { + to, "icon.require"; + relative, 1.0 0.0; + } + min, 6 0; + align, 0.0 0.0; + fixed, 1 1; + visible, 0; + } + } + part { + name, "require"; + type, TEXT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.require.text"; + relative, 1.0 0.0; + } + rel2 { + to, "pad.require.text"; + relative, 1.0 0.0; + } + min, 418 24; + fixed, 1 1; + align, 0.0 0.0; + text { + font, "TizenSans"; + size, 24; + align, 0.0 0.5; + text, "Required fields"; + } + color, 64 136 211 255; + } + } + part { + name, "pad.delete"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, PART_USER_EDIT_CONTENTS_NAME; + relative, 1.0 0.0; + } + rel2 { + to, PART_USER_EDIT_CONTENTS_NAME; + relative, 1.0 0.0; + } + min, 10 0; + fixed, 1 1; + align, 0.0 0.0; + visible, 0; + } + } + part { + name, "bg.delete"; + type, RECT; + scale, 1; + description { + state, "default"; + rel1 { + to, "pad.delete"; + relative, 1.0 0.0; + } + rel2 { + to, "pad.delete"; + relative, 1.0 0.0; + } + min, 86 64; + fixed, 1 1; + align, 0.0 0.0; + color, 126 145 172 255; + } + description { + state, "focus"; + inherit, "default" 0.0; + color, 0 119 246 255; + } + } + part { + name, PART_USER_EDIT_CONTENTS_DELETE; + type, IMAGE; + scale, 1; + description { + state, "default" 0.0; + rel1.to, "bg.delete"; + rel2.to, "bg.delete"; + fixed, 1 1; + image.normal, "btn_user_del.png"; + } + } + } + programs { + program { + name, "sig,focus,delete"; + signal, SIG_FOCUS; + source, SRC_PROG; + action, STATE_SET "focus" 0.0; + transition, LINEAR 0.5; + target, "bg.delete"; + } + program { + name, "sig,unfocus,delete"; + signal, SIG_UNFOCUS; + source, SRC_PROG; + action, STATE_SET "unfocus" 0.0; + transition, LINEAR 0.5; + target, "bg.delete"; + } + } +} diff --git a/include/defs.h b/include/defs.h index 42f66ab..2060ef6 100644 --- a/include/defs.h +++ b/include/defs.h @@ -32,6 +32,8 @@ #define GRP_RECENT_ICON "group.recent.icon" #define GRP_RECENT_PREVIEW "group.recent.preview" #define GRP_USER "group.user" +#define GRP_USER_EDIT "group.user.edit" +#define GRP_USER_EDIT_CONTENTS "group.user.edit.contents" #define PART_HOME_MENU_BAR "part.home.menu.bar" #define PART_HOME_UP_ARROW "part.home.up.arrow" @@ -51,6 +53,16 @@ #define PART_RECENT_THUMBNAIL "part.recent.thumbnail" #define PART_RECENT_ICON "part.recent.icon" #define PART_RECENT_FAVORITE "part.recent.favorite" +#define PART_USER_EDIT_TITLE "part.user.edit.title" +#define PART_USER_EDIT_BTN_DONE "part.user.edit.btn.done" +#define PART_USER_EDIT_BTN_CANCEL "part.user.edit.btn.cancel" +#define PART_USER_EDIT_CONTENTS "part.user.edit.contents" +#define PART_USER_EDIT_CONTENTS_PHOTO "part.user.edit.contents.photo" +#define PART_USER_EDIT_CONTENTS_NAME "part.user.edit.contents.name" +#define PART_USER_EDIT_CONTENTS_PIN "part.user.edit.contents.pin" +#define PART_USER_EDIT_CONTENTS_ACCOUNT "part.user.edit.contents.account" +#define PART_USER_EDIT_CONTENTS_LOCK "part.user.edit.contents.lock" +#define PART_USER_EDIT_CONTETNS_DELETE "part.user.edit.contents.delete" #define SIG_SHOW_NAVIGATION "sig.show.navigation" #define SIG_HIDE_NAVIGATION "sig.hide.navigation" -- 2.7.4 From 1081c2c20a1ba768e0c3e84017ddb6f6683ec89b Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Fri, 19 Jun 2015 11:26:12 +0900 Subject: [PATCH 07/16] draw recent lists and delete icon Change-Id: I61db5350b2674d8b8eb41fbff8e1993f454ba3b2 Signed-off-by: Soohye Shin --- edje/view/recent.edc | 5 ++ include/defs.h | 2 + src/view/view_recent.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 133 insertions(+), 2 deletions(-) diff --git a/edje/view/recent.edc b/edje/view/recent.edc index 49289b2..910fa7d 100644 --- a/edje/view/recent.edc +++ b/edje/view/recent.edc @@ -219,6 +219,11 @@ group { transition, DECEL 0.5; target, "clip"; target, "guide"; + after, "sig.hide.recent.done"; + } + program { + name, "sig.hide.recent.done"; + action, SIGNAL_EMIT SIG_HIDE_RECENT_DONE SRC_EDJE; } } } diff --git a/include/defs.h b/include/defs.h index 42f66ab..9bd6891 100644 --- a/include/defs.h +++ b/include/defs.h @@ -22,6 +22,7 @@ #define VIEW_USER "VIEW_USER" #define SRC_PROG "prog" +#define SRC_EDJE "edje" #define GRP_HOME "group.home" #define GRP_HOME_UP_ARROW "group.home.up.arrow" @@ -65,6 +66,7 @@ #define SIG_UNFOCUS_TO_LEFT "sig.unfocus.to.left" #define SIG_SHOW_RECENT "sig.show.recent" #define SIG_HIDE_RECENT "sig.hide.recent" +#define SIG_HIDE_RECENT_DONE "sig.hide.recent.done" #define TITLE_WIDTH "title.width" diff --git a/src/view/view_recent.c b/src/view/view_recent.c index 3978df7..197b214 100644 --- a/src/view/view_recent.c +++ b/src/view/view_recent.c @@ -26,13 +26,69 @@ #include "datamgr.h" #include "utils.h" +#define MESSAGE_NO_CONTENTS "No Contents" + struct _priv { Evas_Object *win; Evas_Object *base; + Evas_Object *del_btn; + Evas_Object *scr; + Evas_Object *box; + Eina_List *list; struct datamgr *dm; }; +struct _bar_item { + Evas_Object *eo; +}; + +static bool _add_delete_btn(struct _priv *priv, Evas_Object *base) +{ + Evas_Object *btn; + + btn = utils_add_layout(base, GRP_RECENT_DELETE, true, PART_RECENT_DELETE_ICON); + if (!btn) { + _ERR("failed to add delete icon"); + return false; + } + + priv->del_btn = btn; + + return true; +} + +static void _key_down(int id, void *data, Evas *e, Evas_Object *obj, + Evas_Event_Key_Down *ev) +{ + struct _priv *priv; + + if (!data) { + _ERR("Invalid argument"); + return; + } + + priv = data; + + if (!strcmp(ev->keyname, KEY_BACK) || + !strcmp(ev->keyname, KEY_BACK_REMOTE)) { + elm_object_signal_emit(priv->base, SIG_HIDE_RECENT, SRC_PROG); + } else if (!strcmp(ev->keyname, KEY_ENTER) || + !strcmp(ev->KEY_ENTER_REMOTE)) { + /* It should be implemented later */ + } +} + +static input_handler base_handler = { + .key_down = _key_down +}; + +static void _hide_done(void *data, Evas_Object *obj, const char *emission, + const char *source) +{ + viewmgr_pop_view(); +} + static Evas_Object *_create(Evas_Object *win, void *data) { struct _priv *priv; @@ -57,14 +113,13 @@ static Evas_Object *_create(Evas_Object *win, void *data) return NULL; } - base = elm_layout_add(win); + base = utils_add_layout(win, GRP_RECENT, false, NULL); if (!base) { _ERR("failed to create base"); datamgr_fini(dm); free(priv); return NULL; } - elm_layout_file_set(base, EDJEFILE, GRP_RECENT); evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, base); @@ -72,11 +127,56 @@ static Evas_Object *_create(Evas_Object *win, void *data) priv->base = base; priv->dm = dm; + if (!_add_delete_btn(priv, base)) { + _ERR("failed to add recent"); + evas_object_del(base); + datamgr_fini(dm); + free(priv); + return NULL; + } + viewmgr_set_view_data(VIEW_RECENT, priv); + inputmgr_add_callback(base, 0, &base_handler, priv); + elm_object_signal_callback_add(base, SIG_HIDE_RECENT_DONE, SRC_EDJE, + _hide_done, NULL); return base; } +static void _load_recent(struct _priv *priv) +{ + Eina_List *list; + Evas_Object *scr, *box; + + list = datamgr_get_items(priv->dm); + if (!list) { + elm_object_part_text_set(priv->base, PART_RECENT_NO_CONTENTS, + MESSAGE_NO_CONTENTS); + return; + } + + scr = utils_add_scroller(priv->base); + if (!scr) { + _ERR("failed to add scroller"); + return; + } + + box = utils_add_box(scr, true); + if (!box) { + _ERR("failed to add box"); + evas_object_del(scr); + return; + } + elm_object_content_set(scr, box); + elm_object_part_content_set(priv->base, PART_RECENT_CONTENTS, scr); + elm_object_part_text_set(priv->base, PART_RECENT_NO_CONTENTS, ""); + + /* It should be implemented later */ + + priv->scr = scr; + priv->box = box; +} + static void _show(void *data) { struct _priv *priv; @@ -90,6 +190,24 @@ static void _show(void *data) evas_object_show(priv->base); elm_object_signal_emit(priv->base, SIG_SHOW_RECENT, SRC_PROG); + + _load_recent(priv); +} + +static void _unload_recent(struct _priv *priv) +{ + struct _bar_item *bi; + + EINA_LIST_FREE(priv->list, bi) { + evas_object_del(bi->eo); + free(bi); + } + + elm_box_clear(priv->box); + evas_object_del(priv->scr); + priv->box = NULL; + priv->scr = NULL; + priv->list = NULL; } static void _hide(void *data) @@ -103,6 +221,8 @@ static void _hide(void *data) priv = data; + _unload_recent(priv); + evas_object_hide(priv->base); } @@ -116,6 +236,10 @@ static void _destroy(void *data) } priv = data; + + _unload_recent(priv); + + inputmgr_remove_callback(priv->base, &base_handler); datamgr_fini(priv->dm); evas_object_del(priv->base); free(priv); -- 2.7.4 From 124808401700e9995f25ebeaf63cb65c4c692306 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Mon, 22 Jun 2015 11:14:53 +0900 Subject: [PATCH 08/16] modify min size and color value according to modified GUI Change-Id: I677113c14f646c39f8529d788b614e3f9b693dc7 Signed-off-by: Soohye Shin --- edje/view/home.edc | 34 +++++++++++++++++----------------- edje/view/recent.edc | 52 ++++++++++++++++++++++++++-------------------------- include/defs.h | 6 +++--- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/edje/view/home.edc b/edje/view/home.edc index 326edc0..73ebe13 100644 --- a/edje/view/home.edc +++ b/edje/view/home.edc @@ -25,7 +25,7 @@ group{ description { state, "default" 0.0; rel2.relative, 1.0 0.0; - min, 0 97; + min, 0 98; align, 0.5 1.0; fixed, 0 1; visible, 0; @@ -51,7 +51,7 @@ group{ } fixed, 1 1; align, 0.5 0.0; - min, 97 97; + min, 98 98; } } part { @@ -61,7 +61,7 @@ group{ description { state, "default" 0.0; rel1.relative, 0.0 1.0; - min, 0 97; + min, 0 98; align, 0.5 0.0; fixed, 0 1; visible, 0; @@ -87,7 +87,7 @@ group{ rel2.to, "clip.down.arrow"; fixed, 1 1; align, 0.5 1.0; - min, 97 97; + min, 98 98; } } part { @@ -157,7 +157,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 97 97; + min, 98 98; visible, 0; } } @@ -167,7 +167,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 97 30; + min, 98 32; rel1.relative, 0.5 0.0; rel2.relative, 0.5 0.0; align, 0.5 0.0; @@ -177,7 +177,7 @@ group { font, "TizenSans"; text, "Recent"; } - color, 124 124 124 255; + color, 255 255 255 178; } } part { @@ -186,7 +186,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 0 11; + min, 0 10; rel1 { to, "text"; relative, 0.5 1.0; @@ -206,7 +206,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 97 34; + min, 98 34; rel1 { relative, 1.0 1.0; to, "pad.arrow"; @@ -235,7 +235,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 97 97; + min, 98 98; visible, 0; } } @@ -245,7 +245,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 97 30; + min, 98 32; rel1.relative, 0.5 1.0; rel2.relative, 0.5 1.0; align, 0.5 1.0; @@ -255,7 +255,7 @@ group { font, "TizenSans"; text, "ETG"; } - color, 124 124 124 255; + color, 255 255 255 178; } } part { @@ -264,7 +264,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 0 11; + min, 0 10; rel1 { to, "text"; relative, 0.5 0.0; @@ -284,7 +284,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 97 34; + min, 98 34; rel1 { relative, 0.0 0.0; to, "pad.arrow"; @@ -415,7 +415,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 0 23; + min, 0 24; rel1.relative, 0.5 1.0; rel2.relative, 0.5 1.0; align, 0.5 1.0; @@ -439,7 +439,7 @@ group { } align, 0.5 1.0; fixed, 1 1; - min, 128 38; + min, 130 22; } } part { @@ -474,7 +474,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 42 15; + min, 40 14; rel1.relative, 1.0 0.0; rel2.relative, 1.0 0.0; align, 1.0 0.0; diff --git a/edje/view/recent.edc b/edje/view/recent.edc index 910fa7d..35a9f32 100644 --- a/edje/view/recent.edc +++ b/edje/view/recent.edc @@ -94,7 +94,7 @@ group { } rel2.to, "bg"; fixed, 1 1; - color, 242 242 242 255; + color, 244 244 244 255; } } part { @@ -143,7 +143,7 @@ group { to, "pad.title"; relative, 0.0 1.0; } - min, 70 70; + min, 62 62; fixed, 1 1; align, 0.0 0.0; visible, 0; @@ -159,7 +159,7 @@ group { to, "bg"; relative, 1.0 1.0; } - min, 0 70; + min, 0 62; fixed, 1 1; align, 1.0 1.0; visible, 0; @@ -176,11 +176,11 @@ group { relative, 0.0 1.0; } text { - size, 50; + size, 32; font, "TizenSans"; } fixed, 1 1; - color, 51 51 51 255; + color, 0 0 0 178; } } part { @@ -273,7 +273,7 @@ group { description { state, "focus" 0.0; inherit, "default" 0.0; - color, 22 120 224 255; + color, 0 119 246 255; } } part { @@ -282,7 +282,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 1 1; + min, 3 3; rel2.relative, 0.0 0.0; align, 0.0 0.0; fixed, 1 1; @@ -295,7 +295,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 1 1; + min, 3 3; rel1.relative, 1.0 0.0; rel2.relative, 1.0 0.0; align, 1.0 0.0; @@ -317,7 +317,7 @@ group { to, "pad.thumbnail.right"; relative, 0.0 1.0; } - min, 0 198; + min, 0 196; fixed, 0 1; align, 0.5 0.0; } @@ -336,7 +336,7 @@ group { to, PART_RECENT_THUMBNAIL; relative, 0.0 0.0; } - min, 3 3; + min, 4 4; fixed, 1 1; align, 0.0 0.0; visible, 0; @@ -375,7 +375,7 @@ group { to, PART_RECENT_THUMBNAIL; relative, 1.0 0.0; } - min, 3 3; + min, 4 4; fixed, 1 1; align, 1.0 0.0; visible, 0; @@ -406,7 +406,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 16 18; + min, 15 18; rel1 { to, PART_RECENT_THUMBNAIL; relative, 0.0 1.0; @@ -426,7 +426,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 16 18; + min, 15 18; rel1 { to, PART_RECENT_THUMBNAIL; relative, 1.0 1.0; @@ -454,7 +454,7 @@ group { to, "pad.text.right"; relative, 0.0 1.0; } - min, 0 27; + min, 0 28; fixed, 0 1; align, 0.5 0.0; } @@ -473,7 +473,7 @@ group { to, PART_RECENT_TITLE; relative, 1.0 1.0; } - min, 0 9; + min, 0 8; fixed, 0 1; align, 0.5 0.0; visible, 0; @@ -528,13 +528,13 @@ group { scale, 1; description { state, "default" 0.0; - min, 235 294; + min, 236 294; color, 0 0 0 70; } description { state, "focus" 0.0; inherit, "default" 0.0; - color, 22 120 224 255; + color, 0 119 246 255; } } part { @@ -543,7 +543,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 1 1; + min, 3 3; rel2.relative, 0.0 0.0; align, 0.0 0.0; fixed, 1 1; @@ -556,7 +556,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 1 1; + min, 3 3; rel1.relative, 1.0 0.0; rel2.relative, 1.0 0.0; align, 1.0 0.0; @@ -578,7 +578,7 @@ group { to, "pad.thumbnail.right"; relative, 0.0 1.0; } - min, 0 198; + min, 0 196; fixed, 0 1; align, 0.5 0.0; } @@ -597,7 +597,7 @@ group { to, PART_RECENT_THUMBNAIL; relative, 0.0 0.0; } - min, 3 3; + min, 4 4; fixed, 1 1; align, 0.0 0.0; visible, 0; @@ -636,7 +636,7 @@ group { to, PART_RECENT_THUMBNAIL; relative, 1.0 0.0; } - min, 3 3; + min, 4 4; fixed, 1 1; align, 1.0 0.0; visible, 0; @@ -667,7 +667,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 16 18; + min, 15 18; rel1 { to, PART_RECENT_THUMBNAIL; relative, 0.0 1.0; @@ -687,7 +687,7 @@ group { scale, 1; description { state, "default" 0.0; - min, 16 18; + min, 15 18; rel1 { to, PART_RECENT_THUMBNAIL; relative, 1.0 1.0; @@ -715,7 +715,7 @@ group { to, "pad.text.right"; relative, 0.0 1.0; } - min, 0 27; + min, 0 28; fixed, 0 1; align, 0.5 0.0; } @@ -734,7 +734,7 @@ group { to, PART_RECENT_TITLE; relative, 1.0 1.0; } - min, 0 9; + min, 0 8; fixed, 0 1; align, 0.5 0.0; visible, 0; diff --git a/include/defs.h b/include/defs.h index 34204ce..8d87f09 100644 --- a/include/defs.h +++ b/include/defs.h @@ -85,9 +85,9 @@ #define STYLE_LABEL_TITLE "slide_home_title" #define STYLE_LABEL_TITLE_FOCUS "slide_home_title_focus" -#define COLOR_DEFAULT_R 22 -#define COLOR_DEFAULT_G 120 -#define COLOR_DEFAULT_B 224 +#define COLOR_DEFAULT_R 0 +#define COLOR_DEFAULT_G 119 +#define COLOR_DEFAULT_B 246 #define COLOR_DEFAULT_A 255 #define IMAGE_BADGE IMAGEDIR"/badge_bg.png" -- 2.7.4 From da3bbae0c1095a8413ddc2ea5a2c9c46be3d8027 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Mon, 22 Jun 2015 11:29:22 +0900 Subject: [PATCH 09/16] fix build error Change-Id: I5dba57441327eb85045a9dc2d13e109df4bb4982 Signed-off-by: Soohye Shin --- src/view/view_recent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/view_recent.c b/src/view/view_recent.c index 197b214..653d926 100644 --- a/src/view/view_recent.c +++ b/src/view/view_recent.c @@ -74,7 +74,7 @@ static void _key_down(int id, void *data, Evas *e, Evas_Object *obj, !strcmp(ev->keyname, KEY_BACK_REMOTE)) { elm_object_signal_emit(priv->base, SIG_HIDE_RECENT, SRC_PROG); } else if (!strcmp(ev->keyname, KEY_ENTER) || - !strcmp(ev->KEY_ENTER_REMOTE)) { + !strcmp(ev->keyname, KEY_ENTER_REMOTE)) { /* It should be implemented later */ } } -- 2.7.4 From dc5ef245fdee8bec195d1333e8db7ded799c9b37 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Mon, 22 Jun 2015 14:10:06 +0900 Subject: [PATCH 10/16] bug fix - exclude layout evas_object_show from utils to each view Change-Id: I039473b67e4ea4a36ee170d0e4c31fe06de64045 Signed-off-by: Soohye Shin --- src/utils.c | 2 -- src/view/view_home.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils.c b/src/utils.c index ae84a88..efb4455 100644 --- a/src/utils.c +++ b/src/utils.c @@ -44,8 +44,6 @@ Evas_Object *utils_add_layout(Evas_Object *base, const char *group, if (part) elm_object_part_content_set(base, part, ly); - evas_object_show(ly); - return ly; } diff --git a/src/view/view_home.c b/src/view/view_home.c index c21af95..ac19b22 100644 --- a/src/view/view_home.c +++ b/src/view/view_home.c @@ -140,6 +140,7 @@ static struct bar_item *_pack_bar_item(struct _priv *priv, Evas_Object *box, inputmgr_add_callback(eo, 0, &eo_handler, bi); elm_box_pack_end(box, eo); + evas_object_show(eo); bi->priv = priv; bi->eo = eo; -- 2.7.4 From 0fbdc4734cf6218b798a1d672479b6d4df81a6da Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Mon, 22 Jun 2015 15:02:19 +0900 Subject: [PATCH 11/16] add to datamgr_select_item for deciding the action when focused item is pressed by enter key - enum DATAMGR_ITEM_SELECT_ACTION Change-Id: I17afc5988a90655f3e0597578e2191cbd4a39969 Signed-off-by: Soohye Shin --- config/home.json.in | 18 ++++++++++++------ include/datamgr.h | 14 +++++++++++--- src/data/data_home.c | 46 ++++++++++++++++++++++++++++++++++++++++------ src/data/datamgr.c | 8 ++++---- src/view/view_home.c | 8 +++++++- 5 files changed, 74 insertions(+), 20 deletions(-) diff --git a/config/home.json.in b/config/home.json.in index da33bc7..67d77c8 100644 --- a/config/home.json.in +++ b/config/home.json.in @@ -4,42 +4,48 @@ "name": "Owner", "icon": "@IMAGEDIR@/ic_user_08_nor.png", "focus_icon": "@IMAGEDIR@/ic_user_08_foc.png", - "package": "", + "select_action": "push", + "parameter": "VIEW_USER", "notification": false }, { "name": "Favorites", "icon": "@IMAGEDIR@/btn_menu_favorite_nor.png", "focus_icon": "@IMAGEDIR@/btn_menu_favorite_foc.png", - "package": "org.tizen.app-launcher-tv-ref", + "select_action": "launch", + "parameter": "org.tizen.favorite", "notification": false }, { "name": "Media Hub", "icon": "@IMAGEDIR@/btn_menu_media_nor.png", "focus_icon": "@IMAGEDIR@/btn_menu_media_foc.png", - "package": "org.tizen.gallery-tv-ref", + "select_action": "launch", + "parameter": "org.tizen.mediahub", "notification": false }, { "name": "APP", "icon": "@IMAGEDIR@/btn_menu_app_nor.png", "focus_icon": "@IMAGEDIR@/btn_menu_app_foc.png", - "package": "org.tizen.app-launcher-tv-ref", + "select_action": "launch", + "parameter": "org.tizen.apps", "notification": false }, { "name": "Notification", "icon": "@IMAGEDIR@/btn_menu_notification_nor.png", "focus_icon": "@IMAGEDIR@/btn_menu_notification_foc.png", - "package": "org.tizen.music-player-tv-ref", + "select_action": "launch", + "parameter": "org.tizen.infosquare", "notification": true }, { "name": "Settings", "icon": "@IMAGEDIR@/btn_menu_setting_nor.png", "focus_icon": "@IMAGEDIR@/btn_menu_setting_foc.png", - "package": "org.tizen.file-broswer-tv-ref", + "select_action": "launch", + "parameter": "org.tizen.settings", "notification": false } ] diff --git a/include/datamgr.h b/include/datamgr.h index 3d8c38e..9ca5fd4 100644 --- a/include/datamgr.h +++ b/include/datamgr.h @@ -20,6 +20,13 @@ #include #include +enum datamgr_item_select_action { + ITEM_SELECT_ACTION_LAUNCH, + ITEM_SELECT_ACTION_PUSH, + ITEM_SELECT_ACTION_SWITCH, + ITEM_SELECT_ACTION_MAX +}; + struct datamgr { Eina_List *list; const char *view_id; @@ -32,14 +39,15 @@ struct datamgr_item { char *icon; char *focus_icon; char *thumbnail; - char *package; + char *parameter; bool noti; + enum datamgr_item_select_action action; }; struct data_class { bool (*init)(struct datamgr *dm); void (*fini)(struct datamgr *dm); - void (*launch)(struct datamgr *dm); + void (*select)(struct datamgr_item *di); Eina_List *(*get_items)(struct datamgr *dm); /* It should be added later */ }; @@ -47,6 +55,6 @@ struct data_class { struct datamgr *datamgr_init(struct data_class *dclass, const char *view_id); void datamgr_fini(struct datamgr *dm); Eina_List *datamgr_get_items(struct datamgr *dm); -void datamgr_launch(struct datamgr *dm); +void datamgr_select_item(struct datamgr *dm, struct datamgr_item *di); #endif /* __AIR_HOME_DATAMGR_H__ */ diff --git a/src/data/data_home.c b/src/data/data_home.c index a81135a..335ee02 100644 --- a/src/data/data_home.c +++ b/src/data/data_home.c @@ -18,15 +18,22 @@ #include #include #include +#include +#include #include "data_home.h" #include "datamgr.h" +#include "utils.h" + +#define STR_SELECT_ACTION_PUSH "push" +#define STR_SELECT_ACTION_LAUNCH "launch" #define OBJECT_MEMBERS "item" #define MEMBER_STR_NAME "name" #define MEMBER_STR_ICON "icon" #define MEMBER_STR_FOCUS_ICON "focus_icon" -#define MEMBER_STR_PACKAGE "package" +#define MEMBER_STR_SELECT_ACTION "select_action" +#define MEMBER_STR_PARAMETER "parameter" #define MEMBER_INT_NOTIFICATION "notification" static inline char *_read_string(JsonReader *reader, char *member) @@ -64,7 +71,7 @@ static inline gboolean _read_boolean(JsonReader *reader, char *member) static struct datamgr_item *_pack_home_item(JsonReader *reader, int i) { struct datamgr_item *di; - char *name, *icon, *package, *focus_icon; + char *name, *icon, *parameter, *focus_icon, *action; gboolean noti; if (!reader) { @@ -89,7 +96,8 @@ static struct datamgr_item *_pack_home_item(JsonReader *reader, int i) if (!focus_icon) goto err; - package = _read_string(reader, MEMBER_STR_PACKAGE); + action = _read_string(reader, MEMBER_STR_SELECT_ACTION); + parameter = _read_string(reader, MEMBER_STR_PARAMETER); noti = _read_boolean(reader, MEMBER_INT_NOTIFICATION); json_reader_end_element(reader); @@ -100,10 +108,17 @@ static struct datamgr_item *_pack_home_item(JsonReader *reader, int i) return NULL; } + if (!strcmp(action, STR_SELECT_ACTION_PUSH)) + di->action = ITEM_SELECT_ACTION_PUSH; + else if (!strcmp(action, STR_SELECT_ACTION_LAUNCH)) + di->action = ITEM_SELECT_ACTION_LAUNCH; + else + di->action = ITEM_SELECT_ACTION_MAX; + di->title = strdup(name); di->icon = strdup(icon); di->focus_icon = strdup(focus_icon); - di->package = strdup(package); + di->parameter = strdup(parameter); di->noti = noti; return di; @@ -168,7 +183,7 @@ static void _fini(struct datamgr *dm) free(di->title); free(di->icon); free(di->focus_icon); - free(di->package); + free(di->parameter); free(di); } @@ -219,10 +234,29 @@ static bool _init(struct datamgr *dm) return true; } +static void _select(struct datamgr_item *di) +{ + if (!di || !di->parameter) + return; + + switch (di->action) { + case ITEM_SELECT_ACTION_LAUNCH: + utils_launch_app(di->parameter); + break; + case ITEM_SELECT_ACTION_PUSH: + viewmgr_push_view(di->parameter); + break; + default: + _ERR("Invalid state"); + return; + } +} + static struct data_class dclass = { .init = _init, .fini = _fini, - .get_items = _get_items + .get_items = _get_items, + .select = _select }; struct data_class *datamgr_home_get_dclass(void) diff --git a/src/data/datamgr.c b/src/data/datamgr.c index 30579e1..a9d398b 100644 --- a/src/data/datamgr.c +++ b/src/data/datamgr.c @@ -73,15 +73,15 @@ Eina_List *datamgr_get_items(struct datamgr *dm) return dm->dclass->get_items(dm); } -void datamgr_launch(struct datamgr *dm) +void datamgr_select_item(struct datamgr *dm, struct datamgr_item *di) { - if (!dm || !dm->dclass) { + if (!dm || !dm->dclass || !di) { _ERR("Invalid argument"); return; } - if (!dm->dclass->launch) + if (!dm->dclass->select) return; - dm->dclass->launch(dm); + dm->dclass->select(di); } diff --git a/src/view/view_home.c b/src/view/view_home.c index ac19b22..f1900b2 100644 --- a/src/view/view_home.c +++ b/src/view/view_home.c @@ -38,6 +38,7 @@ struct _priv { struct bar_item { Evas_Object *eo; + struct datamgr_item *di; struct _priv *priv; }; @@ -144,6 +145,7 @@ static struct bar_item *_pack_bar_item(struct _priv *priv, Evas_Object *box, bi->priv = priv; bi->eo = eo; + bi->di = di; return bi; err: @@ -222,18 +224,22 @@ static bool _add_home(struct _priv *priv, Evas_Object *base) static void _key_down(int id, void *data, Evas *e, Evas_Object *obj, Evas_Event_Key_Down *ev) { + struct _priv *priv; + if (!data) { _ERR("Invalid argument"); return; } + priv = data; + if (!strcmp(ev->keyname, KEY_DOWN)) { viewmgr_push_view(VIEW_RECENT); } else if (!strcmp(ev->keyname, KEY_UP)) { /* It should be implemented later */ } else if (!strcmp(ev->keyname, KEY_ENTER) || !strcmp(ev->keyname, KEY_ENTER_REMOTE)) { - /* It should be implemented later */ + datamgr_select_item(priv->dm, priv->foc->di); } else if (!strcmp(ev->keyname, KEY_BACK) || !strcmp(ev->keyname, KEY_BACK_REMOTE)) { /* It should be implemented later */ -- 2.7.4 From 67654055d870d3f47cf7a1c10961907fe14635fb Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Mon, 22 Jun 2015 17:32:24 +0900 Subject: [PATCH 12/16] add initial data_user Change-Id: Id00bb8fe38040e75881285b18565360556a84bad Signed-off-by: Soohye Shin --- CMakeLists.txt | 1 + include/data_user.h | 24 ++++++++++++++++++++ src/data/data_user.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/view/view_user.c | 15 +++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 include/data_user.h create mode 100644 src/data/data_user.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 77c56f2..166c86d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ SET(SRCS src/data/datamgr.c src/data/data_home.c src/data/data_recent.c + src/data/data_user.c src/view/view_user.c src/view/view_recent.c src/view/view_home.c) diff --git a/include/data_user.h b/include/data_user.h new file mode 100644 index 0000000..d6e14aa --- /dev/null +++ b/include/data_user.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __AIR_HOME_DATA_USER_H__ +#define __AIR_HOME_DATA_USER_H__ + +#include + +struct data_class *datamgr_user_get_dclass(void); + +#endif /* __AIR_HOME_DATA_USER_H__ */ diff --git a/src/data/data_user.c b/src/data/data_user.c new file mode 100644 index 0000000..664e690 --- /dev/null +++ b/src/data/data_user.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include + +#include "data_user.h" +#include "datamgr.h" + +static void _select(struct datamgr_item *di) +{ + /* It should be implemented later */ +} + +static Eina_List *_get_items(struct datamgr *dm) +{ + if (!dm) { + _ERR("Invalid argument"); + return NULL; + } + + return dm->list; +} + +static void _fini(struct datamgr *dm) +{ + /* It should be implemented later */ +} + +static bool _init(struct datamgr *dm) +{ + /* It should be implemented later */ + + return true; +} + +static struct data_class dclass = { + .init = _init, + .fini = _fini, + .get_items = _get_items, + .select = _select +}; + +struct data_class *datamgr_user_get_dclass(void) +{ + return &dclass; +} + diff --git a/src/view/view_user.c b/src/view/view_user.c index 3f9c282..d9d9a12 100644 --- a/src/view/view_user.c +++ b/src/view/view_user.c @@ -22,17 +22,21 @@ #include "defs.h" #include "view_user.h" +#include "data_user.h" #include "datamgr.h" #include "utils.h" struct _priv { Evas_Object *win; Evas_Object *base; + + struct datamgr *dm; }; static Evas_Object *_create(Evas_Object *win, void *data) { struct _priv *priv; + struct datamgr *dm; Evas_Object *base; if (!win) { @@ -46,9 +50,17 @@ static Evas_Object *_create(Evas_Object *win, void *data) return NULL; } + dm = datamgr_init(datamgr_user_get_dclass(), VIEW_USER); + if (!dm) { + _ERR("failed to initialize datamgr"); + free(priv); + return NULL; + } + base = utils_add_layout(win, GRP_USER, false, NULL); if (!base) { _ERR("failed to create base"); + datamgr_fini(dm); free(priv); return NULL; } @@ -57,6 +69,7 @@ static Evas_Object *_create(Evas_Object *win, void *data) priv->win = win; priv->base = base; + priv->dm = dm; viewmgr_set_view_data(VIEW_USER, priv); @@ -101,6 +114,8 @@ static void _destroy(void *data) } priv = data; + + datamgr_fini(priv->dm); evas_object_del(priv->base); free(priv); } -- 2.7.4 From 3c32f5c1f670d5317c11e666091bfda2b5adcd88 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Tue, 23 Jun 2015 11:02:58 +0900 Subject: [PATCH 13/16] modify home item and add user item to inherit baritem group Change-Id: Ia8bd68384996bb603699713087264e8c7bffe713 Signed-off-by: Soohye Shin --- edje/home.edc | 1 + edje/view/baritem.edc | 179 +++++++++++++++++++++++++++++++++++++ edje/view/home.edc | 183 +++----------------------------------- edje/view/user.edc | 205 +++++++++++++++++++++++++++++++++++++++++++ images/btn_user_add_foc.png | Bin 0 -> 2925 bytes images/btn_user_add_nor.png | Bin 0 -> 2938 bytes images/btn_user_lock_foc.png | Bin 0 -> 3095 bytes images/btn_user_lock_nor.png | Bin 0 -> 3123 bytes include/defs.h | 19 ++-- src/view/view_home.c | 10 +-- 10 files changed, 414 insertions(+), 183 deletions(-) create mode 100644 edje/view/baritem.edc create mode 100644 images/btn_user_add_foc.png create mode 100644 images/btn_user_add_nor.png create mode 100644 images/btn_user_lock_foc.png create mode 100644 images/btn_user_lock_nor.png diff --git a/edje/home.edc b/edje/home.edc index c5304b9..0cf5ac2 100644 --- a/edje/home.edc +++ b/edje/home.edc @@ -17,6 +17,7 @@ #include "../include/defs.h" collections { + #include "view/baritem.edc" #include "view/home.edc" #include "view/recent.edc" #include "view/user.edc" diff --git a/edje/view/baritem.edc b/edje/view/baritem.edc new file mode 100644 index 0000000..f8dcf4d --- /dev/null +++ b/edje/view/baritem.edc @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "../../include/defs.h" +group { + name, GRP_BAR_ITEM; + parts { + part { + name, "bg"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + min, 158 158; + } + } + part { + name, "clip"; + type, RECT; + description { + state, "default" 0.0; + color, 0 0 0 0; + } + description { + state, "focus" 0.0; + inherit, "default" 0.0; + color, 255 255 255 255; + } + description { + state, "up" 0.0; + inherit, "default" 0.0; + rel1.relative, 0.0 -1.0; + rel2.relative, 1.0 0.0; + color, 255 255 255 255; + } + description { + state, "down" 0.0; + inherit, "default" 0.0; + rel1.relative, 0.0 1.0; + rel2.relative, 1.0 2.0; + color, 255 255 255 255; + } + description { + state, "right" 0.0; + inherit, "default" 0.0; + rel1.relative, 1.0 0.0; + rel2.relative, 2.0 1.0; + color, 255 255 255 255; + } + description { + state, "left" 0.0; + inherit, "default" 0.0; + rel1.relative, -1.0 0.0; + rel2.relative, 0.0 1.0; + color, 255 255 255 255; + } + } + part { + name, PART_BAR_ITEM_BG; + type, SWALLOW; + scale, 1; + clip_to, "clip"; + description { + state, "default" 0.0; + min, 158 158; + } + } + part { + name, PART_BAR_ITEM_ICON; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + min, 70 70; + rel1.relative, 0.5 0.5; + rel2.relative, 0.5 0.5; + fixed, 1 1; + } + } + part { + name, PART_BAR_ITEM_ICON_FOCUS; + type, SWALLOW; + scale, 1; + clip_to, "clip"; + description { + state, "default" 0.0; + rel1.to, PART_BAR_ITEM_ICON; + rel2.to, PART_BAR_ITEM_ICON; + } + } + } + programs { + program { + name, "sig,initial,focus"; + signal, SIG_INITIAL_FOCUS; + source, SRC_PROG; + action, STATE_SET "default" 0.0; + target, "clip"; + after, "sig,focus"; + } + program { + name, "sig,focus"; + signal, SIG_FOCUS; + source, SRC_PROG; + action, STATE_SET "focus" 0.0; + transition, LINEAR 0.5; + target, "clip"; + } + program { + name, "sig,unfocus"; + signal, SIG_UNFOCUS; + source, SRC_PROG; + action, STATE_SET "default" 0.0; + transition, LINEAR 0.5; + target, "clip"; + } + program { + name, "sig,focus,to,up"; + signal, SIG_FOCUS_TO_UP; + source, SRC_PROG; + action, STATE_SET "up" 0.0; + transition, LINEAR 0.5; + target, "clip"; + } + program { + name, "sig,focus,to,down"; + signal, SIG_FOCUS_TO_DOWN; + source, SRC_PROG; + action, STATE_SET "down" 0.0; + transition, LINEAR 0.5; + target, "clip"; + } + program { + name, "sig,focus,to,right"; + signal, SIG_FOCUS_TO_RIGHT; + source, SRC_PROG; + action, STATE_SET "right" 0.0; + transition, LINEAR 0.5; + target, "clip"; + } + program { + name, "sig,unfocus,to,right"; + signal, SIG_UNFOCUS_TO_RIGHT; + source, SRC_PROG; + action, STATE_SET "left" 0.0; + target, "clip"; + after, "sig,focus"; + } + program { + name, "sig,focus,to,left"; + signal, SIG_FOCUS_TO_LEFT; + source, SRC_PROG; + action, STATE_SET "left" 0.0; + transition, LINEAR 0.5; + target, "clip"; + } + program { + name, "sig,unfocus,to,left"; + signal, SIG_UNFOCUS_TO_LEFT; + source, SRC_PROG; + action, STATE_SET "right" 0.0; + target, "clip"; + after, "sig,focus"; + } + } +} diff --git a/edje/view/home.edc b/edje/view/home.edc index 73ebe13..e6b1f06 100644 --- a/edje/view/home.edc +++ b/edje/view/home.edc @@ -15,7 +15,7 @@ */ #include "../../include/defs.h" -group{ +group { name, GRP_HOME; parts { part { @@ -303,69 +303,10 @@ group { group { name, GRP_HOME_ITEM; - data.item, TITLE_WIDTH "128"; + inherit, GRP_BAR_ITEM; + data.item, TITLE_WIDTH "130"; parts { part { - name, "bg"; - type, RECT; - scale, 1; - description { - state, "default" 0.0; - min, 157 157; - } - } - part { - name, "clip"; - type, RECT; - description { - state, "default" 0.0; - color, 0 0 0 0; - } - description { - state, "focus" 0.0; - inherit, "default" 0.0; - color, 255 255 255 255; - } - description { - state, "up" 0.0; - inherit, "default" 0.0; - rel1.relative, 0.0 -1.0; - rel2.relative, 1.0 0.0; - color, 255 255 255 255; - } - description { - state, "down" 0.0; - inherit, "default" 0.0; - rel1.relative, 0.0 1.0; - rel2.relative, 1.0 2.0; - color, 255 255 255 255; - } - description { - state, "right" 0.0; - inherit, "default" 0.0; - rel1.relative, 1.0 0.0; - rel2.relative, 2.0 1.0; - color, 255 255 255 255; - } - description { - state, "left" 0.0; - inherit, "default" 0.0; - rel1.relative, -1.0 0.0; - rel2.relative, 0.0 1.0; - color, 255 255 255 255; - } - } - part { - name, PART_HOME_ITEM_BG; - type, SWALLOW; - scale, 1; - clip_to, "clip"; - description { - state, "default" 0.0; - min, 157 157; - } - } - part { name, "pad.icon"; type, RECT; scale, 1; @@ -380,7 +321,7 @@ group { } } part { - name, PART_HOME_ITEM_ICON; + name, PART_BAR_ITEM_ICON; type, SWALLOW; scale, 1; description { @@ -399,17 +340,6 @@ group { } } part { - name, PART_HOME_ITEM_ICON_FOCUS; - type, SWALLOW; - scale, 1; - clip_to, "clip"; - description { - state, "default" 0.0; - rel1.to, PART_HOME_ITEM_ICON; - rel2.to, PART_HOME_ITEM_ICON; - } - } - part { name, "pad.text"; type, RECT; scale, 1; @@ -424,7 +354,7 @@ group { } } part { - name, PART_HOME_ITEM_TITLE; + name, PART_BAR_ITEM_TITLE; type, SWALLOW; scale, 1; description { @@ -443,29 +373,14 @@ group { } } part { - name, PART_HOME_ITEM_TITLE_FOCUS; + name, PART_BAR_ITEM_TITLE_FOCUS; type, SWALLOW; scale, 1; clip_to, "clip"; description { state, "default" 0.0; - rel1.to, PART_HOME_ITEM_TITLE; - rel2.to, PART_HOME_ITEM_TITLE; - } - } - part { - name, "separtor"; - type, RECT; - scale, 1; - description { - state, "default" 0.0; - min, 1 114; - rel1.relative, 1.0 0.5; - rel2.relative, 1.0 0.5; - align, 1.0 0.5; - fixed, 1 1; - color, 245 245 245 255; - visible, 1; + rel1.to, PART_BAR_ITEM_TITLE; + rel2.to, PART_BAR_ITEM_TITLE; } } part { @@ -483,7 +398,7 @@ group { } } part { - name, PART_HOME_ITEM_BADGE; + name, PART_BAR_ITEM_BADGE; type, SWALLOW; scale, 1; description { @@ -502,13 +417,13 @@ group { } } part { - name, PART_HOME_ITEM_BADGE_COUNT; + name, PART_BAR_ITEM_BADGE_COUNT; type, TEXT; scale, 1; description { state, "default" 0.0; - rel1.to, PART_HOME_ITEM_BADGE; - rel2.to, PART_HOME_ITEM_BADGE; + rel1.to, PART_BAR_ITEM_BADGE; + rel2.to, PART_BAR_ITEM_BADGE; fixed, 1 1; text { size, 24; @@ -518,78 +433,4 @@ group { } } } - programs { - program { - name, "sig,initial,focus"; - signal, SIG_INITIAL_FOCUS; - source, SRC_PROG; - action, STATE_SET "default" 0.0; - target, "clip"; - after, "sig,focus"; - } - program { - name, "sig,focus"; - signal, SIG_FOCUS; - source, SRC_PROG; - action, STATE_SET "focus" 0.0; - transition, LINEAR 0.5; - target, "clip"; - } - program { - name, "sig,unfocus"; - signal, SIG_UNFOCUS; - source, SRC_PROG; - action, STATE_SET "default" 0.0; - transition, LINEAR 0.5; - target, "clip"; - } - program { - name, "sig,focus,to,up"; - signal, SIG_FOCUS_TO_UP; - source, SRC_PROG; - action, STATE_SET "up" 0.0; - transition, LINEAR 0.5; - target, "clip"; - } - program { - name, "sig,focus,to,down"; - signal, SIG_FOCUS_TO_DOWN; - source, SRC_PROG; - action, STATE_SET "down" 0.0; - transition, LINEAR 0.5; - target, "clip"; - } - program { - name, "sig,focus,to,right"; - signal, SIG_FOCUS_TO_RIGHT; - source, SRC_PROG; - action, STATE_SET "right" 0.0; - transition, LINEAR 0.5; - target, "clip"; - } - program { - name, "sig,unfocus,to,right"; - signal, SIG_UNFOCUS_TO_RIGHT; - source, SRC_PROG; - action, STATE_SET "left" 0.0; - target, "clip"; - after, "sig,focus"; - } - program { - name, "sig,focus,to,left"; - signal, SIG_FOCUS_TO_LEFT; - source, SRC_PROG; - action, STATE_SET "left" 0.0; - transition, LINEAR 0.5; - target, "clip"; - } - program { - name, "sig,unfocus,to,left"; - signal, SIG_UNFOCUS_TO_LEFT; - source, SRC_PROG; - action, STATE_SET "right" 0.0; - target, "clip"; - after, "sig,focus"; - } - } } diff --git a/edje/view/user.edc b/edje/view/user.edc index ff790e1..419b781 100644 --- a/edje/view/user.edc +++ b/edje/view/user.edc @@ -18,5 +18,210 @@ group { name, GRP_USER; parts { + part { + name, "pad.text"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1.relative, 0.5 1.0; + rel2.relative, 0.5 1.0; + min, 0 388; + align, 0.5 1.0; + fixed, 1 1; + visible, 0; + } + } + part { + name, "text"; + type, TEXT; + scale, 1; + description { + state, "default" 0.0; + rel1.to, "pad.text"; + rel2 { + to, "pad.text"; + relative, 0.0 0.0; + } + min, 200 34; + fixed, 1 1; + align, 0.5 1.0; + text { + text, "Switch User"; + font, "TizenSans"; + size, 34; + } + color, 255 255 255 178; + color2, 0 0 0 255; + } + } + part { + name, "pad.list"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "text"; + relative, 0.5 1.0; + } + rel2 { + to, "text"; + relative, 0.5 1.0; + } + min, 0 42; + align, 0.5 0.0; + fixed, 1 1; + visible, 0; + } + } + part { + name, PART_USER_BAR; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.list"; + relative, 1.0 1.0; + } + rel2 { + to, "pad.list"; + relative, 1.0 1.0; + } + min, 1264 158; + align, 0.5 0.0; + fixed, 1 1; + } + } + } +} + +group { + name, GRP_USER_ITEM; + inherit, GRP_BAR_ITEM; + data.item, TITLE_WIDTH "130"; + parts { + part { + name, "pad.icon"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + min, 0 26; + rel1.relative, 0.5 0.0; + rel2.relative, 0.5 0.0; + align, 0.5 0.0; + fixed, 1 1; + visible, 0; + } + } + part { + name, PART_BAR_ITEM_ICON; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + min, 70 70; + rel1 { + to, "pad.icon"; + relative, 1.0 1.0; + } + rel2 { + to, "pad.icon"; + relative, 1.0 1.0; + } + align, 0.5 0.0; + fixed, 1 1; + } + } + part { + name, "pad.text"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + min, 0 24; + rel1.relative, 0.5 1.0; + rel2.relative, 0.5 1.0; + align, 0.5 1.0; + fixed, 1 1; + visible, 0; + } + } + part { + name, PART_BAR_ITEM_TITLE; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "pad.text"; + relative, 0.0 0.0; + } + rel2 { + to, "pad.text"; + relative, 0.0 0.0; + } + align, 0.5 1.0; + fixed, 1 1; + min, 130 22; + } + } + part { + name, PART_BAR_ITEM_TITLE_FOCUS; + type, SWALLOW; + scale, 1; + clip_to, "clip"; + description { + state, "default" 0.0; + rel1.to, PART_BAR_ITEM_TITLE; + rel2.to, PART_BAR_ITEM_TITLE; + } + } + part { + name, "pad.lock"; + type, RECT; + scale, 1; + description { + state, "default" 0.0; + min, 16 18; + rel1.relative, 1.0 0.0; + rel2.relative, 1.0 0.0; + align, 1.0 0.0; + fixed, 1 1; + visible, 0; + } + } + part { + name, PART_BAR_ITEM_LOCK; + type, SWALLOW; + scale, 1; + description { + state, "default" 0.0; + min, 30 30; + rel1 { + to, "pad.lock"; + relative, 0.0 1.0; + } + rel2 { + to, "pad.lock"; + relative, 0.0 1.0; + } + align, 1.0 0.0; + fixed, 1 1; + } + } + part { + name, PART_BAR_ITEM_LOCK_FOCUS; + type, SWALLOW; + scale, 1; + clip_to, "clip"; + description { + state, "default" 0.0; + rel1.to, PART_BAR_ITEM_LOCK; + rel2.to, PART_BAR_ITEM_LOCK; + } + } } } diff --git a/images/btn_user_add_foc.png b/images/btn_user_add_foc.png new file mode 100644 index 0000000000000000000000000000000000000000..b80cefef140a4ea2d3a67fbca2a0f695b5d95b81 GIT binary patch literal 2925 zcmV-z3zGDSP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6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LGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0001(NklYwAz<>eMtMTz{*MH>I?~TR$w3uvKN=|^W z7%*VKfB^#r3>YwAzz7T&Fkrxd0RsjM7%&0@1`L>Gjf1`=7UL>`0RyIa4*&oF|NjF3 Xqe%#kn343900000NkvXXu0mjf&2L+i literal 0 HcmV?d00001 diff --git a/images/btn_user_add_nor.png b/images/btn_user_add_nor.png new file mode 100644 index 0000000000000000000000000000000000000000..29b9ee5b3c74ad28667e8bcf252214cbc4463db0 GIT binary patch literal 2938 zcmYjTWmFXE7X1*UyF<8icS^$yodSal-3*9Gh*E-sv~UTLb`VgyK?a9Vx*1Ax2x$Sq zcL_nMhxh$?KhEB3?{&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nh(!$fEu&Py}slT4GBiJP#KynXrb@D87&uv|7 zTTDmPCT4b*Loal3e^I@WRk02+ID!p&E$qCQN=F=yC807<;Su7$7M*ZK=&)^9?8*Zw z-ybd1fvc0+*NNN8ZOT}?!;gW74Y*A@tB+Q>wMvdYyMenZSLsux{jG0Wb89em-k5{X z_NFk8(;c>a1?%Su7+!v7$qXkruSyC6WJ4mS%+EapM9PcU+#A7vDD)Fy81Xi4F=0d zIUL_V-|q}s3}XNBZiUKp;~D33!E4W7^(PkNrRV7^>FL)5_}NDnt}Cs%LHt zKqwyo$S44QUElBy08bIy`1cr;cNVWlHJBbBBXj*Fc9rtd|rA-;ImJ!zUzX zmb~>Z{!b?TYmO}R_0LzBR=3o$F&<61xJ;P45HTnIulxV|ZifFzouY?FDo2rMY3_fMX8_RGHqokqIKB8U)WKx$ literal 0 HcmV?d00001 diff --git a/images/btn_user_lock_foc.png b/images/btn_user_lock_foc.png new file mode 100644 index 0000000000000000000000000000000000000000..de5b869963c80ae7e43a13d1e62f082d33f7cf02 GIT binary patch literal 3095 zcmV+y4CwQTP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#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=Eq84_0w=(+q-JoqndN|Upy*3=;2Bs1a=vy6>`JN!%ek4Q zfvSURzz&d?v;yQ^uK}At)$N1jybNpuFF;Y!Q)fd`3%D?|2jJT6%D`!;YTt8N=>~TX zU$6Ao2Z67g zX172g0OMZL+Mu2n0y(%kzSTm)uYd!WvBKYhk|Y5o*JFdXfG?jnU5^bu2ORqR$n{ur zzSJXQg}2OXDr(4wdcy%*{+gLi0-o{PYxJ7TO(4cykf-yww~qw;cL1BwXG=SS5?ufQ N002ovPDHLkV1hRB(98e; literal 0 HcmV?d00001 diff --git a/include/defs.h b/include/defs.h index 8d87f09..4cbf787 100644 --- a/include/defs.h +++ b/include/defs.h @@ -33,19 +33,14 @@ #define GRP_RECENT_ICON "group.recent.icon" #define GRP_RECENT_PREVIEW "group.recent.preview" #define GRP_USER "group.user" +#define GRP_USER_ITEM "group.user.item" #define GRP_USER_EDIT "group.user.edit" #define GRP_USER_EDIT_CONTENTS "group.user.edit.contents" +#define GRP_BAR_ITEM "group.bar.item" #define PART_HOME_MENU_BAR "part.home.menu.bar" #define PART_HOME_UP_ARROW "part.home.up.arrow" #define PART_HOME_DOWN_ARROW "part.home.down.arrow" -#define PART_HOME_ITEM_ICON "part.home.item.icon" -#define PART_HOME_ITEM_ICON_FOCUS "part.home.item.icon.focus" -#define PART_HOME_ITEM_BG "part.home.item.bg" -#define PART_HOME_ITEM_TITLE "part.home.item.title" -#define PART_HOME_ITEM_TITLE_FOCUS "part.home.item.focus" -#define PART_HOME_ITEM_BADGE "part.home.item.badge" -#define PART_HOME_ITEM_BADGE_COUNT "part.home.item.badge.count" #define PART_RECENT_DELETE_ICON "part.recent.delete.icon" #define PART_RECENT_CONTENTS "part.recent.contents" #define PART_RECENT_NO_CONTENTS "part.recent.no.contents" @@ -64,6 +59,16 @@ #define PART_USER_EDIT_CONTENTS_ACCOUNT "part.user.edit.contents.account" #define PART_USER_EDIT_CONTENTS_LOCK "part.user.edit.contents.lock" #define PART_USER_EDIT_CONTETNS_DELETE "part.user.edit.contents.delete" +#define PART_BAR_ITEM_BG "part.bar.item.bg" +#define PART_BAR_ITEM_ICON "part.bar.item.icon" +#define PART_BAR_ITEM_ICON_FOCUS "part.bar.item.icon.focus" +#define PART_BAR_ITEM_TITLE "part.bar.item.title" +#define PART_BAR_ITEM_TITLE_FOCUS "part.bar.item.title.focus" +#define PART_BAR_ITEM_BADGE "part.bar.item.badge" +#define PART_BAR_ITEM_BADGE_COUNT "part.bar.item.badge.count" +#define PART_BAR_ITEM_LOCK "part.bar.item.lock" +#define PART_BAR_ITEM_LOCK_FOCUS "part.bar.item.lock.focus" +#define PART_USER_BAR "part.user.bar" #define SIG_SHOW_NAVIGATION "sig.show.navigation" #define SIG_HIDE_NAVIGATION "sig.hide.navigation" diff --git a/src/view/view_home.c b/src/view/view_home.c index f1900b2..ef88297 100644 --- a/src/view/view_home.c +++ b/src/view/view_home.c @@ -117,25 +117,25 @@ static struct bar_item *_pack_bar_item(struct _priv *priv, Evas_Object *box, return NULL; } - ic = utils_add_icon(eo, di->icon, PART_HOME_ITEM_ICON); + ic = utils_add_icon(eo, di->icon, PART_BAR_ITEM_ICON); if (!ic) goto err; - focus_ic = utils_add_icon(eo, di->focus_icon, PART_HOME_ITEM_ICON_FOCUS); + focus_ic = utils_add_icon(eo, di->focus_icon, PART_BAR_ITEM_ICON_FOCUS); if (!focus_ic) goto err; - lbl = utils_add_label(eo, di->title, STYLE_LABEL_TITLE, PART_HOME_ITEM_TITLE); + lbl = utils_add_label(eo, di->title, STYLE_LABEL_TITLE, PART_BAR_ITEM_TITLE); if (!lbl) goto err; focus_lbl = utils_add_label(eo, di->title, STYLE_LABEL_TITLE_FOCUS, - PART_HOME_ITEM_TITLE_FOCUS); + PART_BAR_ITEM_TITLE_FOCUS); if (!focus_lbl) goto err; bg = utils_add_bg(eo, COLOR_DEFAULT_R, COLOR_DEFAULT_G, COLOR_DEFAULT_B, - COLOR_DEFAULT_A, PART_HOME_ITEM_BG); + COLOR_DEFAULT_A, PART_BAR_ITEM_BG); if (!bg) goto err; -- 2.7.4 From 2c201aceeee7757807ad88f4b76f4d59f7b978f7 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Tue, 23 Jun 2015 13:21:24 +0900 Subject: [PATCH 14/16] add initial view_user_edit Change-Id: Id3406a6830600c1e7db45a70ae475fdc0c7afdda Signed-off-by: Soohye Shin --- CMakeLists.txt | 1 + include/defs.h | 1 + include/view_user_edit.h | 22 ++++++++ src/view/view_user.c | 3 ++ src/view/view_user_edit.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 include/view_user_edit.h create mode 100644 src/view/view_user_edit.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 166c86d..546b4df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ SET(SRCS src/data/data_home.c src/data/data_recent.c src/data/data_user.c + src/view/view_user_edit.c src/view/view_user.c src/view/view_recent.c src/view/view_home.c) diff --git a/include/defs.h b/include/defs.h index 4cbf787..081520d 100644 --- a/include/defs.h +++ b/include/defs.h @@ -20,6 +20,7 @@ #define VIEW_HOME "VIEW_HOME" #define VIEW_RECENT "VIEW_RECENT" #define VIEW_USER "VIEW_USER" +#define VIEW_USER_EDIT "VIEW_USER_EDIT" #define SRC_PROG "prog" #define SRC_EDJE "edje" diff --git a/include/view_user_edit.h b/include/view_user_edit.h new file mode 100644 index 0000000..088b7cf --- /dev/null +++ b/include/view_user_edit.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __AIR_HOME_VIEW_USER_EDIT_H__ +#define __AIR_HOME_VIEW_USER_EDIT_H__ + +view_class *view_user_edit_get_vclass(void); + +#endif /* __AIR_HOME_VIEW_USER_EDIT_H__ */ diff --git a/src/view/view_user.c b/src/view/view_user.c index d9d9a12..b37a454 100644 --- a/src/view/view_user.c +++ b/src/view/view_user.c @@ -22,6 +22,7 @@ #include "defs.h" #include "view_user.h" +#include "view_user_edit.h" #include "data_user.h" #include "datamgr.h" #include "utils.h" @@ -72,6 +73,7 @@ static Evas_Object *_create(Evas_Object *win, void *data) priv->dm = dm; viewmgr_set_view_data(VIEW_USER, priv); + viewmgr_add_view(view_user_edit_get_vclass(), dm); return base; } @@ -115,6 +117,7 @@ static void _destroy(void *data) priv = data; + viewmgr_remove_view(VIEW_USER_EDIT); datamgr_fini(priv->dm); evas_object_del(priv->base); free(priv); diff --git a/src/view/view_user_edit.c b/src/view/view_user_edit.c new file mode 100644 index 0000000..89de84c --- /dev/null +++ b/src/view/view_user_edit.c @@ -0,0 +1,124 @@ +/* + + * Copyright (c) 2015 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "defs.h" +#include "view_user_edit.h" +#include "datamgr.h" +#include "utils.h" + +struct _priv { + Evas_Object *win; + Evas_Object *base; + + struct datamgr *dm; +}; + +static Evas_Object *_create(Evas_Object *win, void *data) +{ + struct _priv *priv; + Evas_Object *base; + + if (!win || !data) { + _ERR("Invalid argument"); + return NULL; + } + + priv = calloc(1, sizeof(*priv)); + if (!priv) { + _ERR("failed to calloc priv"); + return NULL; + } + + base = utils_add_layout(win, GRP_USER_EDIT, false, NULL); + if (!base) { + _ERR("failed to create base"); + free(priv); + return NULL; + } + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, base); + + priv->win = win; + priv->base = base; + priv->dm = data; + + viewmgr_set_view_data(VIEW_USER_EDIT, priv); + + return base; +} + +static void _show(void *data) +{ + struct _priv *priv; + + if (!data) { + _ERR("Invalid argument"); + return; + } + + priv = data; + + evas_object_show(priv->base); +} + +static void _hide(void *data) +{ + struct _priv *priv; + + if (!data) { + _ERR("Invalid argument"); + return; + } + + priv = data; + + evas_object_hide(priv->base); +} + +static void _destroy(void *data) +{ + struct _priv *priv; + + if (!data) { + _ERR("Invalid argument"); + return; + } + + priv = data; + + evas_object_del(priv->base); + free(priv); +} + +static view_class vclass = { + .view_id = VIEW_USER_EDIT, + .create = _create, + .show = _show, + .hide = _hide, + .destroy = _destroy +}; + +view_class *view_user_edit_get_vclass(void) +{ + return &vclass; +} + -- 2.7.4 From 9fe46c5da98ea848f2db3b3ec205de09bd6c436f Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Tue, 23 Jun 2015 20:57:47 +0900 Subject: [PATCH 15/16] emit the signal to hide navigations when view_home is hidden Change-Id: I0b2d5b7d4db612ff19316e40fafc6fe2cd021e77 Signed-off-by: Soohye Shin --- src/view/view_home.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/view/view_home.c b/src/view/view_home.c index ef88297..7f2bd0e 100644 --- a/src/view/view_home.c +++ b/src/view/view_home.c @@ -332,6 +332,7 @@ static void _hide(void *data) priv = data; + elm_object_signal_emit(priv->base, SIG_HIDE_NAVIGATION, SRC_PROG); evas_object_hide(priv->base); } -- 2.7.4 From 73db548b766ea2a76b31f892c7b5d195592893c3 Mon Sep 17 00:00:00 2001 From: Soohye Shin Date: Tue, 23 Jun 2015 21:06:00 +0900 Subject: [PATCH 16/16] load user data - add data_user: integrate with lib-gum for loading user list - add data_switch: integrate with tlm for switching other user Change-Id: I5b402ec9a670c275ff128282a946c9043fb2b8af Signed-off-by: Soohye Shin --- include/datamgr.h | 1 + include/defs.h | 5 +- src/data/data_user.c | 329 ++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 329 insertions(+), 6 deletions(-) diff --git a/include/datamgr.h b/include/datamgr.h index 9ca5fd4..982694d 100644 --- a/include/datamgr.h +++ b/include/datamgr.h @@ -23,6 +23,7 @@ enum datamgr_item_select_action { ITEM_SELECT_ACTION_LAUNCH, ITEM_SELECT_ACTION_PUSH, + ITEM_SELECT_ACTION_POP, ITEM_SELECT_ACTION_SWITCH, ITEM_SELECT_ACTION_MAX }; diff --git a/include/defs.h b/include/defs.h index 081520d..d946e8b 100644 --- a/include/defs.h +++ b/include/defs.h @@ -97,5 +97,8 @@ #define COLOR_DEFAULT_A 255 #define IMAGE_BADGE IMAGEDIR"/badge_bg.png" - +#define IMAGE_USER_ADD IMAGEDIR"/btn_user_add_nor.png" +#define IMAGE_USER_ADD_FOCUS IMAGEDIR"/btn_user_add_foc.png" +#define IMAGE_USER_DEFAULT IMAGEDIR"/ic_user_01_nor.png" +#define IMAGE_USER_DEFAULT_FOCUS IMAGEDIR"/ic_user_01_foc.png" #endif /* __AIR_HOME_DEFS_H__ */ diff --git a/src/data/data_user.c b/src/data/data_user.c index 664e690..e2ab5c4 100644 --- a/src/data/data_user.c +++ b/src/data/data_user.c @@ -16,14 +16,323 @@ #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include #include "data_user.h" #include "datamgr.h" +#include "defs.h" + +#define GUM_ATTR_NAME "username" +#define GUM_ATTR_USERTYPE "usertype" +#define GUM_ATTR_UID "uid" +#define GUM_ATTR_ICON "icon" +#define GUM_LIST_USERTYPE "normal" + +#define ADDRESS_BUF_MAX 128 +#define USER_SWITCH_TLM_SEAT_ID "seat0" +#define USER_SWITCH_DBUS_SOCKET_PATH "/var/run/tlm" +#define USER_SWITCH_TLM_BUS_NAME "org.O1.Tlm.Login" +#define USER_SWITCH_TLM_INTERFACE USER_SWITCH_TLM_BUS_NAME +#define USER_SWITCH_TLM_OBJECT_PATH "/org/O1/Tlm/Login" +#define USER_SWITCH_METHOD "switchUser" + +static GVariant *_build_env_param(const char *username, const char *password) +{ + GVariantBuilder *builder; + GVariant *param, *env; + + builder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY); + if (!builder) { + _ERR("failed to new builder"); + return NULL; + } + + g_variant_builder_add(builder, "{ss}", "", ""); + env = g_variant_builder_end(builder); + g_variant_builder_unref(builder); + + param = g_variant_new("(sss@a{ss})", USER_SWITCH_TLM_SEAT_ID, + username, password, env); + + return param; +} + +static GDBusConnection *_get_bus_connection(GError **error) +{ + gchar address[ADDRESS_BUF_MAX]; + + g_snprintf(address, ADDRESS_BUF_MAX - 1, "unix:path=%s%s-%u", + USER_SWITCH_DBUS_SOCKET_PATH, USER_SWITCH_TLM_SEAT_ID, + getuid()); + + return g_dbus_connection_new_for_address_sync(address, + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, + NULL, NULL, error); +} + +static void _switch(char *name, char *password) +{ + GDBusConnection *conn; + GError *error; + GVariant *param; + GDBusMessage *msg, *res; + guint32 serial; + + if (!name || !password) + return; + + error = NULL; + conn = _get_bus_connection(&error); + if (!conn) { + _ERR("failed to get connection, %s", + error ? error->message : ""); + g_error_free(error); + return; + } + + param = _build_env_param(name, password); + if (!param) { + _ERR("failed to build env param"); + goto err; + } + + msg = g_dbus_message_new_method_call(USER_SWITCH_TLM_BUS_NAME, + USER_SWITCH_TLM_OBJECT_PATH, USER_SWITCH_TLM_INTERFACE, + USER_SWITCH_METHOD); + g_dbus_message_set_body(msg, param); + + res = g_dbus_connection_send_message_with_reply_sync(conn, msg, + G_DBUS_SEND_MESSAGE_FLAGS_NONE, 1000, &serial, NULL, + &error); + if (!res) { + _ERR("failed to send message, %s", error ? error->message : ""); + g_object_unref(msg); + goto err; + } + + g_object_unref(res); + g_object_unref(msg); + g_object_unref(conn); +err: + g_object_unref(conn); + g_error_free(error); + return; +} static void _select(struct datamgr_item *di) { - /* It should be implemented later */ + if (!di) + return; + + switch (di->action) { + case ITEM_SELECT_ACTION_SWITCH: + /* It should be implemented later */ + _switch(di->title, ""); + break; + case ITEM_SELECT_ACTION_PUSH: + viewmgr_push_view(di->parameter); + break; + case ITEM_SELECT_ACTION_POP: + viewmgr_pop_view(); + break; + default: + _ERR("Invalid state"); + return; + } +} + +static void _unload_user(struct datamgr *dm) +{ + struct datamgr_item *di; + + EINA_LIST_FREE(dm->list, di) { + free(di->title); + free(di->icon); + free(di->focus_icon); + free(di->parameter); + + free(di); + } + + dm->list = NULL; +} + +static struct datamgr_item *_pack_user(char *name, char *icon, char *focus_icon, + enum datamgr_item_select_action action, char *parameter) +{ + struct datamgr_item *di; + + di = calloc(1, sizeof(*di)); + if (!di) { + _ERR("failed calloc user item"); + return false; + } + + if (!icon || strlen(icon) == 0) + icon = IMAGE_USER_DEFAULT; + + if (!focus_icon || strlen(focus_icon) == 0) + focus_icon = IMAGE_USER_DEFAULT_FOCUS; + + if (name) + di->title = strdup(name); + if (parameter) + di->parameter = strdup(parameter); + di->icon = strdup(icon); + di->focus_icon = strdup(focus_icon); + di->action = action; + + return di; +} + +static bool _load_login_user(Eina_List **list) +{ + struct datamgr_item *di; + GumUser *user; + uid_t uid; + char *name, *icon; + struct passwd *passwd; + + uid = getuid(); + user = gum_user_get_sync(uid, FALSE); + if (!user) { + _ERR("failed to get user service"); + passwd = getpwuid(uid); + di = _pack_user(passwd->pw_name, IMAGE_USER_DEFAULT, + IMAGE_USER_DEFAULT_FOCUS, + ITEM_SELECT_ACTION_POP, NULL); + if (!di) + return false; + + *list = eina_list_append(*list, di); + return true; + } + + name = NULL; + icon = NULL; + g_object_get(G_OBJECT(user), GUM_ATTR_NAME, &name, GUM_ATTR_ICON, &icon, + NULL); + + di = _pack_user(name, icon, icon, ITEM_SELECT_ACTION_POP, NULL); + if (!di) { + g_object_unref(user); + return false; + } + + *list = eina_list_append(*list, di); + g_object_unref(user); + + return true; +} + +static gchar **_append_string(gchar **src_strv, const gchar *string) +{ + gchar **dest_strv; + gint ind; + gint len; + + if (src_strv) + len = g_strv_length(src_strv); + + len = 0; + ind = 0; + dest_strv = NULL; + + dest_strv = (gchar **)g_malloc0(sizeof(gchar *) * (len + 2)); + if (src_strv) { + while (src_strv[ind]) { + dest_strv[ind] = g_strdup(src_strv[ind]); + ind++; + } + } + + dest_strv[ind++] = g_strdup(string); + dest_strv[ind] = NULL; + + return dest_strv; +} + +static bool _load_users(Eina_List **list) +{ + GumUserList *ulist; + GumUser *user; + GumUserService *service; + struct datamgr_item *di; + char *name, *icon; + gchar **strv; + int i; + + service = gum_user_service_create_sync(FALSE); + if (!service) { + _ERR("failed to create service"); + return false; + } + + strv = _append_string(NULL, GUM_LIST_USERTYPE); + ulist = gum_user_service_get_user_list_sync(service, + (const gchar *const *)strv); + g_strfreev(strv); + if (!ulist) { + _ERR("failed to get user list"); + g_object_unref(service); + return false; + } + + for (i = 0; i < g_list_length(ulist); i++) { + user = g_list_nth_data(ulist, i); + if (!user) + continue; + + g_object_get(G_OBJECT(user), GUM_ATTR_NAME, &name, + GUM_ATTR_ICON, &icon, NULL); + di = _pack_user(name, icon, icon, ITEM_SELECT_ACTION_SWITCH, + NULL); + if (!di) + continue; + + *list = eina_list_append(*list, di); + } + + gum_user_service_list_free(ulist); + g_object_unref(service); + + return true; +} + +static bool _load_add_user(Eina_List **list) +{ + struct datamgr_item *di; + + di = _pack_user(NULL, IMAGE_USER_ADD, IMAGE_USER_ADD_FOCUS, + ITEM_SELECT_ACTION_PUSH, VIEW_USER_EDIT); + if (!di) + return false; + + *list = eina_list_append(*list, di); + + return true; +} + +static bool _load_user(struct datamgr *dm) +{ + if (!_load_login_user(&dm->list)) + _ERR("failed to load login user"); + + if (!_load_users(&dm->list)) + _ERR("failed to load users"); + + if (!_load_add_user(&dm->list)) + _ERR("failed to load add user"); + + return true; } static Eina_List *_get_items(struct datamgr *dm) @@ -33,19 +342,30 @@ static Eina_List *_get_items(struct datamgr *dm) return NULL; } + _unload_user(dm); + _load_user(dm); + return dm->list; } static void _fini(struct datamgr *dm) { - /* It should be implemented later */ + if (!dm) { + _ERR("Invalid argument"); + return; + } + + _unload_user(dm); } static bool _init(struct datamgr *dm) { - /* It should be implemented later */ + if (!dm) { + _ERR("Invalid argument"); + return false; + } - return true; + return _load_user(dm); } static struct data_class dclass = { @@ -59,4 +379,3 @@ struct data_class *datamgr_user_get_dclass(void) { return &dclass; } - -- 2.7.4