add_viewer: Create basic add-viewer view. 59/62859/7 submit/tizen_app/20160329.090645
authorKamil Lipiszko <k.lipiszko@samsung.com>
Sat, 19 Mar 2016 12:09:23 +0000 (13:09 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Sun, 27 Mar 2016 19:32:01 +0000 (12:32 -0700)
Because add-viewer separate app is not supported
anymore it is needed to put its functionality into
homescreen-efl. This commit creates base gui
for adding widgets.

Change-Id: Ib98c6955b14bc7415902000a7d3555c732f7ad7c

38 files changed:
CMake/CMakeLists.txt
CMake/res/edje/CMakeLists.txt
inc/add_viewer/add_viewer.h [new file with mode: 0644]
inc/add_viewer/list_view.h [new file with mode: 0644]
inc/add_viewer/view.h [new file with mode: 0644]
inc/add_viewer/widget.h [new file with mode: 0644]
inc/conf.h
inc/homescreen-efl.h
inc/util.h
project_def.prop
res/edje/color_classes.edc [new file with mode: 0644]
res/edje/preview.edc [new file with mode: 0644]
res/images/00_scroll_bar_h.png [new file with mode: 0644]
res/images/00_scroll_bar_v.png [new file with mode: 0644]
res/images/1x1 preview shortcut.png [new file with mode: 0644]
res/images/icon_drawer_search.png [new file with mode: 0644]
res/images/icon_list_close.png [new file with mode: 0644]
res/images/icon_list_open.png [new file with mode: 0644]
res/images/icon_shadow.png [new file with mode: 0644]
res/images/preview_bg_1x1.png [new file with mode: 0644]
res/images/preview_bg_2x1.png [new file with mode: 0644]
res/images/preview_bg_2x2.png [new file with mode: 0644]
res/images/preview_bg_4x1.png [new file with mode: 0644]
res/images/preview_bg_4x2.png [new file with mode: 0644]
res/images/preview_bg_4x3.png [new file with mode: 0644]
res/images/preview_bg_4x4.png [new file with mode: 0644]
res/images/scroll_bar.9.png [new file with mode: 0644]
res/images/unknown.png [new file with mode: 0644]
src/add_viewer/add_viewer.c [new file with mode: 0644]
src/add_viewer/list_view.c [new file with mode: 0644]
src/add_viewer/view.c [new file with mode: 0644]
src/add_viewer/widget.c [new file with mode: 0644]
src/homescreen-efl.c
src/key.c
src/livebox/livebox_panel.c
src/livebox/livebox_widget.c
src/option_menu.c
src/page_scroller.c

index 6a1c25b..95630d6 100644 (file)
@@ -72,6 +72,11 @@ ADD_EXECUTABLE(${PROJECT_NAME}
        ${PROJECT_ROOT_DIR}/src/livebox/livebox_utils.c
        ${PROJECT_ROOT_DIR}/src/livebox/grid_reposition.c
        ${PROJECT_ROOT_DIR}/src/livebox/livebox_widget.c
+
+       ${PROJECT_ROOT_DIR}/src/add_viewer/add_viewer.c
+       ${PROJECT_ROOT_DIR}/src/add_viewer/list_view.c
+       ${PROJECT_ROOT_DIR}/src/add_viewer/view.c
+       ${PROJECT_ROOT_DIR}/src/add_viewer/widget.c
 )
 
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm)
index a4af2fa..bf99cf5 100644 (file)
@@ -69,3 +69,19 @@ ADD_CUSTOM_TARGET(page_edit.edj
 )
 ADD_DEPENDENCIES(${PROJECT_NAME} page_edit.edj)
 INSTALL(FILES page_edit.edj DESTINATION ${EDJEDIR})
+
+ADD_CUSTOM_TARGET(preview.edj
+               COMMAND edje_cc -id ${PROJECT_EDC_DIR}/../images ${EDJE_CFLAGS}
+               ${PROJECT_EDC_DIR}/preview.edc preview.edj
+               DEPENDS ${PROJECT_EDC_DIR}/preview.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} preview.edj)
+INSTALL(FILES preview.edj DESTINATION ${EDJEDIR})
+
+ADD_CUSTOM_TARGET(color_classes.edj
+               COMMAND edje_cc -id ${PROJECT_EDC_DIR}/../images ${EDJE_CFLAGS}
+               ${PROJECT_EDC_DIR}/color_classes.edc color_classes.edj
+               DEPENDS ${PROJECT_EDC_DIR}/color_classes.edc
+)
+ADD_DEPENDENCIES(${PROJECT_NAME} color_classes.edj)
+INSTALL(FILES color_classes.edj DESTINATION ${EDJEDIR})
diff --git a/inc/add_viewer/add_viewer.h b/inc/add_viewer/add_viewer.h
new file mode 100644 (file)
index 0000000..d00270a
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 ADD_VIEWER_H_
+#define ADD_VIEWER_H_
+
+#include "homescreen-efl.h"
+
+/**
+ * @brief Create "add viewer" window
+ *
+ * @details Creates basic window that shows genlist with
+ * all found widgets on device.
+ *
+ * @param w Evas_Coord width of the window
+ * @param h Evas_Coord height of the window
+ */
+void add_viewer_window_create(Evas_Coord w, Evas_Coord h);
+
+/**
+ * @brief Delete "add viewer" window
+ *
+ * @details Deletes "add viewer" window and goes back to
+ * homescreen home view
+ */
+void add_viewer_window_delete(void);
+
+/**
+ * @brief Get "add viewer" layout
+ *
+ * @return layout Evas_Object
+ */
+Evas_Object *add_viewer_get_layout(void);
+
+/**
+ * @brief Get "add viewer" main theme
+ *
+ * @return theme Elm_Theme
+ */
+Elm_Theme *add_viewer_get_main_theme(void);
+
+#endif
diff --git a/inc/add_viewer/list_view.h b/inc/add_viewer/list_view.h
new file mode 100644 (file)
index 0000000..0cf8e47
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 LIST_VIEW_H_
+#define LIST_VIEW_H_
+
+#include "homescreen-efl.h"
+
+/**
+ * @brief Create content of the list
+ *
+ * @details Function creates content of the genlist with found widgets
+ *
+ * @param naviframe Evas_Object naviframe where content should be created
+ * @param genlist Evas_Object genlist to be created
+ *
+ * @return layout Evas_Object created layout to be displayed
+ */
+Evas_Object *list_view_create_content(Evas_Object *naviframe, Evas_Object *genlist);
+
+#endif
diff --git a/inc/add_viewer/view.h b/inc/add_viewer/view.h
new file mode 100644 (file)
index 0000000..284683c
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 VIEW_H_
+#define VIEW_H_
+
+#include "homescreen-efl.h"
+
+typedef int(* indexing_cb)(Evas_Object *layout, const char *letter, void *data);
+
+/**
+ * @brief Create content of the "add_viewer" layout
+ *
+ * @details Function creates additional object of the layout, index etc.
+ *
+ * @param naviframe Evas_Object naviframe where content should be created
+ * @param genlist Evas_Object genlist to be created
+ *
+ * @return layout Evas_Object created layout to be displayed
+ */
+Evas_Object *view_content_create(Evas_Object *frame, void *data);
+
+/**
+ * @brief Show content
+ *
+ * @details Function sends signal to layout to show its content
+ *
+ * @param layout Evas_Object object to be shown
+ */
+void view_content_show(Evas_Object *layout);
+
+/**
+ * @brief Show index
+ *
+ * @details Function sends signal to layout to show index
+ *
+ * @param layout Evas_Object layout that index belongs to
+ */
+void view_content_show_index(Evas_Object *layout);
+
+/**
+ * @brief Select index item
+ *
+ * @details Function selects choosen item of the index
+ *
+ * @return 0 on success, 1 on failure
+ */
+int view_index_set_index(const char *idx);
+
+/**
+ * @brief Get index object
+ *
+ * @details Function returns index object
+ *
+ * @return index Evas_Object
+ */
+Evas_Object *view_get_index(void);
+
+#endif
diff --git a/inc/add_viewer/widget.h b/inc/add_viewer/widget.h
new file mode 100644 (file)
index 0000000..c5d7c2f
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 WIDGET_H_
+#define WIDGET_H_
+
+#include "homescreen-efl.h"
+
+typedef struct {
+       char *widget_id;
+       char *app_id;
+
+       Eina_List *preview_list;
+       Elm_Object_Item *genlist_item;
+
+       int size_types_count;
+       int size_types;
+} widget_t;
+
+typedef struct {
+       int type;
+       char *path;
+} preview_t;
+
+/**
+ * @brief Initialize widget list
+ *
+ * @details Function creates list with all target widgets, previews
+ * and its sizes.
+ *
+ * @return 0 on success, 1 on failure
+ */
+int widget_init(void);
+
+/**
+ * @brief Remove widget list
+ *
+ * @details This function removes widget list and frees all its allocated
+ * memory
+ */
+void widget_fini(void);
+
+/**
+ * @brief Get widget list
+ *
+ * @details Function returns list with all found widgets and their data.
+ *
+ * @return widget_list Eina_List
+ */
+Eina_List* widget_get_widget_list(void);
+
+#endif
index a076a16..6d03591 100644 (file)
@@ -69,7 +69,6 @@
 *******************************************************************************/
 
 /*================================ OPTION_MENU.C==============================*/
-#define OPTION_MENU_ADD_VIEWER "org.tizen.add-viewer"
 #define OPTION_MENU_SETTINGS "org.tizen.wallpaper-ui-service"
 #define CAPTION_MENU_CENTER_LABEL_TEXT_LEN_MAX 16
 
index c2e2afd..377aa5f 100644 (file)
@@ -36,6 +36,7 @@ typedef enum {
        HOMESCREEN_VIEW_HOME = 0,
        HOMESCREEN_VIEW_HOME_EDIT,
        HOMESCREEN_VIEW_HOME_ALL_PAGES,
+       HOMESCREEN_VIEW_HOME_ADD_VIEWER,
        HOMESCREEN_VIEW_ALL_APPS,
        HOMESCREEN_VIEW_ALL_APPS_EDIT,
        HOMESCREEN_VIEW_ALL_APPS_CHOOSE,
index 23b3f03..1b2f620 100644 (file)
 #include <Elementary.h>
 #include <stdbool.h>
 
-#define BUF_SIZE 64
-
 #ifdef  LOG_TAG
 #undef  LOG_TAG
 #endif
 #define LOG_TAG "HOMESCREEN_EFL"
 
+#define BUF_SIZE 64
+
 /* Multi-language */
 #ifndef _
 #define _(str) gettext(str)
index a5ae489..5a973dc 100644 (file)
@@ -9,7 +9,7 @@ type = app
 profile = mobile-3.0
 
 # C Sources
-USER_SRCS = src/tree.c src/db/db.c src/homescreen-efl.c src/popup.c src/livebox/livebox_widget.c src/dynamic_index.c src/app_mgr.c src/all_apps.c src/layout.c src/app_grid.c src/livebox_all_pages.c src/livebox/livebox_panel.c src/data_model.c src/option_menu.c src/key.c src/app_icon.c src/mouse.c src/folder_panel.c src/livebox/grid_reposition.c src/livebox/livebox_utils.c src/livebox/livebox_animator.c src/livebox/grid_item_resize.c src/app_item.c src/page_scroller.c src/util.c 
+USER_SRCS = src/tree.c src/db/db.c src/homescreen-efl.c src/popup.c src/livebox/livebox_widget.c src/dynamic_index.c src/app_mgr.c src/all_apps.c src/layout.c src/app_grid.c src/livebox_all_pages.c src/livebox/livebox_panel.c src/data_model.c src/option_menu.c src/key.c src/app_icon.c src/mouse.c src/folder_panel.c src/livebox/grid_reposition.c src/livebox/livebox_utils.c src/livebox/livebox_animator.c src/livebox/grid_item_resize.c src/app_item.c src/page_scroller.c src/util.c src/add_viewer/add_viewer.c src/add_viewer/list_view.c  src/add_viewer/view.c src/add_viewer/widget.c
 
 # EDC Sources
 USER_EDCS =  
@@ -59,7 +59,7 @@ USER_EDCS_FONT_DIRS_ABS =
 # EDC Flags
 USER_EXT_EDC_KEYS = EDC0 
 
-USER_EXT_EDC0_EDCS = res/edje/folder_entry.edc res/edje/livebox_layout.edc res/edje/page_edit_util.edc res/edje/icon.edc res/edje/livebox_container.edc res/edje/folder.edc res/edje/home.edc res/edje/page_edit.edc res/edje/app_grid.edc res/edje/index_element.edc 
+USER_EXT_EDC0_EDCS = res/edje/folder_entry.edc res/edje/livebox_layout.edc res/edje/page_edit_util.edc res/edje/icon.edc res/edje/livebox_container.edc res/edje/folder.edc res/edje/home.edc res/edje/page_edit.edc res/edje/app_grid.edc res/edje/index_element.edc res/edje/preview.edc res/edje/color_classes.edc res/edje/tizen-dark-inc.edc
 USER_EXT_EDC0_EDCS_IMAGE_DIRS = res/images 
 USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS = 
 USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds 
diff --git a/res/edje/color_classes.edc b/res/edje/color_classes.edc
new file mode 100644 (file)
index 0000000..de2453b
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+* Samsung API
+* Copyright (c) 2009-2015 Samsung Electronics Co., Ltd.
+*
+* 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/license/
+*
+* 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.
+*/
+
+color_classes {
+       color_class {
+               name: "ATO001";
+               color: 22 22 22 255;
+       }
+       color_class {
+               name: "B041";
+               color: 255 255 255 255;
+       }
+       color_class {
+               name: "B0223";
+               color: 0 0 0 0;
+       }
+       color_class {
+               name: "B052L1";
+               color: 0 0 0 0;
+       }
+       color_class {
+               name: "B052L1P";
+               color: 0 0 0 0;
+       }
+       color_class {
+               name: "B052L1D";
+               color: 0 0 0 0;
+       }
+}
diff --git a/res/edje/preview.edc b/res/edje/preview.edc
new file mode 100644 (file)
index 0000000..a0e0f6c
--- /dev/null
@@ -0,0 +1,1093 @@
+images {
+       image: "icon_list_open.png" COMP;
+       image: "icon_list_close.png" COMP;
+
+       image: "icon_shadow.png" COMP;
+       image: "1x1 preview shortcut.png" COMP;
+
+       image: "preview_bg_1x1.png" COMP;
+       image: "preview_bg_2x1.png" COMP;
+       image: "preview_bg_2x2.png" COMP;
+       image: "preview_bg_4x1.png" COMP;
+       image: "preview_bg_4x2.png" COMP;
+       image: "preview_bg_4x3.png" COMP;
+       image: "preview_bg_4x4.png" COMP;
+       image: "icon_drawer_search.png" COMP;
+}
+
+
+#define BG_PREVIEW_COLOR 134 177 197 255
+
+#include "color_classes.edc"
+
+
+
+styles {
+       style {
+               name: "tree,font";
+               base: "font=Tizen text_class=ATO001 font_size=28 align=left color=#FFFFFF color_class=ATO001 ellipsis=1.0";
+               tag:  "br" "\n";
+               tag:  "hilight" "+ font=Tizen:style=Bold";
+               tag:  "b" "+ font=Tizen:style=Bold";
+               tag:  "tab" "\t";
+       }
+
+       style {
+               name: "open,title,font";
+               base: "font=Tizen text_class=ATO001 font_size=28 align=left color=#FFFFFF color_class=ATO001 ellipsis=1.0";
+               tag: "br" "\n";
+               tag: "hilight" "+ font=Tizen:style=Bold";
+               tag: "b" "+ font=Tizen:style=Bold";
+               tag: "tag" "\t";
+       }
+
+       style {
+               name: "leaf,font";
+               base: "font=Tizen text_class=TO23 font_size=28 align=left color=#AAAAAA color_class=AT0001 ellipsis=1.0";
+               tag:  "br" "\n";
+               tag:  "hilight" "+ font=Tizen:style=Bold";
+               tag:  "b" "+ font=Tizen:style=Bold";
+               tag:  "tab" "\t";
+       }
+}
+
+// 44 + 76
+#define LEFT_SPACE     0
+#define PHYSI_WIDTH    480
+#define LOGI_WIDTH     (PHYSI_WIDTH - LEFT_SPACE)
+
+collections {
+       base_scale: 1.8;
+       plugins {
+               plugin {
+                       name: "touch_sound";
+                       source: "feedback";
+                       param: "1 0";
+               }
+       }
+
+       group {
+               name: "elm/genlist/item/widget,leaf/default";
+
+               data.item: "contents" "elm.icon bg";
+               data.item: "texts" "elm.text";
+
+               parts {
+                       part {
+                               name: "bg";
+                               type: SWALLOW;
+                               scale: 1;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       min: 1 270;
+                                       max: -1 270;
+                               }
+                               description {
+                                       state: "selected" 0.0;
+                                       inherit: "default" 0.0;
+                               }
+                       }
+
+                       part {
+                               name: "padding.top";
+                               type: SPACER;
+                               scale: 1;
+                               mouse_events: 0;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "bg";}
+                                       rel2 { relative: 1.0 0.0; to: "bg"; }
+                                       min: 0 20;
+                               }
+                       }
+
+                       part {
+                               name: "padding.bottom";
+                               type: SPACER;
+                               scale: 1;
+                               mouse_events: 0;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 1.0; to: "bg";}
+                                       rel2 { relative: 1.0 1.0; to: "bg";}
+                                       min: 0 20;
+                               }
+                       }
+
+                       part {
+                               name: "padding.left";
+                               type: SPACER;
+                               scale: 1;
+                               mouse_events: 0;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to: "bg";}
+                                       rel2 { relative: 0.0 1.0; to: "bg";}
+                                       min: 20 0;
+                               }
+                       }
+
+                       part {
+                               name: "padding.right";
+                               type: SPACER;
+                               scale: 1;
+                               mouse_events: 0;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 1.0 0.0; to: "bg";}
+                                       rel2 { relative: 1.0 1.0; to: "bg";}
+                                       min: 20 0;
+                               }
+                       }
+
+                       part {
+                               name: "elm.text";
+                               type: TEXTBLOCK;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.042 1.0; to_y: "padding.top"; }
+                                       rel2 { relative: 0.958 1.0; to_y: "padding.top"; }
+                                       min: 0 36;
+                                       align: 0.0 0.0;
+                                       text { style: "leaf,font"; }
+                               }
+                       }
+
+                       part {
+                               name: "text.right.padding";
+                               type: SPACER;
+                               mouse_events: 0;
+                               scale: 1;
+                               description
+                               {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 1.0 1.0; to_x: "elm.text"; to_y: "padding.top"; }
+                                       rel2 { relative: 1.0 0.0; to_x: "elm.text"; to_y: "padding.bottom"; }
+                                       align: 0.0 0.0;
+                               }
+                       }
+
+                       part {
+                               name: "elm.icon";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 1.0; to: "elm.text"; }
+                                       rel2 { relative: 1.0 0.0; to: "padding.bottom"; }
+                                       align: 0.0 0.0;
+                               }
+                       }
+
+                       part {
+                               name: "top,line";
+                               // clip_to: "disclip";
+                               type: RECT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0/112; }
+                                       rel2 { relative: 1.0 1/112; }
+                                       color_class: "B0223";
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "go_active";
+                               signal: "elm,state,selected";
+                               source: "elm";
+                               action: STATE_SET "selected" 0.0;
+                               target: "bg";
+                       }
+                       program {
+                               name: "go_passive";
+                               signal: "elm,state,unselected";
+                               source: "elm";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+               }
+       }
+
+
+       group {
+               name: "conformant,frame";
+               parts {
+                       part {
+                               name: "bg";
+                               type: RECT;
+                               scale: 1;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 0.0; }
+                                       align: 0.5 0.0;
+                                       min: 0 100;
+                                       max: -1 100;
+                                       fixed: 0 1;
+                                       color_class: "B041";
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show,search" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+
+                       part {
+                               name: "content";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                               }
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 0;
+                               }
+                       }
+
+                       part {
+                               name: "entry";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show,search" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+
+                       part {
+                               name: "nocontent";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 1.0; to_y, "bg"; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "show,search";
+                               signal: "display,search";
+                               source: "container";
+                               action: STATE_SET "show,search" 0.0;
+                               target: "content";
+                               target: "bg";
+                               target: "entry";
+                       }
+                       program {
+                               name: "hide,search";
+                               signal: "undisplay,search";
+                               source: "container";
+                               action: STATE_SET "default" 0.0;
+                               target: "content";
+                               target: "bg";
+                               target: "entry";
+                       }
+
+                       program {
+                               name: "nocontent";
+                               signal: "nocontent";
+                               source: "container";
+                               action: STATE_SET "show" 0.0;
+                               target: "nocontent";
+                               target: "content";
+                       }
+                       program {
+                               name: "content";
+                               signal: "content";
+                               source: "container";
+                               action: STATE_SET "default" 0.0;
+                               target: "nocontent";
+                               target: "content";
+                       }
+               }
+       }
+
+       group {
+               name: "content,frame";
+               parts {
+                       part {
+                               name: "content";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       align: 0.0 0.0;
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show,normal" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "show,easy" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel2 { relative: 1.0 1.0; }
+                                       visible: 1;
+                               }
+                       }
+
+                       part {
+                               name: "index";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.00 0.0;}
+                                       rel2 { relative: 1.00 1.00; }
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show,normal" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 1;
+                               }
+                               description {
+                                       state: "show,easy" 0.0;
+                                       visible: 0;
+                               }
+                       }
+
+                       part {
+                               name: "loading";
+                               type: RECT;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.25 0.40; }
+                                       rel2 { relative: 0.75 0.60; }
+                                       color: 100 100 200 200;
+                                       visible: 0;
+                               }
+
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 0;
+                               }
+                       }
+
+                       part {
+                               name: "loading,txt";
+                               type: TEXT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "loading"; }
+                                       rel2 { relative: 1.0 1.0; to, "loading"; }
+                                       text {
+                                               font: "Tizen:style=Bold";
+                                               text_class: "tizen";
+                                               align: 0.5 0.5;
+                                               size: 26;
+                                               text: "Loading";
+                                       }
+                                       visible: 0;
+                               }
+                               description {
+                                       state: "show" 0.0;
+                                       inherit: "default" 0.0;
+                                       visible: 0;
+                               }
+                       }
+               }
+               programs {
+                       program {
+                               name: "loading,on";
+                               source: "content,frame";
+                               signal: "loading,on";
+                               action: STATE_SET "show" 0.0;
+                               target: "loading";
+                               target: "loading,txt";
+                       }
+                       program {
+                               name: "loading,off";
+                               source: "content,frame";
+                               signal: "loading,off";
+                               action: STATE_SET "default" 0.0;
+                               target: "loading";
+                               target: "loading,txt";
+                       }
+                       program {
+                               name: "show,normal";
+                               signal: "display,normal";
+                               source: "container";
+                               action: STATE_SET "show,normal" 0.0;
+                               target: "content";
+                       }
+                       program {
+                               name: "show,normal,index";
+                               signal: "display,index";
+                               source: "container";
+                               action: STATE_SET "show,normal" 0.0;
+                               target: "index";
+                       }
+                       program {
+                               name: "show,easy";
+                               signal: "display,easy";
+                               source: "container";
+                               action: STATE_SET "show,easy" 0.0;
+                               target: "content";
+                               target: "index";
+                       }
+                       program {
+                               name: "hide";
+                               signal: "undisplay";
+                               source: "container";
+                               action: STATE_SET "default" 0.0;
+                               target: "content";
+                       }
+               }
+       }
+
+
+       group {
+               name: "preview,1x1";
+               parts {
+                       part {
+                               name: "bg";
+                               type: IMAGE;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       image { normal: "preview_bg_1x1.png"; }
+                                       color_class: "B041";
+                               }
+                               description {
+                                       state: "clicked" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 4/87 4/87; }
+                                       rel2 { relative: 83/87 83/87; }
+                               }
+                       }
+
+                       part {
+                               name: "preview";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                               }
+                       }
+
+                       part {
+                               name: "preview,dbg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to, "preview"; }
+                                       rel2 { to, "preview"; }
+                                       color: 0 0 0 0;
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "touch_snd";
+                               signal: "mouse,clicked,1";
+                               source: "preview,dbg";
+                               action: RUN_PLUGIN "touch_sound";
+                       }
+                       program {
+                               name: "in,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,down,1";
+                               action: STATE_SET "clicked" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "out,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,up,1";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "add,to,home";
+                               source: "preview,dbg";
+                               signal: "mouse,clicked,1";
+                               action: SIGNAL_EMIT "add,to,home" "preview";
+                       }
+               }
+       }
+
+       group {
+               name: "preview,2x1";
+               parts {
+                       part {
+                               name: "bg";
+                               type: IMAGE;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       image { normal: "preview_bg_2x1.png"; }
+                                       color_class: "B041";
+                                       min: 164 87;
+                               }
+                               description {
+                                       state: "clicked" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 4/164 4/87; }
+                                       rel2 { relative: 160/164 83/87; }
+                                       min: 156 79;
+                               }
+                       }
+
+                       part {
+                               name: "preview";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                               }
+                       }
+
+                       part {
+                               name: "preview,dbg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to, "preview"; }
+                                       rel2 { to, "preview"; }
+                                       color: 0 0 0 0;
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "touch_snd";
+                               signal: "mouse,clicked,1";
+                               source: "preview,dbg";
+                               action: RUN_PLUGIN "touch_sound";
+                       }
+                       program {
+                               name: "in,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,down,1";
+                               action: STATE_SET "clicked" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "out,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,up,1";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "add,to,home";
+                               source: "preview,dbg";
+                               signal: "mouse,clicked,1";
+                               action: SIGNAL_EMIT "add,to,home" "preview";
+                       }
+               }
+       }
+
+       group {
+               name: "preview,2x2";
+               parts {
+                       part {
+                               name: "bg";
+                               type: IMAGE;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       image { normal: "preview_bg_2x2.png"; }
+                                       min: 164 164;
+                               }
+                               description {
+                                       state: "clicked" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 4/164 4/164; }
+                                       rel2 { relative: 160/164 160/164; }
+                                       min: 156 156;
+                               }
+                       }
+
+                       part {
+                               name: "preview";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                                       min: 133 133;
+                               }
+                       }
+
+                       part {
+                               name: "preview,dbg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to, "preview"; }
+                                       rel2 { to, "preview"; }
+                                       color: 255 0 0 150;
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "touch_snd";
+                               signal: "mouse,clicked,1";
+                               source: "preview,dbg";
+                               action: RUN_PLUGIN "touch_sound";
+                       }
+                       program {
+                               name: "in,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,down,1";
+                               action: STATE_SET "clicked" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "out,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,up,1";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "add,to,home";
+                               source: "preview,dbg";
+                               signal: "mouse,clicked,1";
+                               action: SIGNAL_EMIT "add,to,home" "preview";
+                       }
+               }
+       }
+
+       group {
+               name: "preview,4x1";
+               parts {
+                       part {
+                               name: "bg";
+                               type: IMAGE;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       image { normal: "preview_bg_4x1.png"; }
+                                       color_class: "B041";
+                                       min: 214 107;
+                               }
+                               description {
+                                       state: "clicked" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 4/314 4/52; }
+                                       rel2 { relative: 310/314 48/52; }
+                                       min: 200 100;
+                               }
+                       }
+
+                       part {
+                               name: "preview";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "touch_snd";
+                               signal: "mouse,clicked,1";
+                               source: "preview,dbg";
+                               action: RUN_PLUGIN "touch_sound";
+                       }
+                       program {
+                               name: "in,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,down,1";
+                               action: STATE_SET "clicked" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "out,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,up,1";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "add,to,home";
+                               source: "preview,dbg";
+                               signal: "mouse,clicked,1";
+                               action: SIGNAL_EMIT "add,to,home" "preview";
+                       }
+               }
+       }
+
+       group {
+               name: "preview,4x2";
+               parts {
+                       part {
+                               name: "bg";
+                               type: RECT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       color: BG_PREVIEW_COLOR;
+                                       min: 214 107;
+                               }
+                               description {
+                                       state: "clicked" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 4/314 4/164; }
+                                       rel2 { relative: 310/314 160/164; }
+                                       min: 207 100;
+                               }
+                       }
+
+                       part {
+                               name: "preview";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                               }
+                       }
+                       part {
+                               name: "preview,dbg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to, "preview"; }
+                                       rel2 { to, "preview"; }
+                                       color: 0 0 0 0;
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "touch_snd";
+                               signal: "mouse,clicked,1";
+                               source: "preview,dbg";
+                               action: RUN_PLUGIN "touch_sound";
+                       }
+                       program {
+                               name: "in,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,down,1";
+                               action: STATE_SET "clicked" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "out,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,up,1";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "add,to,home";
+                               source: "preview,dbg";
+                               signal: "mouse,clicked,1";
+                               action: SIGNAL_EMIT "add,to,home" "preview";
+                       }
+               }
+       }
+
+       group {
+               name: "preview,4x3";
+               parts {
+                       part {
+                               name: "bg";
+                               type: IMAGE;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       image { normal: "preview_bg_4x3.png"; }
+                                       color_class: "B041";
+                                       min: 314 239;
+                               }
+                               description {
+                                       state: "clicked" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 4/314 4/239; }
+                                       rel2 { relative: 310/314 235/239; }
+                                       min: 306 231;
+                               }
+                       }
+
+                       part {
+                               name: "preview";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                               }
+                       }
+
+                       part {
+                               name: "preview,dbg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to, "preview"; }
+                                       rel2 { to, "preview"; }
+                                       color: 0 0 0 0;
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "touch_snd";
+                               signal: "mouse,clicked,1";
+                               source: "preview,dbg";
+                               action: RUN_PLUGIN "touch_sound";
+                       }
+                       program {
+                               name: "in,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,down,1";
+                               action: STATE_SET "clicked" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "out,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,up,1";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "add,to,home";
+                               source: "preview,dbg";
+                               signal: "mouse,clicked,1";
+                               action: SIGNAL_EMIT "add,to,home" "preview";
+                       }
+               }
+       }
+
+       group {
+               name: "preview,4x4";
+               parts {
+                       part {
+                               name: "bg";
+                               type: RECT;
+                               mouse_events: 0;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       color: BG_PREVIEW_COLOR;
+                                       min: 214 214;
+                               }
+                               description {
+                                       state: "clicked" 0.0;
+                                       inherit: "default" 0.0;
+                                       rel1 { relative: 4/312 4/312; }
+                                       rel2 { relative: 308/312 308/312; }
+                                       min: 200 200;
+                               }
+                       }
+
+                       part {
+                               name: "preview";
+                               type: SWALLOW;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; to, "bg"; }
+                                       rel2 { relative: 1.0 1.0; to, "bg"; }
+                               }
+                       }
+                       part {
+                               name: "preview,dbg";
+                               type: RECT;
+                               mouse_events: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { to, "preview"; }
+                                       rel2 { to, "preview"; }
+                                       color: 0 0 0 0;
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "touch_snd";
+                               signal: "mouse,clicked,1";
+                               source: "preview,dbg";
+                               action: RUN_PLUGIN "touch_sound";
+                       }
+                       program {
+                               name: "in,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,down,1";
+                               action: STATE_SET "clicked" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "out,effect";
+                               source: "preview,dbg";
+                               signal: "mouse,up,1";
+                               action: STATE_SET "default" 0.0;
+                               target: "bg";
+                               transition: LINEAR 0.1;
+                       }
+                       program {
+                               name: "add,to,home";
+                               source: "preview,dbg";
+                               signal: "mouse,clicked,1";
+                               action: SIGNAL_EMIT "add,to,home" "preview";
+                       }
+               }
+       }
+
+       group {
+               name: "search,btn";
+               parts {
+                       part {
+                               name: "image";
+                               type: IMAGE;
+                               scale: 1;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                                       image { normal: "icon_drawer_search.png"; }
+                                       color_class: "B052L1";
+                                       aspect: 1 1;
+                                       aspect_preference: BOTH;
+                                       min: 63 63;
+                                       max: 63 63;
+                               }
+                               description {
+                                       state: "pressed" 0.0;
+                                       inherit: "default" 0.0;
+                                       color_class: "B052L1P";
+                               }
+                               description {
+                                       state: "dim" 0.0;
+                                       inherit: "default" 0.0;
+                                       color_class: "B052L1D";
+                               }
+                       }
+               }
+               programs {
+                       program {
+                               name: "pressed";
+                               source: "image";
+                               signal: "mouse,down,1";
+                               action: STATE_SET "pressed" 0.0;
+                               target: "image";
+                       }
+                       program {
+                               name: "released";
+                               source: "image";
+                               signal: "mouse,up,1";
+                               action: STATE_SET "default" 0.0;
+                               target: "image";
+                       }
+               }
+       }
+} // collections
+
+
diff --git a/res/images/00_scroll_bar_h.png b/res/images/00_scroll_bar_h.png
new file mode 100644 (file)
index 0000000..526c91c
Binary files /dev/null and b/res/images/00_scroll_bar_h.png differ
diff --git a/res/images/00_scroll_bar_v.png b/res/images/00_scroll_bar_v.png
new file mode 100644 (file)
index 0000000..f07b2ca
Binary files /dev/null and b/res/images/00_scroll_bar_v.png differ
diff --git a/res/images/1x1 preview shortcut.png b/res/images/1x1 preview shortcut.png
new file mode 100644 (file)
index 0000000..6e7cf5f
Binary files /dev/null and b/res/images/1x1 preview shortcut.png differ
diff --git a/res/images/icon_drawer_search.png b/res/images/icon_drawer_search.png
new file mode 100644 (file)
index 0000000..ecca326
Binary files /dev/null and b/res/images/icon_drawer_search.png differ
diff --git a/res/images/icon_list_close.png b/res/images/icon_list_close.png
new file mode 100644 (file)
index 0000000..b26e501
Binary files /dev/null and b/res/images/icon_list_close.png differ
diff --git a/res/images/icon_list_open.png b/res/images/icon_list_open.png
new file mode 100644 (file)
index 0000000..f101249
Binary files /dev/null and b/res/images/icon_list_open.png differ
diff --git a/res/images/icon_shadow.png b/res/images/icon_shadow.png
new file mode 100644 (file)
index 0000000..65e836b
Binary files /dev/null and b/res/images/icon_shadow.png differ
diff --git a/res/images/preview_bg_1x1.png b/res/images/preview_bg_1x1.png
new file mode 100644 (file)
index 0000000..76cdafa
Binary files /dev/null and b/res/images/preview_bg_1x1.png differ
diff --git a/res/images/preview_bg_2x1.png b/res/images/preview_bg_2x1.png
new file mode 100644 (file)
index 0000000..817f5ee
Binary files /dev/null and b/res/images/preview_bg_2x1.png differ
diff --git a/res/images/preview_bg_2x2.png b/res/images/preview_bg_2x2.png
new file mode 100644 (file)
index 0000000..d34f366
Binary files /dev/null and b/res/images/preview_bg_2x2.png differ
diff --git a/res/images/preview_bg_4x1.png b/res/images/preview_bg_4x1.png
new file mode 100644 (file)
index 0000000..1e9ec34
Binary files /dev/null and b/res/images/preview_bg_4x1.png differ
diff --git a/res/images/preview_bg_4x2.png b/res/images/preview_bg_4x2.png
new file mode 100644 (file)
index 0000000..aa224a1
Binary files /dev/null and b/res/images/preview_bg_4x2.png differ
diff --git a/res/images/preview_bg_4x3.png b/res/images/preview_bg_4x3.png
new file mode 100644 (file)
index 0000000..219dc42
Binary files /dev/null and b/res/images/preview_bg_4x3.png differ
diff --git a/res/images/preview_bg_4x4.png b/res/images/preview_bg_4x4.png
new file mode 100644 (file)
index 0000000..59a8bce
Binary files /dev/null and b/res/images/preview_bg_4x4.png differ
diff --git a/res/images/scroll_bar.9.png b/res/images/scroll_bar.9.png
new file mode 100644 (file)
index 0000000..a077f4d
Binary files /dev/null and b/res/images/scroll_bar.9.png differ
diff --git a/res/images/unknown.png b/res/images/unknown.png
new file mode 100644 (file)
index 0000000..535db60
Binary files /dev/null and b/res/images/unknown.png differ
diff --git a/src/add_viewer/add_viewer.c b/src/add_viewer/add_viewer.c
new file mode 100644 (file)
index 0000000..3975b1b
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "util.h"
+
+#include "add_viewer/add_viewer.h"
+#include "add_viewer/list_view.h"
+#include "add_viewer/widget.h"
+
+static struct {
+       Evas_Object *win;
+       Evas_Object *conformant;
+       Evas_Object *layout;
+       Evas_Object *naviframe;
+       Evas_Object *genlist;
+
+       Elm_Theme *theme;
+       Elm_Object_Item *navi_item;
+
+} s_info = {
+       .win = NULL,
+       .conformant = NULL,
+       .layout = NULL,
+       .naviframe = NULL,
+       .genlist = NULL,
+
+       .theme = NULL,
+       .navi_item = NULL,
+};
+
+static void __add_viewer_window_del_cb(void *data, Evas_Object* obj, void* event_info);
+static Elm_Theme *__add_viewer_create_theme(void);
+static Evas_Object *__add_viewer_create_conformant(void);
+static Evas_Object *__add_viewer_create_layout();
+static Evas_Object *__add_viewer_create_naviframe();
+
+Elm_Theme *add_viewer_get_main_theme(void)
+{
+       return s_info.theme;
+}
+
+Evas_Object *add_viewer_get_layout(void)
+{
+       return s_info.layout;
+}
+
+void add_viewer_window_create(Evas_Coord w, Evas_Coord h)
+{
+       int ret = 0;
+
+       ret = widget_init();
+       if (ret != 0) {
+               LOGE("Can not init widget list");
+               return;
+       }
+
+       s_info.win = elm_win_add(NULL, "add_viewer", ELM_WIN_BASIC);
+       if (!s_info.win) {
+               LOGE("Failed to create a new window");
+               return;
+       }
+
+       elm_win_alpha_set(s_info.win, EINA_TRUE);
+       elm_win_autodel_set(s_info.win, EINA_TRUE);
+       evas_object_smart_callback_add(s_info.win, "delete,request", __add_viewer_window_del_cb, NULL);
+
+       s_info.theme = __add_viewer_create_theme();
+       s_info.conformant = __add_viewer_create_conformant();
+       s_info.layout = __add_viewer_create_layout();
+       s_info.naviframe = __add_viewer_create_naviframe();
+
+       s_info.navi_item = list_view_create_content(s_info.naviframe, s_info.genlist);
+
+       elm_object_signal_emit(s_info.layout, "display,normal", "container");
+
+       elm_win_indicator_mode_set(s_info.win, ELM_WIN_INDICATOR_SHOW);
+       elm_win_indicator_opacity_set(s_info.win, ELM_WIN_INDICATOR_OPAQUE);
+       elm_win_resize_object_add(s_info.win, s_info.conformant);
+       elm_win_conformant_set(s_info.win, EINA_TRUE);
+       evas_object_resize(s_info.win, w, h);
+
+       evas_object_show(s_info.naviframe);
+       evas_object_show(s_info.layout);
+       evas_object_show(s_info.conformant);
+
+
+       evas_object_show(s_info.win);
+}
+
+void add_viewer_window_delete(void)
+{
+       home_screen_set_view_type(HOMESCREEN_VIEW_HOME);
+       evas_object_del(s_info.win);
+       widget_fini();
+}
+
+static void __add_viewer_window_del_cb(void *data, Evas_Object* obj, void* event_info)
+{
+       evas_object_del(s_info.win);
+}
+
+static Elm_Theme *__add_viewer_create_theme(void)
+{
+       Elm_Theme *theme = elm_theme_new();
+       if (!theme) {
+               LOGE("Failed to create theme\n");
+               return NULL; }
+
+       elm_theme_ref_set(theme, NULL);
+       elm_theme_extension_add(theme, util_get_res_file_path(EDJE_DIR"/preview.edj"));
+
+       return theme;
+}
+
+static Evas_Object *__add_viewer_create_conformant(void)
+{
+       Evas_Object *conformant;
+       Evas_Object *bg;
+
+       conformant = elm_conformant_add(s_info.win);
+       if (!conformant) {
+               LOGE("Failed to create a conformant\n");
+               return NULL;
+       }
+
+       evas_object_size_hint_weight_set(conformant, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+       bg = elm_bg_add(conformant);
+       if (bg) {
+               elm_object_style_set(bg, "indicator/headerbg");
+               elm_object_part_content_set(conformant, "elm.swallow.indicator_bg", bg);
+               evas_object_show(bg);
+       } else {
+               LOGE("Failed to create a BG object\n");
+       }
+
+       return conformant;
+}
+
+static Evas_Object *__add_viewer_create_layout()
+{
+       Evas_Object *layout;
+       char edj_path[PATH_MAX] = {0, };
+
+       if (!s_info.conformant) {
+               return NULL;
+       }
+
+       layout = elm_layout_add(s_info.conformant);
+       if (!layout) {
+               return NULL;
+       }
+
+       snprintf(edj_path, sizeof(edj_path), "%s", util_get_res_file_path(EDJE_DIR"/preview.edj"));
+       if (elm_layout_file_set(layout, edj_path, "conformant,frame") != EINA_TRUE) {
+               evas_object_del(layout);
+               return NULL;
+       }
+       
+       elm_object_part_content_set(s_info.conformant, "elm.swallow.content", layout);
+
+       return layout;
+}
+
+static Evas_Object *__add_viewer_create_naviframe()
+{
+       Evas_Object *naviframe;
+
+       naviframe = elm_naviframe_add(s_info.conformant);
+       if (!naviframe) {
+               return NULL;
+       }
+
+       elm_naviframe_content_preserve_on_pop_set(naviframe, EINA_TRUE);
+       elm_object_part_content_set(s_info.layout, "content", naviframe);
+
+       return naviframe;
+}
+
diff --git a/src/add_viewer/list_view.c b/src/add_viewer/list_view.c
new file mode 100644 (file)
index 0000000..b4df9a8
--- /dev/null
@@ -0,0 +1,532 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 <Elementary.h>
+#include <widget_service.h>
+#include <widget_viewer_evas.h>
+#include <widget_errno.h>
+#include <shortcut_manager.h>
+
+
+#include "util.h"
+#include "conf.h"
+
+#include "add_viewer/add_viewer.h"
+#include "add_viewer/list_view.h"
+#include "add_viewer/view.h"
+#include "add_viewer/widget.h"
+
+static Evas_Object *__list_view_create_list(Evas_Object *content);
+static void __list_view_genlist_theme_set(Evas_Object *genlist);
+static char *__gl_text_get_cb(void *data, Evas_Object *obj, const char *part);
+static Evas_Object *__gl_content_get_cb (void *data, Evas_Object *obj, const char *part);
+static Evas_Object *__list_view_widget_box_create(Evas_Object *obj, widget_t *widget);
+static Evas_Object *__list_view_preview_box_create(Evas_Object *main_box, widget_t *widget, preview_t *preview);
+static void __list_view_item_realized_cb(void *data, Evas_Object *obj, void *event_info);
+static void __list_view_preview_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+
+Evas_Object *list_view_create_content(Evas_Object *naviframe, Evas_Object *genlist)
+{
+       Elm_Object_Item *item;
+       Evas_Object *content;
+
+       content = view_content_create(naviframe, NULL);
+       if (!content) {
+               return NULL;
+       }
+
+       genlist = __list_view_create_list(content);
+       elm_object_part_content_set(content, "content", genlist);
+
+       item = elm_naviframe_item_push(naviframe, _("IDS_HS_HEADER_ADD_WIDGET"), NULL, NULL, content, NULL);
+       view_content_show(content);
+       view_content_show_index(content);
+
+       if (!item) {
+               LOGD("Failed to push an item\n");
+               return NULL;
+       }
+
+       return content;
+}
+
+static Evas_Object *__list_view_create_list(Evas_Object *content)
+{
+       Elm_Genlist_Item_Class *itc_widget;
+       Evas_Object *genlist = NULL;
+       Elm_Object_Item *widget_gl_item = NULL;
+       Eina_List *widget_list = NULL, *l = NULL;
+       widget_t *widget = NULL;
+
+       genlist = elm_genlist_add(content);
+       if (!genlist) {
+               LOGE("Failed to create a genlist\n");
+               return NULL;
+       }
+
+       elm_scroller_bounce_set(genlist, EINA_FALSE, EINA_TRUE);
+       elm_scroller_policy_set(genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+       elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_NONE);
+
+       __list_view_genlist_theme_set(genlist);
+
+       itc_widget = elm_genlist_item_class_new();
+       itc_widget->item_style = "widget,leaf";
+       itc_widget->func.text_get = __gl_text_get_cb;
+       itc_widget->func.content_get = __gl_content_get_cb;
+
+       widget_list = widget_get_widget_list();
+       if (!widget_list) {
+               LOGE("Can not get widget list");
+               return NULL;
+       }
+
+       LOGD("Widget list length: %d", eina_list_count(widget_list));
+       EINA_LIST_FOREACH(widget_list, l, widget) {
+               LOGD("Genlist append");
+               widget_gl_item = elm_genlist_item_append(genlist, itc_widget, widget, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+               widget->genlist_item = widget_gl_item;
+       }
+
+       evas_object_smart_callback_add(genlist, "realized", __list_view_item_realized_cb, NULL);
+
+       elm_genlist_item_class_free(itc_widget);
+
+       return genlist;
+}
+
+static void __list_view_genlist_theme_set(Evas_Object *genlist)
+{
+       Elm_Theme *main_theme;
+
+       main_theme = add_viewer_get_main_theme();
+       if (main_theme)
+               elm_object_theme_set(genlist, main_theme);
+}
+
+static char *__gl_text_get_cb(void *data, Evas_Object *obj, const char *part)
+{
+       widget_t *widget = data;
+
+       if (!widget || !part)
+               return NULL;
+
+       if(!strcmp(part, "elm.text"))
+               return strdup(widget->widget_id);
+
+       return strdup("widget name not found");
+}
+
+static Evas_Object *__gl_content_get_cb(void *data, Evas_Object *obj, const char *part)
+{
+       LOGD("Part: %s", part);
+
+       Evas_Object *main_box = NULL;
+       Eina_List *widget_list = NULL;
+       widget_t *widget = data;
+
+       if (!widget || !part)
+               return NULL;
+
+       if (!strcmp(part, "bg")) {
+               return NULL;
+       }
+
+       widget_list = widget_get_widget_list();
+       if (!widget_list) {
+               LOGE("Can not get widget list");
+               return NULL;
+       }
+
+       main_box = __list_view_widget_box_create(obj, widget);
+       if (!main_box) {
+               LOGE("Can not create preview box");
+               return NULL;
+       }
+
+       return main_box;
+}
+
+static Evas_Object *__list_view_widget_box_create(Evas_Object *obj, widget_t *widget)
+{
+       LOGD("Create box for %s", widget->widget_id);
+
+       Evas_Object *main_box = NULL;
+       Evas_Object *mid_box = NULL;
+               Evas_Object *small_box = NULL;
+       Evas_Object *preview_layout = NULL;
+       Eina_List *l;
+       Eina_List *children;
+       preview_t *preview;
+       int tmp = 0;
+       int h = 0;
+       int filled = 0;
+       int height = 0;
+
+       main_box = elm_box_add(obj);
+       if (!main_box) {
+               LOGE("Can not create preview box");
+               return NULL;
+       }
+
+       elm_box_horizontal_set(main_box, EINA_FALSE);
+       elm_box_homogeneous_set(main_box, EINA_FALSE);
+       elm_box_padding_set(main_box, 0, 30);
+       elm_box_align_set(main_box, 0.0, 0.0);
+
+       EINA_LIST_FOREACH(widget->preview_list, l, preview) {
+
+               preview_layout = __list_view_preview_box_create(main_box, widget, preview);
+               if(!preview_layout) {
+                       LOGE("Can not create preview layout");
+                       return NULL;
+               }
+
+               elm_object_part_text_set(preview_layout, "text", widget->widget_id);
+
+               //elm_box_pack_end(main_box, preview_layout);
+
+               evas_object_size_hint_min_get(preview_layout, NULL, &h);
+               if (h <= 0) {
+                       LOGE("Preview layout height is unknown");
+                       continue;
+               }
+
+               evas_object_show(preview_layout);
+
+               switch (preview->type) {
+               case WIDGET_SIZE_TYPE_4x6:
+               case WIDGET_SIZE_TYPE_4x5:
+               case WIDGET_SIZE_TYPE_4x4:
+               case WIDGET_SIZE_TYPE_4x3:
+               case WIDGET_SIZE_TYPE_4x2:
+               case WIDGET_SIZE_TYPE_4x1:
+                       if (!mid_box) {
+                               mid_box = elm_box_add(main_box);
+                               if (!mid_box) {
+                                       LOGE("Failed to add mid box\n");
+                                       return NULL;
+                               }
+
+                               elm_box_align_set(mid_box, 0.0, 0.0);
+                               elm_box_horizontal_set(mid_box, EINA_TRUE);
+                               elm_box_homogeneous_set(mid_box, EINA_FALSE);
+                               elm_box_padding_set(mid_box, 12, 0);
+                               evas_object_size_hint_align_set(mid_box, 0.0, 0.0);
+                               filled = 0;
+                       }
+
+                       if (tmp < h) {
+                               tmp = h;
+                       }
+                       filled++;
+                       evas_object_size_hint_align_set(preview_layout, 0.0, 0.0);
+                       elm_box_pack_end(mid_box, preview_layout);
+
+                       if (filled == 2) {
+                               elm_box_pack_end(main_box, mid_box);
+                               evas_object_show(mid_box);
+                               mid_box = NULL;
+                               height += (tmp + 30);
+                               tmp = 0;
+                       }
+                       break;
+               case WIDGET_SIZE_TYPE_2x2:
+               case WIDGET_SIZE_TYPE_2x1:
+               case WIDGET_SIZE_TYPE_1x1:
+                       if (mid_box) {
+                               elm_box_pack_end(main_box, mid_box);
+                               evas_object_show(mid_box);
+                               height += (h + 30);
+                               filled = 0;
+                               tmp = 0;
+                       }
+
+                       if (!small_box) {
+                               small_box = elm_box_add(main_box);
+                               if (!small_box) {
+                                       LOGD("Failed to add small box\n");
+                                       evas_object_del(preview_layout);
+                                       evas_object_del(main_box);
+                                       return NULL;
+                               }
+
+                               elm_box_align_set(small_box, 0.0, 0.0);
+                               elm_box_horizontal_set(small_box, EINA_TRUE);
+                               elm_box_homogeneous_set(small_box, EINA_FALSE);
+                               elm_box_padding_set(small_box, 12, 0);
+                               evas_object_size_hint_align_set(small_box, 0.0, 0.0);
+                               filled = 0;
+                       }
+
+                       if (tmp < h) {
+                               tmp = h;
+                       }
+
+                       filled++;
+                       evas_object_size_hint_align_set(preview_layout, 0.0, 0.0);
+                       elm_box_pack_end(small_box, preview_layout);
+
+                       if (filled == 3) {
+                               evas_object_show(small_box);
+                               elm_box_pack_end(main_box, small_box);
+                               height += (tmp + 30);
+                               small_box = NULL;
+                               tmp = 0;
+                       }
+                       break;
+                       return NULL;
+               default:
+                       LOGE("Unsupported size\n");
+                       break;
+                       return NULL;
+               }
+
+       }
+
+       if (small_box) {
+               evas_object_show(small_box);
+               elm_box_pack_end(main_box, small_box);
+               height += (tmp + 30);
+       } else if (mid_box) {
+               elm_box_pack_end(main_box, mid_box);
+               evas_object_show(mid_box);
+               height += (tmp + 30);
+       }
+
+       children = elm_box_children_get(main_box);
+       if (eina_list_count(children) == 0) {
+               evas_object_del(main_box);
+               LOGE("Preview is not exists");
+               main_box = NULL;
+       } else {
+               height += 20;
+
+               evas_object_size_hint_min_set(main_box, 0, height);
+               evas_object_size_hint_max_set(main_box, 0, height);
+               evas_object_show(main_box);
+       }
+
+       eina_list_free(children);
+
+       return main_box;
+}
+
+static Evas_Object *__list_view_preview_box_create(Evas_Object *main_box, widget_t *widget, preview_t *preview)
+{
+       LOGD("Create preview: type->%d path->%s", preview->type, preview->path);
+
+       Evas_Object *preview_layout = NULL;
+       Evas_Object *preview_img = NULL;
+       char *size_str = NULL;
+       int w = 0, h = 0;
+       int ret = 0;
+
+       if (!preview || !preview->path || !preview->type) {
+               LOGE("Path to preview image is empty");
+               return NULL;
+       }
+
+       switch (preview->type) {
+       case WIDGET_SIZE_TYPE_1x1:
+               size_str = "preview,1x1";
+               break;
+       case WIDGET_SIZE_TYPE_2x1:
+               size_str = "preview,2x1";
+               break;
+       case WIDGET_SIZE_TYPE_2x2:
+               size_str = "preview,2x2";
+               break;
+       case WIDGET_SIZE_TYPE_4x1:
+               size_str = "preview,4x1";
+               break;
+       case WIDGET_SIZE_TYPE_4x2:
+               size_str = "preview,4x2";
+               break;
+       case WIDGET_SIZE_TYPE_4x3:
+               size_str = "preview,4x3";
+               break;
+       case WIDGET_SIZE_TYPE_4x4:
+               size_str = "preview,4x4";
+               break;
+       case WIDGET_SIZE_TYPE_4x5:
+               size_str = "preview,4x5";
+               break;
+       case WIDGET_SIZE_TYPE_4x6:
+               size_str = "preview,4x6";
+               break;
+       case WIDGET_SIZE_TYPE_EASY_1x1:
+               size_str = "easy,preview,1x1";
+               break;
+       case WIDGET_SIZE_TYPE_EASY_3x1:
+               size_str = "easy,preview,3x1";
+               break;
+       case WIDGET_SIZE_TYPE_EASY_3x3:
+               size_str = "easy,preview,3x3";
+               break;
+       default:
+               return NULL;
+       }
+
+       preview_layout = elm_layout_add(main_box);
+       if (!preview_layout) {
+               LOGE("Can not create preview layout");
+               return NULL;
+       }
+
+       LOGD("Widget size_str: %s", size_str);
+       ret = elm_layout_file_set(preview_layout, util_get_res_file_path(EDJE_DIR"/preview.edj"), size_str);
+       if (ret != EINA_TRUE) {
+               LOGE("Can not set preview layout");
+               evas_object_del(preview_layout);
+               return NULL;
+       }
+
+       preview_img = evas_object_image_filled_add(evas_object_evas_get(preview_layout));
+       if (!preview_img) {
+               LOGE("Can not create image object");
+               evas_object_del(preview_layout);
+               return NULL;
+       }
+
+       int *preview_type = calloc(1, sizeof(int));
+       if (!preview_type) {
+               LOGE("Can not allocate memory for additional data");
+       }
+
+       *preview_type = preview->type;
+
+       evas_object_data_set(preview_layout, "preview_type", preview_type);
+       evas_object_event_callback_add(preview_layout, EVAS_CALLBACK_MOUSE_UP, __list_view_preview_clicked_cb, widget);
+
+       evas_object_image_file_set(preview_img, preview->path, NULL);
+       evas_object_image_size_get(preview_img, &w, &h);
+       evas_object_image_fill_set(preview_img, 0, 0, w, h);
+
+       edje_object_size_min_calc(elm_layout_edje_get(preview_layout), &w, &h);
+       evas_object_size_hint_min_set(preview_layout, w, h);
+
+       elm_object_part_content_set(preview_layout, "preview", preview_img);
+
+       return preview_layout;
+}
+
+static void __list_view_item_realized_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       LOGD("item realized_cb");
+
+       char ch[2] = {0, };
+       int ret = 0;
+       Elm_Object_Item *item = event_info;
+       widget_t *widget = NULL;
+
+
+       widget = (widget_t *)elm_object_item_data_get(item);
+
+       LOGD("item data: %s", widget->widget_id);
+       ch[0] = widget->widget_id[0];
+
+       if (strlen(ch) == 0) {
+               LOGE("Can not get first char of widget name");
+               return;
+       }
+
+       ret = view_index_set_index(ch);
+       if (ret != 0)
+               LOGE("Can not set selected index item");
+}
+
+static void __list_view_preview_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+       LOGD("Preview clicked");
+
+       widget_t *widget = NULL;
+       int w = 0, h = 0;
+       int ret = -1;
+       int *size = NULL;
+       shortcut_widget_size_e size_type;
+
+       size = evas_object_data_del(obj, "preview_type");
+       if (*size == WIDGET_SIZE_TYPE_UNKNOWN) {
+               LOGE("Can not get widgets size type");
+               return;
+       }
+
+       widget = (widget_t *)data;
+       if (!widget) {
+               LOGE("Can not get widget");
+               return;
+       }
+
+
+       ret = widget_service_get_size(*size, &w, &h);
+       if (ret != 0) {
+               LOGE("Can not get widget size");
+               return;
+       }
+
+       switch (*size) {
+       case WIDGET_SIZE_TYPE_1x1:
+               size_type = WIDGET_SIZE_1x1;
+               break;
+       case WIDGET_SIZE_TYPE_2x1:
+               size_type = WIDGET_SIZE_2x1;
+               break;
+       case WIDGET_SIZE_TYPE_2x2:
+               size_type = WIDGET_SIZE_2x2;
+               break;
+       case WIDGET_SIZE_TYPE_4x1:
+               size_type = WIDGET_SIZE_4x1;
+               break;
+       case WIDGET_SIZE_TYPE_4x2:
+               size_type = WIDGET_SIZE_4x2;
+               break;
+       case WIDGET_SIZE_TYPE_4x3:
+               size_type = WIDGET_SIZE_4x3;
+               break;
+       case WIDGET_SIZE_TYPE_4x4:
+               size_type = WIDGET_SIZE_4x4;
+               break;
+       case WIDGET_SIZE_TYPE_4x5:
+               size_type = WIDGET_SIZE_4x5;
+               break;
+       case WIDGET_SIZE_TYPE_4x6:
+               size_type = WIDGET_SIZE_4x6;
+               break;
+       case WIDGET_SIZE_TYPE_EASY_1x1:
+               size_type = WIDGET_SIZE_EASY_1x1;
+               break;
+       case WIDGET_SIZE_TYPE_EASY_3x1:
+               size_type = WIDGET_SIZE_EASY_3x1;
+               break;
+       case WIDGET_SIZE_TYPE_EASY_3x3:
+               size_type = WIDGET_SIZE_EASY_3x3;
+               break;
+       default:
+               LOGE("Invalid size type\n");
+               free(size);
+               return;
+       }
+
+       ret = shortcut_add_to_home_widget(widget->widget_id, size_type, widget->widget_id, NULL, -1.0f, 1, NULL, NULL);
+       if (ret != WIDGET_ERROR_NONE)
+               LOGE("ERROR: %s", get_error_message(ret));
+
+       free(size);
+
+       add_viewer_window_delete();
+}
+
diff --git a/src/add_viewer/view.c b/src/add_viewer/view.c
new file mode 100644 (file)
index 0000000..f5450b3
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 "conf.h"
+#include "util.h"
+
+#include "add_viewer/add_viewer.h"
+#include "add_viewer/widget.h"
+#include "add_viewer/view.h"
+
+static Evas_Object *__index_create(Evas_Object *layout, void *data);
+static void __view_index_cb(void *data, Evas_Object *obj, void *event_info);
+static int __view_compare_widget_idx(const void *data1, const void *data2);
+
+static struct {
+       Evas_Object *index;
+} s_info = {
+       .index = NULL
+};
+
+Evas_Object *view_content_create(Evas_Object *frame, void *data)
+{
+       Evas_Object *layout;
+
+       layout = elm_layout_add(frame);
+       if (!layout)
+               return NULL;
+
+       if (elm_layout_file_set(layout, util_get_res_file_path(EDJE_DIR"/preview.edj"), "content,frame") != EINA_TRUE) {
+               LOGE("Can not set layout file");
+               evas_object_del(layout);
+               return NULL;
+       }
+
+       s_info.index = __index_create(layout, data);
+       if (!s_info.index) {
+               evas_object_del(layout);
+               return NULL;
+       }
+       elm_object_part_content_set(layout, "index", s_info.index);
+
+       return layout;
+}
+
+void view_content_show(Evas_Object *layout)
+{
+       if (/*model_is_easy_mode()*/0) {
+               elm_object_signal_emit(layout, "display,easy", "container");
+       } else {
+               elm_object_signal_emit(layout, "display,normal", "container");
+       }
+}
+
+void view_content_show_index(Evas_Object *layout)
+{
+       if (/*!model_is_easy_mode()*/1) {
+               elm_object_signal_emit(layout, "display,index", "container");
+       }
+}
+
+Evas_Object *view_get_index(void)
+{
+       return s_info.index;
+}
+
+int view_index_set_index(const char *idx)
+{
+       Elm_Index_Item *item = NULL;
+
+       LOGD("Find item with idx: %s", idx);
+
+       item = elm_index_item_find(s_info.index, idx);
+       if(!item)
+       {
+               LOGE("Can not find index item");
+               return 1;
+       }
+       elm_index_item_selected_set(item, EINA_TRUE);
+
+       return 0;
+}
+
+static Evas_Object *__index_create(Evas_Object *layout, void *data)
+{
+       Evas_Object *index;
+       const char *idx_str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+       char ch[2] = {0, };
+
+       index = elm_index_add(layout);
+       elm_index_autohide_disabled_set(index, EINA_TRUE);
+       elm_index_omit_enabled_set(index, EINA_TRUE);
+               elm_index_item_append(index, "#", NULL, NULL);
+
+       int i;
+       for (i = 0; i < strlen(idx_str); ++i)
+       {
+               ch[0] = idx_str[i];
+               ch[1] = '\0';
+               elm_index_item_append(index, ch, __view_index_cb, &ch[0]);
+       }
+
+       elm_index_level_go(index, 0);
+
+       return index;
+}
+
+static void __view_index_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       char *idx_str = (char *)data;
+       Eina_List *widget_list = NULL;
+       widget_t *widget = NULL;
+
+       widget_list = widget_get_widget_list();
+       if (!widget_list) {
+               LOGE("Can not get widget list");
+               return;
+       }
+
+       widget = eina_list_search_unsorted(widget_list, __view_compare_widget_idx, idx_str);
+       if (!widget) {
+               LOGE("Can not find widget");
+               return;
+       }
+
+       elm_genlist_item_bring_in(widget->genlist_item, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+
+}
+
+static int __view_compare_widget_idx(const void *data1, const void *data2)
+{
+       widget_t *w = (widget_t *)data1;
+       char *idx_str = (char *)data2;
+
+       char c1 = 0;
+               char c2 = 0;
+
+       c1 = tolower(idx_str[0]);
+       c2 = tolower(w->widget_id[0]);
+
+       LOGD("Compare: %c == %c in %s, %s", c1, c2, idx_str, w->widget_id);
+
+       if(c1 < c2) return -1;
+       else if(c1 > c2) return 1;
+       else return 0;
+
+}
diff --git a/src/add_viewer/widget.c b/src/add_viewer/widget.c
new file mode 100644 (file)
index 0000000..fe8cf94
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * 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 <string.h>
+
+#include <widget_service.h>
+#include <widget_errno.h>
+#include <app_manager.h>
+
+#include "util.h"
+
+#include "add_viewer/widget.h"
+
+static Eina_List *widget_list;
+
+static int __widget_list_cb(const char *appid, const char *lbid, int is_prime, void *data);
+static int __widget_list_widget_append(const char *appid, const char *widget_id, void *data);
+static void __widget_list_widget_remove(widget_t *widget);
+static void __widget_list_delete(void);
+static int __widget_compare_widget_id_cb(const void *data1, const void *data2);
+
+int widget_init(void)
+{
+
+       int ret = 0;
+
+       ret = widget_service_get_widget_list(__widget_list_cb, NULL);
+       LOGD("ERROR: %s", get_error_message(ret));
+       if (ret < 0 || widget_list == NULL) {
+               LOGE("Can not create widget list, ret: %d", ret);
+               return 1;
+       }
+
+       return 0;
+}
+
+void widget_fini(void)
+{
+       __widget_list_delete();
+}
+
+Eina_List *widget_get_widget_list(void)
+{
+       return widget_list;
+}
+
+Eina_List *widget_get_widget_preview_list(widget_t *widget)
+{
+       return widget->preview_list;
+}
+
+static int __widget_list_cb(const char *app_id, const char *widget_id, int is_prime, void *data) {
+       LOGD("Widget list cb, app id = %s, widget id = %s", app_id, widget_id);
+       return __widget_list_widget_append(app_id, widget_id, data);
+}
+
+static int __widget_compare_widget_id_cb(const void *data1, const void *data2)
+{
+       int res = 0;
+       widget_t *w1 = (widget_t *)data1;
+       widget_t *w2 = (widget_t *)data2;
+
+       res = strcmp(w1->widget_id, w2->widget_id);
+
+       if (res < 0) return -1;
+       else if (res > 0) return 1;
+       else return 0;
+}
+
+static void __widget_list_delete(void)
+{
+       Eina_List *l;
+       widget_t *widget;
+
+       EINA_LIST_FOREACH(widget_list, l, widget)
+               __widget_list_widget_remove(widget);
+
+       eina_list_free(widget_list);
+       widget_list = NULL;
+}
+
+static int __widget_list_widget_append(const char *appid, const char *widget_id, void *data)
+{
+       LOGD("App id: %s", appid);
+       LOGD("Widget id: %s", widget_id);
+
+       widget_t *widget = NULL;
+       preview_t *widget_preview_type = NULL;
+
+       int *type = NULL;
+       int types_count = 0;
+       int ret = WIDGET_ERROR_NONE;
+
+/*
+       if (widget_service_get_nodisplay(widget_id)) {
+               LOGE("Widget should not be displayed");
+               return WIDGET_ERROR_NONE;
+       }
+*/
+       ret = widget_service_get_supported_size_types(widget_id, &types_count, &type);
+       if (ret != WIDGET_ERROR_NONE || types_count <= 0) {
+               LOGE("Can not get widgets supported size types");
+               return WIDGET_ERROR_FAULT; }
+
+       widget = calloc(1, sizeof(widget_t));
+       if (!widget) {
+               LOGE("Can not allocate memory for list item");
+               return WIDGET_ERROR_FAULT;
+       }
+
+       int i;
+       for (i = 0; i < types_count; ++i) {
+
+               widget_preview_type = calloc(1, sizeof(preview_t));
+               if (!widget_preview_type) {
+                       LOGE("Can not allocate memory for list item preview type");
+                       __widget_list_delete();
+                       return WIDGET_ERROR_FAULT;
+               }
+
+               widget_preview_type->path = widget_service_get_preview_image_path(widget_id, type[i]);
+               if(!widget_preview_type->path) {
+                       free(widget_preview_type);
+                       continue;
+               }
+
+               widget_preview_type->type = type[i];
+
+               widget->size_types |= type[i];
+               widget->preview_list = eina_list_append(widget->preview_list, widget_preview_type);
+       }
+
+       widget->size_types_count = types_count;
+       widget->app_id = strdup(appid);
+       widget->widget_id = strdup(widget_id);
+
+       widget_list = eina_list_sorted_insert(widget_list, __widget_compare_widget_id_cb, widget);
+       //widget_list = eina_list_append(widget_list, widget);
+
+       free(type);
+
+       return WIDGET_ERROR_NONE;
+}
+
+static void __widget_list_widget_remove(widget_t *widget)
+{
+       Eina_List *l;
+       preview_t *preview;
+
+       EINA_LIST_FOREACH(widget->preview_list, l, preview) {
+               free(preview->path);
+               free(preview);
+       }
+
+       eina_list_free(widget->preview_list);
+       free(widget->app_id);
+       free(widget->widget_id);
+       free(widget);
+}
+
+
index cd629ed..36367a3 100644 (file)
 #include <system_settings.h>
 #include <alloca.h>
 #include "homescreen-efl.h"
+#include "add_viewer/add_viewer.h"
 #include "key.h"
 #include "option_menu.h"
+#include "add_viewer/add_viewer.h"
 #include "livebox/livebox_panel.h"
 #include "livebox/livebox_utils.h"
 #include "mouse.h"
@@ -187,8 +189,14 @@ HAPI void home_screen_set_view_type(homescreen_view_t view)
                break;
        case HOMESCREEN_VIEW_HOME_EDIT:
                LOGI("HOMESCREEN_VIEW_HOME_EDIT");
+               livebox_panel_set_edit_mode_layout(true);
+               livebox_panel_change_edit_mode_state(false);
                elm_object_signal_emit(s_info.layout, SIGNAL_BOTTOM_BUTTONS_HOME_EDIT_STATE_SET, SIGNAL_SOURCE);
                break;
+       case HOMESCREEN_VIEW_HOME_ADD_VIEWER:
+               LOGI("HOMESCREEN_VIEW_ADD_VIEWER");
+               add_viewer_window_create(s_info.root_width, s_info.root_height);
+               break;
        case HOMESCREEN_VIEW_HOME_ALL_PAGES:
                LOGI("HOMESCREEN_VIEW_HOME_ALL_PAGES");
                livebox_all_pages_show();
index 503ca1d..372f536 100644 (file)
--- a/src/key.c
+++ b/src/key.c
@@ -20,6 +20,7 @@
 
 #include "homescreen-efl.h"
 #include "option_menu.h"
+#include "add_viewer/add_viewer.h"
 #include "livebox/livebox_panel.h"
 #include "livebox_all_pages.h"
 #include "folder_panel.h"
@@ -153,6 +154,9 @@ static Eina_Bool __key_release_cb(void *data, int type, void *event)
                        livebox_panel_set_edit_mode_layout(false);
                        livebox_panel_change_edit_mode_state(true);
                        break;
+               case HOMESCREEN_VIEW_HOME_ADD_VIEWER:
+                       add_viewer_window_delete();
+                       break;
                case HOMESCREEN_VIEW_HOME_ALL_PAGES:
                        /*TODO: this should be invoked in homescreen-efl.c*/
                        livebox_all_pages_hide();
@@ -163,7 +167,7 @@ static Eina_Bool __key_release_cb(void *data, int type, void *event)
                        break;
                case HOMESCREEN_VIEW_ALL_APPS_CHOOSE:
                        home_screen_close_all_apps_choose_view();
-                       if(pressed_key == HW_KEY_HOME)
+                       if (pressed_key == HW_KEY_HOME)
                                home_screen_set_view_type(HOMESCREEN_VIEW_HOME);
                        break;
                case HOMESCREEN_VIEW_ALL_APPS_EDIT:
index 901daff..fc3aa9e 100644 (file)
@@ -379,6 +379,7 @@ void livebox_panel_add_livebox(Tree_node_t *node, Evas_Object *page,
        Evas_Object *livebox = NULL;
        Evas_Object *livebox_layout = NULL;
        Evas_Object *grid = NULL;
+       int ret = 0;
 
 
        livebox_layout = elm_layout_add(s_info.livebox_page_scroller);
@@ -395,7 +396,6 @@ void livebox_panel_add_livebox(Tree_node_t *node, Evas_Object *page,
 
 #ifdef LIVEBOX_RESIZE_TEST
        livebox = elm_image_add(livebox_layout);
-       elm_image_file_set(livebox, livebox_pkgname, NULL);
 #else
        livebox = livebox_widget_add(livebox_pkgname, livebox_layout, content_info);
 #endif
@@ -408,12 +408,25 @@ void livebox_panel_add_livebox(Tree_node_t *node, Evas_Object *page,
        node->data->layout = livebox_layout;
        evas_object_data_set(livebox_layout, KEY_ICON_DATA, node);
 
-       elm_layout_file_set(livebox_layout, EDJE_LIVEBOX_LAYOUT_FILENAME,
+       ret = elm_layout_file_set(livebox_layout, util_get_res_file_path(EDJE_LIVEBOX_LAYOUT_FILENAME),
                GROUP_LIVEBOX_LAYOUT);
-       elm_layout_content_set(livebox_layout, PART_LIVEBOX, livebox);
+       if (ret != EINA_TRUE) {
+               LOGE("Can not set layout file");
+               return;
+       }
+
+       ret = elm_layout_content_set(livebox_layout, PART_LIVEBOX, livebox);
+       if (ret != EINA_TRUE) {
+               LOGE("Can not set layout file");
+               return;
+       }
+
        evas_object_size_hint_weight_set(livebox_layout, EVAS_HINT_EXPAND,
                EVAS_HINT_EXPAND);
+
+       evas_object_show(livebox);
        evas_object_show(livebox_layout);
+
        elm_layout_signal_callback_add(livebox_layout, SIGNAL_CLICKED,
                SIGNAL_REMOVE_SOURCE, __livebox_panel_del_cb, NULL);
 
index 69e276a..7124468 100644 (file)
@@ -366,7 +366,7 @@ static int __livebox_widget_get_pkg_list_cb(const char *pkg_id, const char *widg
        return 0;
 }
 
-static void livebox_widget_new(int widget_width, int widget_height, const char *content_info)
+static void livebox_widget_new(int widget_width, int widget_height, const char *appid)
 {
        int page_index = -1;
        int pos_x = 0;
@@ -414,14 +414,14 @@ static void livebox_widget_new(int widget_width, int widget_height, const char *
                }
        }
 
-       item_node = data_model_add_widget(page_node, content_info, pos_x, pos_y, widget_width, widget_height, NULL);
+       item_node = data_model_add_widget(page_node, appid, pos_x, pos_y, widget_width, widget_height, NULL);
        if (!item_node) {
                LOGE("item == NULL");
                return;
        }
 
        elm_scroller_page_bring_in(livebox_panel_get(), page_index, 0);
-       livebox_panel_add_livebox(item_node, page, content_info, pos_x, pos_y, widget_width, widget_height, NULL);
+       livebox_panel_add_livebox(item_node, page, appid, pos_x, pos_y, widget_width, widget_height, NULL);
        livebox_panel_update_dynamic_index();
 }
 
@@ -481,7 +481,7 @@ static int request_cb(const char *appid, const char *name, int type,
 
        LOGI("Widget will be added: %dx%d\n", widget_width, widget_height);
 
-       livebox_widget_new(widget_width, widget_height, content_info);
+       livebox_widget_new(widget_width, widget_height, appid);
        home_screen_print_tree();
 
        return 0; /*returns success. */
index cf0e6f9..7af4cbf 100644 (file)
@@ -180,8 +180,6 @@ static void __option_menu_entry_all_apps_edit_apps_cb(void *data, Evas_Object *o
 static void __option_menu_entry_all_apps_edit_home_cb(void *data, Evas_Object *obj, void *event_info)
 {
        home_screen_set_view_type(HOMESCREEN_VIEW_HOME_EDIT);
-       livebox_panel_set_edit_mode_layout(true);
-       livebox_panel_change_edit_mode_state(false);
        option_menu_hide();
 }
 
@@ -215,27 +213,8 @@ static void __option_menu_entry_all_apps_add_widget_cb(void *data, Evas_Object *
 {
        LOGD("__option_menu_entry_all_apps_add_widget_cb");
 
-       const char *appid = OPTION_MENU_ADD_VIEWER;
-       app_control_h app_control_handle = NULL;
-
-       if (app_control_create(&app_control_handle) != APP_CONTROL_ERROR_NONE) {
-               LOGE("[FAILED][app_control_create]");
-               return;
-       }
+       home_screen_set_view_type(HOMESCREEN_VIEW_HOME_ADD_VIEWER);
 
-       if (app_control_set_app_id(app_control_handle, appid) != APP_CONTROL_ERROR_NONE) {
-               LOGE("[FAILED][app_control_set_app_id]");
-               app_control_destroy(app_control_handle);
-               return;
-       }
-
-       if (app_control_send_launch_request(app_control_handle, _launch_request_cb, NULL) != APP_CONTROL_ERROR_NONE) {
-               LOGE("[FAILED][app_control_send_launch_request]");
-               app_control_destroy(app_control_handle);
-               return;
-       }
-
-       app_control_destroy(app_control_handle);
        option_menu_hide();
 }
 
index 5a64698..308f9ba 100644 (file)
@@ -161,8 +161,6 @@ HAPI Evas_Object* page_scroller_get_page(Evas_Object *scroller, int n)
 
 HAPI bool page_scroller_freeze(Evas_Object *scroller)
 {
-       LOGD("Freeze page scroller");
-
        if (!scroller) {
                LOGE("Page Scroller is NULL");
                return false;
@@ -175,8 +173,6 @@ HAPI bool page_scroller_freeze(Evas_Object *scroller)
 
 HAPI bool page_scroller_unfreeze(Evas_Object *scroller)
 {
-       LOGD("Unfreeze page scroller");
-
        if (!scroller) {
                LOGE("Page Scroller is NULL");
                return false;
@@ -334,7 +330,7 @@ static Evas_Object* __page_scroller_create_scroller(void)
        Evas_Object *box = NULL;
 
        if (!win) {
-               LOGD("Window doesn't exist");
+               LOGE("Window doesn't exist");
                return NULL;
        }