From 2b530a8ed593b9418c7c8fa9f7fe44d0e521a486 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Mon, 14 Sep 2015 12:25:36 +0200 Subject: [PATCH 01/16] Refactoring - removed genlist from Quick Access tiles. [Issue] N/A [Problem] Genlist were unneeded for tiles. [Cause] N/A [Solution] Removed genlist, added aditional swallows for tiles. Change-Id: I9a561d2973c9db0b70f413792dfdab4a2e7c24ab Signed-off-by: Maciej Skrzypkowski --- services/MainUI/DetailPopup.cpp | 1 + services/MainUI/MainUI.cpp | 176 ++++------- services/MainUI/MainUI.h | 19 +- services/MainUI/edc/MainUI.edc | 638 ++++++++++++++++++++-------------------- 4 files changed, 382 insertions(+), 452 deletions(-) diff --git a/services/MainUI/DetailPopup.cpp b/services/MainUI/DetailPopup.cpp index 9d2f1ea..a058691 100644 --- a/services/MainUI/DetailPopup.cpp +++ b/services/MainUI/DetailPopup.cpp @@ -101,6 +101,7 @@ void DetailPopup::hide() evas_object_smart_callback_del(m_historyList, "pressed", _history_url_click); elm_genlist_clear(m_historyList); evas_object_hide(m_layout); + evas_object_del(m_layout); } void DetailPopup::_bg_click(void* data, Evas_Object*, const char*, const char*) diff --git a/services/MainUI/MainUI.cpp b/services/MainUI/MainUI.cpp index 1367a87..afddf7c 100644 --- a/services/MainUI/MainUI.cpp +++ b/services/MainUI/MainUI.cpp @@ -31,12 +31,19 @@ namespace tizen_browser{ namespace base_ui{ -const int SMALL_TILES_ROWS = 2; -const int MAX_TILES_NUMBER = 5; +EXPORT_SERVICE(MainUI, "org.tizen.browser.mainui") + +const int MainUI::MAX_TILES_NUMBER = 5; const int MainUI::MAX_THUMBNAIL_WIDTH = 840; const int MainUI::MAX_THUMBNAIL_HEIGHT = 648; - -EXPORT_SERVICE(MainUI, "org.tizen.browser.mainui") +const int MainUI::BIG_TILE_INDEX = 0; +const std::vector MainUI::TILES_NAMES = { + "elm.swallow.big", + "elm.swallow.small_first", + "elm.swallow.small_second", + "elm.swallow.small_third", + "elm.swallow.small_fourth" +}; typedef struct _HistoryItemData { @@ -53,16 +60,11 @@ typedef struct _BookmarkItemData MainUI::MainUI() : m_parent(nullptr) , m_layout(nullptr) - , m_bookmarksButton(nullptr) - , m_mostVisitedButton(nullptr) , m_bookmarksView(nullptr) , m_mostVisitedView(nullptr) + , m_bookmarksButton(nullptr) + , m_mostVisitedButton(nullptr) , m_bookmarkGengrid(nullptr) - , m_genListLeft(nullptr) - , m_genListCenter(nullptr) - , m_genListRight(nullptr) - , m_big_item_class(nullptr) - , m_small_item_class(nullptr) , m_bookmark_item_class(nullptr) , m_detailPopup(this) { @@ -76,32 +78,12 @@ MainUI::MainUI() MainUI::~MainUI() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - elm_genlist_item_class_free(m_big_item_class); - elm_genlist_item_class_free(m_small_item_class); elm_gengrid_item_class_free(m_bookmark_item_class); } void MainUI::createItemClasses() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - if (!m_big_item_class) { - m_big_item_class = elm_genlist_item_class_new(); - m_big_item_class->item_style = "big_grid_item"; - m_big_item_class->func.text_get = _grid_text_get; - m_big_item_class->func.content_get = _grid_content_get; - m_big_item_class->func.state_get = nullptr; - m_big_item_class->func.del = nullptr; - } - - if (!m_small_item_class) { - m_small_item_class = elm_genlist_item_class_new(); - m_small_item_class->item_style = "small_grid_item"; - m_small_item_class->func.text_get = _grid_text_get; - m_small_item_class->func.content_get = _grid_content_get; - m_small_item_class->func.state_get = nullptr; - m_small_item_class->func.del = nullptr; - } - if (!m_bookmark_item_class) { m_bookmark_item_class = elm_gengrid_item_class_new(); m_bookmark_item_class->item_style = "grid_item"; @@ -150,37 +132,6 @@ Evas_Object* MainUI::createMostVisitedView (Evas_Object * parent) evas_object_size_hint_weight_set(mostVisitedLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set (mostVisitedLayout, EVAS_HINT_FILL, EVAS_HINT_FILL); - Evas_Object* genListLeft = elm_genlist_add(mostVisitedLayout); - - elm_genlist_homogeneous_set(genListLeft, EINA_FALSE); - elm_genlist_multi_select_set(genListLeft, EINA_FALSE); - elm_genlist_select_mode_set(genListLeft, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_genlist_mode_set(genListLeft, ELM_LIST_LIMIT); - evas_object_size_hint_weight_set(genListLeft, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_object_part_content_set(mostVisitedLayout, "elm.swallow.left", genListLeft); - m_genListLeft = genListLeft; - - Evas_Object* genListCenter = elm_genlist_add(mostVisitedLayout); - elm_genlist_homogeneous_set(genListCenter, EINA_FALSE); - elm_genlist_multi_select_set(genListCenter, EINA_FALSE); - elm_genlist_select_mode_set(genListCenter, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_genlist_mode_set(genListCenter, ELM_LIST_LIMIT); - evas_object_size_hint_weight_set(genListCenter, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_object_part_content_set(mostVisitedLayout, "elm.swallow.center", genListCenter); - m_genListCenter = genListCenter; - - Evas_Object* genListRight = elm_genlist_add(mostVisitedLayout); - elm_genlist_homogeneous_set(genListRight, EINA_FALSE); - elm_genlist_multi_select_set(genListRight, EINA_FALSE); - elm_genlist_select_mode_set(genListRight, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_genlist_mode_set(genListRight, ELM_LIST_LIMIT); - evas_object_size_hint_weight_set(genListRight, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_object_part_content_set(mostVisitedLayout, "elm.swallow.right", genListRight); - m_genListRight=genListRight; - Evas_Object* topButtons = createTopButtons(mostVisitedLayout); elm_object_part_content_set(mostVisitedLayout, "elm.swallow.layoutTop", topButtons); @@ -272,21 +223,21 @@ Evas_Object* MainUI::createBottomButton(Evas_Object *parent) return layoutBottom; } -void MainUI::_mostVisited_clicked(void * data, Evas_Object * /* obj */, void * event_info) +void MainUI::_mostVisited_clicked(void * data, Evas_Object *, void *) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); MainUI* mainUI = reinterpret_cast(data); mainUI->mostVisitedClicked(std::string()); } -void MainUI::_bookmark_clicked(void * data, Evas_Object * /* obj */, void * event_info) +void MainUI::_bookmark_clicked(void * data, Evas_Object *, void *) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); MainUI* mainUI = reinterpret_cast(data); mainUI->bookmarkClicked(std::string()); } -void MainUI::_bookmark_manager_clicked(void * data, Evas_Object * /* obj */, void * event_info) +void MainUI::_bookmark_manager_clicked(void * data, Evas_Object *, void *) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); MainUI* mainUI = static_cast(data); @@ -296,33 +247,38 @@ void MainUI::_bookmark_manager_clicked(void * data, Evas_Object * /* obj */, voi void MainUI::addHistoryItem(std::shared_ptr hi) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - if (m_map_history_views.size() >= MAX_TILES_NUMBER) - return; + M_ASSERT(m_historyItems.size() < MAX_TILES_NUMBER); + int tileNumber = m_historyItems.size(); HistoryItemData *itemData = new HistoryItemData(); itemData->item = hi; itemData->mainUI = std::shared_ptr(this); - Elm_Object_Item* historyView = nullptr; - - if (m_map_history_views.empty()) - { - BROWSER_LOGD("%s:%d %s m_map_history_views.size %d", __FILE__, __LINE__, __func__, m_map_history_views.size()); - historyView = elm_genlist_item_append(m_genListLeft, m_big_item_class, itemData, nullptr, ELM_GENLIST_ITEM_NONE, nullptr, this); - } else if (m_map_history_views.size() <= SMALL_TILES_ROWS) { - BROWSER_LOGD("%s:%d %s m_map_history_views.size %d", __FILE__, __LINE__, __func__, m_map_history_views.size()); - historyView = elm_genlist_item_append(m_genListCenter, m_small_item_class, itemData, nullptr, ELM_GENLIST_ITEM_NONE, nullptr, this); - } else { - BROWSER_LOGD("%s:%d %s m_map_history_views.size %d", __FILE__, __LINE__, __func__, m_map_history_views.size()); - historyView = elm_genlist_item_append(m_genListRight, m_small_item_class, itemData, nullptr, ELM_GENLIST_ITEM_NONE, nullptr, this); - } - m_map_history_views.insert(std::pair(hi->getUrl(),historyView)); + Evas_Object* tile = elm_layout_add(m_mostVisitedView); + if (tileNumber == BIG_TILE_INDEX) + elm_layout_file_set(tile, edjFilePath.c_str(), "big_tile"); + else + elm_layout_file_set(tile, edjFilePath.c_str(), "small_tile"); + evas_object_size_hint_weight_set(tile, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set (tile, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(tile); + elm_object_part_content_set(m_mostVisitedView, TILES_NAMES[tileNumber].c_str(), tile); + m_tiles.push_back(tile); + + elm_layout_text_set(tile, "page_title", hi->getTitle().c_str()); + elm_layout_text_set(tile, "page_url", hi->getUrl().c_str()); + Evas_Object * thumb = tizen_browser::tools::EflTools::getEvasImage(hi->getThumbnail(), m_parent); + elm_object_part_content_set(tile, "elm.thumbnail", thumb); + edje_object_signal_callback_add(elm_layout_edje_get(tile), "mouse,clicked,1", "over", _thumbClicked, itemData); + + m_historyItems.push_back(hi); } void MainUI::addHistoryItems(std::shared_ptr items) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); int i = 0; + m_historyItems.clear(); for (auto it = items->begin(); it != items->end(); ++it) { i++; if (i > MAX_TILES_NUMBER) @@ -354,17 +310,6 @@ void MainUI::addBookmarkItems(std::vector(data); - if (!strcmp(part, "page_title")) { - return strdup(itemData->item->getTitle().c_str()); - } - if (!strcmp(part, "page_url")) { - return tools::clearURL(itemData->item->getUrl()); - } - return strdup(""); -} char* MainUI::_grid_bookmark_text_get(void *data, Evas_Object *, const char *part) { @@ -378,29 +323,6 @@ char* MainUI::_grid_bookmark_text_get(void *data, Evas_Object *, const char *par return strdup(""); } -Evas_Object * MainUI::_grid_content_get(void *data, Evas_Object *obj, const char *part) -{ - BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part); - HistoryItemData *itemData = reinterpret_cast(data); - - if (!strcmp(part, "elm.thumbnail")) { - if (itemData->item->getThumbnail()) { - Evas_Object * thumb = tizen_browser::tools::EflTools::getEvasImage(itemData->item->getThumbnail(), itemData->mainUI->m_parent); - return thumb; - } - else { - return nullptr; - } - } - else if (!strcmp(part, "elm.thumbButton")) { - Evas_Object *thumbButton = elm_button_add(obj); - elm_object_style_set(thumbButton, "thumbButton"); - evas_object_smart_callback_add(thumbButton, "clicked", _thumbSelected, data); - return thumbButton; - } - return nullptr; -} - Evas_Object * MainUI::_grid_bookmark_content_get(void *data, Evas_Object *obj, const char *part) { BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part); @@ -424,8 +346,16 @@ Evas_Object * MainUI::_grid_bookmark_content_get(void *data, Evas_Object *obj, c return nullptr; } -void MainUI::_thumbSelected(void * data, Evas_Object * /* obj */, void * /* event_info */) +void MainUI::_thumbSelected(void * data, Evas_Object * , void *) { + BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); + HistoryItemData * itemData = reinterpret_cast(data); + itemData->mainUI->mostVisitedTileClicked(itemData->item, DetailPopup::HISTORY_ITEMS_NO); +} + +void MainUI::_thumbClicked(void* data, Evas_Object *, const char *, const char *) +{ + BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); HistoryItemData * itemData = reinterpret_cast(data); itemData->mainUI->mostVisitedTileClicked(itemData->item, DetailPopup::HISTORY_ITEMS_NO); } @@ -434,10 +364,10 @@ void MainUI::clearHistoryGenlist() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - elm_genlist_clear(m_genListRight); - elm_genlist_clear(m_genListLeft); - elm_genlist_clear(m_genListCenter); - m_map_history_views.clear(); + for (auto it = m_tiles.begin(); it != m_tiles.end(); ++it) + edje_object_signal_callback_del(elm_layout_edje_get(*it), "mouse,clicked,1", "over", _thumbClicked); + + m_historyItems.clear(); } void MainUI::showHistory() @@ -455,7 +385,7 @@ void MainUI::showHistory() elm_object_focus_set(m_mostVisitedButton, true); - if (m_map_history_views.empty()) { + if (m_historyItems.empty()) { setEmptyView(true); return; } @@ -511,10 +441,6 @@ void MainUI::openDetailPopup(std::shared_ptr currItem, st void MainUI::showNoHistoryLabel() { - evas_object_hide(elm_object_part_content_get(m_mostVisitedView, "elm.swallow.left")); - evas_object_hide(elm_object_part_content_get(m_mostVisitedView, "elm.swallow.right")); - evas_object_hide(elm_object_part_content_get(m_mostVisitedView, "elm.swallow.center")); - elm_layout_text_set(m_mostVisitedView, "elm.text.empty", "No visited site"); elm_layout_signal_emit(m_mostVisitedView, "empty,view", "mainui"); } diff --git a/services/MainUI/MainUI.h b/services/MainUI/MainUI.h index 9814981..7994674 100644 --- a/services/MainUI/MainUI.h +++ b/services/MainUI/MainUI.h @@ -75,14 +75,10 @@ private: Evas_Object* createBottomButton(Evas_Object *parent); Evas_Object* createTopButtons(Evas_Object *parent); - static char* _grid_text_get(void *data, Evas_Object *obj, const char *part); - static Evas_Object * _grid_content_get(void *data, Evas_Object *obj, const char *part); static char* _grid_bookmark_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object * _grid_bookmark_content_get(void *data, Evas_Object *obj, const char *part); - static void _itemSelected(void * data, Evas_Object * obj, void * event_info); - static void _item_deleted(void *data, Evas_Object *obj); static void _thumbSelected(void * data, Evas_Object * obj, void * event_info); - static void _deleteBookmark(void *data, Evas_Object *obj, void *event_info); + static void _thumbClicked(void *data, Evas_Object *obj, const char *emission, const char *source); void setEmptyView(bool empty); void showNoHistoryLabel(); @@ -97,20 +93,19 @@ private: Evas_Object *m_bookmarksButton; Evas_Object *m_mostVisitedButton; Evas_Object *m_bookmarkGengrid; - Evas_Object *m_genListLeft; - Evas_Object *m_genListCenter; - Evas_Object *m_genListRight; + std::vector m_tiles; - Elm_Gengrid_Item_Class * m_big_item_class; - Elm_Gengrid_Item_Class * m_small_item_class; Elm_Gengrid_Item_Class * m_bookmark_item_class; - DetailPopup m_detailPopup; - std::multimap m_map_history_views; + services::HistoryItemVector m_historyItems; std::map m_map_bookmark_views; bool m_gengridSetup; std::string edjFilePath; bool m_desktopMode; + + static const int MAX_TILES_NUMBER; + static const int BIG_TILE_INDEX; + static const std::vector TILES_NAMES; }; } diff --git a/services/MainUI/edc/MainUI.edc b/services/MainUI/edc/MainUI.edc index 030e8dd..0625a90 100644 --- a/services/MainUI/edc/MainUI.edc +++ b/services/MainUI/edc/MainUI.edc @@ -20,43 +20,33 @@ collections { #define ITEM_WIDTH 374 #define PARENT_ITEM_HEIGHT 36 - group{ - name: "elm/button/base/invisible_button"; - parts{ - part{ - name: "button"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - color: 0 0 0 0; - } - } - part{ - name: "over"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "button";} - rel2 { relative: 1.0 1.0;to: "button";} - color: 0 0 0 0; - } +group{ + name: "elm/button/base/invisible_button"; + parts{ + part{ + name: "button"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + fixed: 1 1; + color: 0 0 0 0; } } - programs{ - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } + part{ + name: "over"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + fixed: 1 1; + rel1 { relative: 0.0 0.0;to: "button";} + rel2 { relative: 1.0 1.0;to: "button";} + color: 0 0 0 0; } } } +} group { name: "elm/button/base/thumbButton"; images { @@ -90,243 +80,314 @@ group { name: "mv_bookmarks"; data { item: "focus_highlight" "off"; } - images { - image: "web_shadow.png" COMP; - } - color_classes{ - color_class{ - name: "defaultBgColor"; - color: 18 22 34 255; - } - color_class{ - name: "focusBgColor"; - color: 0 119 246 255; + images { + image: "web_shadow.png" COMP; + } + color_classes{ + color_class{ + name: "defaultBgColor"; + color: 18 22 34 255; + } + color_class{ + name: "focusBgColor"; + color: 0 119 246 255; + } + color_class{ + name: "imageHighlight"; + color: 255 255 255 102; + } + color_class{ + name: "focusbtBgColor"; + color: 22 120 224 255; + } + color_class{ + name: "titleTextColor"; + color: 74 74 74 255; + } + color_class{ + name: "focusTextColor"; + color: 255 255 255 255; + } + color_class{ + name: "highlightTextColor"; + color: 255 255 255 51; + } + color_class{ + name: "urlTextColor"; + color: 116 116 116 204; + } + color_class{ + name: "transparent"; + color: 0 0 0 0; + } + } + + parts { + part { name: "layoutTop_bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 255 255 255 255; + min: 0 181; + max: -1 181; + align: 0.0 0.0; + fixed: 0 0; + rel1 { + relative: 0 0; offset: 0 104; + } + rel2{ + relative: 1 1; + } } - color_class{ - name: "imageHighlight"; - color: 255 255 255 102; + } + part { name: "gengrid_bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 255 255 255 255; + min: 1920 626; + max: -1 626; + align: 0.0 0.0; + fixed: 0 0; + rel1 { + to: "layoutTop_bg"; + relative: 0 1; + } + rel2{ + relative: 1 1; + } } - color_class{ - name: "focusbtBgColor"; - color: 22 120 224 255; + } + part { name: "layoutBottom_bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 255 255 255 255; + min: 1920 181; + max: 1920 181; + align: 0.0 0.0; + fixed: 0 0; + rel1 { + relative: 0 1; to: "gengrid_bg"; + } + rel2{ + relative: 1 1; + } } - color_class{ - name: "titleTextColor"; - color: 74 74 74 255; + } + + part { name: "elm.swallow.grid"; + type: SWALLOW; + description { state: "default" 0.0; + min: 1920 614; + max: 1920 614; + align: 0.0 0.0; + fixed: 0 0; + rel1 { + relative: 0 0; to: "gengrid_bg"; offset: 63 0; + } + rel2 { + relative: 1 1; + offset: 0 0; + } } - color_class{ - name: "focusTextColor"; - color: 255 255 255 255; + } + + part { name: "center_rect"; + type: RECT; + description { state: "default" 0.0; + min: 1592 614; + max: 1592 614; + visible: 0; + align: 0.5 0.0; + rel1 { + to: "gengrid_bg"; + relative: 0 0; + } + rel2 { + to: "gengrid_bg"; + relative: 1 1; + } } - color_class{ - name: "highlightTextColor"; - color: 255 255 255 51; + description { state: "empty" 0.0; + inherit: "default" 0.0; + visible: 1; + color: 229 229 229 255; } - color_class{ - name: "urlTextColor"; - color: 116 116 116 204; + } + + part { name: "elm.swallow.big"; + type: SWALLOW; + description { state: "default" 0.0; + min: 784 614; + max: 784 614; + align: 0.0 0.0; + fixed: 0 0; + visible: 1; + rel1 { + relative: 0 0; to: "center_rect"; + } + rel2 { + relative: 1 1; + offset: 0 0; + } } - color_class{ - name: "transparent"; - color: 0 0 0 0; + description { state: "empty" 0.0; + inherit: "default" 0.0; + visible: 0; } } - parts { - part { name: "layoutTop_bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - min: 0 181; - max: -1 181; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - relative: 0 0; offset: 0 104; - } - rel2{ - relative: 1 1; - } + part { name: "elm.swallow.small_first"; + type: SWALLOW; + description { state: "default" 0.0; + min: 378 294; + max: 378 294; + align: 0.0 0.0; + fixed: 0 0; + visible: 1; + rel1 { + to: "center_rect"; + relative: 0 0; + offset: 810 0; } - } - part { name: "gengrid_bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - min: 1920 626; - max: -1 626; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - to: "layoutTop_bg"; - relative: 0 1; - } - rel2{ - relative: 1 1; - } + rel2{ + to: "center_rect"; + relative: 1 1; + offset: 0 0; } } - part { name: "layoutBottom_bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - min: 1920 181; - max: 1920 181; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - relative: 0 1; to: "gengrid_bg"; - } - rel2{ - relative: 1 1; - } - } + description { state: "empty" 0.0; + inherit: "default" 0.0; + visible: 0; } + } - part { name: "elm.swallow.grid"; - type: SWALLOW; - description { state: "default" 0.0; - min: 1920 614; - max: 1920 614; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - relative: 0 0; to: "gengrid_bg"; offset: 63 0; - } - rel2 { - relative: 1 1; - offset: 0 0; - } + part { name: "elm.swallow.small_second"; + type: SWALLOW; + description { state: "default" 0.0; + min: 378 294; + max: 378 294; + align: 0.0 0.0; + fixed: 0 0; + visible: 1; + rel1 { + to: "center_rect"; + relative: 0 0; + offset: 810 320; + } + rel2{ + to: "center_rect"; + relative: 1 1; + offset: 0 0; } } + description { state: "empty" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } - part { name: "center_rect"; - type: RECT; - description { state: "default" 0.0; - min: 1592 614; - max: 1592 614; - visible: 0; - align: 0.5 0.0; - rel1 { - to: "gengrid_bg"; - relative: 0 0; - } - rel2 { - to: "gengrid_bg"; - relative: 1 1; - } + part { name: "elm.swallow.small_third"; + type: SWALLOW; + description { state: "default" 0.0; + min: 378 294; + max: 378 294; + align: 0.0 0.0; + fixed: 0 0; + visible: 1; + rel1 { + to: "center_rect"; + relative: 0 0; + offset: 1214 0; } - description { state: "empty" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 229 229 229 255; + rel2 { + to: "center_rect"; + relative: 1 1; + offset: 0 0; } } - part { name: "elm.swallow.left"; - type: SWALLOW; - description { state: "default" 0.0; - min: 784 614; - max: 784 614; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - relative: 0 0; to: "center_rect"; - } - rel2 { - relative: 1 1; - offset: 0 0; - } - } + description { state: "empty" 0.0; + inherit: "default" 0.0; + visible: 0; } - part { name: "elm.swallow.center"; - type: SWALLOW; - description { state: "default" 0.0; - min: 378 614; - max: 378 614; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - to: "center_rect"; - relative: 0 0; - offset: 810 0; - } - rel2{ - to: "center_rect"; - relative: 1 1; - offset: 0 0; - } + } + + part { name: "elm.swallow.small_fourth"; + type: SWALLOW; + description { state: "default" 0.0; + min: 378 294; + max: 378 294; + align: 0.0 0.0; + fixed: 0 0; + visible: 1; + rel1 { + to: "center_rect"; + relative: 0 0; + offset: 1214 320; } - } - part { name: "elm.swallow.right"; - type: SWALLOW; - description { state: "default" 0.0; - min: 378 614; - max: 378 614; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - to: "center_rect"; - relative: 0 0; - offset: 1214 0; - } - rel2 { - to: "center_rect"; - relative: 1 1; - offset: 0 0; - } + rel2 { + to: "center_rect"; + relative: 1 1; + offset: 0 0; } } + description { state: "empty" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } - part { name: "elm.swallow.layoutTop"; - type: SWALLOW; - description { state: "default" 0.0; - min: 1920 181; - max: 1920 181; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - relative: 0 0; to: "layoutTop_bg"; - } - rel2 { - relative: 1 1; - offset: 0 0; - } + part { name: "elm.swallow.layoutTop"; + type: SWALLOW; + description { state: "default" 0.0; + min: 1920 181; + max: 1920 181; + align: 0.0 0.0; + fixed: 0 0; + rel1 { + relative: 0 0; to: "layoutTop_bg"; + } + rel2 { + relative: 1 1; + offset: 0 0; } } - part { name: "uri_bar_shadow"; - type: IMAGE; - scale: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 0; - min: 1920 14; - max: 1920 14; - image.normal: "web_shadow.png"; - rel1 { relative: 0.0 0.0; to: "elm.swallow.layoutTop"; } - rel2 { relative: 1.0 1.0; } + } + + part { name: "uri_bar_shadow"; + type: IMAGE; + scale: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 0 0; + min: 1920 14; + max: 1920 14; + image.normal: "web_shadow.png"; + rel1 { relative: 0.0 0.0; to: "elm.swallow.layoutTop"; } + rel2 { relative: 1.0 1.0; } + } + } + + part { name: "elm.swallow.layoutBottom"; + type: SWALLOW; + description { state: "default" 0.0; + min: 1920 181; + max: 1920 181; + align: 0.0 0.0; + fixed: 0 0; + rel1 { + to: "layoutBottom_bg"; + relative: 0 0; } - } - part { name: "elm.swallow.layoutBottom"; - type: SWALLOW; - description { state: "default" 0.0; - min: 1920 181; - max: 1920 181; - align: 0.0 0.0; - fixed: 0 0; - rel1 { - relative: 0 0; to: "layoutBottom_bg"; - } - rel2 { - relative: 1 1; - offset: 0 0; - } + rel2 { + relative: 1 1; + offset: 0 0; } + } } part { name: "elm.text.empty"; @@ -362,6 +423,11 @@ group { name: "mv_bookmarks"; signal: "empty,view"; source: "mainui"; action: STATE_SET "empty" 0.0; + target: "elm.swallow.big"; + target: "elm.swallow.small_first"; + target: "elm.swallow.small_second"; + target: "elm.swallow.small_third"; + target: "elm.swallow.small_fourth"; target: "elm.text.empty"; target: "center_rect"; } @@ -371,13 +437,18 @@ group { name: "mv_bookmarks"; action: STATE_SET "default" 0.0; target: "elm.text.empty"; target: "center_rect"; + target: "elm.swallow.big"; + target: "elm.swallow.small_first"; + target: "elm.swallow.small_second"; + target: "elm.swallow.small_third"; + target: "elm.swallow.small_fourth"; } } } -group { name: "elm/genlist/item/big_grid_item/default"; +group { name: "big_tile"; data.item: "texts" "page_title page_url"; - data.item: "contents" "elm.thumbnail elm.thumbButton"; + data.item: "contents" "elm.thumbnail"; min: 600 614; max: 600 614; images { @@ -531,14 +602,6 @@ group { name: "elm/genlist/item/big_grid_item/default"; align: 0 0.5; } } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - //color_class: highlightTextColor; - } } part { name: "page_url"; @@ -564,25 +627,9 @@ group { name: "elm/genlist/item/big_grid_item/default"; align: 0 0.5; } } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - //color_class: highlightTextColor; - } } - part { name: "elm.thumbButton"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - - part { name: "over2"; + part { name: "over"; type: RECT; mouse_events: 1; repeat_events: 1; @@ -592,22 +639,12 @@ group { name: "elm/genlist/item/big_grid_item/default"; rel2.to: "background"; } } - part { name: "over3"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "background"; - rel2.to: "background"; - } - } } programs{ program { name: "mouse_in"; signal: "mouse,in"; - source: "over2"; + source: "over"; action: STATE_SET "selected" 0.0; target: "background"; target: "border_top"; @@ -616,7 +653,7 @@ group { name: "elm/genlist/item/big_grid_item/default"; } program { name: "mouse_out"; signal: "mouse,out"; - source: "over2"; + source: "over"; action: STATE_SET "default" 0.0; target: "background"; target: "border_top"; @@ -626,9 +663,9 @@ group { name: "elm/genlist/item/big_grid_item/default"; } } -group { name: "elm/genlist/item/small_grid_item/default"; +group { name: "small_tile"; data.item: "texts" "page_title page_url"; - data.item: "contents" "elm.thumbnail elm.thumbButton"; + data.item: "contents" "elm.thumbnail"; images { image: "web_frame_selected.png" COMP; image: "ico_bg_round_shape_37x37.png" COMP; @@ -839,15 +876,7 @@ group { name: "elm/genlist/item/small_grid_item/default"; } } - part { name: "elm.thumbButton"; - type: SWALLOW; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - - part { name: "over2"; + part { name: "over"; type: RECT; mouse_events: 1; repeat_events: 1; @@ -857,23 +886,12 @@ group { name: "elm/genlist/item/small_grid_item/default"; rel2.to: "background"; } } - - part { name: "over3"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "background"; - rel2.to: "background"; - } - } } programs { program { name: "mouse_in"; signal: "mouse,in"; - source: "over2"; + source: "over"; action: STATE_SET "selected" 0.0; target: "background"; target: "border_top"; @@ -882,7 +900,7 @@ group { name: "elm/genlist/item/small_grid_item/default"; } program { name: "mouse_out"; signal: "mouse,out"; - source: "over2"; + source: "over"; action: STATE_SET "default" 0.0; target: "background"; target: "border_top"; @@ -1053,7 +1071,7 @@ group { name: "elm/gengrid/item/grid_item/default"; } } - part { name: "over2"; + part { name: "over"; type: RECT; mouse_events: 1; repeat_events: 1; @@ -1063,22 +1081,12 @@ group { name: "elm/gengrid/item/grid_item/default"; rel2.to: "background"; } } - part { name: "over3"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "background"; - rel2.to: "background"; - } - } } programs{ program { name: "mouse_in"; signal: "mouse,in"; - source: "over2"; + source: "over"; action: STATE_SET "selected" 0.0; target: "background"; target: "focus_highlight"; @@ -1086,7 +1094,7 @@ group { name: "elm/gengrid/item/grid_item/default"; } program { name: "mouse_out"; signal: "mouse,out"; - source: "over2"; + source: "over"; action: STATE_SET "default" 0.0; target: "background"; target: "focus_highlight"; -- 2.7.4 From 571cf603958864b0df21cb070d5b7a281c11d2e6 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Mon, 14 Sep 2015 13:07:04 +0200 Subject: [PATCH 02/16] Added proper handler for bookmark click in Quick Access view. [Issue] N/A [Problem] Clicking on bookmark caused opening popup or crashing. [Cause] Wrong callback was assigned to bookmark click. [Solution] Changed callback to opening new tab. Change-Id: I85dbaa29ba83005e25a4796f80a80c901a23a1f9 Signed-off-by: Maciej Skrzypkowski --- services/MainUI/MainUI.cpp | 6 +++--- services/MainUI/MainUI.h | 3 ++- services/SimpleUI/SimpleUI.cpp | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/services/MainUI/MainUI.cpp b/services/MainUI/MainUI.cpp index afddf7c..3822075 100644 --- a/services/MainUI/MainUI.cpp +++ b/services/MainUI/MainUI.cpp @@ -340,17 +340,17 @@ Evas_Object * MainUI::_grid_bookmark_content_get(void *data, Evas_Object *obj, c else if (!strcmp(part, "elm.thumbButton")) { Evas_Object *thumbButton = elm_button_add(obj); elm_object_style_set(thumbButton, "thumbButton"); - evas_object_smart_callback_add(thumbButton, "clicked", _thumbSelected, data); + evas_object_smart_callback_add(thumbButton, "clicked", _thumbBookmarkClicked, data); return thumbButton; } return nullptr; } -void MainUI::_thumbSelected(void * data, Evas_Object * , void *) +void MainUI::_thumbBookmarkClicked(void * data, Evas_Object * , void *) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); HistoryItemData * itemData = reinterpret_cast(data); - itemData->mainUI->mostVisitedTileClicked(itemData->item, DetailPopup::HISTORY_ITEMS_NO); + itemData->mainUI->openURLInNewTab(itemData->item, itemData->mainUI->isDesktopMode()); } void MainUI::_thumbClicked(void* data, Evas_Object *, const char *, const char *) diff --git a/services/MainUI/MainUI.h b/services/MainUI/MainUI.h index 7994674..94fa9d9 100644 --- a/services/MainUI/MainUI.h +++ b/services/MainUI/MainUI.h @@ -59,6 +59,7 @@ public: void addBookmarkItems(std::vector >); boost::signals2::signal, int)> mostVisitedTileClicked; + boost::signals2::signal, bool)> openURLInNewTab; boost::signals2::signal mostVisitedClicked; boost::signals2::signal bookmarkClicked; boost::signals2::signal bookmarkManagerClicked; @@ -77,7 +78,7 @@ private: static char* _grid_bookmark_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object * _grid_bookmark_content_get(void *data, Evas_Object *obj, const char *part); - static void _thumbSelected(void * data, Evas_Object * obj, void * event_info); + static void _thumbBookmarkClicked(void * data, Evas_Object * obj, void * event_info); static void _thumbClicked(void *data, Evas_Object *obj, const char *emission, const char *source); void setEmptyView(bool empty); void showNoHistoryLabel(); diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 43dea86..6d39786 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -286,6 +286,7 @@ void SimpleUI::connectUISignals() M_ASSERT(m_mainUI.get()); m_mainUI->getDetailPopup().openURLInNewTab.connect(boost::bind(&SimpleUI::onOpenURLInNewTab, this, _1, _2)); + m_mainUI->openURLInNewTab.connect(boost::bind(&SimpleUI::onOpenURLInNewTab, this, _1, _2)); m_mainUI->mostVisitedTileClicked.connect(boost::bind(&SimpleUI::onMostVisitedTileClicked, this, _1, _2)); m_mainUI->mostVisitedClicked.connect(boost::bind(&SimpleUI::onMostVisitedClicked, this,_1)); m_mainUI->bookmarkClicked.connect(boost::bind(&SimpleUI::onBookmarkButtonClicked, this,_1)); -- 2.7.4 From 1fc1fc36ce625d77f2580448a0505d3c26a8902e Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Fri, 11 Sep 2015 13:54:40 +0200 Subject: [PATCH 03/16] BookmarkManagerUI Implementing new AbstractUIComponent methods. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class needs AbstractUIComponent to have some view managing functions. [Cause:] N/A [Solution:] Implemented needed methods: void init(Evas_Object* parent) Evas_Object* getContent() void showUI() void hideUI() [Verify:] Change is not affecting browsers behaviour. Change-Id: Ia8f4eca29b82a54f239671f32bc6c43f9a47b7fe --- services/BookmarkManagerUI/BookmarkManagerUI.cpp | 97 ++++++++++++++++++------ services/BookmarkManagerUI/BookmarkManagerUI.h | 15 +++- 2 files changed, 87 insertions(+), 25 deletions(-) diff --git a/services/BookmarkManagerUI/BookmarkManagerUI.cpp b/services/BookmarkManagerUI/BookmarkManagerUI.cpp index cd50471..5d08bf0 100644 --- a/services/BookmarkManagerUI/BookmarkManagerUI.cpp +++ b/services/BookmarkManagerUI/BookmarkManagerUI.cpp @@ -58,16 +58,78 @@ BookmarkManagerUI::BookmarkManagerUI() BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); edjFilePath = EDJE_DIR; edjFilePath.append("BookmarkManagerUI/BookmarkManagerUI.edj"); + createGengridItemClasses(); } BookmarkManagerUI::~BookmarkManagerUI() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if(m_folder_item_class) + elm_gengrid_item_class_free(m_folder_item_class); + if(m_bookmark_item_class) + elm_gengrid_item_class_free(m_bookmark_item_class); +} + +void BookmarkManagerUI::createGengridItemClasses() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_folder_item_class = elm_gengrid_item_class_new(); + m_folder_item_class->item_style = "grid_bm_item"; + m_folder_item_class->func.text_get = _grid_folder_text_get; + m_folder_item_class->func.content_get = _grid_folder_content_get; + m_folder_item_class->func.state_get = nullptr; + m_folder_item_class->func.del = nullptr; + + m_bookmark_item_class = elm_gengrid_item_class_new(); + m_bookmark_item_class->item_style = "grid_ds_item"; + m_bookmark_item_class->func.text_get = _grid_bookmark_text_get; + m_bookmark_item_class->func.content_get = _grid_bookmark_content_get; + m_bookmark_item_class->func.state_get = nullptr; + m_bookmark_item_class->func.del = nullptr; } void BookmarkManagerUI::show(Evas_Object* parent) { + init(parent); + b_mm_layout=createBookmarksLayout(m_parent); + showUI(); +} + +void BookmarkManagerUI::init(Evas_Object* parent) +{ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parent); m_parent = parent; +} + +void BookmarkManagerUI::showUI() +{ + evas_object_show(b_mm_layout); + //regenerate gengrid and genlist + createGenGrid(); + showTopContent(); +} + +void BookmarkManagerUI::hideUI() +{ + evas_object_hide(b_mm_layout); + evas_object_del(m_gengrid); + m_gengrid=nullptr; + evas_object_del(m_genList); + m_genList=nullptr; +} + +Evas_Object* BookmarkManagerUI::getContent() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + if (!b_mm_layout) + b_mm_layout = createBookmarksLayout(m_parent); + return b_mm_layout; +} + +Evas_Object* BookmarkManagerUI::createBookmarksLayout(Evas_Object* parent) +{ m_folder.clear(); elm_theme_extension_add(nullptr, edjFilePath.c_str()); b_mm_layout = elm_layout_add(parent); @@ -77,28 +139,14 @@ void BookmarkManagerUI::show(Evas_Object* parent) evas_object_show(b_mm_layout); createGenGrid(); - - if (!m_folder_item_class) { - m_folder_item_class = elm_gengrid_item_class_new(); - m_folder_item_class->item_style = "grid_bm_item"; - m_folder_item_class->func.text_get = _grid_folder_text_get; - m_folder_item_class->func.content_get = _grid_folder_content_get; - m_folder_item_class->func.state_get = nullptr; - m_folder_item_class->func.del = nullptr; - } - - if (!m_bookmark_item_class) { - m_bookmark_item_class = elm_gengrid_item_class_new(); - m_bookmark_item_class->item_style = "grid_ds_item"; - m_bookmark_item_class->func.text_get = _grid_bookmark_text_get; - m_bookmark_item_class->func.content_get = _grid_bookmark_content_get; - m_bookmark_item_class->func.state_get = nullptr; - m_bookmark_item_class->func.del = nullptr; - } + return b_mm_layout; } +//TODO: Make parend the argument and return created object to make code more modular. +// (After fixing window managment) void BookmarkManagerUI::createGenGrid() { + //TODO: After fixing window managment remove this. if(m_gengrid != nullptr) evas_object_del(m_gengrid); @@ -117,6 +165,9 @@ void BookmarkManagerUI::createGenGrid() elm_gengrid_item_size_set(m_gengrid, 404 * efl_scale, 320 * efl_scale); } +//TODO: Remove externall calls and make it private method. +// Make parend the argument and return created object +// to make code more modular.(After fixing window managment) void BookmarkManagerUI::showTopContent() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -269,7 +320,7 @@ Evas_Object * BookmarkManagerUI::getGenList() return m_genList; } -Evas_Object * BookmarkManagerUI::getContent() +Evas_Object * BookmarkManagerUI::getGenGrid() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); return m_gengrid; @@ -315,8 +366,8 @@ void BookmarkManagerUI::addBookmarkFolderItems(std::vector); @@ -62,7 +69,11 @@ public: boost::signals2::signal folderItemClicked; private: + Evas_Object* createBookmarksLayout(Evas_Object* parent); void createGenGrid(); + void createGengridItemClasses(); + Evas_Object *getGenList(); + Evas_Object *getGenGrid(); static char* _grid_folder_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object * _grid_folder_content_get(void *data, Evas_Object *obj, const char *part); static char* _grid_bookmark_text_get(void *data, Evas_Object *obj, const char *part); -- 2.7.4 From 06372d9557fd613262a21fe287bcb36b40e14fd0 Mon Sep 17 00:00:00 2001 From: Albert Malewski Date: Mon, 14 Sep 2015 14:12:12 +0200 Subject: [PATCH 04/16] Removed inheritance of AbstractUIComponent in MainUI and SimpleURI classes [Issue] https://bugs.tizen.org/jira/browse/TT-157 [Problem] MainUI and SimpleURI classes are not UI components in fact. They are not suspected to call AbstractUIComponent's methods. [Cause] N/A [Solution] Removed inheritance of AbstractUIComponent in MainUI and SimpleURI classes. [Verify] This patch does not change browser's behaviour. Change-Id: I048c6ad288df7af331efda6552565b83a112af08 --- services/MainUI/MainUI.h | 3 +-- services/SimpleURI/SimpleURI.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/services/MainUI/MainUI.h b/services/MainUI/MainUI.h index 94fa9d9..0ebc78d 100644 --- a/services/MainUI/MainUI.h +++ b/services/MainUI/MainUI.h @@ -34,8 +34,7 @@ namespace base_ui{ //TODO: This class name is not revelant to what this class actually does. //Rename this class and file to "QuickAccessUI". class BROWSER_EXPORT MainUI - : public tizen_browser::interfaces::AbstractUIComponent - , public tizen_browser::core::AbstractService + : public tizen_browser::core::AbstractService { public: MainUI(); diff --git a/services/SimpleURI/SimpleURI.h b/services/SimpleURI/SimpleURI.h index 77ec107..e28abed 100644 --- a/services/SimpleURI/SimpleURI.h +++ b/services/SimpleURI/SimpleURI.h @@ -34,8 +34,7 @@ namespace tizen_browser{ namespace base_ui{ class BROWSER_EXPORT SimpleURI - : public tizen_browser::interfaces::AbstractUIComponent - , public tizen_browser::core::AbstractService + : public tizen_browser::core::AbstractService { public: enum IconType{ -- 2.7.4 From aadbbcd9df9a8a91e392602f4541dd3f0ef086e6 Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Mon, 14 Sep 2015 18:16:49 +0200 Subject: [PATCH 05/16] TabUI Implementing new AbstractUIComponent methods. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class needs AbstractUIComponent to have some view managing functions. [Cause:] N/A [Solution:] Implemented needed methods: void init(Evas_Object* parent) Evas_Object* getContent() void showUI() void hideUI() [Verify:] Change is not affecting browsers behaviour. Change-Id: I6d4a91af909722050564690510f64e9c331b7fe5 --- services/TabUI/TabUI.cpp | 90 +++++++++++++++++++++++++++++++++++++----------- services/TabUI/TabUI.h | 8 +++++ 2 files changed, 77 insertions(+), 21 deletions(-) diff --git a/services/TabUI/TabUI.cpp b/services/TabUI/TabUI.cpp index e93f03e..a3e0916 100644 --- a/services/TabUI/TabUI.cpp +++ b/services/TabUI/TabUI.cpp @@ -76,17 +76,59 @@ void TabUI::createTabItemClass() void TabUI::show(Evas_Object* parent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + init(parent); + m_tab_layout = createTabUILayout(m_parent); + showUI(); +} + +void TabUI::showUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_tab_layout); + evas_object_show(m_tab_layout); + //regenerate gengrid + m_gengrid = createGengrid(m_tab_layout); + elm_object_part_content_set(m_tab_layout, "tab_gengrid", m_gengrid); + evas_object_show(m_gengrid); + + evas_object_show(elm_layout_content_get(m_tab_layout, "action_bar")); + evas_object_show(elm_layout_content_get(m_tab_layout, "top_bar")); +} + +void TabUI::hideUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_tab_layout); + evas_object_hide(m_tab_layout); + + //delete gengrid + evas_object_del(m_gengrid); + m_gengrid = nullptr; + + evas_object_hide(elm_layout_content_get(m_tab_layout, "action_bar")); + evas_object_hide(elm_layout_content_get(m_tab_layout, "top_bar")); +} + +void TabUI::init(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); M_ASSERT(parent); m_parent = parent; - //TODO:check if there is no some memory leak due to not destroying previous instance of this UI element. - m_tab_layout = createTabUILayout(parent); - evas_object_show(m_tab_layout); +} + +Evas_Object* TabUI::getContent() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + if(!m_tab_layout) + m_tab_layout = createTabUILayout(m_parent); + return m_tab_layout; } Evas_Object* TabUI::createTabUILayout(Evas_Object* parent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - M_ASSERT(parent); + Evas_Object* tab_layout = elm_layout_add(parent); elm_layout_file_set(tab_layout, m_edjFilePath.c_str(), "tab-layout"); evas_object_size_hint_weight_set(tab_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -98,31 +140,34 @@ Evas_Object* TabUI::createTabUILayout(Evas_Object* parent) buttonBar = createActionBar(tab_layout); elm_object_part_content_set(tab_layout, "action_bar", buttonBar); + return tab_layout; +} - //create gengrid containing tabs - m_gengrid = elm_gengrid_add(tab_layout); - elm_object_part_content_set(tab_layout, "tab_gengrid", m_gengrid); +Evas_Object* TabUI::createGengrid(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parent); - M_ASSERT(m_parent); - elm_gengrid_align_set(m_gengrid, 0, 0); - elm_gengrid_select_mode_set(m_gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_gengrid_multi_select_set(m_gengrid, EINA_FALSE); - elm_gengrid_horizontal_set(m_gengrid, EINA_TRUE); - elm_gengrid_highlight_mode_set(m_gengrid, EINA_TRUE); - elm_scroller_policy_set(m_gengrid, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF); - elm_scroller_page_size_set(m_gengrid, 0, 327); + Evas_Object* gengrid = elm_gengrid_add(parent); - evas_object_size_hint_weight_set(m_gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_gengrid_align_set(gengrid, 0, 0); + elm_gengrid_select_mode_set(gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_gengrid_multi_select_set(gengrid, EINA_FALSE); + elm_gengrid_horizontal_set(gengrid, EINA_TRUE); + elm_gengrid_highlight_mode_set(gengrid, EINA_TRUE); + elm_scroller_policy_set(gengrid, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF); + elm_scroller_page_size_set(gengrid, 0, 327); + + evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); double efl_scale = elm_config_scale_get() / elm_app_base_scale_get(); - elm_gengrid_item_size_set(m_gengrid, 364 * efl_scale, 320 * efl_scale); - evas_object_event_callback_add(m_gengrid, EVAS_CALLBACK_MOUSE_IN, _focus_in, this); + elm_gengrid_item_size_set(gengrid, 364 * efl_scale, 320 * efl_scale); + evas_object_event_callback_add(gengrid, EVAS_CALLBACK_MOUSE_IN, _focus_in, this); - return tab_layout; + return gengrid; } - Evas_Object* TabUI::createActionBar(Evas_Object* parent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -170,6 +215,7 @@ void TabUI::_close_clicked(void* data, Evas_Object*, void*) void TabUI::hide() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); evas_object_hide(elm_layout_content_get(m_tab_layout, "action_bar")); evas_object_hide(elm_layout_content_get(m_tab_layout, "top_bar")); evas_object_hide(elm_layout_content_get(m_tab_layout, "tab_gengrid")); @@ -368,6 +414,7 @@ void TabUI::clearItems() Evas_Object* TabUI::createNoHistoryLabel() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); Evas_Object *label = elm_label_add(m_parent); elm_object_text_set(label, "No favorite websites."); evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -389,6 +436,7 @@ void TabUI::closeAllTabs() void TabUI::setEmptyGengrid(bool setEmpty) { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); if (setEmpty) { elm_object_part_content_set(m_gengrid, "elm.swallow.empty", createNoHistoryLabel()); } else { diff --git a/services/TabUI/TabUI.h b/services/TabUI/TabUI.h index 21cd5b2..d650052 100644 --- a/services/TabUI/TabUI.h +++ b/services/TabUI/TabUI.h @@ -36,6 +36,12 @@ class BROWSER_EXPORT TabUI public: TabUI(); ~TabUI(); + //AbstractUIComponent interface implementation + void showUI(); + void hideUI(); + void init(Evas_Object *parent); + Evas_Object* getContent(); + void show(Evas_Object *parent); virtual std::string getName(); void clearItems(); @@ -54,6 +60,7 @@ public: boost::signals2::signal tabsCount; private: + static char* _grid_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object * _tab_grid_content_get(void *data, Evas_Object *obj, const char *part); static void _itemSelected(void * data, Evas_Object * obj, void * event_info); @@ -72,6 +79,7 @@ private: Evas_Object* createTabUILayout(Evas_Object* parent); Evas_Object* createActionBar(Evas_Object* parent); + Evas_Object* createGengrid(Evas_Object* parent); Evas_Object* createTopButtons(Evas_Object* parent); Evas_Object* createNoHistoryLabel(); void createTabItemClass(); -- 2.7.4 From 67476fe16d898eb94f7baa0d32a870cf054e1834 Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Mon, 14 Sep 2015 15:48:57 +0200 Subject: [PATCH 06/16] MoreMenuUI Implementing new AbstractUIComponent methods. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class needs AbstractUIComponent to have some view managing functions. [Cause:] N/A [Solution:] Implemented needed methods: void init(Evas_Object* parent) Evas_Object* getContent() void showUI() void hideUI() [Verify:] Change is not affecting browsers behaviour. Change-Id: I4aef907e35f5240be86c259f4d6705a43c93ee4a --- services/MoreMenuUI/MoreMenuUI.cpp | 130 +++++++++++++++++++++++++++---------- services/MoreMenuUI/MoreMenuUI.h | 16 +++++ 2 files changed, 112 insertions(+), 34 deletions(-) diff --git a/services/MoreMenuUI/MoreMenuUI.cpp b/services/MoreMenuUI/MoreMenuUI.cpp index 7489ab6..4db8fd8 100644 --- a/services/MoreMenuUI/MoreMenuUI.cpp +++ b/services/MoreMenuUI/MoreMenuUI.cpp @@ -45,55 +45,113 @@ typedef struct _MoreItemData } MoreMenuItemData; MoreMenuUI::MoreMenuUI() - : m_gengrid(NULL) - , m_parent(NULL) - , m_item_class(NULL) + : m_gengrid(nullptr) + , m_parent(nullptr) + , m_item_class(nullptr) + , m_mm_layout(nullptr) , m_desktopMode(true) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_edjFilePath = EDJE_DIR; m_edjFilePath.append("MoreMenuUI/MoreMenu.edj"); + m_item_class = crateItemClass(); } MoreMenuUI::~MoreMenuUI() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (m_item_class) + elm_gengrid_item_class_free(m_item_class); } -void MoreMenuUI::show(Evas_Object* parent, bool desktopMode) +Elm_Gengrid_Item_Class* MoreMenuUI::crateItemClass() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + Elm_Gengrid_Item_Class* item_class = elm_gengrid_item_class_new(); + item_class->item_style = "menu_item"; + item_class->func.text_get = _grid_text_get; + item_class->func.content_get = _grid_content_get; + item_class->func.state_get = NULL; + item_class->func.del = NULL; + return item_class; +} + +void MoreMenuUI::init(Evas_Object* parent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parent); m_parent = parent; - m_desktopMode = desktopMode; - elm_theme_extension_add(NULL, m_edjFilePath.c_str()); - m_mm_layout = elm_layout_add(parent); - elm_layout_file_set(m_mm_layout, m_edjFilePath.c_str(), "moremenu-layout"); - evas_object_size_hint_weight_set(m_mm_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_mm_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(m_mm_layout); - - m_gengrid = elm_gengrid_add(m_mm_layout); - elm_object_part_content_set(m_mm_layout, "elm.swallow.grid", m_gengrid); - - if (!m_item_class) { - m_item_class = elm_gengrid_item_class_new(); - m_item_class->item_style = "menu_item"; - m_item_class->func.text_get = _grid_text_get; - m_item_class->func.content_get = _grid_content_get; - m_item_class->func.state_get = NULL; - m_item_class->func.del = NULL; - } +} - elm_gengrid_align_set(m_gengrid, 0, 0); - elm_gengrid_select_mode_set(m_gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_gengrid_multi_select_set(m_gengrid, EINA_FALSE); - elm_gengrid_horizontal_set(m_gengrid, EINA_FALSE); - elm_scroller_policy_set(m_gengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); - elm_scroller_page_size_set(m_gengrid, 0, 327); - evas_object_size_hint_weight_set(m_gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); - elm_gengrid_item_size_set(m_gengrid, 364 * efl_scale, 320 * efl_scale); +void MoreMenuUI::show(Evas_Object* parent, bool desktopMode) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + init(parent); + //TODO: move this function call to SimpleUI::initUIServices after introducing new window managment. + setDesktopMode(desktopMode); + m_mm_layout=createMoreMenuLayout(parent); + showUI(); +} +void MoreMenuUI::showUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + evas_object_show(getContent()); + //regenerate gengrid + m_gengrid=createGengrid(getContent()); addItems(); + elm_object_part_content_set(getContent(), "elm.swallow.grid", m_gengrid); +} + +void MoreMenuUI::hideUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_mm_layout); + evas_object_hide(getContent()); + //destroy gengrid + evas_object_del(m_gengrid); +} + + +Evas_Object* MoreMenuUI::getContent() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + if(!m_mm_layout) + m_mm_layout = createMoreMenuLayout(m_parent); + return m_mm_layout; +} + +Evas_Object* MoreMenuUI::createMoreMenuLayout(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + elm_theme_extension_add(NULL, m_edjFilePath.c_str()); + Evas_Object* mm_layout = elm_layout_add(parent); + elm_layout_file_set(mm_layout, m_edjFilePath.c_str(), "moremenu-layout"); + evas_object_size_hint_weight_set(mm_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(mm_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + + evas_object_show(mm_layout); + return mm_layout; +} + +Evas_Object* MoreMenuUI::createGengrid(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + Evas_Object* gengrid = elm_gengrid_add(parent); + elm_object_part_content_set(parent, "elm.swallow.grid", gengrid); + + elm_gengrid_align_set(gengrid, 0, 0); + elm_gengrid_select_mode_set(gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); + elm_gengrid_multi_select_set(gengrid, EINA_FALSE); + elm_gengrid_horizontal_set(gengrid, EINA_FALSE); + elm_scroller_policy_set(gengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); + elm_scroller_page_size_set(gengrid, 0, 327); + evas_object_size_hint_weight_set(gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_gengrid_item_size_set(gengrid, 364 * efl_scale, 320 * efl_scale); + return gengrid; } void MoreMenuUI::showCurrentTab() @@ -138,6 +196,7 @@ void MoreMenuUI::setFavIcon(std::shared_ptr void MoreMenuUI::setDocIcon() { + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); if(m_icon) evas_object_del(m_icon); @@ -188,7 +247,7 @@ void MoreMenuUI::_close_clicked(void* data, Evas_Object*, void*) void MoreMenuUI::AddBookmarkPopupCalled() { - + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_add_bookmark_popup = std::make_shared(m_mm_layout); m_add_bookmark_popup->show(); m_add_bookmark_popup->addBookmarkFolderItems(m_map_bookmark_folder_list); @@ -234,8 +293,8 @@ void MoreMenuUI::CancelClicked(Evas_Object*) void MoreMenuUI::addToBookmarks(int folder_id) { - AddBookmarkInput(folder_id); BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + AddBookmarkInput(folder_id); m_add_bookmark_popup->hide(); m_add_bookmark_popup.reset(); } @@ -476,6 +535,9 @@ void MoreMenuUI::_thumbSelected(void* data, Evas_Object*, void*) case EXIT_BROWSER: _exitClicked(); break; + default: + BROWSER_LOGD("[%s:%d] Warning: Unhandled button.", __PRETTY_FUNCTION__, __LINE__); + break; } } } diff --git a/services/MoreMenuUI/MoreMenuUI.h b/services/MoreMenuUI/MoreMenuUI.h index 06e4017..4b0fccb 100644 --- a/services/MoreMenuUI/MoreMenuUI.h +++ b/services/MoreMenuUI/MoreMenuUI.h @@ -61,10 +61,21 @@ class BROWSER_EXPORT MoreMenuUI public: MoreMenuUI(); ~MoreMenuUI(); + + //AbstractUIComponent interface methods + void init(Evas_Object* parent); + Evas_Object* getContent(); + void showUI(); + void hideUI(); + + void setDesktopMode(bool desktopMode) {m_desktopMode = desktopMode;} + void show(Evas_Object *main_layout, bool desktopMode); + //TODO: remove this function after new view managment introduction. void showCurrentTab(); virtual std::string getName(); void addItems(); + //TODO: remove this function after new view managment introduction. void hide(); void clearItems(); void getBookmarkFolderList(std::vector > ); @@ -75,14 +86,19 @@ public: boost::signals2::signal addToBookmarkClicked; boost::signals2::signal AddBookmarkInput; boost::signals2::signal BookmarkFolderCreated; + //TODO: remove redundant argument from this signal. boost::signals2::signal bookmarkManagerClicked; boost::signals2::signal BookmarkFoldersListImport; boost::signals2::signal historyUIClicked; boost::signals2::signal settingsClicked; + //TODO: remove redundant argument from this signal. boost::signals2::signal closeMoreMenuClicked; boost::signals2::signal switchToMobileMode; boost::signals2::signal switchToDesktopMode; private: + Elm_Gengrid_Item_Class* crateItemClass(); + Evas_Object* createMoreMenuLayout(Evas_Object* parent); + Evas_Object* createGengrid(Evas_Object* parent); static char* _grid_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object * _grid_content_get(void *data, Evas_Object *obj, const char *part); static void _thumbSelected(void * data, Evas_Object * obj, void * event_info); -- 2.7.4 From cce3446c1bc84eafa4f047511e071bd50c5e24e2 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Tue, 15 Sep 2015 10:33:12 +0200 Subject: [PATCH 07/16] Remove unused classes. [Issue#] N/A [Problem] These classes were unused. [Cause] N/A [Solution] Delete classes and theirs references. [Verify] Run browser, check if page browsing works. Change-Id: I11bd790c0cec58dfa7e13f7b9d553a8b822e69a3 Signed-off-by: Maciej Skrzypkowski --- services/MainUI/MainUI.cpp | 7 +- services/MainUI/edc/MainUI.edc | 20 +- services/SimpleUI/CMakeLists.txt | 25 -- services/SimpleUI/HistoryList.cpp | 317 -------------- services/SimpleUI/HistoryList.h | 95 ----- services/SimpleUI/NetworkErrorHandler.cpp | 57 --- services/SimpleUI/NetworkErrorHandler.h | 65 --- services/SimpleUI/RelatedWebPages.cpp | 156 ------- services/SimpleUI/RelatedWebPages.h | 54 --- services/SimpleUI/Settings.cpp | 334 --------------- services/SimpleUI/Settings.h | 92 ----- services/SimpleUI/SimpleScroller.cpp | 68 --- services/SimpleUI/SimpleScroller.h | 43 -- services/SimpleUI/SimpleUI.cpp | 76 ---- services/SimpleUI/SimpleUI.h | 28 -- services/SimpleUI/TabList.cpp | 288 ------------- services/SimpleUI/TabList.h | 84 ---- services/SimpleUI/WebTitleBar.cpp | 122 ------ services/SimpleUI/WebTitleBar.h | 76 ---- services/SimpleUI/ZoomList.cpp | 144 ------- services/SimpleUI/ZoomList.h | 72 ---- services/SimpleUI/edc/EntryPopup.edc | 51 --- services/SimpleUI/edc/HistoryItem.edc | 660 ------------------------------ services/SimpleUI/edc/RelatedPages.edc | 298 -------------- services/SimpleUI/edc/Settings.edc | 574 -------------------------- services/SimpleUI/edc/TabItem.edc | 513 ----------------------- services/SimpleUI/edc/WebTitleBar.edc | 116 ------ services/SimpleUI/edc/ZoomItem.edc | 221 ---------- 28 files changed, 20 insertions(+), 4636 deletions(-) delete mode 100644 services/SimpleUI/HistoryList.cpp delete mode 100644 services/SimpleUI/HistoryList.h delete mode 100644 services/SimpleUI/NetworkErrorHandler.cpp delete mode 100644 services/SimpleUI/NetworkErrorHandler.h delete mode 100644 services/SimpleUI/RelatedWebPages.cpp delete mode 100644 services/SimpleUI/RelatedWebPages.h delete mode 100644 services/SimpleUI/Settings.cpp delete mode 100644 services/SimpleUI/Settings.h delete mode 100644 services/SimpleUI/SimpleScroller.cpp delete mode 100644 services/SimpleUI/SimpleScroller.h delete mode 100644 services/SimpleUI/TabList.cpp delete mode 100644 services/SimpleUI/TabList.h delete mode 100644 services/SimpleUI/WebTitleBar.cpp delete mode 100644 services/SimpleUI/WebTitleBar.h delete mode 100644 services/SimpleUI/ZoomList.cpp delete mode 100644 services/SimpleUI/ZoomList.h delete mode 100644 services/SimpleUI/edc/EntryPopup.edc delete mode 100644 services/SimpleUI/edc/HistoryItem.edc delete mode 100644 services/SimpleUI/edc/RelatedPages.edc delete mode 100644 services/SimpleUI/edc/Settings.edc delete mode 100644 services/SimpleUI/edc/TabItem.edc delete mode 100644 services/SimpleUI/edc/WebTitleBar.edc delete mode 100644 services/SimpleUI/edc/ZoomItem.edc diff --git a/services/MainUI/MainUI.cpp b/services/MainUI/MainUI.cpp index 3822075..d5bec80 100644 --- a/services/MainUI/MainUI.cpp +++ b/services/MainUI/MainUI.cpp @@ -277,8 +277,8 @@ void MainUI::addHistoryItem(std::shared_ptr hi) void MainUI::addHistoryItems(std::shared_ptr items) { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); + clearHistoryGenlist(); int i = 0; - m_historyItems.clear(); for (auto it = items->begin(); it != items->end(); ++it) { i++; if (i > MAX_TILES_NUMBER) @@ -364,9 +364,12 @@ void MainUI::clearHistoryGenlist() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - for (auto it = m_tiles.begin(); it != m_tiles.end(); ++it) + for (auto it = m_tiles.begin(); it != m_tiles.end(); ++it) { edje_object_signal_callback_del(elm_layout_edje_get(*it), "mouse,clicked,1", "over", _thumbClicked); + evas_object_del(*it); + } + m_tiles.clear(); m_historyItems.clear(); } diff --git a/services/MainUI/edc/MainUI.edc b/services/MainUI/edc/MainUI.edc index 0625a90..8dfe2be 100644 --- a/services/MainUI/edc/MainUI.edc +++ b/services/MainUI/edc/MainUI.edc @@ -46,6 +46,16 @@ group{ } } } + programs{ + program { + name: "mouse_click"; + signal: "mouse,clicked,1"; + source: "over"; + script { + emit("elm,action,click", ""); + } + } + } } group { name: "elm/button/base/thumbButton"; @@ -222,7 +232,7 @@ group { name: "mv_bookmarks"; min: 784 614; max: 784 614; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { relative: 0 0; to: "center_rect"; @@ -244,7 +254,7 @@ group { name: "mv_bookmarks"; min: 378 294; max: 378 294; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { to: "center_rect"; @@ -269,7 +279,7 @@ group { name: "mv_bookmarks"; min: 378 294; max: 378 294; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { to: "center_rect"; @@ -294,7 +304,7 @@ group { name: "mv_bookmarks"; min: 378 294; max: 378 294; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { to: "center_rect"; @@ -319,7 +329,7 @@ group { name: "mv_bookmarks"; min: 378 294; max: 378 294; align: 0.0 0.0; - fixed: 0 0; + fixed: 1 1; visible: 1; rel1 { to: "center_rect"; diff --git a/services/SimpleUI/CMakeLists.txt b/services/SimpleUI/CMakeLists.txt index 0e0a5fd..af5a134 100644 --- a/services/SimpleUI/CMakeLists.txt +++ b/services/SimpleUI/CMakeLists.txt @@ -1,35 +1,17 @@ project(SimpleUI) set(SimpleUI_SRCS - NetworkErrorHandler.cpp - HistoryList.cpp SimpleUI.cpp ButtonBar.cpp SimplePopup.cpp - ZoomList.cpp - TabList.cpp BookmarksManager.cpp - Settings.cpp - SimpleScroller.cpp - WebTitleBar.cpp - RelatedWebPages.cpp - CustomPopup.cpp ) set(SimpleUI_HEADERS - NetworkErrorHandler.h SimpleUI.h ButtonBar.h SimplePopup.h - ZoomList.h - TabList.h BookmarksManager.h - Settings.h - SimpleScroller.h - HistoryList.h - WebTitleBar.h - RelatedWebPages.h - CustomPopup.h ) include(Coreheaders) @@ -101,17 +83,10 @@ set(edcFiles LeftButtonBar.edc RightButtonBar.edc AuthenticationPopup.edc - TabItem.edc - ZoomItem.edc BookmarksManager.edc - Settings.edc ScrollerDefault.edc - HistoryItem.edc - WebTitleBar.edc ErrorMessage.edc - RelatedPages.edc Tooltip.edc - CustomPopup.edc ) foreach(edec ${edcFiles}) diff --git a/services/SimpleUI/HistoryList.cpp b/services/SimpleUI/HistoryList.cpp deleted file mode 100644 index 508ae8f..0000000 --- a/services/SimpleUI/HistoryList.cpp +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "HistoryList.h" -#include "BrowserAssert.h" -#include "BrowserLogger.h" -#include "HistoryItem.h" -#include "EflTools.h" -#include - -#if MERGE_ME -#include -#include -#include -#include -#endif - -namespace tizen_browser -{ -namespace base_ui -{ - - -HistoryList::HistoryList(std::shared_ptr mainWindow, Evas_Object* parentButton) - : MenuButton(mainWindow, parentButton) - ,m_genList(NULL) - ,m_itemClass(NULL) - ,m_lastFocusedItem(NULL) - ,m_deleteSelected(false) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleUI/HistoryItem.edj"); - elm_theme_extension_add(0, edjFilePath.c_str()); - - itemWidth = atoi(edje_file_data_get(edjFilePath.c_str(),"item_width")); - itemHeight = atoi(edje_file_data_get(edjFilePath.c_str(),"item_height")); - parentItemHeight = atoi(edje_file_data_get(edjFilePath.c_str(),"parent_item_height")); - itemsCounter = 0; - parentItemsCounter = 0; - - m_genList = elm_genlist_add(m_window.get()); - elm_object_style_set(m_genList, "history"); - elm_genlist_homogeneous_set(m_genList, EINA_FALSE); - elm_genlist_multi_select_set(m_genList, EINA_FALSE); - elm_genlist_select_mode_set(m_genList, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_genlist_mode_set(m_genList, ELM_LIST_LIMIT); - elm_genlist_decorate_mode_set(m_genList, EINA_TRUE); - evas_object_size_hint_weight_set(m_genList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - evas_object_smart_callback_add(m_genList, "item,focused", focusItem, this); - evas_object_smart_callback_add(m_genList, "item,unfocused", unFocusItem, NULL); - - m_itemClass = elm_genlist_item_class_new(); - m_itemClass->item_style = "history_item"; - m_itemClass->func.text_get = &listItemTextGet; - m_itemClass->func.content_get = &listItemContentGet; - m_itemClass->func.state_get = 0; - m_itemClass->func.del = 0; - - m_itemClassNoFavicon = elm_genlist_item_class_new(); - m_itemClassNoFavicon->item_style = "history_item_no_favicon"; - m_itemClassNoFavicon->func.text_get = &listItemTextGet; - m_itemClassNoFavicon->func.content_get = &listItemContentGet; - m_itemClassNoFavicon->func.state_get = 0; - m_itemClassNoFavicon->func.del = 0; - - m_parentItemClass= elm_genlist_item_class_new(); - m_parentItemClass->item_style = "history_parent_item"; - m_parentItemClass->func.text_get = &listParentItemTextGet; - m_parentItemClass->func.content_get = 0; - m_parentItemClass->func.state_get = 0; - m_parentItemClass->func.del = 0; -} - -HistoryList::~HistoryList() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); -} - -void HistoryList::addItem(const std::shared_ptr item) -{ - BROWSER_LOGD("[%s:%d]:%s ", __PRETTY_FUNCTION__, __LINE__, item->getTitle().c_str()); - //first check if ther's a date item. - GroupIterator parenIter = m_groupParent.find(item->getLastVisit().date()); - Elm_Object_Item* groupParent; - - ItemData * id = new ItemData; - id->h_list = this; - id->h_item = item.get(); - if(parenIter == m_groupParent.end()){ - groupParent = elm_genlist_item_append(m_genList, //genlist - m_parentItemClass, //item Class - //id.get(), //item data - id, - 0, //parent item - ELM_GENLIST_ITEM_GROUP,//item type - paretn_item_clicked_cb, - NULL //data passed to above function - ); - elm_object_item_disabled_set(groupParent, EINA_TRUE); - m_groupParent[item->getLastVisit().date()] = groupParent; - ++parentItemsCounter; - } else { - groupParent = parenIter->second; - } - - Elm_Object_Item* elmItem = elm_genlist_item_append(m_genList, //genlist - item->getFavIcon()->dataSize ? m_itemClass : m_itemClassNoFavicon, //item Class - //id.get(), //item data - id, - groupParent, //parent item - ELM_GENLIST_ITEM_NONE,//item type - NULL, - NULL //data passed to above function - ); - id->e_item = elmItem; - -// m_items.push_back(item); - ++itemsCounter; -} - -void HistoryList::clearList() -{ - elm_genlist_clear(m_genList); - itemsCounter = 0; - parentItemsCounter = 0; - m_groupParent.clear(); -} - -void HistoryList::addItems(tzSrv::HistoryItemVector items) -{ - clearList(); - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - tzSrv::HistoryItemVectorConstIter end = items.end(); - for(tzSrv::HistoryItemVectorConstIter item = items.begin(); item!=end; item++){ - addItem(*item); - } -} - -Evas_Object* HistoryList::getContent() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - return m_genList; -} - -MenuButton::ListSize HistoryList::calculateSize() -{ - ListSize result; - - result.width = itemWidth; - - result.height = itemsCounter*itemHeight + parentItemsCounter*parentItemHeight + 16; //"16" is size of frame - if (result.height > 868) - result.height = 868; - - return result; -} - -Evas_Object* HistoryList::getFirstFocus() -{ - return m_genList; -} - -Evas_Object* HistoryList::listItemContentGet(void* data, Evas_Object* obj, const char* part) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ItemData * id = static_cast(data); - if(!strcmp(part, "favicon") && id->h_item->getFavIcon()) - { - return tizen_browser::tools::EflTools::getEvasImage(id->h_item->getFavIcon(), obj); - } - else if(!strcmp(part, "content_click")) - { - Evas_Object *content_click = elm_button_add(obj); - elm_object_style_set(content_click, "invisible_button"); - evas_object_smart_callback_add(content_click, "clicked", HistoryList::item_clicked_cb, id); - return content_click; - } - else if(!strcmp(part, "del_click")) - { - Evas_Object *del_click = elm_button_add(obj); - elm_object_style_set(del_click, "invisible_button"); - evas_object_smart_callback_add(del_click, "clicked", HistoryList::item_delete_clicked_cb, id); - return del_click; - } - return NULL; -} - -char* HistoryList::listItemTextGet(void* data, Evas_Object* /* obj */, const char* part) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ItemData * id = static_cast(data); - if(!strcmp(part, "page_title")) - { - if(!id->h_item->getTitle().empty()){ - return strdup(id->h_item->getTitle().c_str()); - } - } - else if(!strcmp(part, "page_url")) - { - if(!id->h_item->getUrl().empty()){ - return strdup(id->h_item->getUrl().c_str()); - } - } -#if MERGE_ME - else if(!strcmp(part, "page_time")) - { - std::string retstr = boost::posix_time::to_simple_string(id->h_item->getLastVisit().time_of_day()); - return strdup(retstr.c_str()); - } -#endif - return strdup(""); -} - -void HistoryList::item_clicked_cb(void* data, Evas_Object* /* obj */, void* /* event_info */) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ItemData * id = static_cast(data); - id->h_list->clickedHistoryItem(id->h_item->getUrl()); -} - -void HistoryList::item_delete_clicked_cb(void* data, Evas_Object* /* obj */, void* /* event_info */) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ItemData * id = static_cast(data); - id->h_list->deleteHistoryItem(id->h_item->getUrl()); - elm_object_item_del(id->e_item); - elm_genlist_item_update(id->e_item); - BROWSER_LOGD("[%s:%d] Genlist count: %d", __PRETTY_FUNCTION__, __LINE__, elm_genlist_items_count(id->h_list->m_genList)); -} - -char* HistoryList::listParentItemTextGet(void* data, Evas_Object* /* obj */, const char* /* part */ ) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - ///\todo fix year out of range - ItemData * id = static_cast(data); - std::string retstr = boost::gregorian::to_simple_string(id->h_item->getLastVisit().date()); - return strdup(retstr.c_str()); - -} - -void HistoryList::paretn_item_clicked_cb(void* /* data */, Evas_Object* /* obj */, void* /* event_info */) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); -} - -void HistoryList::focusItem(void* data, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,in", "content_click"); - - HistoryList *self = static_cast(data); - self->m_lastFocusedItem = item; -} - -void HistoryList::unFocusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - ItemData * id = reinterpret_cast(elm_object_item_data_get(item)); - M_ASSERT(id); - elm_object_item_signal_emit(item, "mouse,out", "content_click"); - elm_object_item_signal_emit(item, "mouse,out", "del_click"); - id->h_list->m_deleteSelected = false; -} - -void HistoryList::rightPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,in", "del_click"); - m_deleteSelected = true; - } -} - -void HistoryList::leftPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,out", "del_click"); - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,in", "content_click"); - m_deleteSelected = false; - } -} - -void HistoryList::enterPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - - ItemData * id = reinterpret_cast(elm_object_item_data_get(m_lastFocusedItem)); - M_ASSERT(id); - if(m_deleteSelected) { - deleteHistoryItem(id->h_item->getUrl()); - elm_object_item_del(m_lastFocusedItem); - elm_genlist_item_update(m_lastFocusedItem); - } - else - clickedHistoryItem(id->h_item->getUrl()); - } -} - -} /* end of namespace base_ui */ -} /* end of namespace tizen_browser */ diff --git a/services/SimpleUI/HistoryList.h b/services/SimpleUI/HistoryList.h deleted file mode 100644 index 098f41f..0000000 --- a/services/SimpleUI/HistoryList.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef HISTORYLIST_H -#define HISTORYLIST_H -#include -#include -#include -#include - -#include -#include -#include - -#include "MenuButton.h" - -#include "HistoryItem.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -namespace tzSrv = tizen_browser::services; - -class HistoryList : public MenuButton -{ -public: - HistoryList(std::shared_ptr mainWindow, Evas_Object* parentButton); - ~HistoryList(); - void addItems(tzSrv::HistoryItemVector items); - void addItem(const std::shared_ptr item); - virtual Evas_Object *getContent(); - virtual ListSize calculateSize(); - virtual Evas_Object* getFirstFocus(); - boost::signals2::signal clickedHistoryItem; - boost::signals2::signal deleteHistoryItem; - void clearList(); - - void rightPressed(); - void leftPressed(); - void enterPressed(); - -private: - - static Evas_Object* listItemContentGet(void *data, Evas_Object *obj, const char *part); - static char* listItemTextGet(void *data, Evas_Object *obj, const char *part); - static char* listParentItemTextGet(void *data, Evas_Object *obj, const char *part); - - static void paretn_item_clicked_cb(void *data, Evas_Object *obj, void *event_info); - static void item_clicked_cb(void *data, Evas_Object *obj, void *event_info); - static void item_delete_clicked_cb(void *data, Evas_Object *obj, void *event_info); - -private: - struct ItemData{ - tizen_browser::base_ui::HistoryList * h_list; - tizen_browser::services::HistoryItem * h_item; - Elm_Object_Item * e_item; - }; - Evas_Object *m_genList; - Elm_Genlist_Item_Class *m_itemClass; - Elm_Genlist_Item_Class *m_itemClassNoFavicon; - Elm_Genlist_Item_Class *m_parentItemClass; - int itemsCounter; - int parentItemsCounter; - int itemHeight; - int itemWidth; - int parentItemHeight; - std::map m_groupParent; - typedef std::map::iterator GroupIterator; - - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); - - Elm_Object_Item *m_lastFocusedItem; - bool m_deleteSelected; -}; - -} /* end of namespace base_ui */ -} /* end of namespace tizen_browser */ - -#endif // HISTORYLIST_H diff --git a/services/SimpleUI/NetworkErrorHandler.cpp b/services/SimpleUI/NetworkErrorHandler.cpp deleted file mode 100644 index 0c6f148..0000000 --- a/services/SimpleUI/NetworkErrorHandler.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "NetworkErrorHandler.h" - -#if PLATFORM(TIZEN) -#include -#endif - -namespace tizen_browser -{ -namespace basic_ui -{ - -NetworkErrorHandler::NetworkErrorHandler() -{ -#if PLATFORM(TIZEN) - connection_create(&connection); - connection_set_type_changed_cb(connection, onConnectionStateChanged, this); -#endif -} - -NetworkErrorHandler::~NetworkErrorHandler() -{ -#if PLATFORM(TIZEN) - connection_unset_type_changed_cb(connection); - connection_destroy(connection); -#endif -} - -#if PLATFORM(TIZEN) -void NetworkErrorHandler::onConnectionStateChanged(connection_type_e type, void* user_data) -{ - NetworkErrorHandler *self = static_cast(user_data); - if(type == CONNECTION_TYPE_DISCONNECTED){ - self->networkError(); - }else{ - self->networkConnected(); - } -} -#endif - -} /* end of namespace basic_ui */ -} /* end of namespace tizen_browser */ diff --git a/services/SimpleUI/NetworkErrorHandler.h b/services/SimpleUI/NetworkErrorHandler.h deleted file mode 100644 index 2b39f92..0000000 --- a/services/SimpleUI/NetworkErrorHandler.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NETWORKINGERRORHANDLER_H -#define NETWORKINGERRORHANDLER_H - -#include "browser_config.h" -#include - -#if PLATFORM(TIZEN) -#include -#endif - -#include - -namespace tizen_browser -{ -namespace basic_ui -{ - - - -class NetworkErrorHandler -{ - -public: - NetworkErrorHandler(); - ~NetworkErrorHandler(); - - boost::signals2::signal networkError; - boost::signals2::signal networkConnected; - -private: -#if PLATFORM(TIZEN) - static void onConnectionStateChanged(connection_type_e type, void* user_data); -#endif - - /** - * @brief Typedef, RAI for connection ptr. - * - * dlopen return void* - * dlclose return int - */ -#if PLATFORM(TIZEN) - connection_h connection; -#endif -}; - -} /* end of namespace basic_ui */ -} /* end of namespace tizen_browser */ - -#endif // NETWORKINGERRORHANDLER_H diff --git a/services/SimpleUI/RelatedWebPages.cpp b/services/SimpleUI/RelatedWebPages.cpp deleted file mode 100644 index 7a52a86..0000000 --- a/services/SimpleUI/RelatedWebPages.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "RelatedWebPages.h" -#include "BrowserLogger.h" -#include "BrowserAssert.h" -#include "Tools/EflTools.h" - -namespace tizen_browser{ -namespace base_ui{ - -typedef struct _BookmarkItemData -{ - std::shared_ptr item; - std::shared_ptr relatedWebPages; -} BookmarkItemData; - -RelatedWebPages::RelatedWebPages() : m_parent(NULL), m_gengrid(NULL), m_item_class(NULL), m_gengridSetup(false) -{ - -} - -void RelatedWebPages::init(Evas_Object* p) -{ - m_parent = p; - m_gengrid = elm_gengrid_add(m_parent); - - evas_object_smart_callback_add(m_gengrid, "item,focused", focusItem, NULL); - evas_object_smart_callback_add(m_gengrid, "item,unfocused", unFocusItem, NULL); - - if (!m_item_class) { - m_item_class = elm_genlist_item_class_new(); - m_item_class->item_style = "rel_page_item"; - m_item_class->func.text_get = NULL; - m_item_class->func.content_get = _grid_content_get; - m_item_class->func.state_get = NULL; - m_item_class->func.del = NULL; - } -} - -void RelatedWebPages::addRelatedPage(std::shared_ptr bi) -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - BookmarkItemData *itemData = new BookmarkItemData(); - itemData->item = bi; - itemData->relatedWebPages = std::shared_ptr(this); - /*Elm_Object_Item* bookmarkView =*/ elm_gengrid_item_append(m_gengrid, m_item_class, itemData, NULL, this); - //m_map_bookmark_views.insert(std::pair(bi->getAddress(),bookmarkView)); - - //setEmptyGengrid(false); -} - -Evas_Object * RelatedWebPages::_grid_content_get(void *data, Evas_Object *obj, const char *part) -{ - BROWSER_LOGD("%s:%d %s part=%s", __FILE__, __LINE__, __func__, part); - BookmarkItemData *itemData = reinterpret_cast(data); - - if (!strcmp(part, "elm.thumbnail")) { - if (itemData->item->getThumbnail()) { - Evas_Object * thumb = tizen_browser::tools::EflTools::getEvasImage(itemData->item->getThumbnail(), itemData->relatedWebPages->m_parent); - return thumb; - } - else { - return NULL; - } - } - else if (!strcmp(part, "elm.label")) { - Evas_Object *label = elm_label_add(obj); - elm_object_style_set(label, "rel_pages_label"); - elm_object_text_set(label, itemData->item->getTittle().c_str()); - return label; - } - else if (!strcmp(part, "elm.thumbButton")) { - Evas_Object *thumbButton = elm_button_add(obj); - elm_object_style_set(thumbButton, "thumbButton"); - evas_object_smart_callback_add(thumbButton, "clicked", RelatedWebPages::_thumbSelected, data); - return thumbButton; - } - return NULL; -} - -Evas_Object * RelatedWebPages::getContent() -{ - BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - M_ASSERT(m_parent); - - /*if(!elm_gengrid_items_count(m_gengrid)) - elm_object_part_content_set(m_gengrid, "elm.swallow.empty", createNoBookmarksLabel());*/ - - if(!m_gengridSetup) { - std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleUI/RelatedPages.edj"); - elm_theme_extension_add(NULL, edjFilePath.c_str()); - - - elm_object_style_set(m_gengrid, "rel_pages"); - - elm_gengrid_align_set(m_gengrid, 0, 0); - elm_gengrid_item_size_set(m_gengrid, 252, 222); - elm_gengrid_select_mode_set(m_gengrid, ELM_OBJECT_SELECT_MODE_ALWAYS); - elm_gengrid_multi_select_set(m_gengrid, EINA_FALSE); - elm_gengrid_horizontal_set(m_gengrid, EINA_FALSE); - elm_gengrid_highlight_mode_set(m_gengrid, EINA_TRUE); - elm_scroller_policy_set(m_gengrid, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); - elm_scroller_page_size_set(m_gengrid, 0, 327); - - evas_object_size_hint_weight_set(m_gengrid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_gengrid, EVAS_HINT_FILL, EVAS_HINT_FILL); - - m_gengridSetup = true; - } - return m_gengrid; -} - -void RelatedWebPages::deleteAllItems() -{ - BROWSER_LOGD("Deleting all items from gengrid"); - elm_gengrid_clear(m_gengrid); -} - -void RelatedWebPages::_thumbSelected(void * data, Evas_Object * /*obj*/, void * /*event_info*/) -{ - BookmarkItemData * itemData = reinterpret_cast(data); - itemData->relatedWebPages->bookmarkClicked(itemData->item); -} - -void RelatedWebPages::focusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,in", "over2"); -} - -void RelatedWebPages::unFocusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,out", "over2"); -} - -} - -} diff --git a/services/SimpleUI/RelatedWebPages.h b/services/SimpleUI/RelatedWebPages.h deleted file mode 100644 index 0be0119..0000000 --- a/services/SimpleUI/RelatedWebPages.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef RELATEDWEBPAGES_H -#define RELATEDWEBPAGES_H - -#include -#include "BookmarkItem.h" - -#include - -namespace tizen_browser{ -namespace base_ui{ - -class RelatedWebPages -{ -public: - RelatedWebPages(); - void init(Evas_Object* p); - Evas_Object* getContent(); - void addRelatedPage(std::shared_ptr bi); - void deleteAllItems(); - - boost::signals2::signal)> bookmarkClicked; - -private: - Evas_Object *m_parent, *m_gengrid; - Elm_Gen_Item_Class *m_item_class; - bool m_gengridSetup; - - static Evas_Object* _grid_content_get(void *data, Evas_Object *obj, const char *part); - static void _thumbSelected(void * data, Evas_Object * obj, void * event_info); - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); -}; - -} - -} - -#endif // RELATEDWEBPAGES_H diff --git a/services/SimpleUI/Settings.cpp b/services/SimpleUI/Settings.cpp deleted file mode 100644 index db9c61b..0000000 --- a/services/SimpleUI/Settings.cpp +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Settings.h" -#include -#include -#include -#include -#include -#include "BrowserLogger.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -SettingsItem::SettingsItem() - : action(std::make_shared()) -{ - -} -SettingsItem::SettingsItem( std::shared_ptr action) - : action(action) -{ - -} - - -SettingsItem::SettingsItem(const SettingsItem& source) - : action(source.action) -{ - -} -SettingsItem::SettingsItem(const SettingsItem* source) - : action(source->action) -{ - -} - - -SettingsItem::~SettingsItem() -{ - //elm_genlist_item_class_free(m_itemClass);?? -} - -Settings::Settings(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton) - : MenuButton(mainWindow, parentButton) - , m_genlist(0) - , m_itemClass(0) - , m_internalPopup(0) - , m_internalPopupVisible(false) - , m_pointerModeEnabled(true) -{ - std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleUI/Settings.edj"); - elm_theme_extension_add(0, edjFilePath.c_str()); - - m_genlist = elm_genlist_add(m_window.get()); - - evas_object_smart_callback_add(m_genlist, "item,focused", focusItem, NULL); - evas_object_smart_callback_add(m_genlist, "item,unfocused", unFocusItem, NULL); - - elm_object_style_set(m_genlist, "settings"); - elm_genlist_homogeneous_set(m_genlist, EINA_TRUE); - elm_genlist_multi_select_set(m_genlist, EINA_FALSE); - - elm_genlist_select_mode_set(m_genlist, ELM_OBJECT_SELECT_MODE_ALWAYS); - - m_itemClass = elm_genlist_item_class_new(); - m_itemClass->item_style = "settings_item"; - - m_itemClass->func.text_get = &gridTextGet; - m_itemClass->func.content_get = &gridOptionLabelGet; - m_itemClass->func.state_get = 0; - m_itemClass->func.del = 0; -} - -Settings::~Settings() -{ - -} - -Evas_Object* Settings::getContent() -{ - return m_genlist; -} - -tizen_browser::base_ui::MenuButton::ListSize Settings::calculateSize() -{ - ListSize result; - - result.width = 490; - result.height = 426; - - return result; -} - -Evas_Object* Settings::getFirstFocus() -{ - return m_genlist; -} - -void Settings::addAction(sharedAction action) -{ - std::shared_ptr settingsItem = std::make_shared(action); - BROWSER_LOGD("[%s] %x: %s", __func__ , settingsItem.get(), settingsItem->action->getText().c_str() ); - Elm_Object_Item* elmItem= elm_genlist_item_append(m_genlist, //genlist - m_itemClass, //item Class - settingsItem.get(), //item data - 0, //parent item - ELM_GENLIST_ITEM_NONE,//item type - itemClicked, - this - ); - m_settingsItemsMap[elmItem] = settingsItem; - BROWSER_LOGD("[%s:%d] \n\t %x:%s ", __PRETTY_FUNCTION__, __LINE__, elmItem, settingsItem->action->getText().c_str()); - if(!settingsItem->action->isEnabled()){ - elm_object_item_disabled_set(elmItem, EINA_TRUE); - } - if(settingsItem->action->isCheckable()){ - elm_object_item_signal_emit(elmItem, - (settingsItem->action->isChecked() ? "switch,on" : "switch,off") - , "SettingsModel"); - } else { - elm_object_item_signal_emit(elmItem, "switch,hide", "SettingsModel"); - } - action->enabledChanged.connect(boost::bind(&Settings::onEnabledChanged, this, action)); - m_actionButtonMap[action] = elmItem; -} - -void Settings::onEnabledChanged(sharedAction action) -{ - BROWSER_LOGD("[%s]", __func__); - refreshAction(action); -} - -void Settings::refreshAction(sharedAction action) -{ - BROWSER_LOGD("[%s]", __func__); - if(action->isEnabled()) - elm_object_item_disabled_set(m_actionButtonMap[action], EINA_FALSE); - else - elm_object_item_disabled_set(m_actionButtonMap[action], EINA_TRUE); -} - -char* Settings::gridTextGet(void* data, Evas_Object* /*obj*/, const char* part) -{ - BROWSER_LOGD("[%s]", __func__); - SettingsItem *settingsItem =reinterpret_cast(data); - if(!strcmp(part, "optionName")){ - if(!settingsItem->action->getText().empty()){ - return strdup(settingsItem->action->getText().c_str()); - } - } - return strdup(""); -} - -Evas_Object* Settings::gridOptionLabelGet(void* data, Evas_Object* obj, const char* part) -{ - SettingsItem *settingsItem =reinterpret_cast(data); - if(!strcmp(part, "optionValue")){ - if(settingsItem->action->isEnabled() && settingsItem->action->isCheckable()){ - Evas_Object *label = elm_label_add(obj); - elm_object_text_set(label, (settingsItem->action->isChecked() ? "On" :"Off" )); - elm_object_style_set(label, "settings_label"); - return label; - } - } - return NULL; - -} - -void Settings::itemClicked(void* data, Evas_Object* /*o*/, void* event_info) -{ - BROWSER_LOGD("[%s]", __func__); - - Settings* settings = reinterpret_cast(data); - Elm_Object_Item* elmItem = reinterpret_cast(event_info); - BROWSER_LOGD("[%s:%d] \n\t %x", __PRETTY_FUNCTION__, __LINE__, elmItem); - if(settings->m_settingsItemsMap.count(elmItem)){ - std::shared_ptr settingsItem(settings->m_settingsItemsMap[elmItem]);// elm_object_item_data_get(elmItem) - if(settingsItem->action->isEnabled()){ - if(settingsItem->action->isCheckable()) { - settings->showInternalPopup(elmItem); - } else{ - settingsItem->action->trigger(); - } - } - } -} - -void Settings::showInternalPopup(Elm_Object_Item* listItem) -{ - BROWSER_LOGD("[%s]", __func__); - m_internalPopupVisible = true; - m_trackedItem = listItem; - - if(!m_internalPopup){ - m_internalPopup = elm_ctxpopup_add(m_window.get()); - evas_object_smart_callback_add(m_internalPopup, "dismissed", Settings::dismissedCtxPopup, this); - } - Evas_Object * buttonBox = elm_box_add(m_internalPopup); - Evas_Object * radioOn = elm_radio_add(m_internalPopup); - Evas_Object * radioOff = elm_radio_add(m_internalPopup); - - - elm_object_text_set(radioOn, "On"); - elm_object_text_set(radioOff, "Off"); - - elm_object_style_set(radioOn, "settings_radio"); - elm_object_style_set(radioOff, "settings_radio"); - - elm_box_pack_end(buttonBox, radioOn); - elm_box_pack_end(buttonBox, radioOff); - - m_checkState = (m_settingsItemsMap[m_trackedItem]->action->isChecked() ? CheckStateOn : CheckStateOff ); - - elm_radio_state_value_set(radioOn, CheckStateOn);//true - elm_radio_value_pointer_set(radioOn, reinterpret_cast(&m_checkState)); - - elm_radio_state_value_set(radioOff, CheckStateOff);//false - elm_radio_value_pointer_set(radioOff, reinterpret_cast(&m_checkState)); - - elm_radio_group_add(radioOff, radioOn); - - evas_object_smart_callback_add(radioOn, "changed", radioChanged, this); - evas_object_smart_callback_add(radioOff, "changed", radioChanged, this); - - evas_object_size_hint_weight_set(buttonBox, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(buttonBox, EVAS_HINT_FILL, EVAS_HINT_FILL); - - evas_object_show(buttonBox); - evas_object_show(radioOn); - evas_object_show(radioOff); - - - elm_object_content_set(m_internalPopup, buttonBox); - elm_ctxpopup_direction_priority_set(m_internalPopup, - ELM_CTXPOPUP_DIRECTION_DOWN, - ELM_CTXPOPUP_DIRECTION_DOWN, - ELM_CTXPOPUP_DIRECTION_DOWN, - ELM_CTXPOPUP_DIRECTION_DOWN); - Evas_Coord w,h,x,y; - -#if PLATFORM(TIZEN) - evas_object_geometry_get(elm_object_item_track(m_trackedItem), &x, &y, &w, &h); - - BROWSER_LOGD("[%s:%d] \n\tx:%d; y:%d; w:%d; h:%d ", __PRETTY_FUNCTION__, __LINE__, - x, y, w, h); - evas_object_move(m_internalPopup, x + 354, y);//354 is proper value -#endif - - elm_object_style_set(m_internalPopup, "settings_button"); - evas_object_show(m_internalPopup); - if(!m_pointerModeEnabled) - elm_object_focus_set(radioOn, EINA_TRUE); - elm_object_item_signal_emit(m_trackedItem, "selected", "SettingsModel"); - elm_object_signal_emit(m_genlist, "show_popup", "SettingsModel"); -} - -void Settings::dismissedCtxPopup(void* data, Evas_Object* obj, void* /*event_info*/) -{ - BROWSER_LOGD("[%s]", __func__); - Settings* settings = static_cast(data); - evas_object_hide(obj); - settings->m_internalPopup = 0; - elm_object_signal_emit(settings->m_genlist, "hide_popup", "SettingsModel"); - elm_object_item_signal_emit(settings->m_trackedItem, "unselected", "SettingsModel"); - -#if PLATFORM(TIZEN) - elm_object_item_untrack(settings->m_trackedItem); -#endif - settings->m_internalPopupVisible = false; -} - -void Settings::radioChanged(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Settings *settings = static_cast(data); - std::shared_ptr settingsItem(settings->m_settingsItemsMap[settings->m_trackedItem]); - settingsItem->action->toggle(); - elm_object_item_signal_emit(settings->m_trackedItem, - (settingsItem->action->isChecked() ? "switch,on" : "switch,off") - , "SettingsModel"); - elm_genlist_item_update(settings->m_trackedItem); - elm_object_signal_emit(settings->m_internalPopup, "elm,state,hide", "elm"); -} - -void Settings::focusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,in", "option*"); -} - -void Settings::unFocusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,out", "option*"); -} - -void Settings::setPointerModeEnabled (bool enabled) -{ - m_pointerModeEnabled = enabled; -} - -bool Settings::canBeDismissed() -{ - BROWSER_LOGD("[%s]", __func__); - bool internalPopupVisible = m_internalPopup && m_internalPopupVisible; - if(internalPopupVisible) { - elm_ctxpopup_dismiss(m_internalPopup); - return false; - } - return true; -} - -}//namespace base_ui - -}//namespace tizen_browser diff --git a/services/SimpleUI/Settings.h b/services/SimpleUI/Settings.h deleted file mode 100644 index f8a086e..0000000 --- a/services/SimpleUI/Settings.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SETTINGS_H -#define SETTINGS_H -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Action.h" -#include "MenuButton.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -struct SettingsItem{ - std::shared_ptr action; - SettingsItem(); - SettingsItem(std::shared_ptr action); - SettingsItem(const SettingsItem& source); - SettingsItem(const SettingsItem* source); - ~SettingsItem(); -}; - - -class Settings: public MenuButton -{ -public: - Settings(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton); - ~Settings(); - virtual Evas_Object *getContent(); - virtual ListSize calculateSize(); - virtual Evas_Object* getFirstFocus(); - void addAction(sharedAction action); - void onEnabledChanged(sharedAction action); - void refreshAction(sharedAction action); - void setPointerModeEnabled (bool enabled); - - virtual bool canBeDismissed(); -private: - static char *gridTextGet(void *data, Evas_Object* obj, const char *part); - static Evas_Object *gridOptionLabelGet(void* data, Evas_Object* /*obj*/, const char* part); - static void itemClicked(void *data, Evas_Object *o, void *event_info); - - void showInternalPopup(Elm_Object_Item* parent); - static void dismissedCtxPopup(void* data, Evas_Object* obj, void* event_info); - static void radioChanged(void *data, Evas_Object *obj, void *event_info); - -private: - Evas_Object *m_genlist; - Evas_Object *m_internalPopup; - Elm_Object_Item *m_trackedItem; - Elm_Genlist_Item_Class *m_itemClass; - bool m_internalPopupVisible; - bool m_pointerModeEnabled; - std::map> m_settingsItemsMap; - std::map m_actionButtonMap; - enum CheckState{ - CheckStateOn=1 - ,CheckStateOff=2 - }; - CheckState m_checkState; - - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); -}; - -}//namespace base_ui - -}//namespace tizen_browser - -#endif // SETTINGS_H diff --git a/services/SimpleUI/SimpleScroller.cpp b/services/SimpleUI/SimpleScroller.cpp deleted file mode 100644 index beff98c..0000000 --- a/services/SimpleUI/SimpleScroller.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "SimpleScroller.h" -#include "BrowserLogger.h" - -namespace tizen_browser{ -namespace base_ui{ - -SimpleScroller::SimpleScroller(Evas_Object* parent, Evas_Object *content) -{ - m_scroller = elm_scroller_add(parent); - elm_scroller_propagate_events_set(m_scroller, EINA_TRUE); - evas_object_smart_callback_add(m_scroller, "edge,top", _scrollTopReached, m_scroller); - evas_object_smart_callback_add(m_scroller, "edge,bottom", _scrollBottomReached, m_scroller); - evas_object_smart_callback_add(m_scroller, "scroll,down", _scrollDown, m_scroller); - evas_object_smart_callback_add(m_scroller, "scroll,up", _scrollUp, m_scroller); - elm_object_focus_allow_set(m_scroller, EINA_FALSE); - elm_scroller_policy_set(m_scroller, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_AUTO); - elm_scroller_content_min_limit(m_scroller, EINA_FALSE, EINA_FALSE); - elm_object_content_set(m_scroller, content); - evas_object_show(m_scroller); -} - -Evas_Object* SimpleScroller::getEvasObjectPtr() -{ - return m_scroller; -} - -void SimpleScroller::_scrollTopReached(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("Top"); - elm_object_signal_emit(reinterpret_cast(data), "hide,top,shadow", ""); -} - -void SimpleScroller::_scrollBottomReached(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("Bottom"); - elm_object_signal_emit(reinterpret_cast(data), "hide,bottom,shadow", ""); -} - -void SimpleScroller::_scrollDown(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("Down"); - elm_object_signal_emit(reinterpret_cast(data), "show,top,shadow", ""); -} - -void SimpleScroller::_scrollUp(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("Up"); - elm_object_signal_emit(reinterpret_cast(data), "show,bottom,shadow", ""); -} - -} -} diff --git a/services/SimpleUI/SimpleScroller.h b/services/SimpleUI/SimpleScroller.h deleted file mode 100644 index 6a6c32d..0000000 --- a/services/SimpleUI/SimpleScroller.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SIMPLESCROLLER_H -#define SIMPLESCROLLER_H - -#include "Elementary.h" - -namespace tizen_browser{ -namespace base_ui{ - -class SimpleScroller -{ -public: - SimpleScroller(Evas_Object* parent, Evas_Object *content); - //void setContent(Evas_Object *content); - Evas_Object* getEvasObjectPtr(); -private: - Evas_Object *m_scroller; - - static void _scrollTopReached(void *data, Evas_Object *obj, void *event_info); - static void _scrollBottomReached(void *data, Evas_Object *obj, void *event_info); - static void _scrollDown(void *data, Evas_Object *obj, void *event_info); - static void _scrollUp(void *data, Evas_Object *obj, void *event_info); -}; - -} -} - -#endif // SIMPLESCROLLER_H diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 6d39786..9ee8eae 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -46,7 +46,6 @@ #include "BookmarkItem.h" #include "boost/date_time/gregorian/gregorian.hpp" #include "boost/date_time/posix_time/posix_time.hpp" -#include "NetworkErrorHandler.h" #include "SqlStorage.h" #include "DetailPopup.h" @@ -64,14 +63,12 @@ SimpleUI::SimpleUI() , m_mainLayout(nullptr) , m_progressBar(nullptr) , m_popup(nullptr) - , m_settings() , m_moreMenuUI() , m_tabUI() , m_bookmarkManagerUI() , m_mainUI() , m_initialised(false) , m_isHomePageActive(false) - , m_currentZoom(ZOOM_TYPE_100) , items_vector() , m_networkErrorPopup(0) , m_wvIMEStatus(false) @@ -270,11 +267,6 @@ void SimpleUI::loadUIServices() std::dynamic_pointer_cast (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.mainui")); - - m_netErrorHandler = - std::unique_ptr - - (new tizen_browser::basic_ui::NetworkErrorHandler); } void SimpleUI::connectUISignals() @@ -377,8 +369,6 @@ void SimpleUI::connectModelSignals() void SimpleUI::loadThemes() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - elm_theme_extension_add(nullptr, edjePath("SimpleUI/ZoomItem.edj").c_str()); - elm_theme_extension_add(nullptr, edjePath("SimpleUI/TabItem.edj").c_str()); elm_theme_extension_add(nullptr, edjePath("SimpleUI/ErrorMessage.edj").c_str()); elm_theme_overlay_add(0, edjePath("SimpleUI/ScrollerDefault.edj").c_str()); @@ -841,72 +831,6 @@ void SimpleUI::webEngineURLChanged(const std::string url) bookmarkCheck(); } -void SimpleUI::showZoomMenu() -{ - if(!m_zoomList){ - BROWSER_LOGD("[%s:%d] - create ", __PRETTY_FUNCTION__, __LINE__); - m_zoomList = std::make_shared(m_window, - rightButtonBar->getButton("zoom_in_button")); - m_zoomList->addItem("300%", ZOOM_TYPE_300); - m_zoomList->addItem("200%", ZOOM_TYPE_200); - m_zoomList->addItem("150%", ZOOM_TYPE_150); - m_zoomList->addItem("100%", ZOOM_TYPE_100); - m_zoomList->addItem("75%", ZOOM_TYPE_75); - m_zoomList->addItem("50%", ZOOM_TYPE_50); - - m_zoomList->zoomChanged.connect(boost::bind(&SimpleUI::zoomLevelChanged, this, _1)); - } - - zoom_type currentZoomType; - - currentZoomType = static_cast (m_webEngine->getZoomFactor()); - - //Handling Initial case - if(m_webEngine->getZoomFactor() == 0){ - m_webEngine->setZoomFactor(100); - m_currentZoom = static_cast (100); - currentZoomType = ZOOM_TYPE_100; - } - //each tab may have another zoom, but there is only one instance of zoomlist - //so we should refresh value of zoom every time - m_zoomList->setZoom(currentZoomType); - BROWSER_LOGD("Current zoom factor from webkit %d%%", m_webEngine->getZoomFactor()); - - m_platformInputManager->returnPressed.disconnect_all_slots(); - m_platformInputManager->returnPressed.connect(boost::bind(&SimpleUI::onReturnPressed, this, m_zoomList.get())); - hidePopup.connect(boost::bind(&SimpleUI::onReturnPressed, this, m_zoomList.get())); - m_zoomList->showPopup(); -} - -void SimpleUI::zoomLevelChanged(int zoom_level) -{ - m_webEngine->setZoomFactor(zoom_level); - m_currentZoom = static_cast (zoom_level); -} - -void SimpleUI::AddBookmarkPopup(std::string& str) -{ - BROWSER_LOGD("[%s]", __func__); - if(!m_bookmarks_manager){ - m_bookmarks_manager = std::make_shared(m_window, - rightButtonBar->getButton("bookmark_button")); - m_bookmarks_manager->addAction( m_bookmarks_manager_Add_NewFolder); - m_bookmarks_manager->addAction( m_bookmarks_manager_BookmarkBar); - m_bookmarks_manager->addAction( m_bookmarks_manager_Folder1); - m_bookmarks_manager->addAction( m_bookmarks_manager_Folder2); - m_bookmarks_manager->addAction( m_bookmarks_manager_Folder3); - } - m_platformInputManager->returnPressed.disconnect_all_slots(); - m_platformInputManager->returnPressed.connect(boost::bind(&SimpleUI::onReturnPressed, this, m_bookmarks_manager.get())); - hidePopup.connect(boost::bind(&SimpleUI::onReturnPressed, this, m_bookmarks_manager.get())); - m_bookmarks_manager->showPopup(); -} - -void SimpleUI::AddNewFolderPopup(std::string& str) -{ - BROWSER_LOGD("[%s]", __func__); -} - void SimpleUI::showTabUI() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index ce52557..9a8b7db 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -43,8 +43,6 @@ #include "HistoryService.h" #include "BookmarkManagerUI.h" #include "SimpleURI.h" -#include "SimpleScroller.h" -#include "WebTitleBar.h" #include "PlatformInputManager.h" #include "SessionStorage.h" #include "SqlStorage.h" @@ -53,13 +51,7 @@ #include "Action.h" #include "SimplePopup.h" #include "WebConfirmation.h" -#include "ZoomList.h" -#include "TabList.h" #include "BookmarksManager.h" -#include "Settings.h" -#include "HistoryList.h" -#include "NetworkErrorHandler.h" -#include "CustomPopup.h" #include "Config.h" namespace tizen_browser{ @@ -223,17 +215,8 @@ private: */ void deleteBookmark(void); - /** - * \brief shows Zoom showZoomMenu - */ - void showZoomMenu(); - - void zoomLevelChanged(int zoom_level); - void showHistory(); void hideHistory(); - void AddBookmarkPopup(std::string& str); - void AddNewFolderPopup(std::string& str); void addBookmarkFolders(); void newFolderBookmarkManager(const char* title, int by_user); @@ -300,14 +283,10 @@ private: Evas_Object *m_popup; Evas_Object *m_entry; Evas_Object *m_errorLayout; - CustomPopup *m_ownPopup; - SimpleScroller *m_scroller; std::shared_ptr> m_webEngine; std::shared_ptr m_simpleURI; std::shared_ptr leftButtonBar; - std::shared_ptr webviewbar; - std::shared_ptr rightButtonBar; std::shared_ptr m_favoriteService; std::shared_ptr m_historyService; @@ -317,18 +296,12 @@ private: std::shared_ptr m_historyUI; std::shared_ptr m_settingsUI; std::shared_ptr m_tabUI; - std::shared_ptr m_zoomList; - std::shared_ptr m_tabList; std::shared_ptr m_platformInputManager; std::shared_ptr m_sessionService; tizen_browser::Session::Session m_currentSession; std::shared_ptr m_bookmarks_manager; - std::shared_ptr m_settings; - std::shared_ptr m_historyList; - std::shared_ptr webTitleBar; bool m_initialised; bool m_isHomePageActive; - zoom_type m_currentZoom; int m_tabLimit; int m_favoritesLimit; bool m_wvIMEStatus; @@ -339,7 +312,6 @@ private: Ewk_Context *m_ewkContext; std::vector> items_vector; - std::unique_ptr m_netErrorHandler; SimplePopup* m_networkErrorPopup; void searchWebPage(std::string &text, int flags); diff --git a/services/SimpleUI/TabList.cpp b/services/SimpleUI/TabList.cpp deleted file mode 100644 index 5ea4930..0000000 --- a/services/SimpleUI/TabList.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "TabList.h" -#include "BrowserAssert.h" -#include "BrowserLogger.h" -#include "EflTools.h" -#include -#include - -namespace tizen_browser -{ -namespace base_ui -{ - -const int TabList::ScrollBorderValue = 8; - -TabList::TabList(std::shared_ptr< Evas_Object > parent, Evas_Object* parentButton) - : MenuButton(parent, parentButton) - , m_list(NULL) - , m_box(NULL) - , m_deleteSelected(false) -{ - m_box = elm_box_add(m_window.get()); - evas_object_size_hint_align_set(m_box, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(m_box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(m_box); - - m_newTabBtn = elm_button_add(m_box); - elm_object_style_set(m_newTabBtn, "new_tab_elem"); - evas_object_smart_callback_add(m_newTabBtn, "clicked", TabList::_newTab_clicked_cb, (void*)this); - //evas_object_smart_callback_add(m_newTabBtn, "focused", TabList::newButtonFocused, this); - //evas_object_smart_callback_add(m_newTabBtn, "unfocused", TabList::newButtonUnFocused, this); - evas_object_show(m_newTabBtn); - - m_list = elm_list_add(m_box); - evas_object_size_hint_align_set(m_list, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(m_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_list_mode_set(m_list, ELM_LIST_SCROLL); - elm_list_multi_select_set(m_list, EINA_FALSE); - elm_list_select_mode_set(m_list, ELM_OBJECT_SELECT_MODE_ALWAYS); - - evas_object_smart_callback_add(m_list, "item,focused", TabList::focusItem, this); - evas_object_smart_callback_add(m_list, "item,unfocused", TabList::unFocusItem, this); - - elm_object_focus_next_object_set(m_newTabBtn, m_list, ELM_FOCUS_DOWN); - - elm_object_style_set(m_list, "tab_list"); - - elm_box_pack_end(m_box, m_newTabBtn); - elm_box_pack_end(m_box, m_list); - - elm_list_go(m_list); - - //elm_object_focus_next_object_set(m_newTabBtn, m_list, ELM_FOCUS_DOWN); - - evas_object_show(m_list); -} - -void TabList::addItem(std::shared_ptr tab) -{ - tab_data *data = new tab_data(); - data->id = tab->getId(); - data->tab_list = this; - - Evas_Object *end = elm_button_add(m_list); - Evas_Object *icon = elm_button_add(m_list); - - - elm_object_focus_allow_set(end, EINA_TRUE); - elm_object_focus_allow_set(icon, EINA_TRUE); - - elm_object_style_set(end, "invisible_button"); - elm_object_style_set(icon, "invisible_button"); - - Evas_Object * thumbnail = tizen_browser::tools::EflTools::getEvasImage(tab->getThumbnail(), icon); - if (thumbnail) - elm_object_part_content_set(icon, "e.swallow.icon", thumbnail); - else - BROWSER_LOGD("[%s] Empty thumbnail added to tabs vector", __func__); - - evas_object_smart_callback_add(icon, "clicked", TabList::_item_clicked_cb, (void *)data); - evas_object_smart_callback_add(end, "clicked", TabList::_deleteTab_clicked_cb, (void *)data); - Elm_Object_Item *item = elm_list_item_append(m_list, tab->getTitle().c_str(), icon, end, NULL, data); - - elm_object_focus_next_object_set(elm_list_item_object_get(item), - elm_object_item_part_content_get(item, "elm.swallow.end"), ELM_FOCUS_RIGHT); - - m_items[tab->getId()] = item; - - elm_list_go(m_list); -} - -void TabList::addItems(std::vector> items) -{ - clearItems(); - for (std::vector >::iterator it = items.begin(); it != items.end(); ++it) { - addItem(*it); - } -} - -void TabList::clearItems() -{ - m_items.clear(); - - /* - * Calling elm_list_clear in this case makes that list cannot receive focus anymore. - * So deleting item by item is necessary. - */ - Elm_Object_Item *item; - while((item = elm_list_first_item_get(m_list))) - elm_object_item_del(item); -} - -void TabList::replaceItems(std::vector< std::shared_ptr< basic_webengine::TabContent > > items) -{ - clearItems(); - addItems(items); -} - -int TabList::getItemcCount() -{ - return m_items.size(); -} - -Evas_Object* TabList::getContent() -{ - return m_box; -} - -MenuButton::ListSize TabList::calculateSize() -{ - elm_object_focus_allow_set(m_list, m_items.size() ? EINA_TRUE : EINA_FALSE); - - ListSize result; - - result.width = 390; - - result.height = 89 * (getItemcCount()+1) + 8; - - int x, y, w, h; - Evas_Object *focusDown = elm_object_focus_next_object_get(m_newTabBtn, ELM_FOCUS_DOWN); - evas_object_geometry_get(focusDown, &x, &y, &w, &h); - BROWSER_LOGD("%d %d %d %d\n", x, y, w, h); - - const int listMaxHeight = atoi(edje_file_data_get((std::string(EDJE_DIR) + "SimpleUI/TabItem.edj").c_str(),"list_max_height")); - if (result.height > listMaxHeight) - result.height = listMaxHeight; - - return result; -} - -void TabList::_item_clicked_cb(void* data, Evas_Object */*obj*/, void */*event_info*/) -{ - tab_data *tab = static_cast(data); - tab->tab_list->tabClicked(tab->id); - tab->tab_list->hidePopup(); -} - -void TabList::_newTab_clicked_cb(void* data, Evas_Object */*obj*/, void */*event_info*/) -{ - TabList *self = reinterpret_cast(data); - self->newTabClicked(); - self->hidePopup(); -} - -void TabList::_deleteTab_clicked_cb(void* data, Evas_Object */*obj*/, void */*event_info*/) -{ - tab_data *tab = static_cast(data); - tab->tab_list->tabDelete(tab->id); - tab->tab_list->hidePopup(); -} - -void TabList::setCurrentTabId(tizen_browser::basic_webengine::TabId currentTabId) -{ - m_currentTabId = currentTabId; -} - -void TabList::disableNewTabBtn(bool disabled) -{ - elm_object_disabled_set(m_newTabBtn, disabled); -} - -void TabList::onPopupShow() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - - if(m_items.find(m_currentTabId) != m_items.end()) - elm_object_item_signal_emit(m_items[m_currentTabId], "highlight,selected", ""); -} - -Evas_Object* TabList::getFirstFocus() -{ - BROWSER_LOGD("[%s:%d] m_newTabBtn: %x ", __PRETTY_FUNCTION__, __LINE__, m_newTabBtn); - return m_newTabBtn; -} - -void TabList::focusItem(void* data, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - TabList *self = reinterpret_cast(data); - Elm_Object_Item *item = reinterpret_cast(event_info); - BROWSER_LOGD("[%s:%d] Item: %s ", __PRETTY_FUNCTION__, __LINE__, elm_object_item_part_text_get(item,"elm.text")); - //elm_object_signal_emit(elm_object_item_ item, "mouse,in", "elm.swallow.icon"); - elm_object_item_signal_emit( item, "mouse,in", "elm.swallow.icon"); - //elm.swallow.end - //Evas_Object* delIcon = elm_object_part_content_get(item, "elm.swallow.end"); - self->m_lastFocusedItem = item; -} - -void TabList::unFocusItem(void* data, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - TabList *self = reinterpret_cast(data); - Elm_Object_Item *item = reinterpret_cast(event_info); - BROWSER_LOGD("[%s:%d] Item: %s ", __PRETTY_FUNCTION__, __LINE__, elm_object_item_part_text_get(item,"elm.text")); - //elm_object_signal_emit(elm_object_item_ item, "mouse,in", "elm.swallow.icon"); - elm_object_item_signal_emit(item, "mouse,out", "elm.swallow.end"); - elm_object_item_signal_emit(item, "mouse,out", "elm.swallow.icon"); - - self->m_deleteSelected = false; -} - -void TabList::newButtonFocused(void* /*data*/, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); -} - -void TabList::newButtonUnFocused(void* data, Evas_Object* /*obj*/, void* /*event_info*/) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - TabList *self = reinterpret_cast(data); - //EFL BUG workaround: it looks like button do not get "unfocus" signal each time. - elm_object_signal_emit(self->m_newTabBtn, "elm,action,unfocus","elm"); -} - -void TabList::rightPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,out", "elm.swallow.icon"); - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,in", "elm.swallow.end"); - m_deleteSelected = true; - } -} - -void TabList::leftPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,out", "elm.swallow.end"); - elm_object_item_signal_emit(m_lastFocusedItem, "mouse,in", "elm.swallow.icon"); - m_deleteSelected = false; - } -} - -void TabList::enterPressed() -{ - if(m_lastFocusedItem && elm_object_focus_get(elm_object_item_widget_get(m_lastFocusedItem))) { - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - - tab_data *td = static_cast(elm_object_item_data_get(m_lastFocusedItem)); - M_ASSERT(td); - - if(m_deleteSelected) { - tabDelete(td->id); - } - else { - tabClicked(td->id); - } - hidePopup(); - } -} - -} - -} diff --git a/services/SimpleUI/TabList.h b/services/SimpleUI/TabList.h deleted file mode 100644 index 81c0fca..0000000 --- a/services/SimpleUI/TabList.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TABLIST_H -#define TABLIST_H - -#include -#include - -#include "TabId.h" -#include "SimpleScroller.h" - -#include "MenuButton.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -class TabList:public MenuButton{ - -public: - TabList(std::shared_ptr parent, Evas_Object* parentButton); - void addItem(std::shared_ptr); - void addItems(std::vector>); - void clearItems(); - void replaceItems(std::vector< std::shared_ptr< tizen_browser::basic_webengine::TabContent > > items); - virtual Evas_Object *getContent(); - virtual ListSize calculateSize(); - virtual Evas_Object* getFirstFocus(); - boost::signals2::signal newTabClicked; - boost::signals2::signal tabClicked; - boost::signals2::signal tabDelete; - int getItemcCount(); - void setCurrentTabId(tizen_browser::basic_webengine::TabId currentTabId); - void disableNewTabBtn(bool disabled); - void onPopupShow(); - - void rightPressed(); - void leftPressed(); - void enterPressed(); -private: - std::map m_items; - tizen_browser::basic_webengine::TabId m_currentTabId; - Evas_Object *m_list, *m_box, *m_newTabBtn; - static void _item_clicked_cb(void* data, Evas_Object *obj, void *event_info); - static void _newTab_clicked_cb(void* data, Evas_Object *obj, void *event_info); - static void _deleteTab_clicked_cb(void* data, Evas_Object *obj, void *event_info); - static void focusItem(void* data, Evas_Object* obj, void *event_info); - static void unFocusItem(void* data, Evas_Object* obj, void *event_info); - static void newButtonFocused(void* data, Evas_Object* obj, void *event_info); - static void newButtonUnFocused(void* data, Evas_Object* obj, void *event_info); - struct tab_data{ - tizen_browser::basic_webengine::TabId id; - TabList *tab_list; - }; - - Elm_Object_Item *m_lastFocusedItem; - bool m_deleteSelected; - - /** - * Above this size tablist is scrolled. - */ - static const int ScrollBorderValue; -}; - -} - -} - -#endif //TABLIST_H diff --git a/services/SimpleUI/WebTitleBar.cpp b/services/SimpleUI/WebTitleBar.cpp deleted file mode 100644 index c610d9e..0000000 --- a/services/SimpleUI/WebTitleBar.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "BrowserLogger.h" -#include "EflTools.h" - -#include "WebTitleBar.h" - -// show bar by this time (seconds) - due to IA Guidline -#define DELAY_TIME 4.0 - -namespace tizen_browser -{ -namespace base_ui -{ - -WebTitleBar::WebTitleBar(Evas_Object *parent, const std::string &edjFile, const std::string &groupName) : - m_timer(NULL) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - std::string edjFilePath = EDJE_DIR; - edjFilePath.append(edjFile); - elm_theme_extension_add(NULL, edjFilePath.c_str()); - m_layout = elm_layout_add(parent); - Eina_Bool layoutSetResult = elm_layout_file_set(m_layout, edjFilePath.c_str(), groupName.c_str()); - if(!layoutSetResult) - BROWSER_LOGE("[%s:%d]: Layout file not found: ", __func__, __LINE__, edjFilePath.c_str()); - evas_object_size_hint_weight_set(m_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(m_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); -} - -WebTitleBar::~WebTitleBar() -{ - if(m_timer) - ecore_timer_del(m_timer); -} - -void WebTitleBar::setFavIcon(std::shared_ptr favicon) -{ - BROWSER_LOGD("[%s:%d] faviconType:%d ", __PRETTY_FUNCTION__, __LINE__, favicon->imageType); - if(favicon->imageType != tools::BrowserImage::ImageTypeNoImage){ - m_icon = tizen_browser::tools::EflTools::getEvasImage(favicon, m_layout); - if(m_icon){ - evas_object_image_fill_set(m_icon, 0, 0, 37, 37); - evas_object_resize(m_icon, 37, 37); - elm_object_part_content_set(m_layout, "favicon", m_icon); - evas_object_show(m_icon); - } else { - removeFavIcon(); - } - } else { - removeFavIcon(); - } -} - -void WebTitleBar::removeFavIcon() -{ - Evas_Object * favicon = elm_object_part_content_unset(m_layout, "favicon"); - evas_object_hide(favicon); - if (favicon) { - evas_object_del(favicon); - } -} - - -void WebTitleBar::show(const std::string & title) -{ - setTitle(title); - - if(m_timer) - ecore_timer_del(m_timer); - - m_timer = ecore_timer_add(0.7, show_cb, this); -} - -Eina_Bool WebTitleBar::show_cb(void * data) -{ - WebTitleBar * self = static_cast (data); - if(self->m_timer) - ecore_timer_del(self->m_timer); - self->m_timer = ecore_timer_add(DELAY_TIME, hide_cb, self); - elm_object_signal_emit(self->m_layout, "show_webtitle_bar", "web"); - return ECORE_CALLBACK_CANCEL; -} - -void WebTitleBar::setTitle(const std::string & title) -{ - BROWSER_LOGD("Changing title on WebTitle bar to: %s", title.c_str()); - elm_object_part_text_set(m_layout, "text", title.c_str()); -} - -void WebTitleBar::hide() -{ - hide_cb(this); -} - -Eina_Bool WebTitleBar::hide_cb(void * data) -{ - WebTitleBar * self = static_cast (data); - elm_object_signal_emit(self->m_layout, "hide_webtitle_bar", "web"); - if(self->m_timer) - ecore_timer_del(self->m_timer); - self->m_timer = NULL; - return ECORE_CALLBACK_CANCEL; -} - -} /* end of base_ui */ -} /* end of tizen_browser */ diff --git a/services/SimpleUI/WebTitleBar.h b/services/SimpleUI/WebTitleBar.h deleted file mode 100644 index 8d7ca2e..0000000 --- a/services/SimpleUI/WebTitleBar.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef WEBTITLEBAR_H -#define WEBTITLEBAR_H - -#include - -namespace tizen_browser -{ -namespace base_ui -{ - -class WebTitleBar -{ -public: - WebTitleBar(Evas_Object * parent, const std::string &edjFile, const std::string &groupName); - ~WebTitleBar(); - - /** - * @brief Return layout of the Web Title bar - */ - Evas_Object * getContent() { return m_layout; }; - - /** - * @brief Show Web Title bar - * - * @param url title of webpage - */ - void show(const std::string & title); - - /** - * @brief Set favicon on Web tittle bar - * - * @param favicon Favicon image - */ - void setFavIcon(std::shared_ptr favicon); - - /** - * @brief remove favicon properly, and update view - * - */ - void removeFavIcon(); - - /** - * @brief Hide Web tittle bar - */ - void hide(); - -private: - void setTitle(const std::string & title); - static Eina_Bool show_cb(void * data); - static Eina_Bool hide_cb(void * data); - Evas_Object * m_layout; - Evas_Object * m_icon; - Ecore_Timer * m_timer; - -}; - -} /* end of base_ui */ -} /* end of tizen_browser */ - -#endif // WEBTITLEBAR_H diff --git a/services/SimpleUI/ZoomList.cpp b/services/SimpleUI/ZoomList.cpp deleted file mode 100644 index 03d1600..0000000 --- a/services/SimpleUI/ZoomList.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ZoomList.h" -#include "BrowserAssert.h" -#include "BrowserLogger.h" -#include -#include - -namespace tizen_browser -{ -namespace base_ui -{ - - -ZoomList::ZoomList(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton) - : MenuButton(mainWindow, parentButton) - , m_trackFirst(0) - , m_items(0) -{ - BROWSER_LOGD("[%s:%d] this: %x", __PRETTY_FUNCTION__, __LINE__, this); - m_list = elm_list_add(m_window.get()); - - evas_object_smart_callback_add(m_list, "item,focused", focusItem, this); - evas_object_smart_callback_add(m_list, "item,unfocused", unFocusItem, this); - evas_object_smart_callback_add(m_list, "activated", _item_clicked_cb, this); - - elm_object_style_set(m_list, "zoom_list"); - elm_list_mode_set(m_list, ELM_LIST_EXPAND); - evas_object_size_hint_align_set(m_list, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(m_list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_list_go(m_list); - evas_object_show(m_list); -} - -ZoomList::~ZoomList() -{ -} - - -void ZoomList::addItem(const char* text, zoom_type value) -{ - zoom_data *data = new zoom_data(); - data->value = value; - data->zoom_list = this; - - elm_list_item_append(m_list, text, NULL, NULL, ZoomList::_item_clicked_cb, (void *)data); - elm_list_go(m_list); - - m_items++; -} - -void ZoomList::setZoom(zoom_type value) -{ - Elm_Object_Item * item = elm_list_first_item_get(m_list); - while (item != NULL) - { - zoom_type *elem_zoom = (zoom_type*)elm_object_item_data_get(item); - edje_object_signal_emit(elm_list_item_object_get(item), "unchecked", ""); - if (*elem_zoom == value) - { - edje_object_signal_emit(elm_list_item_object_get(item), "default_checked", ""); - current_zoom = value; - } - item = elm_list_item_next(item); - } -} - -Evas_Object* ZoomList::getContent() -{ - evas_object_resize(m_list, 390, 0); - return m_list; -} - -MenuButton::ListSize ZoomList::calculateSize() -{ - ListSize result; - - result.width = 390; - result.height = 590; - - return result; -} - -void ZoomList::_item_clicked_cb(void* /*data*/, Evas_Object */*obj*/, void *event_info) -{ - Elm_Object_Item *item = static_cast(event_info); - zoom_data *zoom = static_cast(elm_object_item_data_get(item)); - M_ASSERT(zoom); - if (zoom->value != zoom->zoom_list->current_zoom) - { - zoom->zoom_list->zoomChanged(zoom->value); - edje_object_signal_emit(elm_list_item_object_get(item), "checked", ""); - item = elm_list_first_item_get(zoom->zoom_list->m_list); - while (item != NULL) - { - zoom_type *elem_zoom = (zoom_type*)elm_object_item_data_get(item); - if (*elem_zoom == zoom->zoom_list->current_zoom) - { - edje_object_signal_emit(elm_list_item_object_get(item), "unchecked", ""); - zoom->zoom_list->current_zoom = zoom->value; - break; - } - item = elm_list_item_next(item); - } - } - zoom->zoom_list->hidePopup(); -} - -Evas_Object* ZoomList::getFirstFocus() -{ - return m_list; -} - -void ZoomList::focusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,in", "over2"); -} - -void ZoomList::unFocusItem(void* /*data*/, Evas_Object* /*obj*/, void* event_info) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Elm_Object_Item *item = reinterpret_cast(event_info); - elm_object_item_signal_emit( item, "mouse,out", "over2"); -} - -} - -} diff --git a/services/SimpleUI/ZoomList.h b/services/SimpleUI/ZoomList.h deleted file mode 100644 index 5210ce3..0000000 --- a/services/SimpleUI/ZoomList.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2014 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/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ZOOMLIST_H -#define ZOOMLIST_H - -#include -#include -#include -#include "MenuButton.h" - -namespace tizen_browser -{ -namespace base_ui -{ - -typedef enum { - ZOOM_TYPE_50 = 50, - ZOOM_TYPE_75 = 75, - ZOOM_TYPE_100 = 100, - ZOOM_TYPE_150 = 150, - ZOOM_TYPE_200 = 200, - ZOOM_TYPE_300 = 300, -} zoom_type; - - -class ZoomList:public MenuButton{ - -public: - ZoomList(std::shared_ptr< Evas_Object > mainWindow, Evas_Object* parentButton); - ~ZoomList(); - void addItem(const char* text, zoom_type value); - void setZoom(zoom_type value); - virtual Evas_Object *getContent(); - virtual ListSize calculateSize(); - boost::signals2::signal zoomChanged; - - virtual Evas_Object* getFirstFocus(); - -private: - Evas_Object *m_list; - Evas_Object *m_trackFirst; - zoom_type current_zoom; - int m_items; - static void _item_clicked_cb(void* data, Evas_Object *obj, void *event_info); - struct zoom_data{ - zoom_type value; - ZoomList *zoom_list; - }; - - static void focusItem(void* data, Evas_Object* obj, void* event_info); - static void unFocusItem(void* data, Evas_Object* obj, void* event_info); -}; - -} - -} - -#endif //ZOOMLIST_H diff --git a/services/SimpleUI/edc/EntryPopup.edc b/services/SimpleUI/edc/EntryPopup.edc deleted file mode 100644 index 95ea129..0000000 --- a/services/SimpleUI/edc/EntryPopup.edc +++ /dev/null @@ -1,51 +0,0 @@ -collections { - group { - name: "entry_popup"; - parts { - part { - name: "label"; - type : TEXT; - scale:1; - description { - state: "default" 0.0; - visible: 1; - //align: 0.0 0.0; - rel1 { relative: 0.0 0.0;} - rel2 { relative: 1.0 1.0;} - min: 200 60; - max: 200 60; - text { - text: "Label"; - min: 0 1; - max: 1 1; - size: 20; - } - } - } - part { - name: "entry"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - min: 200 60; - max: 200 60; - rel1 { relative: 0.0 1.0; to: "label"; } - rel2 { relative: 1.0 1.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - } -} \ No newline at end of file diff --git a/services/SimpleUI/edc/HistoryItem.edc b/services/SimpleUI/edc/HistoryItem.edc deleted file mode 100644 index d95f69c..0000000 --- a/services/SimpleUI/edc/HistoryItem.edc +++ /dev/null @@ -1,660 +0,0 @@ -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 128; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } -#define SPACER_ITEM_BR(spacer_name, W, H, elem) \ - part { name: spacer_name; \ - type: RECT; \ - scale:1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - align: 0 1; \ - min: W H; \ - max: W H; \ - fixed: 1 1; \ - color: 255 255 255 10; \ - rel1 { relative: 0.0 1.0; to: elem;} \ - rel2 { relative: 1.0 1.0; to: elem;} \ - } \ - } -#define WIDTH 436 -#define HEIGHT 136 -#define ITEM_WIDTH 374 -#define PARENT_ITEM_HEIGHT 36 -data { item: "item_width" ITEM_WIDTH; item: "item_height" HEIGHT; item: "parent_item_height" PARENT_ITEM_HEIGHT;} -collections { - group{ - name: "history"; - min: WIDTH 0; - max: WIDTH 868; - parts{ - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "background"; - type: RECT; - description{ - state: "default" 0.0; - color: 0 0 0 0; - rel1{ - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - mouse_events: 1; - description{ - state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; - rel1{ - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "elm.swallow.empty"; - type: SWALLOW; - description{ - state: "default" 0.0; - fixed: 1 1; - rel1{ - relative: 0 0; - } - rel2{ - relative: 0 0; - } - } - } - }//parts - }//group - group { - name: "elm/genlist/item/history_item/default"; - alias: "elm/genlist/item_odd/history_item/default"; - alias: "elm/genlist/item_compress/history_item/default"; - alias: "elm/genlist/item_compress_odd/history_item/default"; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - images { - image: "ico_delete.png" COMP; - image: "thumbnail.png" COMP; - } - data.item: "texts" "page_title page_url page_time"; - data.item: "contents" "favicon content_click del_click"; - color_classes{ - color_class{ - name: "defaultBgColor"; - color: 18 22 34 255; - } - color_class{ - name: "focusBgColor"; - color: 69 143 255 255; - } - color_class{ - name: "highlightBgColor"; - color: 69 143 255 102; - } - color_class{ - name: "imageHighlight"; - color: 255 255 255 102; - } - color_class{ - name: "focusDelBgColor"; - color: 96 114 146 255; - } - color_class{ - name: "defaultTextColor"; - color: 211 211 211 255; - } - color_class{ - name: "focusTextColor"; - color: 255 255 255 255; - } - color_class{ - name: "highlightTextColor"; - color: 255 255 255 51; - } - color_class{ - name: "dateTextColor"; - color: 211 211 211 204; - } - color_class{ - name: "transparent"; - color: 0 0 0 0; - } - } - parts { - part { - name: "bg_clipper"; - scale:1; - mouse_events: 1; - type: SWALLOW; - description { - state: "default" 0.0; - color: 0 0 0 0; - align: 0 0; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - } - } - part { - name: "item_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: ITEM_WIDTH HEIGHT; - max: ITEM_WIDTH HEIGHT; - align: 0 1; - rel1 { relative: 0.0 0.0;to: "bg_clipper";} - rel2 { relative: 1.0 1.0;to: "bg_clipper";} - color_class: defaultBgColor; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusBgColor; - } - } - SPACER_ITEM_BR("horizontal_line", ITEM_WIDTH, 2, "bg_clipper") - part { - name: "favicon_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 0; - min: 37 37; - max: 37 37; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "item_bg"; offset: 25 25;} - rel2 { relative: 1.0 1.0; to: "item_bg";} - color_class: transparent; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: imageHighlight; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - } - part { - name: "favicon"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 37 37; - max: 37 37; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "favicon_bg";} - rel2 { relative: 1.0 1.0; to: "favicon_bg";} - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: imageHighlight; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - } - part { - name: "page_title"; - scale: 1; - type: TEXT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 275 40; - max: 275 40; - align: 0 0; - rel1 { relative: 0.0 0.0; to: item_bg; offset:74 20;} - rel2 { relative: 1.0 1.0; to: item_bg;} - color_class: defaultTextColor; - text { - text: "Web page title"; - font: "font_name"; - size: 30; - align: 0 1; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: highlightTextColor; - } - } - part { - name: "page_url"; - scale: 1; - type: TEXT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 275 22; - max: 275 22; - align: 1 0; - rel1 { relative: 0.0 1.0; to: "page_title";} - rel2 { relative: 1.0 1.0; to: "page_title";} - color_class: defaultTextColor; - text { - text: "http:/onet.pl"; - font: "font_name"; - size: 22; - align: 0 0.5; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: highlightTextColor; - } - } - part { - name: "page_time"; - scale: 1; - type: TEXT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 275 22; - max: 275 22; - align: 1 0; - rel1 { relative: 0.0 1.0; to: "page_url";} - rel2 { relative: 1.0 1.0; to: "page_url";} - color_class: defaultTextColor; - text { - text: "10:25 AM"; - font: "font_name"; - size: 22; - align: 0 0.5; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusTextColor; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: highlightTextColor; - } - } - part { - name: "del_bg"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0 0; - min: 54 HEIGHT; - max: 54 HEIGHT; - rel1 { relative: 1.0 0.0; to: "item_bg";} - rel2 { relative: 1.0 1.0;to: "bg_clipper";} - color_class: transparent; - } - description { - state: "highlight" 0.0; - inherit: "default" 0.0; - color_class: focusBgColor; - visible: 1; - } - description { - state: "focus" 0.0; - inherit: "default" 0.0; - color_class: focusDelBgColor; - visible: 1; - } - } - part { - name: "del_icon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 0.5; - min: 40 40; - max: 40 40; - rel1 { relative: 0.0 0.0; to: "del_bg";} - rel2 { relative: 1.0 1.0; to: "del_bg";} - image.normal: "ico_delete.png"; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "focus" 0.0; - inherit: "highlight" 0.0; - } - } - part { - name: "over"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: ITEM_WIDTH HEIGHT; - max: ITEM_WIDTH HEIGHT; - rel1 { relative: 0.0 0.0; to: "item_bg";} - rel2 { relative: 1.0 1.0; to: "item_bg";} - color_class: transparent; - } - description { - state: "highlight" 0.0; - inherit: "default" 0 0; - color_class: highlightBgColor; - visible: 1; - } - } - part { - name: "content_click"; - scale:1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: ITEM_WIDTH HEIGHT; - max: ITEM_WIDTH HEIGHT; - rel1 { relative: 0.0 0.0; to: "over";} - rel2 { relative: 1.0 1.0; to: "over";} - color_class: transparent; - } - } - part { - name: "del_over"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: 54 HEIGHT; - max: 54 HEIGHT; - rel1 { relative: 0.0 0.0; to: "del_bg";} - rel2 { relative: 1.0 1.0; to: "del_bg";} - color_class: transparent; - } - } - part { - name: "del_click"; - scale:1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: 54 HEIGHT; - max: 54 HEIGHT; - rel1 { relative: 0.0 0.0; to: "del_over";} - rel2 { relative: 1.0 1.0; to: "del_over";} - color_class: transparent; - } - } - } - programs{ - program { - name: "mouse_in_content_click"; - signal: "mouse,in"; - source: "content_click"; - script { - emit("mouse_in_content_click", ""); - } - } - program { - name: "mouse_out_content_click"; - signal: "mouse,out"; - source: "content_click"; - script { - emit("mouse_out_content_click", ""); - } - } - program { - name: "mouse_in_content"; - signal: "mouse_in_content_click"; - source: ""; - action: STATE_SET "focus" 0.0; - target: "item_bg"; - target: "favicon"; - target: "page_title"; - target: "page_url"; - target: "page_time"; - target: "del_bg"; - target: "del_icon"; - } - program { - name: "mouse_out_content"; - signal: "mouse_out_content_click"; - source: ""; - action: STATE_SET "default" 0.0; - target: "item_bg"; - target: "favicon"; - target: "page_title"; - target: "page_url"; - target: "page_time"; - target: "del_bg"; - target: "del_icon"; - } - program { - name: "mouse_in_del_click"; - signal: "mouse,in"; - source: "del_click"; - script { - emit("mouse_in_del_click", ""); - } - } - program { - name: "mouse_out_del_click"; - signal: "mouse,out"; - source: "del_click"; - script { - emit("mouse_out_del_click", ""); - } - } - program { - name: "mouse_in_del"; - signal: "mouse_in_del_click"; - source: ""; - action: STATE_SET "highlight" 0.0; - target: "item_bg"; - target: "favicon"; - target: "page_title"; - target: "page_url"; - target: "page_time"; - target: "del_bg"; - target: "del_icon"; - target: "over"; - } - program { - name: "mouse_out_del"; - signal: "mouse_out_del_click"; - source: ""; - action: STATE_SET "default" 0.0; - target: "item_bg"; - target: "favicon"; - target: "page_title"; - target: "page_url"; - target: "page_time"; - target: "del_bg"; - target: "del_icon"; - target: "over"; - } - } - } - - - group { - name: "elm/genlist/item/history_item_no_favicon/default"; - alias: "elm/genlist/item_odd/history_item_no_favicon/default"; - alias: "elm/genlist/item_compress/history_item_no_favicon/default"; - alias: "elm/genlist/item_compress_odd/history_item_no_favicon/default"; - inherit: "elm/genlist/item/history_item/default"; - images { - image: "ico_page_37.png" COMP; - } - parts { - part { - name: "no_favicon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 37 37; - max: 37 37; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "favicon_bg";} - rel2 { relative: 1.0 1.0; to: "favicon_bg";} - image.normal: "ico_page_37.png"; - } - } - } - } - - /* ----------------------------------------------------------------- */ - group { - name: "elm/genlist/item/history_parent_item/default"; - data.item: "texts" "date_text"; - min: WIDTH PARENT_ITEM_HEIGHT; - max: WIDTH PARENT_ITEM_HEIGHT; - parts { - part { - name: "bg_clipper"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 0; - align: 0 0; - color: 0 0 0 0; - min: WIDTH PARENT_ITEM_HEIGHT; - max: WIDTH PARENT_ITEM_HEIGHT; - } - } - part { - name: "text_bg"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - color: 18 22 34 245; - min: ITEM_WIDTH PARENT_ITEM_HEIGHT; - max: ITEM_WIDTH PARENT_ITEM_HEIGHT; - } - } - part { - name: "date_text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - min: 324 PARENT_ITEM_HEIGHT; - max: 324 PARENT_ITEM_HEIGHT; - fixed: 1 1; - align: 0 0; - color_class: dateTextColor; - rel1 { relative: 0.0 0.0; to: "text_bg"; offset: 25 0;} - rel2 { relative: 1.0 1.0; to: "text_bg";} - text { - text: "March. 19. 2014"; - font: "font_name"; - size: 22; - align: 0 0.5; - } - } - } - } - } - /* ----------------------------------------------------------------- */ - group{ - name: "elm/button/base/invisible_button"; - parts{ - part{ - name: "button"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - color: 0 0 0 0; - } - } - part{ - name: "over"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "button";} - rel2 { relative: 1.0 1.0;to: "button";} - color: 0 0 0 0; - } - } - } - programs{ - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - } - } -} \ No newline at end of file diff --git a/services/SimpleUI/edc/RelatedPages.edc b/services/SimpleUI/edc/RelatedPages.edc deleted file mode 100644 index bb3dabf..0000000 --- a/services/SimpleUI/edc/RelatedPages.edc +++ /dev/null @@ -1,298 +0,0 @@ -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 128; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } - -collections { - -group { name: "elm/label/base/rel_pages_label"; - styles { - style { name: "textblock_white"; - base: "font=Sans font_size="24" color=#D3D3D3 ellipsis=1"; - } - } - styles { - style { name: "textblock_white_bold"; - base: "font=Sans:style=Bold font_size="24" color=#D3D3D3 ellipsis=1"; - } - } - - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - fixed: 1 1; - min: 208 55; - max: 208 55; - text { - style: "textblock_white"; - max: 1 1; - } - } - description { state: "bold" 0.0; - inherit: "default" 0.0; - text { - style: "textblock_white_bold"; - max: 1 1; - } - } - } - } -} - -group { - name: "elm/button/base/thumbButton"; - images { - image: "ico_delete.png" COMP; - } - parts { - part { name: "elm.swallow.content"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 1; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - } - } - } - - programs { - program { name: "mouse,clicked"; - signal: "mouse,down,1"; - source: "elm.swallow.content"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - } -} - -group { - name: "elm/gengrid/base/rel_pages"; - data { - item: "focus_highlight" "off"; - } - - parts { - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part { name: "background"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 42 50 64 0; - rel1 { - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1 {relative: 0.0 0.0;} - rel2 {relative: 1.0 1.0; offset: 14 14;} - } - } - part { name: "elm.swallow.empty"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 0.5; - rel1 { - relative: 0.5 0.5; - } - rel2 { - relative: 0.5 0.5; - } - } - } - } - } -group { name: "elm/gengrid/item/rel_page_item/default"; - data.item: "texts" "elm.text"; - data.item: "contents" "elm.thumbnail elm.text elm.label elm.thumbButton"; - images { - image: "web_frame_selected.png" COMP; - } - parts { - part { name: "bg"; - clip_to: "disclip"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "elm.thumbnail"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.0; - min: 238 153; - max: 238 153; - rel1 { - relative: 0.0 0.0; - } - rel2 { - relative: 1.0 1.0; - } - } - description { state: "selected"; - inherit: "default" 0.0; - } - } - part { name: "focus_highlight"; - type: IMAGE; - description { state: "default" 0.0; - rel1 { - to: "elm.thumbnail"; - relative: 0.0 0.0; - } - rel2 { - to: "elm.thumbnail"; - relative: 1.0 1.0; - } - image.normal: "web_frame_selected.png"; - image.border: 8 8 8 0; - image.border_scale: 1; - image.middle: NONE; - visible: 0; - } - description { state: "selected"; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "background"; - clip_to: "disclip"; - type: RECT; - description { state: "default" 0.0; - min: 238 55; - max: 238 55; - align: 0.0 0.0; - color: 30 38 50 255; - rel1 { - to: "elm.thumbnail"; - relative: 0.0 1.0; - offset: 0 0; - } - rel2 { - relative: 1.0 1.0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 70 143 254 255; - } - } - part { name: "label_spacer"; - type: SPACER; -description { -state: "default" 0.0; -min: 15 55; -max: 15 55; -align: 0.0 0.0; -rel1{to: "background"; relative: 0.0 0.0;} -} -} - part { name: "elm.label"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - min: 208 55; - max: 208 55; - align: 0.0 0.0; - rel1 { to: "label_spacer"; - relative: 1.0 0.0; - } - rel2 { - to: "elm.thumbnail"; - relative: 1.0 1.0; - } - } - } - part { name: "disclip"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.thumbButton"; - clip_to: "disclip"; - type: SWALLOW; - description { state: "default" 0.0; - } - } - part { name: "over2"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "bg"; - rel2.to: "background"; - } - } - part { name: "over3"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1.to: "background"; - rel2.to: "background"; - } - } - } - programs{ - program { - name: "mouse_in"; - signal: "mouse,in"; - source: "over2"; - action: STATE_SET "selected" 0.0; - target: "background"; - target: "focus_highlight"; - target: "elm.thumbnail"; - } - program { - name: "mouse_out"; - signal: "mouse,out"; - source: "over2"; - action: STATE_SET "default" 0.0; - target: "background"; - target: "focus_highlight"; - target: "elm.thumbnail"; - } - } -} -} \ No newline at end of file diff --git a/services/SimpleUI/edc/Settings.edc b/services/SimpleUI/edc/Settings.edc deleted file mode 100644 index 3b8ab9f..0000000 --- a/services/SimpleUI/edc/Settings.edc +++ /dev/null @@ -1,574 +0,0 @@ -#define WIDTH 473 -#define HEIGHT 490 -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 128; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } -data { item: "width" WIDTH; item: "height" HEIGHT; } -color_classes{ - color_class{ - name: "defaultFontColor"; - color: 211 211 211 255; - } - color_class{ - name: "disabledFontColor"; - color: 60 60 60 160; - } - color_class{ - name: "selectedItemFontColor"; - color: 255 255 255 255; - } - color_class{ - name: "transparent"; - color: 0 0 0 0; - } - color_class{ - name: "selectedBackground"; - color: 69 143 255 255; - } - color_class{ - name: "dimmColor"; - color: 0 0 0 128; - } - color_class{ - name: "on_offBackgroundColor"; - color: 255 255 255 255; - } -} -collections { - group{ name: "elm/genlist/base/settings"; - min: 473 426; - max: 473 426; - parts{ - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "background"; - type: RECT; - description{ - state: "default" 0.0; - color: 18 22 34 255; - rel1{ - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "elm.swallow.content"; - type: SWALLOW; - clip_to: "clipper"; - mouse_events: 1; - description{ - state: "default" 0.0; - align: 0.5 0.5; - fixed: 1 1; - rel1{ - relative: 0 0; - } - rel2{ - relative: 1 1; - } - } - } - part{ - name: "elm.swallow.empty"; - type: SWALLOW; - description{ - state: "default" 0.0; - fixed: 1 1; - rel1{ - relative: 0.5 0.5; - } - rel2{ - relative: 0.5 0.5; - } - } - } - part{ name: "dimmer"; - type: RECT; - description{ - state: "default" 0.0; - color: 0 0 0 128; - visible: 0; - } - description{ - state: "popup_show" 0.0; - inherit: "default"; - visible:1; - } - } - }//parts - programs{ - program{ - name: "show_popup"; - signal: "show_popup"; - source: "SettingsModel"; - action: STATE_SET "popup_show" 0.0; - target: "dimmer"; - } - program{ - name: "hide_popup"; - signal: "hide_popup"; - source: "SettingsModel"; - action: STATE_SET "default" 0.0; - target: "dimmer"; - } - } - }//group - group{ name: "elm/genlist/item/settings_item/default"; - alias: "elm/genlist/item_odd/settings_item/default"; - alias: "elm/genlist/item_compress/settings_item/default"; - alias: "elm/genlist/item_compress_odd/settings_item/default"; - min: 473 80; - max: 473 80; - data.item: "texts" "optionName"; - data.item: "contents" "optionValue"; - parts{ - part{ - name: "value_helper"; - mouse_events:0; - description{ - state: "default" 0.0; - color: 0 0 0 0; - } - description{ - state: "on" 0.0; - color: 0 0 0 0; - } - description{ - state: "off" 0.0; - color: 0 0 0 0; - } - } - part{ - name: "optionBackground"; - type: RECT; - mouse_events: 1; - description{ - state: "default" 0.0; - color_class: "transparent"; - rel1{ - relative: 0.0 0.0; - } - rel2{ - relative: 1.0 1.0; - } - } - description{ - state: "mouseOver" 0.0; - inherit: "default"; - color_class: "selectedBackground"; - } - description{ - state: "mouseOut" 0.0; - inherit: "default"; - } - description{ - state: "selected" 0.0; - inherit: "mouseOver"; - } - } - part{ name:"optionName"; - type: TEXT; - description{ - state: "default" 0.0; - align: 0 0.5; - min: 298 80; - max: 298 80; - color_class: "defaultFontColor"; - rel1{ - relative: 0.0 0.0; - offset: 25 0; - } - rel2.relative: 1.0 1.0; - text{ - size: 30; - align: 0 0.5; - } - } - description{ - state: "mouseOut" 0.0; - inherit: "default"; - } - description{ - state: "mouseOver" 0.0; - inherit: "default" 0.0; - color_class: "selectedItemFontColor"; - } - description{ - state: "disabled" 0.0; - inherit: "default" 0.0; - color_class: "disabledFontColor"; - } - } - part{ name: "optionValue"; - type: SWALLOW; - description{ - state: "default" 0.0; - align: 0 0.5; - fixed: 1 1; - min: 100 40; - max: 100 40; - visible: 1; - rel1{ - relative: 1.0 0.0; - to: "optionName"; - offset: 25 0; - } - rel2{ - relative: 1.0 1.0; - } - } - } - programs{ - program{ name: "mouse_in"; - signal: "mouse,in"; - source: "option*"; - script{ - new cur_state_helper[31]; - new Float:index; - get_state(PART:"optionName", cur_state_helper, 30, index); - if(!strcmp(cur_state_helper,"default")){ - set_state(PART:"optionBackground", "mouseOver", 0.0); - } - } - } - program{ name: "mouse_out"; - signal: "mouse,out"; - source: "option*"; - script{ - new st[31]; - new Float:vl - get_state(PART:"optionBackground", st, 30, vl); - if(strcmp(st,"selected")){ - set_state(PART:"optionBackground", "mouseOut", 0.0); - } - } - } - program{ signal: "selected"; - source: "SettingsModel"; - action: STATE_SET "selected" 0.0; - target: "optionBackground"; - } - program{ signal: "unselected"; - source: "SettingsModel"; - action: STATE_SET "mouseOut" 0.0; - target: "optionBackground"; - } - program{ name: "go_disabled"; - signal: "elm,state,disabled"; source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "optionName"; - } - program{ name: "go_enabled"; - signal: "elm,state,enabled"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "optionName"; - } - program{ name: "go_Off"; - signal: "switch,off"; - source: "SettingsModel"; - action: STATE_SET "off" 0.0; - target: "value_helper"; - } - program{ name: "go_On"; - signal: "switch,on"; - source: "SettingsModel"; - action: STATE_SET "on" 0.0; - target: "value_helper"; - } - program{ name: "go_switch_hide"; - signal: "switch,hide"; - source: "SettingsModel"; - action: STATE_SET "default" 0.0; - target: "value_helper"; - } - }//programs - }//parts - }//group - group{ name: "elm/ctxpopup/bg/settings_button"; - parts { - part{ - name: "base_bg"; - type: RECT; - mouse_events: 1; - description{ - state: "default" 0.0; - color: 0 0 0 0; - } - } - } - programs{ - program { - signal: "mouse,clicked,*"; - source: "base_bg"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - } - }//group: "elm/ctxpopup/bg/settings_button"; - group{ name: "elm/ctxpopup/base/settings_button"; - max: 0 0; - parts{ - part{ - name: "base"; - scale: 1; - type: RECT; - description{ - state: "default" 0.0; - min: 185 164; - max: 185 164; - //color: 0 0 0 0; - color_class: "transparent"; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - color_class: "on_offBackgroundColor"; - visible: 1; - } - } - part{ - name: "elm.swallow.content"; - scale: 1; - type: SWALLOW; - description{ - state: "default" 0.0; - rel1{ - to:"base"; - relative: 0 0; - } - rel2{ - to:"base"; - relative:1 1; - } - } - } - } - programs { - program { - signal: "elm,state,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - transition: LINEAR 0.2; - target: "base"; - } - program { - signal: "elm,state,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.3; - target: "base"; - after: "hide2"; - } - program { name: "hide2"; - action: SIGNAL_EMIT "elm,action,hide,finished" ""; - } - } - }//group "elm/ctxpopup/base/settings_button"; - group{ name: "elm/radio/base/settings_radio"; - images.image: "check_foc.png" COMP; - images.image: "check_nor.png" COMP; - parts{ - part{name: "item_bg"; type: RECT; mouse_events:0; - scale: 1; - description{ - state: "default" 0.0; - color_class: "transparent"; - min: 185 82; - max: 185 82; - } - description{ - state: "mouse_over" 0.0; - inherit: "default"; - color_class: "selectedBackground"; - } - } - part{name: "left_spacer"; type: SPACER; - scale: 1; - description{ - state: "default" 0.0; - min: 20 82; - max: 20 82; - align: 0 0; - rel1{ - relative:0 0; - to: item_bg; - } - } - } - part{name: "elm.text"; type: TEXT; mouse_events: 0; - scale: 1; - description{ - state: "default" 0.0; - color_class: "defaultFontColor"; - align: 0 0.5; - rel1{ - relative: 1 0; - to: "left_spacer"; - } - rel2{ - relative: 0 1; - to_x: "indicator"; - to_y: "right_spacer"; - } - text{ - size: 30; - align: 0 0.5; - } - } - description{ - state: "mouse_over" 0.0; - inherit: "default"; - color_class: "selectedItemFontColor"; - } - } - part { name: "indicator"; mouse_events: 0; - scale: 1; - type: IMAGE; - description { state: "default" 0.0; - align: 1 0.5; - rel2{ - relative: 0 1; - to: "right_spacer"; - } - min: 38 38; - max: 38 38; - visible: 0; - } - description { - state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - image.normal: "check_foc.png"; - } - description{ - state: "selected_mouse_over" 0.0; - inherit: "selected"; - image.normal: "check_nor.png"; - } - } - part{ name: "right_spacer"; type: SPACER; - scale: 1; - description{ - state: "default" 0.0; - min: 20 82; - max: 20 82; - align: 1 1; - rel2{ - relative:1 1; - to: item_bg; - } - } - } - part{ name: "event"; type: RECT; - description{ - state: "default" 0.0; - color: 0 0 0 0; - } - } - }//parts - script { - public mouse_in() { - new st[31]; - new Float:vl - get_state(PART:"indicator", st, 30, vl) - if(!strcmp(st,"selected")) - set_state(PART:"indicator", "selected_mouse_over", 0.0); - set_state(PART:"item_bg", "mouse_over", 0.0); - set_state(PART:"elm.text", "mouse_over", 0.0); - } - public mouse_out() { - new st[31]; - new Float:vl - get_state(PART:"indicator", st, 30, vl) - if(!strcmp(st,"selected_mouse_over")) - set_state(PART:"indicator", "selected", 0.0); - set_state(PART:"item_bg", "default", 0.0); - set_state(PART:"elm.text", "default", 0.0); - } - } - programs{ - program{ - signal: "mouse,clicked,1"; source: "event"; - action: SIGNAL_EMIT "elm,action,radio,toggle" ""; - } - program{ - signal: "mouse,in"; source: "event"; - script{ - mouse_in(); - } - } - program{ - signal: "mouse,out"; source: "event"; - script{ - mouse_out(); - } - } - program{ - signal: "elm,action,focus"; source: "elm"; - script{ - mouse_in(); - } - } - program{ - signal: "elm,action,unfocus"; source: "elm"; - script{ - mouse_out(); - } - } - program{ - signal: "elm,state,radio,on"; source: "elm"; - action: STATE_SET "selected" 0.0; - target: "indicator"; - } - program{ - signal: "elm,state,radio,off"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "indicator"; - } - } - }//group "elm/radio/base/settings_radio"; - - group { name: "elm/label/base/settings_label"; - styles { - style { name: "label_style"; - base: "font="FNBD" font_size=30 text_class=tb_plain align=center color=#d3d3d3ff"; - tag: "br" "\n"; - tag: "hilight" "+ font="FNBD" color=#d3d3d3ff text_class=tb_plain"; - tag: "b" "+ font="FNBD" color=#d3d3d3ff text_class=tb_light"; - } - } - parts { - part { name: "elm.text"; type: TEXTBLOCK; - scale: 1; - description { state: "default" 0.0; - text { style: "label_style"; - min: 1 1; - } - } - } - } - } -}//collections \ No newline at end of file diff --git a/services/SimpleUI/edc/TabItem.edc b/services/SimpleUI/edc/TabItem.edc deleted file mode 100644 index 54952f8..0000000 --- a/services/SimpleUI/edc/TabItem.edc +++ /dev/null @@ -1,513 +0,0 @@ -#define SPACER_ITEM_BR(spacer_name, W, H, elem) \ - part { name: spacer_name; \ - type: RECT; \ - scale:1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - align: 0 0; \ - min: W H; \ - max: W H; \ - fixed: 1 1; \ - color: 18 22 34 245; \ - rel1 { relative: 0.0 0.0; to: elem;} \ - rel2 { relative: 1.0 1.0; to: elem;} \ - } \ - } -#define WIDTH 436 -#define HEIGHT 89 -data { item: "width" WIDTH; item: "height" HEIGHT; item: "list_max_height" 868;} -collections { - group { - name: "elm/list/item/tab_list"; - alias: "elm/list/item_odd/tab_list"; - alias: "elm/list/item_compress/tab_list"; - alias: "elm/list/item_compress_odd/tab_list"; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - images { - image: "ico_delete.png" COMP; - image: "thumbnail.png" COMP; - } - parts { - part { - name: "bg_clipper"; - scale:1; - mouse_events: 1; - type: SWALLOW; - description { - state: "default" 0.0; - color: 0 0 0 0; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - } - } - part { - name: "tab_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 374 87; - max: 374 87; - align: 0 1; - rel1 { relative: 0.0 0.0;to: "bg_clipper";} - rel2 { relative: 1.0 1.0;to: "bg_clipper";} - color: 18 22 34 255; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - } - } - SPACER_ITEM_BR("horizontal_line", 374, 2, "bg_clipper") - part { - name: "elm.text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.5; - min: 249 79; - max: 249 79; - rel1 { relative: 0.0 0.0; to: "tab_bg"; offset: 100 0;} - rel2 { relative: 1.0 1.0; to: "tab_bg";} - color: 200 200 200 255; - text { - text: ""; - font: "font_name"; - size: 30; - align: 0 0.5; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - text { - text: ""; - font: "Tizen:style=Bold"; - size: 30; - align: 0 0.5; - } - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color: 255 255 255 51; - } - } - part { - name: "elm.del.bg"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0 0; - min: 54 87; - max: 54 87; - rel1 { relative: 1.0 0.0; to: "tab_bg";} - rel2 { relative: 1.0 1.0;to: "bg_clipper";} - color: 96 114 146 255; - } - description { - state: "highlight" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - visible: 1; - } - description { - state: "focus" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "elm.del.icon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 0.5; - min: 40 40; - max: 40 40; - rel1 { relative: 0.0 0.0; to: "elm.del.bg";} - rel2 { relative: 1.0 1.0; to: "elm.del.bg";} - color: 255 255 255 255; - image.normal: "ico_delete.png"; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "focus" 0.0; - inherit: "highlight" 0.0; - } - } - part { - name: "elm.swallow.icon"; - scale: 1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - fixed: 1 1; - min: 374 87; - max: 374 87; - rel1 { relative: 0.0 0.0; to: "tab_bg";} - rel2 { relative: 1.0 1.0; to: "tab_bg";} - color: 0 0 0 0; - } - } - part { - name: "elm.swallow.end"; - scale: 1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0 0; - min: 54 87; - max: 54 87; - rel1 { relative: 1.0 0.0; to: "elm.swallow.icon";} - rel2 { relative: 1.0 1.0; to: "elm.swallow.icon";} - } - } - part { - name: "over"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 0; - align: 0 0; - fixed: 1 1; - min: 374 87; - max: 374 87; - rel1 { relative: 0.0 0.0; to: "tab_bg";} - rel2 { relative: 1.0 1.0; to: "tab_bg";} - color: 0 0 0 0; - } - description { - state: "highlight" 0.0; - inherit: "default" 0 0; - color: 69 143 255 51; - visible: 1; - } - } - } - programs{ - program { - name: "mouse_in_tab"; - signal: "mouse,in"; - source: "elm.swallow.icon"; - action: STATE_SET "focus" 0.0; - target: "tab_bg"; - target: "elm.del.bg"; - target: "elm.del.icon"; - } - program { - name: "mouse_out_tab"; - signal: "mouse,out"; - source: "elm.swallow.icon"; - action: STATE_SET "default" 0.0; - target: "tab_bg"; - target: "elm.del.bg"; - target: "elm.del.icon"; - } - program { - name: "mouse_in_del"; - signal: "mouse,in"; - source: "elm.swallow.end"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(strcmp(st, "selected")) { - set_state(PART:"elm.text", "highlight", 0.0); - } - set_state(PART:"elm.del.bg", "highlight", 0.0); - set_state(PART:"elm.del.icon", "highlight", 0.0); - set_state(PART:"over", "highlight", 0.0); - } - } - program { - name: "mouse_out_del"; - signal: "mouse,out"; - source: "elm.swallow.end"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(strcmp(st, "selected")) { - set_state(PART:"elm.text", "default", 0.0); - } - set_state(PART:"elm.del.bg", "default", 0.0); - set_state(PART:"elm.del.icon", "default", 0.0); - set_state(PART:"over", "default", 0.0); - } - } - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "elm.swallow.icon"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "mouse_click2"; - signal: "mouse,clicked,1"; - source: "elm.swallow.end"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "highlight_selected_tab"; - signal: "highlight,selected"; - source: ""; - action: STATE_SET "selected" 0.0; - target: "elm.text"; - } - program { - name: "focused"; - signal: "item,focused"; - //signal: "elm,state,selected"; - source: ""; - //action: SIGNAL_EMIT "mouse,in" "elm.swallow.icon"; - action: STATE_SET "focus" 0.0; - target: "tab_bg"; - target: "elm.del.bg"; - target: "elm.del.icon"; - } - program { - name: "unfocused"; - signal: "item,unfocused"; - //signal: "elm,state,unselected"; - source: ""; - //action: SIGNAL_EMIT "mouse,out" "elm.swallow.icon"; - action: STATE_SET "default" 0.0; - target: "tab_bg"; - target: "elm.del.bg"; - target: "elm.del.icon"; - } - } - } - /* ----------------------------------------------------------------- */ - group { - name: "elm/button/base/new_tab_elem"; - parts { - part { - name: "bg_clipper"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - align: 0 0; - color: 0 0 0 0; - min: WIDTH 80; - max: WIDTH 80; - } - } - part { - name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - min: 374 80; - max: 374 80; - align: 0 0; - fixed: 1 1; - color: 18 22 34 255; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - } - } - part { - name: "elm.text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.5; - min: 324 80; - max: 324 80; - rel1 { relative: 0.0 0.0; to: "bg"; offset: 25 0;} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 255 255 255 255; - text { - text: "+ New tab"; - font: "font_name"; - size: 30; - align: 0 0.5; - } - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color: 255 255 255 51; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 60 60 60 160; - } - } - part { - name: "over"; - scale:1; - mouse_events: 1; - type: RECT; - description { - state: "default" 0.0; - visible: 1; - rel1 { relative: 0.0 0.0; to: "bg";} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 0 0 0 0; - } - } - } - programs{ - program { - name: "mouse_in"; - signal: "mouse,in"; - source: "over"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(strcmp(st, "disabled")) { - set_state(PART:"bg", "focus", 0.0); - } - } - } - program { - name: "mouse_out"; - signal: "mouse,out"; - source: "over"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - program { - name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { - name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { - name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - //action: SIGNAL_EMIT "mouse,in" "elm.swallow.icon"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if(strcmp(st, "disabled")) { - set_state(PART:"bg", "focus", 0.0); - } - } - } - program { - name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - //action: SIGNAL_EMIT "mouse,in" "elm.swallow.icon"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - } - } - /* ----------------------------------------------------------------- */ - group{ - name: "elm/button/base/invisible_button"; - parts{ - part{ - name: "button"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - color: 0 0 0 0; - } - } - part { - name: "e.swallow.icon"; - scale:1; - mouse_events: 1; - type: SWALLOW; - description { - state: "default" 0.0; - visible: 1; - align: 0 0.5; - min: 79 79; - max: 79 79; - rel1 { relative: 0.0 0.0;to: "button"; offset: 4 0;} - rel2 { relative: 1.0 1.0;to: "button";} - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color: 255 255 255 51; - } - } - part{ - name: "over"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "button";} - rel2 { relative: 1.0 1.0;to: "button";} - color: 0 0 0 0; - } - } - } - programs{ - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "over"; - script { - emit("elm,action,click", ""); - } - } - } - } -} diff --git a/services/SimpleUI/edc/WebTitleBar.edc b/services/SimpleUI/edc/WebTitleBar.edc deleted file mode 100644 index d6346aa..0000000 --- a/services/SimpleUI/edc/WebTitleBar.edc +++ /dev/null @@ -1,116 +0,0 @@ -#define WEB_TITLE_BAR_WIDTH 1920 -#define WEB_TITLE_BAR_HEIGHT 87 -#define WEB_TITLE_BAR_TEXT_WIDTH 1691 -#define WEB_TITLE_BAR_TEXT_OFFSET 12 -#define WEB_TITLE_BAR_TEXT_SIZE 30 -#define WEB_TITLE_BAR_FAVICON_W_H 37 -#define WEB_TITLE_BAR_FAVICON_OFFSET 90 - -collections{ - group{ name: "web_title_bar"; - styles { - style { name: "text_style"; - base: "font=Sans font_size="WEB_TITLE_BAR_TEXT_SIZE" color=#D3D3D3 align=left"; - } - } - parts{ - part{ name: "web_title_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - ///\todo No given color in guidlines - color: 10 10 10 150; - min: WEB_TITLE_BAR_WIDTH 0; - max: WEB_TITLE_BAR_WIDTH 0; - fixed: 1 1; - align: 0 1; - rel1 { relative: 0.0 1.0; } - rel2 { relative: 1.0 1.0; } - } - description { state: "visible" 0.0; - inherit: "default"; - min: WEB_TITLE_BAR_WIDTH WEB_TITLE_BAR_HEIGHT; - max: WEB_TITLE_BAR_WIDTH WEB_TITLE_BAR_HEIGHT; - } - } - part{ name: "favicon_spacer"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: WEB_TITLE_BAR_FAVICON_OFFSET WEB_TITLE_BAR_HEIGHT; - max: WEB_TITLE_BAR_FAVICON_OFFSET WEB_TITLE_BAR_HEIGHT; - fixed: 1 1; - align: 0 0; - rel1{ relative: 0.0 0.0; to: "web_title_bg"; } - rel2{ relative: 1.0 1.0; to: "web_title_bg"; } - } - } - part{ name: "title_spacer"; - type: SPACER; - scale: 1; - description { state: "default" 0.0; - min: WEB_TITLE_BAR_TEXT_OFFSET WEB_TITLE_BAR_HEIGHT; - max: WEB_TITLE_BAR_TEXT_OFFSET WEB_TITLE_BAR_HEIGHT; - fixed: 1 1; - align: 0.0 0.0; - rel1{ relative: 1.0 0.0; to_x: "favicon"; } - rel2{ relative: 1.0 1.0; to: "web_title_bg"; } - } - } - - part{ name: "favicon"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - min: WEB_TITLE_BAR_FAVICON_W_H WEB_TITLE_BAR_FAVICON_W_H; - max: WEB_TITLE_BAR_FAVICON_W_H WEB_TITLE_BAR_FAVICON_W_H; - fixed: 1 1; - align: 0.0 0.5; - rel1 { to: "favicon_spacer"; relative: 1 0; } - rel2 { to: "favicon_spacer"; } - } - } - part{ name: "text"; - type: TEXTBLOCK; - scale: 1; - description { state: "default" 0.0; - color: 211 211 211 255; - min: WEB_TITLE_BAR_TEXT_WIDTH WEB_TITLE_BAR_HEIGHT; - max: WEB_TITLE_BAR_TEXT_WIDTH WEB_TITLE_BAR_HEIGHT; - visible: 1; - fixed: 1 1; - text { - text: ""; - style: "text_style"; - } - rel1 { relative: 1.0 0.0; to: "title_spacer"; offset: 0 WEB_TITLE_BAR_HEIGHT;} - rel2 { relative: 1.0 1.0; to: "web_title_bg"; } - align: 0.0 0.0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - rel1 { relative: 1.0 0.0; to: "title_spacer"; offset: 0 0;} - } - } - } - programs{ - program{ - name: "show_bar"; - signal: "show_webtitle_bar"; - source: "web"; - action: STATE_SET "visible" 0.0; - target: "web_title_bg"; - target: "text"; - transition: LINEAR 0.5; - } - program{ - name: "hide_bar"; - signal: "hide_webtitle_bar"; - source: "web"; - action: STATE_SET "default" 0.0; - target: "web_title_bg"; - target: "text"; - transition: LINEAR 0.5; - } - } -} diff --git a/services/SimpleUI/edc/ZoomItem.edc b/services/SimpleUI/edc/ZoomItem.edc deleted file mode 100644 index eec3ff8..0000000 --- a/services/SimpleUI/edc/ZoomItem.edc +++ /dev/null @@ -1,221 +0,0 @@ -#define SPACER_ITEM_BR(spacer_name, W, H) \ - part { name: spacer_name; \ - type: RECT; \ - scale:1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - align: 1 1; \ - min: W H; \ - max: W H; \ - fixed: 1 1; \ - color: 255 255 255 10; \ - rel1 { relative: 0.0 1.0; to: "bg";} \ - rel2 { relative: 1.0 1.0; to: "bg";} \ - } \ - } - -#define WIDTH 374 -#define HEIGHT 82 - -data { item: "width" WIDTH; item: "height" HEIGHT; } - -collections { - group { - name: "elm/list/item/zoom_list"; - alias: "elm/list/item_odd/zoom_list"; - alias: "elm/list/item_compress/zoom_list"; - alias: "elm/list/item_compress_odd/zoom_list"; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - images { - image: "check_nor.png" COMP; - image: "check_foc.png" COMP; - } - parts { - part { - name: "bg_clipper"; - scale:1; - mouse_events: 0; - type: RECT; - description { - state: "default" 0.0; - min: WIDTH HEIGHT; - color: 0 0 0 0; - } - } - part { - name: "bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: WIDTH HEIGHT; - max: WIDTH HEIGHT; - color: 18 22 34 255; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - } - description { state: "highlight focus" 0.0; - inherit: "focus" 0.0; - } - } - SPACER_ITEM_BR("content_br", 374, 2) - part { - name: "elm.swallow.icon"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.0 0.0; - min: 38 38; - max: 38 38; - rel1 { relative: 1.0 0.0; to: "elm.text"; offset: 15 21;} - rel2 { relative: 1.0 1.0; to: "elm.text";} - color: 255 255 255 255; - image.normal: "check_foc.png"; - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "highlight focus" 0.0; - inherit: "highlight" 0.0; - image.normal: "check_nor.png"; - } - } - part { - name: "elm.text"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: 281 80; - max: 281 80; - rel1 { relative: 0.0 0.0; to: "bg"; offset: 25 0;} - rel2 { relative: 1.0 1.0; to: "bg";} - color: 255 255 255 255; - text { - text: ""; - font: "font_name"; - size: 30; - align: 0 0.5; - } - } - description { state: "highlight" 0.0; - inherit: "default" 0.0; - color: 69 143 255 255; - } - description { state: "focus" 0.0; - inherit: "default" 0.0; - } - description { state: "highlight focus" 0.0; - inherit: "focus" 0.0; - } - } - part { - name: "over2"; - scale:1; - type: RECT; - mouse_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { to: "bg_clipper"; relative: 0 0; } - rel2 { to: "bg_clipper"; relative: 1 1; } - } - } - } - programs{ - program { - name: "mouse_in"; - signal: "mouse,in"; - source: "over2"; - script { - new st[31]; - new Float:vl; - get_state(PART:"bg", st, 30, vl); - if(!strcmp(st, "highlight")) { - set_state(PART:"bg", "highlight focus", 0.0); - set_state(PART:"elm.text", "highlight focus", 0.0); - set_state(PART:"elm.swallow.icon", "highlight focus", 0.0); - } - else { - set_state(PART:"bg", "focus", 0.0); - set_state(PART:"elm.text", "focus", 0.0); - set_state(PART:"elm.swallow.icon", "focus", 0.0); - } - } - } - program { - name: "mouse_out"; - signal: "mouse,out"; - source: "over2"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.swallow.icon"; - script { - new st[31]; - new Float:vl; - get_state(PART:"bg", st, 30, vl); - if(!strcmp(st, "highlight focus")) { - set_state(PART:"bg", "highlight", 0.0); - set_state(PART:"elm.text", "highlight", 0.0); - set_state(PART:"elm.swallow.icon", "highlight", 0.0); - } - else if(!strcmp(st, "highlight")) { - set_state(PART:"bg", "highlight", 0.0); - set_state(PART:"elm.text", "highlight", 0.0); - set_state(PART:"elm.swallow.icon", "highlight", 0.0); - } - else { - set_state(PART:"bg", "default", 0.0); - set_state(PART:"elm.text", "default", 0.0); - set_state(PART:"elm.swallow.icon", "default", 0.0); - } - } - } - program { - name: "checked"; - signal: "checked"; - source: ""; - action: STATE_SET "highlight focus" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.swallow.icon"; - } - program { - name: "unchecked"; - signal: "unchecked"; - source: ""; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.swallow.icon"; - } - program { - name: "default_checked"; - signal: "default_checked"; - source: ""; - action: STATE_SET "highlight" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.swallow.icon"; - } - } - } -} -- 2.7.4 From b674d0b9776f018cfc3adb051ae8ca883454a72f Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Fri, 11 Sep 2015 14:04:37 +0200 Subject: [PATCH 08/16] Make AbstractUIComponent doing anything. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class needs AbstractUIComponent to have some view managing functions. [Cause:] N/A [Solution:] Added needed methods to interface: void init(Evas_Object* parent) Evas_Object* getContent() void showUI() void hideUI() [Verify:] Change builds. Browser is not crashing on loading services. Merge it after all UI components implement these methods. Change-Id: I7c67cad62a5b68a713395ecc1487fa9e90c72bc7 --- core/AbstractInterfaces/AbstractUIComponent.h | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/core/AbstractInterfaces/AbstractUIComponent.h b/core/AbstractInterfaces/AbstractUIComponent.h index 19d2984..daf9f76 100644 --- a/core/AbstractInterfaces/AbstractUIComponent.h +++ b/core/AbstractInterfaces/AbstractUIComponent.h @@ -27,9 +27,33 @@ namespace interfaces */ class AbstractUIComponent { +public: +/** + * @brief Sets the parent which will be used when getContent is used. + */ + virtual void init(Evas_Object* parent) = 0; + +/** + * @brief If UI content is not created creates it. + * Call init betore calling this function. + * @return UI content. + */ + virtual Evas_Object* getContent() = 0; + +/** + * @brief This makes element visible and clickable. + * Recreates genlists and gengrids (due to elm_genlist_clear and elm_gengrid_clear isue) + */ + virtual void showUI() = 0; + +/** + * @brief This makes UI element invisible and unclickable. + * Deletes genlists and gengrids (due to elm_genlist_clear and elm_gengrid_clear isue) + */ + virtual void hideUI() = 0; }; -} -} +}//namespace interfaces +}//namespace tizen_browser #endif /* __ABSTRACT_UI_COMPONENT_H__ */ -- 2.7.4 From 7af05447d9444e15afb26a3a481492e0a6c2a7b5 Mon Sep 17 00:00:00 2001 From: Marcin Lapinski Date: Fri, 11 Sep 2015 15:37:24 +0200 Subject: [PATCH 09/16] ViewManager class added. [Issue#:] https://bugs.tizen.org/jira/browse/TT-157 [Problem:] New window management class is needed. [Cause:] N/A [Solution:] Implemented new class with following public methods: popStackTo popTheStack pushViewToStack getContent [Verify:] Class is not used. Changes builds and doesn't crash. Merge this after merging this patch: https://review.tizen.org/gerrit/#/c/48052/ Change-Id: I4b8ca2866fa1cecbf858b4aed41e42112620a9f7 --- services/SimpleUI/CMakeLists.txt | 2 + services/SimpleUI/ViewManager.cpp | 122 ++++++++++++++++++++++++++++++++++++++ services/SimpleUI/ViewManager.h | 92 ++++++++++++++++++++++++++++ 3 files changed, 216 insertions(+) create mode 100644 services/SimpleUI/ViewManager.cpp create mode 100644 services/SimpleUI/ViewManager.h diff --git a/services/SimpleUI/CMakeLists.txt b/services/SimpleUI/CMakeLists.txt index af5a134..4c77390 100644 --- a/services/SimpleUI/CMakeLists.txt +++ b/services/SimpleUI/CMakeLists.txt @@ -5,6 +5,7 @@ set(SimpleUI_SRCS ButtonBar.cpp SimplePopup.cpp BookmarksManager.cpp + ViewManager.cpp ) set(SimpleUI_HEADERS @@ -12,6 +13,7 @@ set(SimpleUI_HEADERS ButtonBar.h SimplePopup.h BookmarksManager.h + ViewManager.h ) include(Coreheaders) diff --git a/services/SimpleUI/ViewManager.cpp b/services/SimpleUI/ViewManager.cpp new file mode 100644 index 0000000..eab2bbc --- /dev/null +++ b/services/SimpleUI/ViewManager.cpp @@ -0,0 +1,122 @@ +/* + * Copyrm_previousTopight (c) 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/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * ViewManager.cpp + * + * Created on: Sep 11, 2015 + * Author: m.lapinski@samsung.com + */ + +#include + +#include "ViewManager.h" +#include "core/BrowserLogger.h" +#include "core/ServiceManager/Debug/BrowserAssert.h" + +namespace tizen_browser{ +namespace base_ui{ + +ViewManager::ViewManager(Evas_Object* parentWindow) + :m_mainLayout(nullptr) + ,m_previousTop(nullptr) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parentWindow); + m_mainLayout = elm_layout_add(parentWindow); + evas_object_size_hint_weight_set(m_mainLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set (m_mainLayout, EVAS_HINT_FILL, EVAS_HINT_FILL); + if(!elm_object_style_set (m_mainLayout,"content-back")) + BROWSER_LOGD("[%s:%d] elm_object_style_set falied.",__PRETTY_FUNCTION__, __LINE__); + elm_win_resize_object_add(parentWindow, m_mainLayout); + evas_object_show(m_mainLayout); +} + +void ViewManager::popStackTo(interfaces::AbstractUIComponent* view) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(view); + + if(!m_viewStack.empty()) + m_previousTop = m_viewStack.top(); + + while(!m_viewStack.empty()) + { + if (m_viewStack.top() == view) + break; + m_viewStack.pop(); + } + updateLayout(); +} + +void ViewManager::popTheStack() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if(!m_viewStack.empty()) + { + m_previousTop = m_viewStack.top(); + m_viewStack.pop(); + updateLayout(); + } +} + +void ViewManager::pushViewToStack(interfaces::AbstractUIComponent* view) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(view); + m_viewStack.push(view); + updateLayout(); +} + + +void ViewManager::updateLayout() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + Evas_Object* swallowed = elm_layout_content_get(m_mainLayout, "elm.swallow.content"); + + if (!m_viewStack.empty()) + { + if (m_viewStack.top()->getContent() == swallowed) + { + BROWSER_LOGD("[%s:%d] Top of stack is already visible!!!", + __PRETTY_FUNCTION__, __LINE__); + return; + } + if(m_previousTop) + m_previousTop->hideUI(); + elm_layout_content_unset(m_mainLayout, "elm.swallow.content"); + elm_layout_content_set(m_mainLayout, "elm.swallow.content", m_viewStack.top()->getContent()); + m_viewStack.top()->showUI(); + } + else + { + BROWSER_LOGD("[%s:%d] Stack is empty!!!",__PRETTY_FUNCTION__, __LINE__); + if(m_previousTop) + m_previousTop->hideUI(); + + elm_layout_content_unset(m_mainLayout, "elm.swallow.content"); + elm_layout_content_set(m_mainLayout, "elm.swallow.content", nullptr); + } +} + +Evas_Object* ViewManager::getContent() +{ + M_ASSERT(m_mainLayout); + return m_mainLayout; +} + +}//namespace base_ui +}//names1pace tizen_browser diff --git a/services/SimpleUI/ViewManager.h b/services/SimpleUI/ViewManager.h new file mode 100644 index 0000000..06d385d --- /dev/null +++ b/services/SimpleUI/ViewManager.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 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/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * ViewManager.h + * + * Created on: Sep 11, 2015 + * Author: m.lapinski@samsung.com + */ + +#ifndef VIEWMANAGER_H_ +#define VIEWMANAGER_H_ + +#include + +#include + +#include "core/AbstractInterfaces/AbstractUIComponent.h" + +namespace tizen_browser{ +namespace base_ui{ + + +/** + * @brief This class simplifies UI component management. It is a views stack. + * It handles all widget framework issues related to changing active view. + */ +class ViewManager +{ +public: +/** + * @brief constructor. + * + * @param A window which will contatin ViewManager's main layout. + */ + ViewManager(Evas_Object* parentWindow); + +/** + * @brief Pops stack to specified view. Hides actual view (if there is any) and + * make specified view visible. Does nothing if stack is empty. If view + * is not in the stack, it pops whole stack. + * + * @param A view which stack should be popped to. Do not use nullptr. + */ + void popStackTo(interfaces::AbstractUIComponent* view); + +/** + * @brief Pops actual view from the stack, hides it and if there is any view + * under it makes it visible. + */ + void popTheStack(); + +/** + * @brief Pushes view to the stack, hides if any wiew was visible hides it and + * new one visible visible. + * + * @param View pushed to stack. Do not use nullptr. + */ + void pushViewToStack(interfaces::AbstractUIComponent* view); + +/** + * @brief Function returns elm layout used in view management. It's parent is + * specified in constructor. + * + * @return ViewManager's main layout. + */ + Evas_Object* getContent(); + +private: + void updateLayout(); +private: + Evas_Object* m_mainLayout; + std::stack m_viewStack; + interfaces::AbstractUIComponent* m_previousTop; +}; + +}//namespace base_ui +}//namespace tizen_browser +#endif //VIEWMANAGER_H_ -- 2.7.4 From 3f1454d3372211caa24570e24d5c6cb71167dc24 Mon Sep 17 00:00:00 2001 From: Dariusz Frankiewicz Date: Fri, 18 Sep 2015 12:18:53 +0200 Subject: [PATCH 10/16] fixup! ViewManager class added. Change-Id: I9a52869f215df69a9e82c18ab2b3e4c547ea1c1d --- services/SimpleUI/ViewManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/SimpleUI/ViewManager.cpp b/services/SimpleUI/ViewManager.cpp index eab2bbc..ca45d1a 100644 --- a/services/SimpleUI/ViewManager.cpp +++ b/services/SimpleUI/ViewManager.cpp @@ -1,5 +1,5 @@ /* - * Copyrm_previousTopight (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 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. -- 2.7.4 From 5059e93c83493911ad58c4c26162f2792c99ded6 Mon Sep 17 00:00:00 2001 From: Albert Malewski Date: Fri, 18 Sep 2015 15:02:56 +0200 Subject: [PATCH 11/16] Changed database path [Issue] N/A [Problem] There was wrong database path which resulted in fails while launching the browser. [Cause] Wrong Tizen platform variable was used. [Solution] Used TZ_USER_APP instead of TZ_USER_DB. [Verify] Launch browser > Observe logs There shouldn't be fails in logs while loading database. Change-Id: I2641314543647e15cdfc70b5b8decc201fdcc57b --- core/Config/Config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Config/Config.cpp b/core/Config/Config.cpp index 2665734..d9f5490 100644 --- a/core/Config/Config.cpp +++ b/core/Config/Config.cpp @@ -26,7 +26,7 @@ namespace config void DefaultConfig::load(const std::string &) { const char *db_path = NULL; - db_path = tzplatform_getenv(TZ_USER_DB); + db_path = tzplatform_getenv(TZ_USER_APP); m_data["main_service_name"] = std::string("org.tizen.browser.base_UI"); //m_data["favorite_service_name"] = std::string("org.tizen.browser.service.favorite.browserProvider"); -- 2.7.4 From 3ef233bc3596ecebb4dde179f0eb667c7c721c84 Mon Sep 17 00:00:00 2001 From: Dariusz Frankiewicz Date: Fri, 18 Sep 2015 07:53:18 -0700 Subject: [PATCH 12/16] Revert "Changed database path" This reverts commit 5059e93c83493911ad58c4c26162f2792c99ded6. Change-Id: I8cdfa7391739693de3813eed6d2179a90f94f76f --- core/Config/Config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Config/Config.cpp b/core/Config/Config.cpp index d9f5490..2665734 100644 --- a/core/Config/Config.cpp +++ b/core/Config/Config.cpp @@ -26,7 +26,7 @@ namespace config void DefaultConfig::load(const std::string &) { const char *db_path = NULL; - db_path = tzplatform_getenv(TZ_USER_APP); + db_path = tzplatform_getenv(TZ_USER_DB); m_data["main_service_name"] = std::string("org.tizen.browser.base_UI"); //m_data["favorite_service_name"] = std::string("org.tizen.browser.service.favorite.browserProvider"); -- 2.7.4 From d822c546ff9f515c2ac73d560fad2b7158666330 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Mon, 21 Sep 2015 11:24:46 +0200 Subject: [PATCH 13/16] Moved code responsible for web page ui to separate service. [Issue] https://bugs.tizen.org/jira/browse/TT-167 [Problem] Functionality of SimpleUI was confusing. [Cause] N/A [Solution] Created new class WebPageUI, moved all classes connected to web page ui to new service. Change-Id: I633b5c5abad0040b9b7d51e5fb532de2c0d25689 Signed-off-by: Maciej Skrzypkowski --- services/CMakeLists.txt | 2 +- services/MainUI/MainUI.cpp | 41 +- services/MainUI/MainUI.h | 24 +- services/SimpleUI/CMakeLists.txt | 13 +- services/SimpleUI/SimpleUI.cpp | 388 ++++------------ services/SimpleUI/SimpleUI.h | 39 +- services/SimpleUI/edc/ErrorMessage.edc | 169 ------- services/SimpleUI/edc/LeftButtonBar.edc | 100 ---- services/SimpleUI/edc/MainLayout.edc | 291 ------------ services/SimpleUI/edc/RightButtonBar.edc | 83 ---- services/SimpleUI/edc/ScrollerDefault.edc | 502 --------------------- services/SimpleUI/edc/webview.edc | 91 ---- services/SimpleURI/CMakeLists.txt | 27 -- services/SimpleURI/edc/URIEntry.edc | 273 ----------- services/SimpleURI/images/ico_search.png | Bin 18426 -> 0 bytes services/SimpleURI/images/ico_url.png | Bin 3000 -> 0 bytes .../SimpleURI/images/search_searchbar_bg_foc.png | Bin 17789 -> 0 bytes .../SimpleURI/images/search_searchbar_bg_nor.png | Bin 17740 -> 0 bytes services/{SimpleUI => WebPageUI}/ButtonBar.cpp | 99 ++-- services/{SimpleUI => WebPageUI}/ButtonBar.h | 47 +- services/WebPageUI/CMakeLists.txt | 68 +++ .../SimpleURI.cpp => WebPageUI/URIEntry.cpp} | 171 +++---- .../SimpleURI.h => WebPageUI/URIEntry.h} | 70 ++- services/WebPageUI/WebPageUI.cpp | 307 +++++++++++++ services/WebPageUI/WebPageUI.h | 108 +++++ services/WebPageUI/edc/ErrorMessage.edc | 179 ++++++++ .../{SimpleUI => WebPageUI}/edc/ImageButton.edc | 0 services/WebPageUI/edc/LeftButtonBar.edc | 103 +++++ services/WebPageUI/edc/RightButtonBar.edc | 86 ++++ services/{SimpleUI => WebPageUI}/edc/Spacer.edc | 0 services/WebPageUI/edc/URIEntry.edc | 296 ++++++++++++ services/WebPageUI/edc/WebPageUI.edc | 318 +++++++++++++ .../images/btn_bar_back_nor.png | Bin .../images/btn_bar_forward_nor.png | Bin .../images/btn_bar_manager_nor.png | Bin .../images/btn_bar_more_nor.png | Bin .../images/btn_bar_reload_nor.png | Bin .../images/btn_bar_stop_nor.png | Bin .../images/btn_bar_vertical_settings.png | Bin .../images/round_rectangle_4X4.png | Bin .../images/web_browsing_icon_error.png | Bin .../{SimpleUI => WebPageUI}/images/web_shadow.png | Bin unit_tests/CMakeLists.txt | 4 +- 43 files changed, 1792 insertions(+), 2107 deletions(-) delete mode 100644 services/SimpleUI/edc/ErrorMessage.edc delete mode 100644 services/SimpleUI/edc/LeftButtonBar.edc delete mode 100644 services/SimpleUI/edc/MainLayout.edc delete mode 100644 services/SimpleUI/edc/RightButtonBar.edc delete mode 100644 services/SimpleUI/edc/ScrollerDefault.edc delete mode 100644 services/SimpleUI/edc/webview.edc delete mode 100644 services/SimpleURI/CMakeLists.txt delete mode 100644 services/SimpleURI/edc/URIEntry.edc delete mode 100644 services/SimpleURI/images/ico_search.png delete mode 100755 services/SimpleURI/images/ico_url.png delete mode 100644 services/SimpleURI/images/search_searchbar_bg_foc.png delete mode 100644 services/SimpleURI/images/search_searchbar_bg_nor.png rename services/{SimpleUI => WebPageUI}/ButtonBar.cpp (69%) rename services/{SimpleUI => WebPageUI}/ButtonBar.h (59%) create mode 100644 services/WebPageUI/CMakeLists.txt rename services/{SimpleURI/SimpleURI.cpp => WebPageUI/URIEntry.cpp} (59%) rename services/{SimpleURI/SimpleURI.h => WebPageUI/URIEntry.h} (54%) create mode 100644 services/WebPageUI/WebPageUI.cpp create mode 100644 services/WebPageUI/WebPageUI.h create mode 100644 services/WebPageUI/edc/ErrorMessage.edc rename services/{SimpleUI => WebPageUI}/edc/ImageButton.edc (100%) create mode 100644 services/WebPageUI/edc/LeftButtonBar.edc create mode 100644 services/WebPageUI/edc/RightButtonBar.edc rename services/{SimpleUI => WebPageUI}/edc/Spacer.edc (100%) create mode 100644 services/WebPageUI/edc/URIEntry.edc create mode 100644 services/WebPageUI/edc/WebPageUI.edc rename services/{SimpleUI => WebPageUI}/images/btn_bar_back_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_forward_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_manager_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_more_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_reload_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_stop_nor.png (100%) rename services/{SimpleUI => WebPageUI}/images/btn_bar_vertical_settings.png (100%) rename services/{SimpleUI => WebPageUI}/images/round_rectangle_4X4.png (100%) rename services/{SimpleUI => WebPageUI}/images/web_browsing_icon_error.png (100%) rename services/{SimpleUI => WebPageUI}/images/web_shadow.png (100%) diff --git a/services/CMakeLists.txt b/services/CMakeLists.txt index b4944bf..975dd93 100644 --- a/services/CMakeLists.txt +++ b/services/CMakeLists.txt @@ -7,7 +7,7 @@ add_subdirectory(HistoryUI) add_subdirectory(TabUI) add_subdirectory(SimpleUI) add_subdirectory(SettingsUI) -add_subdirectory(SimpleURI) +add_subdirectory(WebPageUI) add_subdirectory(BookmarkManagerUI) add_subdirectory(StorageService) add_subdirectory(HistoryService) diff --git a/services/MainUI/MainUI.cpp b/services/MainUI/MainUI.cpp index d5bec80..11df7f9 100644 --- a/services/MainUI/MainUI.cpp +++ b/services/MainUI/MainUI.cpp @@ -81,6 +81,34 @@ MainUI::~MainUI() elm_gengrid_item_class_free(m_bookmark_item_class); } +void MainUI::init(Evas_Object* parent) +{ + M_ASSERT(parent); + m_parent = parent; +} + + +Evas_Object* MainUI::getContent() +{ + M_ASSERT(m_parent); + if (!m_layout) { + m_layout = createQuickAccessLayout(m_parent); + } + return m_layout; +} + +void MainUI::showMostVisited(std::shared_ptr< services::HistoryItemVector > vec) +{ + addHistoryItems(vec); + showHistory(); +} + +void MainUI::showBookmarks(std::vector< std::shared_ptr< tizen_browser::services::BookmarkItem > > vec) +{ + addBookmarkItems(vec); + showBookmarks(); +} + void MainUI::createItemClasses() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); @@ -94,14 +122,6 @@ void MainUI::createItemClasses() } } -void MainUI::show(Evas_Object* parent) -{ - //FIXME: this may be source of memory leak this object is not deleted anywhere - m_layout = createQuickAccessLayout(parent); - evas_object_show(m_layout); - - m_parent = parent; -} Evas_Object* MainUI::createQuickAccessLayout(Evas_Object* parent) { @@ -304,6 +324,7 @@ void MainUI::addBookmarkItem(std::shared_ptr > items) { + clearBookmarkGengrid(); BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); for (auto it = items.begin(); it != items.end(); ++it) { addBookmarkItem(*it); @@ -393,6 +414,7 @@ void MainUI::showHistory() return; } setEmptyView(false); + evas_object_show(m_layout); } void MainUI::clearBookmarkGengrid() @@ -417,13 +439,12 @@ void MainUI::showBookmarks() evas_object_show(m_bookmarksView); elm_object_focus_set(m_bookmarksButton, true); + evas_object_show(m_layout); } void MainUI::hide() { BROWSER_LOGD("%s:%d %s", __FILE__, __LINE__, __func__); - - //TODO: remove these "evas_object_hide" after cleaning up the mess in whole app window. evas_object_hide(m_layout); evas_object_hide(m_mostVisitedView); evas_object_hide(m_bookmarksView); diff --git a/services/MainUI/MainUI.h b/services/MainUI/MainUI.h index 0ebc78d..0b5b52b 100644 --- a/services/MainUI/MainUI.h +++ b/services/MainUI/MainUI.h @@ -39,24 +39,17 @@ class BROWSER_EXPORT MainUI public: MainUI(); ~MainUI(); - void show(Evas_Object *main_layout); + void init(Evas_Object *main_layout); + Evas_Object* getContent(); + void showMostVisited(std::shared_ptr vec); + void showBookmarks(std::vector > vec); void hide(); virtual std::string getName(); - void clearHistoryGenlist(); - void clearBookmarkGengrid(); - void showHistory(); - void showBookmarks(); - void clearItems(); void openDetailPopup(std::shared_ptr currItem, std::shared_ptr prevItems); bool isDesktopMode() const; void setDesktopMode(bool mode); DetailPopup & getDetailPopup(); - void addHistoryItem(std::shared_ptr); - void addHistoryItems(std::shared_ptr); - void addBookmarkItem(std::shared_ptr); - void addBookmarkItems(std::vector >); - boost::signals2::signal, int)> mostVisitedTileClicked; boost::signals2::signal, bool)> openURLInNewTab; boost::signals2::signal mostVisitedClicked; @@ -68,6 +61,15 @@ public: private: void createItemClasses(); + void addHistoryItem(std::shared_ptr); + void addHistoryItems(std::shared_ptr); + void addBookmarkItem(std::shared_ptr); + void addBookmarkItems(std::vector >); + void clearHistoryGenlist(); + void clearBookmarkGengrid(); + void showHistory(); + void showBookmarks(); + void clearItems(); Evas_Object* createQuickAccessLayout(Evas_Object *parent); Evas_Object* createMostVisitedView(Evas_Object *parent); diff --git a/services/SimpleUI/CMakeLists.txt b/services/SimpleUI/CMakeLists.txt index 4c77390..9771495 100644 --- a/services/SimpleUI/CMakeLists.txt +++ b/services/SimpleUI/CMakeLists.txt @@ -2,7 +2,6 @@ project(SimpleUI) set(SimpleUI_SRCS SimpleUI.cpp - ButtonBar.cpp SimplePopup.cpp BookmarksManager.cpp ViewManager.cpp @@ -10,7 +9,6 @@ set(SimpleUI_SRCS set(SimpleUI_HEADERS SimpleUI.h - ButtonBar.h SimplePopup.h BookmarksManager.h ViewManager.h @@ -23,7 +21,7 @@ include(EWebKitHelpers) include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_SOURCE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/services) -include_directories(${CMAKE_SOURCE_DIR}/services/SimpleURI) +include_directories(${CMAKE_SOURCE_DIR}/services/WebPageUI) include_directories(${CMAKE_SOURCE_DIR}/services/WebEngineService) include_directories(${CMAKE_SOURCE_DIR}/services/WebEngineService/src) include_directories(${CMAKE_SOURCE_DIR}/services/StorageService) @@ -45,7 +43,7 @@ pkg_check_modules(capi_net QUIET capi-network-connection) add_library(${PROJECT_NAME} SHARED ${SimpleUI_SRCS}) -add_dependencies(${PROJECT_NAME} SimpleURI) +add_dependencies(${PROJECT_NAME} WebPageUI) add_dependencies(${PROJECT_NAME} StorageService) add_dependencies(${PROJECT_NAME} HistoryService) add_dependencies(${PROJECT_NAME} MoreMenuUI) @@ -56,7 +54,7 @@ add_dependencies(${PROJECT_NAME} TabUI) add_dependencies(${PROJECT_NAME} SettingsUI) add_dependencies(${PROJECT_NAME} PlatformInputManager) add_dependencies(${PROJECT_NAME} SessionStorage) -target_link_libraries(${PROJECT_NAME} SimpleURI) +target_link_libraries(${PROJECT_NAME} WebPageUI) target_link_libraries(${PROJECT_NAME} StorageService) target_link_libraries(${PROJECT_NAME} HistoryService) target_link_libraries(${PROJECT_NAME} MoreMenuUI) @@ -81,13 +79,8 @@ include(EDCCompile) #please do not add edc/ directory set(edcFiles - MainLayout.edc - LeftButtonBar.edc - RightButtonBar.edc AuthenticationPopup.edc BookmarksManager.edc - ScrollerDefault.edc - ErrorMessage.edc Tooltip.edc ) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 9ee8eae..dee412f 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -20,7 +20,6 @@ #include #endif -#include #include #include #include @@ -37,7 +36,6 @@ #include "TabId.h" #include "Tools/EflTools.h" #include "BrowserImage.h" -#include "SimpleURI.h" #include "SimpleUI.h" #include "BookmarkItem.h" #include "Tools/EflTools.h" @@ -60,15 +58,12 @@ const int ROOT_FOLDER = 0; SimpleUI::SimpleUI() : AbstractMainWindow() - , m_mainLayout(nullptr) - , m_progressBar(nullptr) , m_popup(nullptr) , m_moreMenuUI() , m_tabUI() , m_bookmarkManagerUI() , m_mainUI() , m_initialised(false) - , m_isHomePageActive(false) , items_vector() , m_networkErrorPopup(0) , m_wvIMEStatus(false) @@ -147,29 +142,23 @@ int SimpleUI::exec(const std::string& _url) //set global show tooltip timeout elm_config_tooltip_delay_set( boost::any_cast (config.get("TOOLTIP_DELAY"))); - loadThemes(); - loadUIServices(); loadModelServices(); createActions(); - // create view layouts - m_mainLayout = createWebLayout(m_window.get()); - elm_win_resize_object_add(m_window.get(), m_mainLayout); - - m_errorLayout = createErrorLayout(m_window.get()); - - //this needs to be called after UI is estabilished + // initModelServices() needs to be called after initUIServices() + initUIServices(); initModelServices(); + // create view layouts + elm_win_resize_object_add(m_window.get(), m_webPageUI->getContent()); + connectModelSignals(); connectUISignals(); connectActions(); - elm_layout_signal_callback_add(m_simpleURI->getContent(), "slide_websearch", "elm", SimpleUI::favicon_clicked, this); - // show main layout and window - evas_object_show(m_mainLayout); + evas_object_show(m_webPageUI->getContent()); evas_object_show(m_window.get()); } m_initialised = true; @@ -180,63 +169,17 @@ int SimpleUI::exec(const std::string& _url) if (url.empty()) { BROWSER_LOGD("[%s]: changing to homeUrl", __func__); - switchViewToHomePage(); + switchViewToQuickAccess(); restoreLastSession(); + } else { + openNewTab(url); } - else - openNewTab(url); - m_simpleURI->setFocus(); + m_webPageUI->getURIEntry().setFocus(); BROWSER_LOGD("[%s]:%d url=%s", __func__, __LINE__, url.c_str()); return 0; } -Evas_Object* SimpleUI::createWebLayout(Evas_Object* parent) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - // create web layout - Evas_Object* web_layout = elm_layout_add(parent); - evas_object_size_hint_weight_set(web_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_layout_file_set(web_layout, edjePath("SimpleUI/MainLayout.edj").c_str(), "main_layout"); - - // left buttons - leftButtonBar = std::make_shared(web_layout, "SimpleUI/LeftButtonBar.edj", "left_button_bar"); - leftButtonBar->addAction(m_back, "prev_button"); - leftButtonBar->addAction(m_forward, "next_button"); - leftButtonBar->addAction(m_reload, "refresh_stop_button"); - - //register action that will be used later by buttons" - leftButtonBar->registerEnabledChangedCallback(m_stopLoading, "refresh_stop_button"); - - // right buttons - rightButtonBar = std::make_shared(web_layout, "SimpleUI/RightButtonBar.edj", "right_button_bar"); - rightButtonBar->addAction(m_tab, "tab_button"); - rightButtonBar->addAction(m_showMoreMenu, "setting_button"); - - // progress bar - m_progressBar = elm_progressbar_add(web_layout); - elm_object_style_set(m_progressBar,"play_buffer"); - - //URL bar (Evas Object is shipped by SimpleURI object) - elm_object_part_content_set(web_layout, "uri_entry", m_simpleURI->getContent(web_layout)); - elm_object_part_content_set(web_layout, "uri_bar_buttons_left", leftButtonBar->getContent()); - elm_object_part_content_set(web_layout, "uri_bar_buttons_right", rightButtonBar->getContent()); - - return web_layout; -} - -Evas_Object* SimpleUI::createErrorLayout(Evas_Object* parent) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - Evas_Object* errorLayout = elm_layout_add(parent); - evas_object_size_hint_weight_set(errorLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - elm_layout_file_set(errorLayout, edjePath("SimpleUI/ErrorMessage.edj").c_str(), "error_message"); - - return errorLayout; -} - void SimpleUI::restoreLastSession() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -258,10 +201,10 @@ void SimpleUI::loadUIServices() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_simpleURI = + m_webPageUI = std::dynamic_pointer_cast - - (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.simpleuri")); + + (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.webpageui")); m_mainUI = std::dynamic_pointer_cast @@ -273,8 +216,8 @@ void SimpleUI::connectUISignals() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - M_ASSERT(m_simpleURI.get()); - m_simpleURI->uriChanged.connect(boost::bind(&SimpleUI::filterURL, this, _1)); + M_ASSERT(m_webPageUI.get()); + m_webPageUI->getURIEntry().uriChanged.connect(boost::bind(&SimpleUI::filterURL, this, _1)); M_ASSERT(m_mainUI.get()); m_mainUI->getDetailPopup().openURLInNewTab.connect(boost::bind(&SimpleUI::onOpenURLInNewTab, this, _1, _2)); @@ -314,13 +257,19 @@ void SimpleUI::loadModelServices() (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.sessionStorageService")); } +void SimpleUI::initUIServices() +{ + m_webPageUI->init(m_window.get()); + m_mainUI->init(m_webPageUI->getContent()); +} + void SimpleUI::initModelServices() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); M_ASSERT(m_webEngine); - M_ASSERT(m_mainLayout); - m_webEngine->init(m_mainLayout); + M_ASSERT(m_webPageUI->getContent()); + m_webEngine->init(m_webPageUI->getContent()); M_ASSERT(m_favoriteService); m_favoriteService->synchronizeBookmarks(); @@ -335,9 +284,9 @@ void SimpleUI::connectModelSignals() BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_webEngine->uriChanged.connect(boost::bind(&SimpleUI::webEngineURLChanged, this, _1)); - m_webEngine->uriChanged.connect(boost::bind(&SimpleURI::changeUri, m_simpleURI.get(), _1)); + m_webEngine->uriChanged.connect(boost::bind(&URIEntry::changeUri, &m_webPageUI->getURIEntry(), _1)); m_webEngine->uriOnTabChanged.connect(boost::bind(&SimpleUI::checkTabId,this,_1)); - m_webEngine->webViewClicked.connect(boost::bind(&SimpleURI::clearFocus, m_simpleURI.get())); + m_webEngine->webViewClicked.connect(boost::bind(&URIEntry::clearFocus, &m_webPageUI->getURIEntry())); m_webEngine->backwardEnableChanged.connect(boost::bind(&SimpleUI::backEnable, this, _1)); m_webEngine->forwardEnableChanged.connect(boost::bind(&SimpleUI::forwardEnable, this, _1)); m_webEngine->loadStarted.connect(boost::bind(&SimpleUI::loadStarted, this)); @@ -353,56 +302,19 @@ void SimpleUI::connectModelSignals() m_favoriteService->bookmarkAdded.connect(boost::bind(&SimpleUI::onBookmarkAdded, this,_1)); m_favoriteService->bookmarkDeleted.connect(boost::bind(&SimpleUI::onBookmarkRemoved, this, _1)); - //m_historyService->historyEmpty.connect(boost::bind(&SimpleUI::disableHistoryButton, this, _1)); m_historyService->historyAdded.connect(boost::bind(&SimpleUI::onHistoryAdded, this,_1)); m_historyService->historyDeleted.connect(boost::bind(&SimpleUI::onHistoryRemoved, this,_1)); - //TODO "clearHistoryGenlist" should be renamed to "onHistoryDeleteFinished" - //and "historyAllDeleted"should be renamed to historyDeleteFinished" - m_historyService->historyAllDeleted.connect(boost::bind(&MainUI::clearHistoryGenlist, m_mainUI.get())); m_platformInputManager->returnPressed.connect(boost::bind(&elm_exit)); m_platformInputManager->backPressed.connect(boost::bind(&SimpleUI::onBackPressed, this)); } -//TODO: move it to WebUI -void SimpleUI::loadThemes() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - elm_theme_extension_add(nullptr, edjePath("SimpleUI/ErrorMessage.edj").c_str()); - - elm_theme_overlay_add(0, edjePath("SimpleUI/ScrollerDefault.edj").c_str()); - elm_theme_overlay_add(0, edjePath("SimpleUI/Tooltip.edj").c_str()); -} - void SimpleUI::createActions() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); ///\todo Add MulitStateAction. and convert m_stopLoading and m_reload actons to it? - m_back = sharedAction(new Action("Back")); - m_back->setToolTip("Previous"); - m_back->setIcon("browser/toolbar_prev"); - - m_forward = sharedAction(new Action("Next")); - m_forward->setToolTip("Next"); - m_forward->setIcon("browser/toolbar_next"); - - m_stopLoading = sharedAction(new Action("Stop")); - m_stopLoading->setToolTip("Stop"); - m_stopLoading->setIcon("browser/toolbar_stop"); - - m_reload = sharedAction(new Action("Reload")); - m_reload->setToolTip("Reload"); - m_reload->setIcon("browser/toolbar_reload"); - m_tab = sharedAction(new Action("Tabs")); - m_tab->setToolTip("Tab page"); - m_tab->setIcon("browser/toolbar_tab"); - - m_showMoreMenu = sharedAction(new Action("Settings")); - m_showMoreMenu->setToolTip("Settings"); - m_showMoreMenu->setIcon("browser/toolbar_setting"); - m_settingPrivateBrowsing = sharedAction(new Action("Private browsing")); m_settingPrivateBrowsing->setToolTip("On exit from private mode all cookies, history, and stored data will be deleted"); m_settingPrivateBrowsing->setCheckable(true); @@ -436,48 +348,30 @@ void SimpleUI::createActions() void SimpleUI::connectActions() { - //left bar - m_back->triggered.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::back, m_webEngine.get())); - m_back->triggered.connect(boost::bind(&SimpleUI::updateBrowserView, this)); - m_forward->triggered.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::forward, m_webEngine.get())); - m_stopLoading->triggered.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::stopLoading, m_webEngine.get())); - m_reload->triggered.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::reload, m_webEngine.get())); - m_reload->triggered.connect(boost::bind(&SimpleUI::updateBrowserView, this)); - - //right bar - m_tab->triggered.connect(boost::bind(&SimpleUI::showTabUI, this)); - m_showMoreMenu->triggered.connect(boost::bind(&SimpleUI::showMoreMenu, this)); - + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); m_settingPrivateBrowsing->toggled.connect(boost::bind(&SimpleUI::settingsPrivateModeSwitch, this, _1)); -} -void SimpleUI::updateURIBarView() -{ - m_simpleURI->changeUri(m_webEngine->getURI()); - leftButtonBar->setActionForButton("refresh_stop_button", m_reload); - stopEnable(true); - reloadEnable(true); - hideProgressBar(); -} + //left bar + m_webPageUI->backPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::back, m_webEngine.get())); + m_webPageUI->backPage.connect(boost::bind(&SimpleUI::switchViewToWebPage, this)); + m_webPageUI->forwardPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::forward, m_webEngine.get())); + m_webPageUI->stopLoadingPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::stopLoading, m_webEngine.get())); + m_webPageUI->reloadPage.connect(boost::bind(&tizen_browser::basic_webengine::AbstractWebEngine::reload, m_webEngine.get())); + m_webPageUI->reloadPage.connect(boost::bind(&SimpleUI::switchViewToWebPage, this)); -void SimpleUI::updateWebView() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - evas_object_hide(elm_object_part_content_get(m_mainLayout, "web_view")); - elm_object_part_content_unset(m_mainLayout, "web_view"); - elm_object_part_content_set(m_mainLayout, "web_view", m_webEngine->getLayout()); - evas_object_show(m_webEngine->getLayout()); + //right bar + m_webPageUI->showTabUI.connect(boost::bind(&SimpleUI::showTabUI, this)); + m_webPageUI->showMoreMenu.connect(boost::bind(&SimpleUI::showMoreMenu, this)); } -void SimpleUI::updateBrowserView() +void SimpleUI::switchViewToWebPage() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if(isHomePageActive()) - hideMainUI(); - - updateWebView(); - - updateURIBarView(); + M_ASSERT(m_webPageUI); + M_ASSERT(m_mainUI); + if(m_webPageUI->isHomePageActive()) + m_mainUI->hide(); + m_webPageUI->switchViewToWebPage(m_webEngine->getLayout(), m_webEngine->getURI()); } void SimpleUI::switchToTab(const tizen_browser::basic_webengine::TabId& tabId) @@ -493,42 +387,23 @@ void SimpleUI::switchToTab(const tizen_browser::basic_webengine::TabId& tabId) return; } BROWSER_LOGD("[%s:%d] swiching to web_view ", __PRETTY_FUNCTION__, __LINE__); - updateBrowserView(); -} - -bool SimpleUI::isHomePageActive() -{ - return m_isHomePageActive; + switchViewToWebPage(); } bool SimpleUI::isErrorPageActive() { - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - return elm_object_part_content_get(m_mainLayout, "web_view") == m_errorLayout; + return m_webPageUI->isErrorPageActive(); } -void SimpleUI::switchViewToHomePage() +void SimpleUI::switchViewToQuickAccess() { - BROWSER_LOGD("[%s:%d] isHomePageActive : %d", __PRETTY_FUNCTION__, __LINE__, m_isHomePageActive); - if(isHomePageActive()) - return; - - showMainUI(); - filterURL(HomePageURL); + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if(m_webPageUI->isHomePageActive()) + return; + m_webPageUI->switchViewToQuickAccess(m_mainUI->getContent()); m_webEngine->disconnectCurrentWebViewSignals(); - - leftButtonBar->setActionForButton("refresh_stop_button", m_reload); - - stopEnable(false); - reloadEnable(false); - forwardEnable(false); - backEnable(false); - evas_object_hide(leftButtonBar->getContent()); - elm_object_signal_emit(m_mainLayout, "shiftback_uri", "ui"); - elm_object_signal_emit(m_simpleURI->getContent(), "shiftback_uribg", "ui"); - - hideProgressBar(); + m_mainUI->showMostVisited(getMostVisitedItems()); } void SimpleUI::checkTabId(const tizen_browser::basic_webengine::TabId& id){ @@ -560,7 +435,7 @@ void SimpleUI::closeTab(const tizen_browser::basic_webengine::TabId& id) void SimpleUI::bookmarkCheck() { - if (isHomePageActive()) + if (m_webPageUI->isHomePageActive()) return; if(m_favoriteService->bookmarkExists(m_webEngine->getURI())){ @@ -616,28 +491,19 @@ void SimpleUI::onClearHistoryClicked(const std::string&) void SimpleUI::onMostVisitedClicked(const std::string&) { BROWSER_LOGD("[%s]", __func__); - m_mainUI->clearHistoryGenlist(); - m_mainUI->clearBookmarkGengrid(); - m_mainUI->addHistoryItems(getMostVisitedItems()); - m_mainUI->showHistory(); + m_mainUI->showMostVisited(getMostVisitedItems()); } void SimpleUI::onBookmarkButtonClicked(const std::string&) { BROWSER_LOGD("[%s]", __func__); - m_mainUI->clearBookmarkGengrid(); - m_mainUI->clearHistoryGenlist(); - m_mainUI->addBookmarkItems(getBookmarks()); - m_mainUI->showBookmarks(); + m_mainUI->showBookmarks(getBookmarks()); } void SimpleUI::onBookmarkManagerButtonClicked(const std::string&) { BROWSER_LOGD("[%s]", __func__); - if(m_mainUI) { // TODO: remove this section when naviframes will be available - m_mainUI->clearBookmarkGengrid(); - m_mainUI->clearHistoryGenlist(); - } + m_mainUI->hide(); if(m_moreMenuUI) { // TODO: remove this section when naviframes will be available m_moreMenuUI->clearItems(); @@ -696,28 +562,28 @@ void SimpleUI::setwvIMEStatus(bool status) void SimpleUI::onBackPressed() { BROWSER_LOGD("[%s]", __func__); - if (!m_simpleURI->hasFocus() && !m_wvIMEStatus && !isHomePageActive() && m_back->isEnabled()) + if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus && !m_webPageUI->isHomePageActive() && m_webPageUI->isBackButtonEnabled()) m_webEngine->backButtonClicked(); } void SimpleUI::backEnable(bool enable) { - m_back->setEnabled(enable); + m_webPageUI->setBackButtonEnabled(enable); } void SimpleUI::forwardEnable(bool enable) { - m_forward->setEnabled(enable); + m_webPageUI->setForwardButtonEnabled(enable); } void SimpleUI::reloadEnable(bool enable) { - m_reload->setEnabled(enable); + m_webPageUI->setReloadButtonEnabled(enable); } void SimpleUI::stopEnable(bool enable) { - m_stopLoading->setEnabled(enable); + m_webPageUI->setStopButtonEnabled(enable); } void SimpleUI::addBookmarkEnable(bool enable) @@ -734,69 +600,42 @@ void SimpleUI::zoomEnable(bool enable) void SimpleUI::settingsButtonEnable(bool enable) { - m_showMoreMenu->setEnabled(enable); + m_webPageUI->setMoreMenuButtonEnabled(enable); } void SimpleUI::loadStarted() { - BROWSER_LOGD("Switching \"reload\" to \"stopLoading\"."); - showProgressBar(); - elm_object_signal_emit(m_simpleURI->getContent(), "shiftright_uribg", "ui"); - elm_object_signal_emit(m_mainLayout, "shiftright_uri", "ui"); - evas_object_show(leftButtonBar->getContent()); - leftButtonBar->setActionForButton("refresh_stop_button", m_stopLoading); + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); addBookmarkEnable(false); if(!m_webEngine->isPrivateMode()){ m_currentSession.updateItem(m_webEngine->currentTabId().toString(), m_webEngine->getURI()); } + m_webPageUI->loadStarted(); } void SimpleUI::progressChanged(double progress) { - if(progress == 1.0){ - hideProgressBar(); - } else { - elm_progressbar_value_set(m_progressBar,progress); - } + m_webPageUI->progressChanged(progress); } void SimpleUI::loadFinished() { - elm_object_signal_emit(m_mainLayout, "hide_progressbar_bg", "ui"); - BROWSER_LOGD("Switching \"stopLoading\" to \"reload\"."); - - leftButtonBar->setActionForButton("refresh_stop_button", m_reload); + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); addBookmarkEnable(m_favoriteService->countBookmarksAndSubFolders() < m_favoritesLimit); - if(m_webEngine->isLoadError()){ - loadError(); - } - if(!m_webEngine->isPrivateMode()){ m_historyService->addHistoryItem(std::make_shared (m_webEngine->getURI(), m_webEngine->getTitle(), m_webEngine->getFavicon()), m_webEngine->getSnapshotData(MainUI::MAX_THUMBNAIL_WIDTH, MainUI::MAX_THUMBNAIL_HEIGHT)); } + m_webPageUI->loadFinished(); } void SimpleUI::loadError() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - hideWebView(); - elm_object_part_content_set(m_mainLayout, "web_view",m_errorLayout); - //evas_object_show(m_errorLayout); -} - -void SimpleUI::setErrorButtons() -{ -// leftButtonBar->setActionForButton("bookmark_button", m_bookmark); - leftButtonBar->setActionForButton("refresh_stop_button", m_reload); -// addBookmarkEnable(false); - stopEnable(false); - reloadEnable(true); - forwardEnable(false); - evas_object_hide(m_progressBar); + m_webPageUI->switchViewToErrorPage(); } void SimpleUI::filterURL(const std::string& url) @@ -807,7 +646,7 @@ void SimpleUI::filterURL(const std::string& url) //create some kind of std::man //and then just map[url]() ? m_webEngine->setURI(url) : /*do nothing*/;; if(/*url.empty() ||*/ url == HomePageURL){ - m_simpleURI->changeUri(""); + m_webPageUI->getURIEntry().changeUri(""); } else if (!url.empty()){ //check if url is in favorites @@ -815,19 +654,19 @@ void SimpleUI::filterURL(const std::string& url) //check if url is in blocked //no filtering - if (isHomePageActive()) + if (m_webPageUI->isHomePageActive()) openNewTab(url); else m_webEngine->setURI(url); } - m_simpleURI->clearFocus(); + m_webPageUI->getURIEntry().clearFocus(); //addBookmarkEnable(false); } void SimpleUI::webEngineURLChanged(const std::string url) { BROWSER_LOGD("webEngineURLChanged:%s", url.c_str()); - m_simpleURI->clearFocus(); + m_webPageUI->getURIEntry().clearFocus(); bookmarkCheck(); } @@ -856,7 +695,7 @@ void SimpleUI::closeTabUI(const std::string& str) void SimpleUI::newTabClicked(const std::string& str) { BROWSER_LOGD("%s", __func__); - switchViewToHomePage(); + switchViewToQuickAccess(); } void SimpleUI::tabClicked(const tizen_browser::basic_webengine::TabId& tabId) @@ -885,7 +724,7 @@ void SimpleUI::handleConfirmationRequest(basic_webengine::WebConfirmationPtr web { basic_webengine::AuthenticationConfirmationPtr auth = std::dynamic_pointer_cast(webConfirmation); - Evas_Object *popup_content = elm_layout_add(m_mainLayout); + Evas_Object *popup_content = elm_layout_add(m_webPageUI->getContent()); std::string edjFilePath = EDJE_DIR; edjFilePath.append("SimpleUI/AuthenticationPopup.edj"); Eina_Bool layoutSetResult = elm_layout_file_set(popup_content, edjFilePath.c_str(), "authentication_popup"); @@ -961,36 +800,6 @@ void SimpleUI::authPopupButtonClicked(PopupButtons button, std::shared_ptrhide(); - m_mainUI = nullptr; - m_isHomePageActive = false; -} - -void SimpleUI::showMainUI() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - m_mainUI = std::dynamic_pointer_cast - - (tizen_browser::core::ServiceManager::getInstance().getService("org.tizen.browser.mainui")); - M_ASSERT(m_mainUI); - hideWebView(); - m_mainUI->show(m_window.get()); - m_mainUI->addHistoryItems(getMostVisitedItems()); - m_mainUI->addBookmarkItems(getBookmarks()); - m_isHomePageActive = true; -} - void SimpleUI::showHistoryUI(const std::string& str) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -1048,7 +857,7 @@ void SimpleUI::closeSettingsUI(const std::string& str) void SimpleUI::showMoreMenu() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - bool desktopMode = isHomePageActive() ? m_mainUI->isDesktopMode() : m_webEngine->isDesktopMode(); + bool desktopMode = m_webPageUI->isHomePageActive() ? m_mainUI->isDesktopMode() : m_webEngine->isDesktopMode(); if(!m_moreMenuUI){ m_moreMenuUI = std::dynamic_pointer_cast @@ -1098,7 +907,7 @@ void SimpleUI::closeMoreMenu(const std::string& str) void SimpleUI::switchToMobileMode() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (!isHomePageActive()) { + if (!m_webPageUI->isHomePageActive()) { m_webEngine->switchToMobileMode(); m_webEngine->reload(); } else { @@ -1109,7 +918,7 @@ void SimpleUI::switchToMobileMode() void SimpleUI::switchToDesktopMode() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (!isHomePageActive()) { + if (!m_webPageUI->isHomePageActive()) { m_webEngine->switchToDesktopMode(); m_webEngine->reload(); } else { @@ -1162,18 +971,10 @@ void SimpleUI::closeBookmarkManagerMenu(const std::string& str) } if(m_mainUI) { - m_mainUI->addHistoryItems(getMostVisitedItems()); - m_mainUI->showHistory(); + m_mainUI->showBookmarks(getBookmarks()); } } -void SimpleUI::openLinkFromPopup(const std::string &uri) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - filterURL(uri); - hidePopup(); -} - void SimpleUI::hideHistory() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -1284,21 +1085,18 @@ void SimpleUI::tabCreated() popup->buttonClicked.connect(boost::bind(&SimpleUI::tabLimitPopupButtonClicked, this, _1, _2)); popup->show(); } - elm_object_part_text_set(rightButtonBar->getContent(), "tabs_number", (boost::format("%1%") % tabs).str().c_str()); + m_webPageUI->setTabsNumber(tabs); } void SimpleUI::updateView() { int tabs = m_webEngine->tabsCount(); BROWSER_LOGD("[%s] Opened tabs: %d", __func__, tabs); if (tabs == 0) { - switchViewToHomePage(); - elm_object_part_text_set(rightButtonBar->getContent(), "tabs_number", ""); - } else { - if (!isHomePageActive()) { - updateBrowserView(); - } - elm_object_part_text_set(rightButtonBar->getContent(), "tabs_number", (boost::format("%1%") % tabs).str().c_str()); + switchViewToQuickAccess(); + } else if (!m_webPageUI->isHomePageActive()) { + switchViewToWebPage(); } + m_webPageUI->setTabsNumber(tabs); } void SimpleUI::tabClosed(const tizen_browser::basic_webengine::TabId& id) { @@ -1332,35 +1130,11 @@ void SimpleUI::onNetworkConnected() } } -void SimpleUI::showProgressBar() -{ - elm_object_signal_emit(m_mainLayout, "show_progressbar_bg", "ui"); - elm_object_part_content_set(m_mainLayout,"progress_bar",m_progressBar); -} - -void SimpleUI::hideProgressBar() -{ - elm_object_signal_emit(m_mainLayout, "hide_progressbar_bg", "ui"); - elm_progressbar_value_set(m_progressBar,0.0); - elm_object_part_content_unset(m_mainLayout,"progress_bar"); - evas_object_hide(m_progressBar); -} - void SimpleUI::searchWebPage(std::string &text, int flags) { m_webEngine->searchOnWebsite(text, flags); } -void SimpleUI::favicon_clicked(void *data, Evas_Object *, const char *, const char *) -{ - BROWSER_LOGD("[%s],", __func__); - SimpleUI *self = reinterpret_cast(data); - if (!self->isHomePageActive() && !self->isErrorPageActive()) - { - self->m_simpleURI->clearFocus(); - } -} - void SimpleUI::addToBookmarks(int folder_id) { BROWSER_LOGD("[%s,%d],", __func__, __LINE__); diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index 9a8b7db..5a9ff1f 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -33,16 +33,15 @@ #include "service_macros.h" // components +#include "WebPageUI.h" #include "AbstractWebEngine.h" #include "MoreMenuUI.h" #include "HistoryUI.h" #include "SettingsUI.h" #include "MainUI.h" #include "TabUI.h" -#include "ButtonBar.h" #include "HistoryService.h" #include "BookmarkManagerUI.h" -#include "SimpleURI.h" #include "PlatformInputManager.h" #include "SessionStorage.h" #include "SqlStorage.h" @@ -74,13 +73,13 @@ public: void destroyUI(); private: // setup functions - void loadThemes(); void createActions(); void connectActions(); void loadUIServices(); void connectUISignals(); void loadModelServices(); void initModelServices(); + void initUIServices(); void connectModelSignals(); void restoreLastSession(); Evas_Object* createWebLayout(Evas_Object* parent); @@ -108,11 +107,8 @@ private: void bookmarkAdded(); void bookmarkDeleted(); - bool isHomePageActive(); - void switchViewToHomePage(); - void updateBrowserView(); - void updateWebView(); - void updateURIBarView(); + void switchViewToQuickAccess(); + void switchViewToWebPage(); void updateView(); void openNewTab(const std::string &uri, bool desktopMode = true); @@ -150,20 +146,10 @@ private: void authPopupButtonClicked(PopupButtons button, std::shared_ptr popupData); void onActionTriggered(const Action& action); - - void setwvIMEStatus(bool status); - sharedAction m_back; - sharedAction m_forward; - sharedAction m_stopLoading; - sharedAction m_reload; - sharedAction m_bookmark; - sharedAction m_unbookmark; - sharedAction m_tab; sharedAction m_share; sharedAction m_zoom_in; - sharedAction m_showMoreMenu; sharedAction m_showBookmarkManagerUI; sharedAction m_settingPointerMode; sharedAction m_settingPrivateBrowsing; @@ -229,18 +215,12 @@ private: void switchToDesktopMode(); void showHistoryUI(const std::string& str); void closeHistoryUI(const std::string&); - void showMainUI(); - void hideMainUI(); void showURIBar(); void hideURIBar(); - void hideWebView(); void hideSettingsMenu(); void showSettingsUI(const std::string&); void closeSettingsUI(const std::string&); - void showProgressBar(); - void hideProgressBar(); - void closeBookmarkManagerMenu(const std::string& str); void updateBookmarkManagerGenGrid(int folder_id); void showBookmarkManagerMenu(); @@ -263,7 +243,6 @@ private: void onDeleteDataButton(PopupButtons button, std::shared_ptr popupData); void onDeleteFavoriteButton(PopupButtons button, std::shared_ptr popupData); void tabLimitPopupButtonClicked(PopupButtons button, std::shared_ptr< PopupData > /*popupData*/); - void openLinkFromPopup(const std::string &); void disableHistoryButton(bool flag); int tabsCount(); @@ -278,16 +257,13 @@ private: std::string edjePath(const std::string &); - Evas_Object *m_mainLayout; - Evas_Object *m_progressBar; Evas_Object *m_popup; Evas_Object *m_entry; Evas_Object *m_errorLayout; + std::shared_ptr m_webPageUI; std::shared_ptr> m_webEngine; - std::shared_ptr m_simpleURI; - std::shared_ptr leftButtonBar; - std::shared_ptr rightButtonBar; +// std::shared_ptr m_simpleURI; std::shared_ptr m_favoriteService; std::shared_ptr m_historyService; std::shared_ptr m_moreMenuUI; @@ -301,7 +277,6 @@ private: tizen_browser::Session::Session m_currentSession; std::shared_ptr m_bookmarks_manager; bool m_initialised; - bool m_isHomePageActive; int m_tabLimit; int m_favoritesLimit; bool m_wvIMEStatus; @@ -315,8 +290,6 @@ private: SimplePopup* m_networkErrorPopup; void searchWebPage(std::string &text, int flags); - static void favicon_clicked(void *data, Evas_Object *obj, const char *emission, const char *source); - }; } diff --git a/services/SimpleUI/edc/ErrorMessage.edc b/services/SimpleUI/edc/ErrorMessage.edc deleted file mode 100644 index d644951..0000000 --- a/services/SimpleUI/edc/ErrorMessage.edc +++ /dev/null @@ -1,169 +0,0 @@ - -collections{ - images { - image: "web_browsing_icon_error.png" COMP; - } - styles { - style { name: "mssage_style"; - base: "font=Sans font_size=35 color=#d3d3d3 wrap=word align=0.5"; - } - style { name: "mssage_hint_style"; - base: "font=Sans font_size=24 color=#868686 wrap=word align=0.5"; - } - } - group{ name: "error_message"; - parts{ - part{ name: "message_background"; - type: RECT; - mouse_events: 1; - description{ - state: "default" 0.0; - visible: 1; - rel1.relative: 0 0; - rel2.relative: 1 1; - color: 42 50 64 255; - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "error_message_background"; - type:RECT; - description{ - state: "default" 0.0; - visible: 1; - min: 1582 730; - max: 1582 730; - fixed: 1 1; - align: 0.5 0.5; - color: 30 38 50 153; - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "err_ico"; - type: IMAGE; - description{ - state: "default" 0.0; - visible: 1; - min: 140 140; - max:140 140; - fixed: 1 1; - align: 0.5 0; - rel1{ - relative: 0 0; - offset:0 163; - to: "error_message_background"; - } - rel2{ - relative: 1 1; - to: "error_message_background"; - } - image{ - normal: "web_browsing_icon_error.png"; - } - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "error_text"; - type: TEXTBLOCK; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 1502 96; - max: 1502 96; - //color: 211 211 211 255; - align: 0.5 0; - rel1{ - relative: 0 1; - to_x: "error_message_background"; - to_y: "err_ico"; - } - rel2{ - relative: 1 1; - to: "error_message_background"; - } - text{ - style: "mssage_style"; - text: "Server not found.
Please check the followings:"; - //min: 0 0; - //max: 1 1; - //align: 1 0; - //size: 35; - } - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "error_hint"; - type: TEXTBLOCK; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - min: 1502 117; - max: 1502 117; - color: 134 134 134 255; - align: 0.5 0; - rel1{ - relative: 0 1; - to_x: "error_message_background"; - to_y: "error_text"; - } - rel2{ - relative: 1 1; - to: "error_message_background"; - } - text{ - max: 0 1; - style: "mssage_hint_style"; - text: "Check for any typing error in URL.
" - "Check your network settings.
" - "Try again later.
" - "Click refresh to reload."; - } - } - description{ - state: "visibleError" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - }//parts - programs{ - program{ name: "show_error"; - signal: "show_error"; - source: "model"; - action: STATE_SET "visibleError" 0.0; - target: "message_background"; - target: "error_message_background"; - target: "err_ico"; - target: "error_text"; - target: "error_hint"; - } - program{ name: "hide_error"; - signal: "hide_error"; - source: "model"; - action: STATE_SET "default" 0.0; - target: "message_background"; - target: "error_message_background"; - target: "err_ico"; - target: "error_text"; - target: "error_hint"; - } - }//programs - } -} diff --git a/services/SimpleUI/edc/LeftButtonBar.edc b/services/SimpleUI/edc/LeftButtonBar.edc deleted file mode 100644 index 5de8ab2..0000000 --- a/services/SimpleUI/edc/LeftButtonBar.edc +++ /dev/null @@ -1,100 +0,0 @@ -#include "ImageButton.edc" -#include "Spacer.edc" - -collections { - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_prev", 82, 102, "btn_bar_back_nor.png") - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_next", 82, 102, "btn_bar_forward_nor.png") - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_reload", 82, 102, "btn_bar_reload_nor.png") - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_stop", 82, 102, "btn_bar_stop_nor.png") - - group { - name: "left_button_bar"; - - parts { - - part { name: "prev_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 1 1; - min: 70 70; - max: 70 70; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - - ADD_SPACER("spacer_1", "prev_button", 10, 70) - - part { name: "next_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 1 1; - min: 70 70; - max: 70 70; - rel1 { relative: 1.0 0.0; to: "spacer_1"; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - - ADD_SPACER("spacer_2", "next_button", 10, 70) - - part { name: "refresh_stop_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 1 1; - min: 70 70; - max: 70 70; - rel1 { relative: 1.0 0.0; to: "spacer_2"; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - - } - } -} diff --git a/services/SimpleUI/edc/MainLayout.edc b/services/SimpleUI/edc/MainLayout.edc deleted file mode 100644 index aedfdbd..0000000 --- a/services/SimpleUI/edc/MainLayout.edc +++ /dev/null @@ -1,291 +0,0 @@ -#define URI_LENGTH 1720 -#define URI_LENGTH_SHORT 1460 -#define URI_WIDTH 82 -#include "Spacer.edc" -#define DEBUG_RECT_OVER(over_part, r, g, b) \ - part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ - \ -scale:1; \ - type : RECT; \ - repeat_events: 1; \ - description { \ - state: "default" 0.0; \ - visible: 1; \ - color: r g b 255; \ - rel1 { to: over_part; relative: 0 0; } \ - rel2 { to: over_part; relative: 1 1; } \ - } \ - } -collections { - group { - name: "main_layout"; - images { - image: "web_shadow.png" COMP; - } - parts { - part { name: "uri_bar_bg"; - type : RECT; - scale: 1; - description { state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0 0; - min: 1920 104; - max: 1920 104; - color: 255 255 255 255; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 0.0; } - } - } - ADD_SPACER_OVER("left_spacer", "uri_bar_bg", 7, 104) - part { name: "uri_bar_buttons_left"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0 0.5; - min: 246 102; - max: 246 102; - fixed: 1 1; - rel1 { relative: 1.0 1.0; to: "left_spacer"; } - rel2 { relative: 0.0 0.0; to: "left_spacer"; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - ADD_SPACER("left_buttons_spacer", "uri_bar_buttons_left", 0.5, 102) - part { name: "uri_entry"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.5; - min: URI_LENGTH URI_WIDTH; - max: URI_LENGTH URI_WIDTH; - fixed: 1 1; - rel1 { relative: 1.0 0.5; to: "left_spacer"; } - rel2 { relative: 1.0 0.5; to: "left_spacer"; } - } - description { - state: "moveright" 0.0; - inherit: "default" 0.0; - visible: 1; - min: URI_LENGTH_SHORT URI_WIDTH; - max: URI_LENGTH_SHORT URI_WIDTH; - rel1 { relative: 1.0 0.5; to: "left_buttons_spacer"; } - rel2 { relative: 1.0 0.5; to: "left_buttons_spacer"; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - ADD_SPACER("right_buttons_spacer", "uri_entry", 26, 102) - part { name: "uri_bar_buttons_right"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.5; - min: 164 102; - max: 164 102; - fixed: 1 1; - rel1 { relative: 1.0 0.5; to: "right_buttons_spacer"; } - rel2 { relative: 1.0 0.5; to: "right_buttons_spacer"; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - ADD_SPACER("right_spacer", "uri_bar_buttons_right", 74, 102) - part { name: "web_view"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 0; - rel1 { relative: 0.0 1.0; to: "uri_bar_bg"; } - rel2 { relative: 1.0 1.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "shadow"; - type: IMAGE; - scale: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 0; - min: 1920 14; - max: 1920 14; - image.normal: "web_shadow.png"; - rel1 { relative: 0.0 0.0; to: "web_view"; } - rel2 { relative: 1.0 1.0; } - } - } - part { name: "progress_bar"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 0; - min: 1920 2; - max: 1920 2; - rel1 { - relative: 0.0 0.0; - offset: -12 -10; - to: "web_view"; - } - rel2 { relative: 1.0 1.0; } - } - } - part { name: "progress_bar_light_bg"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - fixed: 1 1; - min: 0 8; - max: 1920 8; - align: 0 0; - visible: 0; - rel1.to: "web_view"; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 0.0; - color: 69 143 255 55; - } - description {state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part{ name: "web_title_bar"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - min: 1920 87; - max: 1920 87; - fixed: 1 1; - align: 0 1; - rel1 { to: "web_view"; relative: 0.0 1.0; } - rel2 { to: "web_view"; relative: 1.0 1.0; } - } - } - - - part {name: "popup_bg"; - type: RECT; - scale: 1; - mouse_events: 1; - description {state: "default" 0.0; - visible: 0; - min: 1920 1080; - fixed: 1 1; - color: 100 100 100 128; - rel1 {relative: 0.0 0.0; } - rel2 {relative: 1.0 1.0; } - } - description {state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - part { name: "popup"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - visible: 0; - min: 0 0; - max: 700 800; - align: 0.5 0.5; - rel1 { relative: 0.0 0.0; to: "web_view";} - rel2 { relative: 1.0 1.0; to: "web_view";} - fixed: 1 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - max: 1920 1080; - } - } - } -} - programs { - program { name: "shiftright_uribar"; - signal: "shiftright_uri"; - source: "ui"; - action: STATE_SET "moveright" 0.0; - target: "uri_entry"; - } - program { name: "shiftback_uribar"; - signal: "shiftback_uri"; - source: "ui"; - action: STATE_SET "default" 0.0; - target: "uri_entry"; - } - program { name: "hide_progress"; - signal: "hide_progressbar_bg"; - source: "ui"; - action: STATE_SET "default" 0.0; - target: "progress_bar_light_bg"; - } - program { name: "show_progress"; - signal: "show_progressbar_bg"; - source: "ui"; - action: STATE_SET "visible" 0.0; - target: "progress_bar_light_bg"; - } - program {name: "show_popup"; - signal: "elm,state,show"; source: "elm"; - action: STATE_SET "visible" 0.0; - transition: LINEAR 0.0; - target: "popup"; - target: "popup_bg"; - } - program {name: "hide_popup"; - signal: "elm,state,hide"; source: "elm"; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.0; - target: "popup"; - target: "popup_bg"; - } - } -} -} diff --git a/services/SimpleUI/edc/RightButtonBar.edc b/services/SimpleUI/edc/RightButtonBar.edc deleted file mode 100644 index 164289e..0000000 --- a/services/SimpleUI/edc/RightButtonBar.edc +++ /dev/null @@ -1,83 +0,0 @@ -#include "ImageButton.edc" -#include "Spacer.edc" -collections { -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_tab", 82, 102, "btn_bar_manager_nor.png") -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_setting", 82, 102, "btn_bar_more_nor.png") - group { - name: "right_button_bar"; - parts { - part { name: "tab_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: 70 70; - max: 70 70; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "tabs_number"; - type: TEXT; - scale: 1; - repeat_events: 1; - description{ - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: 70 70; - max: 70 70; - color: 86 86 86 255; - rel1 { relative: 0.0 0.0; to: "tab_button"; offset: 5 13; } - rel2 { relative: 1.0 1.0; to: "tab_button"; } - text { - text: ""; - font: "Tizen:style=Bold"; - size: 19; - align: 0.5 0.5; - } - } - } - ADD_SPACER("spacer_1", "tab_button", 10, 70) - part { name: "setting_button"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - fixed: 1 1; - align: 0.0 0.0; - min: 70 70; - max: 70 70; - fixed: 1 1; - rel1 { relative: 1.0 0.0; to: "spacer_1"; } - rel2 { relative: 0.0 0.0; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - } -} diff --git a/services/SimpleUI/edc/ScrollerDefault.edc b/services/SimpleUI/edc/ScrollerDefault.edc deleted file mode 100644 index 472b8fb..0000000 --- a/services/SimpleUI/edc/ScrollerDefault.edc +++ /dev/null @@ -1,502 +0,0 @@ -collections { -group { name: "elm/scroller/base/default"; - - alias: "elm/list/base/default"; - alias: "elm/genlist/base/default"; - alias: "elm/gengrid/base/default"; - alias: "elm/scroller/base/map_bubble"; - alias: "elm/genscroller/base/default"; - - data { - item: "focus_highlight" "on"; - } - - script { - public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; - public timer0(val) { - new v; - v = get_int(sbvis_v); - if (v) { - v = get_int(sbalways_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - v = get_int(sbvis_h); - if (v) { - v = get_int(sbalways_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - set_int(sbvis_timer, 0); - return 0; - } - } - images { - image: "bt_sm_base2.png" COMP; - image: "scrollbar_vertical.png" COMP; - image: "bt_sm_shine.png" COMP; - image: "bt_sm_hilight.png" COMP; - image: "web_shadow.png" COMP; - image: "web_shadow_from_bottom.png" COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "shadow_top"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - align: 0.0 0.0; - fixed: 1 1; - min: 0 63; - max: -1 63; - image.normal: "web_shadow.png"; - rel1 { relative: 0.0 0.0; to: "elm.swallow.content"; } - rel2 { relative: 1.0 0.0; to: "elm.swallow.content"; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "shadow_bottom"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - align: 0.0 0.0; - fixed: 1 1; - min: 0 63; - max: -1 63; - image.normal: "web_shadow_from_bottom.png"; - rel1 { relative: 0.0 1.0; to: "elm.swallow.content"; offset: 0 -63; } - rel2 { relative: 1.0 1.0; to: "elm.swallow.content"; offset: 0 -63; } - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 10 17; - align: 1.0 0.0; - rel1 { - relative: 1.0 0.0; - offset: -70 2; - to_y: "elm.swallow.content"; - to_x: "elm.swallow.content"; - } - rel2 { - relative: 1.0 0.0; - offset: -70 -1; - to_y: "sb_hbar"; - to_x: "elm.swallow.content"; - } - } - } - part { name: "elm.dragable.vbar"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 8 45; - max: 10 99999; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_vbar"; - } - image { - normal: "scrollbar_vertical.png"; - //border: 6 6 6 6; - border: 0 0 4 4; - middle: SOLID; - } - image.border_scale: 1; - color: 0 0 0 191; - } - } - part { name: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar_clip"; - clip_to: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 17 10; - align: 0.0 1.0; - rel1 { - relative: 0.0 1.0; - offset: 2 0; - to_x: "elm.swallow.content"; - to_y: "elm.swallow.content"; - } - rel2 { - relative: 0.0 1.0; - offset: -1 -1; - to_x: "sb_vbar"; - to_y: "elm.swallow.content"; - } - } - } - part { name: "elm.dragable.hbar"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "sb_hbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 17 10; - max: 99999 10; - rel1 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - rel2 { - relative: 0.5 0.5; - offset: 0 0; - to: "sb_hbar"; - } - image { - normal: "bt_sm_base2.png"; - border: 4 4 4 4; - middle: SOLID; - } - } - } - part { name: "sb_hbar_over1"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.relative: 1.0 0.5; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_hilight.png"; - border: 4 4 4 0; - } - } - } - part { name: "sb_hbar_over2"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.dragable.hbar"; - rel2.to: "elm.dragable.hbar"; - image { - normal: "bt_sm_shine.png"; - border: 4 4 4 0; - } - } - } - part { name: "disabler"; - type: RECT; - description { state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; - color: 0 0 0 0; - visible: 0; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 128 128 128 128; - } - } - } - programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - set_state(PART:"sb_hbar_clip", "hidden", 0.0); - set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_h, 0); - set_int(sbvis_v, 0); - set_int(sbalways_v, 0); - set_int(sbalways_h, 0); - set_int(sbvis_timer, 0); - } - } - - program { name: "vbar_show"; - signal: "elm,action,show,vbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_hide"; - signal: "elm,action,hide,vbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_show_always"; - signal: "elm,action,show_always,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - set_int(sbalways_v, 1); - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - } - } - program { name: "vbar_show_notalways"; - signal: "elm,action,show_notalways,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_v); - if (v) { - set_int(sbalways_v, 0); - v = get_int(sbvis_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - } - } - program { name: "sb_vbar_show"; - signal: "do-show-vbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - program { name: "sb_vbar_hide"; - signal: "do-hide-vbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - - program { name: "hbar_show"; - signal: "elm,action,show,hbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_hide"; - signal: "elm,action,hide,hbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_show_always"; - signal: "elm,action,show_always,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - set_int(sbalways_h, 1); - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - } - } - program { name: "hbar_show_notalways"; - signal: "elm,action,show_notalways,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_h); - if (v) { - set_int(sbalways_h, 0); - v = get_int(sbvis_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - } - } - program { name: "sb_hbar_show"; - signal: "do-show-hbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - program { name: "sb_hbar_hide"; - signal: "do-hide-hbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - - program { name: "scroll"; - signal: "elm,action,scroll"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - v = get_int(sbvis_timer); - if (v > 0) cancel_timer(v); - v = timer(4.5, "timer0", 0); - set_int(sbvis_timer, v); - } - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "disabler"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "disabler"; - } - program { name: "show_top_shadow"; - signal: "show,top,shadow"; - source: ""; - transition: LINEAR 0.1; - action: STATE_SET "visible" 0.0; - target: "shadow_top"; - } - program { name: "hide_top_shadow"; - signal: "hide,top,shadow"; - source: ""; - transition: LINEAR 0.1; - action: STATE_SET "hidden" 0.0; - target: "shadow_top"; - } - program { name: "show_bottom_shadow"; - signal: "show,bottom,shadow"; - source: ""; - transition: LINEAR 0.1; - action: STATE_SET "visible" 0.0; - target: "shadow_bottom"; - } - program { name: "hide_bottom_shadow"; - signal: "hide,bottom,shadow"; - source: ""; - transition: LINEAR 0.1; - action: STATE_SET "hidden" 0.0; - target: "shadow_bottom"; - } - } -} -} diff --git a/services/SimpleUI/edc/webview.edc b/services/SimpleUI/edc/webview.edc deleted file mode 100644 index 0602899..0000000 --- a/services/SimpleUI/edc/webview.edc +++ /dev/null @@ -1,91 +0,0 @@ -#include "ImageButton.edc" -#include "Spacer.edc" -collections { - -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_history", 70, 70, "web_ico_history.png") -FOUR_STATE_IMAGE_BUTTON("browser/toolbar_bookmark", 70, 70, "web_ico_favorite_on.png") - - group { - name: "web_view_bar"; - parts { - part { name: "most_visited_button"; - type :RECT; - scale: 1; - description { - - state: "default" 0.0; - visible: 1; - fixed :1 1; - align: 0.5 0.5; - min: 70 70; - max: 70 70; - - - - rel1 { - - relative: 1.0 1.0; - - offset: 150 150; - - } - - rel2 { - - relative: 0.9 0.8; - - offset: 150 150; - - } -} - -} - - - -part { name: "visited_bookmarks"; - type :RECT; - scale: 1; - description { - - state: "default" 0.0; - visible: 1; - - align: 0.5 0.5; - min: 70 70; - max: 70 70; - - fixed :1 1; - - - rel1 { - - relative: 1.0 1.0; - - offset: 150 150; - - } - - rel2 { - - relative: 0.9 0.8; - - offset: 150 150; - - } -} - -} - - - - - - - - - - - } - } - } diff --git a/services/SimpleURI/CMakeLists.txt b/services/SimpleURI/CMakeLists.txt deleted file mode 100644 index 82200f8..0000000 --- a/services/SimpleURI/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -project(SimpleURI) - -set(SimpleURI_SRCS - SimpleURI.cpp - ) - -set(SimpleURI_HEADERS - SimpleURI.h - ) - -include(Coreheaders) -include(EFLHelpers) - -add_library(${PROJECT_NAME} SHARED ${SimpleURI_SRCS}) - -if(TIZEN_BUILD) - target_link_libraries(${PROJECT_NAME} ${pkgs_LDFLAGS}) - target_link_libraries(${PROJECT_NAME} boost_regex) -endif(TIZEN_BUILD) - -install(TARGETS ${PROJECT_NAME} - LIBRARY DESTINATION services - ARCHIVE DESTINATION services/static) - -EDJ_TARGET(URIEntry.edj - ${CMAKE_CURRENT_SOURCE_DIR}/edc/URIEntry.edc - ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/services/SimpleURI/edc/URIEntry.edc b/services/SimpleURI/edc/URIEntry.edc deleted file mode 100644 index 1ec64f6..0000000 --- a/services/SimpleURI/edc/URIEntry.edc +++ /dev/null @@ -1,273 +0,0 @@ -#define URI_INPUTBOX_LENGTH 1720 -#define URI_INPUTBOX_LENGTH_SMALL 1460 -#define URI_INPUTBOX_WIDTH 82 -collections { -group { name: "elm/entry/selection/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - } -} -group { name: "elm/entry/cursor/browser_entry"; - parts { - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 22 120 237 255; - min: 2 36; - max: 2 36; - visible: 0; - } - description { - state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "focused" 0.0; - target: "bg"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - } - } -} -group { - name: "elm/entry/base-single/uri_entry"; - styles { - style { - name: "browser-entry-uri-style-unselected"; - base: "font=Sans:style=SVD_Medium font_size="42" wrap=none color=#969696"; - } - style { - name: "browser-entry-uri-style-selected"; - base: "font=Sans:style=SVD_Medium font_size="42" wrap=none color=#4088d3"; - } - } - data { - item: focus_highlight "off"; - } - parts { - - part { name: "bg"; - scale:1; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - - part { - name: "elm.guide"; - scale:1; - type: TEXTBLOCK; - mouse_events: 0; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-unselected"; - min: 0 1; - } - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "label.text.clip"; - scale:1; - type: RECT; - description { - state: "default" 0.0; - } - } - part { - name: "elm.text"; - scale:1; - multiline: 0; - entry_mode: EDITABLE; - select_mode: DEFAULT; - cursor_mode: BEFORE; - type: TEXTBLOCK; - clip_to: "label.text.clip"; - source: "elm/entry/selection/browser_entry"; - source4: "elm/entry/cursor/browser_entry"; - description { state: "default" 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 1.0; - align: 0.0 0.0; - text { - style: "browser-entry-uri-style-selected"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "gdisabled"; - signal: "elm,guide,disabled"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "elm.guide"; - } - program { name: "genabled"; - signal: "elm,guide,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.guide"; - } - } -}//group - -group { - name: "elm/button/base/entry_btn"; - parts { - part { - name: "bg"; - type: RECT; - description { state: "default" 0.0; - color: 0 0 0 0; - visible: 1; - } - } - } - programs { - program { - name: "mouse_click"; - signal: "mouse,clicked,1"; - source: "bg"; - script { - emit("elm,action,click", ""); - } - } - } - } - - - group { - name: "uri_entry_layout"; - parts { - part { - name: "spacer_1"; - type: SPACER; - scale: 1; - description { - state: "default" 0.0; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 0.0 0.0; offset: 15 0; } - align: 0.0 0.0; - fixed: 1 1; - min: 1 102; - max: 1 102; - } - } - part { name: "uri_entry_swallow"; - type : SWALLOW; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - color: 255 255 255 255; - align: 0.0 0.0; - min: URI_INPUTBOX_LENGTH URI_INPUTBOX_WIDTH; - max: URI_INPUTBOX_LENGTH URI_INPUTBOX_WIDTH; - fixed: 1 1; - rel1 { relative: 1 0; to: "spacer_1"; } - rel2 { relative: 1 1; to: "spacer_1"; } - } - description { - state: "moveright" 0.0; - inherit: "default" 0.0; - visible: 1; - min: URI_INPUTBOX_LENGTH_SMALL URI_INPUTBOX_WIDTH; - max: URI_INPUTBOX_LENGTH_SMALL URI_INPUTBOX_WIDTH; - } - description { - state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - description { - state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "over"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { relative: 0 0; to: "spacer_1"; } - rel2 { relative: 1 1; to: "spacer_1"; } - } - } - part { name: "uri_entry_btn"; - type: SWALLOW; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - visible: 1; - rel1.to: "uri_entry_swallow"; - rel2.to: "uri_entry_swallow"; - } - } - } - programs { - program { name: "shiftright_uribarbg"; - signal: "shiftright_uribg"; - source: "ui"; - action: STATE_SET "moveright" 0.0; - target: "uri_entry_swallow"; - } - program { name: "shiftback_uribarbg"; - signal: "shiftback_uribg"; - source: "ui"; - action: STATE_SET "default" 0.0; - target: "uri_entry_swallow"; - } - program { - name: "mouse_in_entry"; - source: "over"; - signal: "mouse,in"; - action: STATE_SET "focused" 0.0; - target: "spacer_1"; - } - program { - name: "mouse_out_entry"; - source: "over"; - signal: "mouse,out"; - action: STATE_SET "default" 0.0; - target: "spacer_1"; - } - } - } -} diff --git a/services/SimpleURI/images/ico_search.png b/services/SimpleURI/images/ico_search.png deleted file mode 100644 index 4ff60425fc94c1e4798581ed7a6cf85857c2f70b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18426 zcmeI3cU05Kx4^#?=}ke3iqe!KsWcNp4OOHEDKwg=06^T<#=?blN3lLuLISM+M=hsYSvO&-jb{h|h)U0Ycz~=^@&F*>NJ68Xoct(s zN{AnYs$`2sD^Y0_Us50e0K#78xDqk0qq0WRJ#WqJ5@U|rQCwCFDY=*@$H=5^(ozI9ngp3bV(B(I&U!Iom(16%?2D_rU;AnhY#J+~Mg^pVZs3(eW>tBB_t7ZS zW)-Gj6~GhrOjHP9+GjJN>k{T9Uz?xY$rE#che=P}VkZWNvZ= z^7sMo2At0T-~s3|5fCDE18LLTm)L)y6rAD+^ zq)uK(m8l^tV|NIFf(6~(!Rs{|ZRIx0=wo@YS*GBc@RJJgSY64!smB12m%5rY+Ns&F zMv3CaM*Slt5_>?e?+VPR`1lNb9%?G2ngYNpdUVTYZODx^F@^#$L7&fT9Ow7jEt(fP zo$PyE()1RPH~P|jiaO86^7PTNj*g+h!S=29&39lQxkr5_*6d-r&jx;oMtz!o*H_iA z77O1MYt8?@ujcXFZRgiD9TPs_(>0u8{i#%R?vvs(mHW0nWgc2G1J0|0k62_Ko`RoO zNisjC`C#MIIedSw_6(nKuO4vK- zH8JKUOlGa~HUcrew#R}2V7G-D81v|cNu3Y?SmecOT{T<#wpw1BDX^}3MOU@xCvW`& z=4$tA%%#jl@GJs$o3<-~TDT!Wwow_PVptbFo|KvWo_54p^NLZN}4KSt+u4+0C?@Ym5%-pB`y0 z^pkvWNq!vUp{l<*&07NziHBy-|2T&cAr@9kkRb^v|-fx_l)29 z-ZI3*<5$PkB@#6hvgHNki3$w)E1BCaC_GD6sKY=FU~e)RXT4$?{`wf?=1DV0^PthHOM>O&?rlJq^$V_PVYp%VZyR8gH*cnie zo{{cRXjAB1X#J*Azj!P^=R&1rx#vu*gjwBI^_}Y0#FWMrIU}weuHE?}`Lgy#$alry zf`IdDPnTOT?vnGzGjpqU$K-CKTIjkuU3+WNwqr%)CPiTgKE!i64<1?$4V~X<7t&?QFo$#oi!2^Pw0>+RP<7e4!KE_L2gI(WHp`|H;H=iHhmOA z^k|Z5YS$Skk#5kuPs(x4er8RSBbJ54O(iBL+3jxtXBdOC*VcB|R}OBazYE^=D&pz8 zoa`IfHDeb$uZ-)Dlg1OeetWF@n`W-3PDt~;dUT)jP>YG^ZzrGuy+zTEXvbLMtr1lS z4wCAAx$SD{c}BrBc0$hhZ)4hT1I7a=gC2N~=bpy~%+mVO2FH7p+&u?-(fd^A@N*G! zEkJ(EMjj$xQmk3*4&Isf5x*$kJz|3FB>a87W6bPuUYXfyvy}ap_YYNHR`#p^5i4TRn0-Yy<7qA;4P2`sBc>-cMsw3H>?!q63j~ znUMNj)bP`dHE$2*%U%Mn(nhA6ZcB97a{Ny-DXojLhc`}2Gd3O(39nJCA*w)H^ji|! z(L1%)J51VW*+(4vBeg;=TIMKJeW*k$sMWD>%srzxx^h#5eL(E)>PP#lZ}9}Y5p@$8IvDk)t8HwTqX)#Z_ZIeJ ze9l_q)k%knWjf_DR_|-q=n5NJn?QMV_hi@co0kgjm*JaypZbmt_kePDNTe5J3};A? z#XDZ!6z|=BbL`#UmYtA{CmNmQaV6-ovv*OqD+u`y8=n}OV9sIQVm@N@$DelJ!nVC9 zw~ViitoU2^kJio|71OiE534%ec--t;eOn1Lwlg=TO^TBWM&GB;1ns))5EMLC$M=+P zR!~)NZq;&Y56<#P!A9emzy&uS&HD9~_+)?wwvQj(oZI zaAeUd!Dk!xDiReT{^nVeSytJuSu;C)cHD7%Y~1qVbx*`6>&^|5r*u)C;ajIL4@oaa z_diP`PBtCRIgt|;4gS#O-Fc=Yas=1d>n}-}xFbb>_0)1MdBm{7uyN<)ZTjT(&LL^{ z+wNIckb8n&(_f=Lr#*A5D?e49Ra~|+plm#%@>Znp^yu1LgU0T+mEnKM&b?^OMHqEg zPDN0rA56dNmF zEpRZd>2vD46iM`ol#?k9@#67sa<>>G5d9{!+0jq==q7yArd+wtXFfL+%gI8b-?zSL zYi!AEIh`??k#;xem-Dl)nQs)Xbk^3?uCIC+rUTpkcKgg&HKU86IB~XD(sA$?rF|N6 zejl#Ab8XI_NmEEmo8#xpoce^*0d)cZQksPEpnKSFL*ghwU@V^ELjZ>bQCS;N*51@4 zjEcnt5a>!i1R{xSq%u){S4D}0H&SuevxnMK(F8w|O$3eL8sUJ!MFijwcoh?45mXqG z0fgunG2ow&1!$GVXppbAf9UBHBho~+(`Rd1l5Q3wTsB{vAtTgWz z>q7~p8>y(wH}viLGOi%%w}!|eU)ZrILc*|A2n-B`{DYCbJ!i9^pr2ZX&@K0}dh%st zKW#7s6HX;STnHhQP#TV4xtBnutNyGLc-%KX)KFUB0v|jMLI@-Tu}nf(ornFj3)HXQ zK)#uO*Nt!Le;hrXDF~in<`EE(pE_1Jgr7p-4TQ%}@mE zVVRS~nruGoSz(XI(y{->%Xf9z{ZQ~E-|&CsWvS-(KJ4w0w&V~xmW(6VS{Sp&4knTC z$Srs%!T<(?fv`RZ9LNB!y9KmG2Y~?T!SPT%T{xbA*U?=V)%j2phPp&V29x zr%n9C%@0l4kV06Y6TU2@Sb?>WW?Tuu-1d`P$|I~{00rVr_U>*B8^}YIajk&Zf)N?50bWZe$YOn3aSV zI?7hO%xeB+y9m{lwJ#(XvxdfA#9rHp6h;X2upqJC2_f^DPMa0;KV*+@`Sm~fur#9oq*pdy+(y`da2C0^IP+oC za&fT%;Vg1-apuFO<>F!k!dc|v;>?Fl%f-b8gtN%S#hDMAmWzuG2xpOti!&cKEf*IX z5Y8eO7iT_fS}ra&Ae==mF3x<|v|Ls*Ma&d9y!=~lp zVgtfiw&#Hr0PqReT9{$NUjC8o=qPO_!`!zqQAm8q@r;Yi zQ@>eWU6_~S8rxUeb#UIu8AWlU?SU<+Th(8(TRFqKVuXAKq ziD5(WP$gbM$IwvcZdECzr@~gc)&E4Cn&LXBv-gVaKl}+GXX#bpZ}uK7li)D~%k7&O z&!NUf*_a&ViH|kQ%YW6u$m1{K+YtL}yMLG@Tjsm|R#dd$dfwzvoS$9^3 zDxN7KdPgTu!O_e6E&y54eql&lQ1Fmu+8Fz?Jp%4UIb0!A{9cSMRnFk8-B8_d`DuRaq&~zTmUFd42hc39|3~Zw~bXr+BRnmz2rs z2Fz6LQ3z7)msefUDE}^06O3P>5%IWmf;qf>vie#p$n#98P3+9CcitRrzL{QqF*cI* z2wxOP(_RpGUnM3R`5-n1m0o^!I7cJ}STb;{<;V$!;fE3&$I#-Afx}zRUAI zT&NuHLU1b^-lK4dN4W{1G+R_0@+JUl6<$!c-qzIUu6gHuI`x z{o}~nIWg0`QN`Ucm3e7nLS15anv0pCw@H7E8$K@%9rjYtIK6Mu>4yMhg(P|32R)!6 X>h#VTp{BO^BhKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0002vNklEYJU> zbas?aGZ|S?D(}54r6*$n3>YwAz<>b*2AnE&m(9!7+C_Yplce*zMZ4{$m zOPX4Hhes*Vb>#asU#@pA(2{g4xx$wKdR8)cA3zT!%}WK}o}dRY(YXz+YwAz<>b*1`HT5V8DO@8wSVz#N((iV8DM( u#sAWP0RsjM7%*VKfC2xM761VM{{sLf-yP1%${*+e0000|jhTDh>;A5_KI>lVSu@x5 zh+XS!D=)K11^@tgdpj#P=v{W=B_#p<&B_%lhu)+)cHTUwZ2rVc3`jn)5CCLcSY-0r zwZ3dVo9D~sAneIx1c%FJu>3&)2yRVvXHwkzRZK^ozOi(O2|wb%c2kx@xLNKGUl6}s zPg7cHO^oKL7G>9pxz^Tm)N9jY#19?}KcMWYFSk$TiDZxF>4SUD#O%BCp=;+EzelAb z&+EsoJSO$!4yP70N|sB>9kVlVH42x@vRpFv_dPXL)m=R(^9Y%x96(8`fUe0K)fNNZ zg%OD>waO*017gAVWu<^}r<8Kc;^=Y3mzKvjiiPhLE9b|ra*zsN0GNj!v^)!#+lYmy zCM|ad(&qqM>u5gRz*;1*Rp*!I_kr-#cgJ^%0UM5JDvPDZ1Bm%xj1}O!8pv&2x6c~z z!T<{x4pn&I2@=5Adot{Ri$y?rgOY4MASDN2Tw@|v0CRQ%TWhtogMq!rfdw{0p2R;_ z<|*~*L8Ol76N{JPts^!_A%i46JyA<^8|+nAE-{yuyc0Mg@? zq0tVH1~(|=H8dC>EL7Nne0f7+T+7F&d#txHhhq)^UHq`7F@1EwqVUxc;Q?c(mkrMG z-7K5FePll)U(x&uklx?wIn0@0V}0sSaZ5{YPtTJzRhAp5cRY8EF)O!}dye}59Y*{( z^7i-Z&z45uHbvOZdG~we-8YUIiyIG1@AYYa9%uWpNOt_A#(k|Sd!J%2y#?K_^MVdq zB_9~ZWoX4(9$s;4S@SskS*QL7aZ;xdaB&++Y-c?3+$Ng%Uk*A-Ui|WBBLFZ|!mfCr zDD@>bW0@|0vn zCBd9|5!U6>#&ZOg21#il7dIcRv@?cWWwLZ$EE%U$eCP-JOTST?=QZ0j2fAtZ>u04H+AY#fxZO(k z%a_C-(MPPTjqFM7x!GgTqu!%Av_U4-$2{n_cka)0-R^8#qt>g`YuGCRCgChR&Lq2a zoI6FCYZSNM^8Benw+pV(=jI!3PsZ2pQL%T(IDh)+{YAd2z9Xy)FZkEyb{t*eoOsW( zxvt;#MdAzbHv&2NDCIphF-%>xl!cNDnQDTC7m^&$s@>nORzty%7jz@Ot+E?!C z?#!&!=c2Qj=hzgp-@?2{V}(#EN~k>!Z4HUP6~Q=g6}Ndr<<8L9JcT2g4Zjatx!K} z=va&eH~M8COFZV4W0&KaWBaPiIBy^`^=z4SiT8&H1&f+BIvaItnQ;w2ruMnFxOZgA zWU4rs65i&avi&mDPnB2+ZUklyCZ%299G>RL&U_kD*7tt#F7zm6G~j*aTU$9Vi2}K$ z5^Zt~3yHUkg4je2bWPizuH;QO&B+adx%iYR8)TyY;8*A00PJF~vT{^`-QsJWlB>+PXe?y?)`j z!mFTte$V=|-h+jufsyO+-WgsV>o*nHoKHQ!>`}@2lFYf8#m))NIcblWH!uEKc)KvG zNbO?p6N$FG!hphERHlzAv*=dd&B27Sgk9Hm{W@wYDIeXUkfX6)BaC;MyMVBc@HDyM z#Gu)(TW^l_qnTcfN{vqpx(nymt*Bz9x~JT?WvViZd3%Oq_QyKxu0th~P$}xw9kpdW zYxr-2Hg$zIzfDakNU0n+*LGphc#t(1-G1_};mH+g-UhsTH*3kiyY@Dj$(}rl@$1YD zb0ND#Ft7A!qiN`P&-0Hj7G(&sN2sq=Nq>>JC%Z}AM3bkur`}ucnv@sS7S*}jWT$P3 z>?Hr9Jx(7F9d80M!>Qh4x|@bC|ktsKEJ!S z;=HDB?H`BEYmW3KHN-ct6e8D#y?As_lKPyw|7Mt+PGoeXXO!7NPK?*0CTyaSpsAhA z>$G}rbSgcmuo#ch%QFu2zux(A zU^x0&>NDByovKOb+D)90Qw^1GA~RL8Q1kQ&$IKmLoL3$BmxYqvIh6y;hUN>F9h3>F z)Tm@?p_`1GVxEvU>Md~|veR=4J^V*}sZq$%TLu~Wy~TTVvJRCx$~$(X5YkkVcOU|A zri3!=p2P8nf-JK&oe~O}FPYC7JL+=5$o#Qef%}WlOO8t3_A5A)`=d8frqJ^23(9)k z$9j_aOwf~YqdxWy{#Z`h%KCx31$WvGnVfiia(rN3<-D%Lg&9!}o=6R^=ViIu@cG1` zkT#ia5bg=s{Qf6 zCKoTXcjp!A`>0fPl5*_6yajEliORn`(QOazRgY%hxpBPx$mOh@s$zO0qnXkF{3$YR zgTk@w#OH|$f$}Y_m*qRxT^@M*mvtLDv0k^WWKSWv_{JYGsRE7ZsD0-FZacb5KT_{YPx4W%Qaq}$iqJj6Vl9x@(+AM8IAjF{!cX7|54_90-? zdFOzjfg15<@li=_g~G?h4<2eXn^N539<6+3t5EaP^|92~0;IgLyvMI6s-J0dtU`MF zN2EJPmdF!YcO2N6+a-DbryUwh4fHn4sz_9tNX*qYZT>Edrgv^QA7OTi%!tShSEkq92-V7;As> zy8V}J<%0C#rgqyAiO4;TWASg}6v;ov9gnMvl8<_owu*$uKQrTw_J7PIH_{uIr>Tye z9;?e!RY8Znd-&>cLsL@Isl=hggc|`rXNInXEult=AvrW*?6ePRbuL^Hl>`TPxJI{b@nOuN53dOnLWGdW+xPI$f>1_raf6E@+Q3Y$!YsTm?d`9~mgK`Nik zrLfulq^T^M`ThibebV)01=869-U=cbUVCP$XM{j2Djy_4sc4AA7$UJo6s$1;XGk!> zuf*U97|bk@shThiCn)XdR6g~esC-cuuEVCY7$N^iWv1qr8ct3G`#>I_8b|}}tw_+= zQ7jgnu!`YhfM;N#B?jUcNUVvWF%pk40+9?n-2j7S7=bi8I625K!@rWYV$-%yF+my{7#bp1(N{tGCO-64IOA157$5p)=~>}lNxN`a&?ZFnpH*j~ z_y5->z9I8fQ+6yKlsX}^QVL3}$!*3R4EnP4v%{Y?xm|FmTpl>F3Qe^>FT?5mWqSLV zh?!i?1S)M}qao2IautLqd{H{nt?9^5VXUtw@Sjnh(w`On{Wb)?V4$#spOTua^?eZ@ zo52@Qxu69T%8CDF8BPg)839)&q9^ubf7X9s4tUfZ|GyddXG`e6eFkQ7m*z_iWP)@O z`g7WTF8F7YHZ_%BuBXr2z}M@KNT(4PY;FLRPhtg7nIM`I$Rwg?3TN6RPTz$HWVSz> z>%^vmBm*M)TgBguf__|EJN4TdiRWf(iLkdO8)Nat#z-6rJ6mQ}y;(XF_b~#r$3Xc` zom|^c%vWXb`d$-zh5z=+`X)FGbU_Cm==u~o+YJx(79Kj=4G*1(^ay0}Nw`m~!HQ=^ zP26m!pt?inLXZRv4PFGVy_OXW`g>WipnC#uVyDA?j)6PA8R-4Jz*&w@fm7);>-09c zMNE}KXG7>%ik?1~ezki{@2~&P4>KeBcdEj)M2*0J2scHzg!6%UMYv!-F(As1q>+ia92HU7q+3)ba<=BAI!)_l-RKWeMK zmT?Dsl7i~EUbfPt`%)=*{Zix+ngY-KB=?O@A4xw|+34(pqze){4;+}g6ajO&C53|A S+B&FHfW5V|Ri5S6-Twnc%6EqV diff --git a/services/SimpleURI/images/search_searchbar_bg_nor.png b/services/SimpleURI/images/search_searchbar_bg_nor.png deleted file mode 100644 index ad1a285d66c3bf941d9f0c7e8f16102e3846dc35..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17740 zcmeI3c{r5o|HmJZeJiAr&R9Y+tF4*FSjL(yjEuAxGh3or2zntbFjB|2R~(|UXtSAdtM=52mFxY*n4xqHl?YT2#|haDF8^jGKs_u z8v@uoHaCFHfjJO~Fit4jpBY34fUx#V4+hDje~H=Xvk@!Dgy^G=Y%&uZnO-}f}s)j#h+Sj0$ca{xujQkn*LTuTIa zABD%S(X5uZ28e{+myrajoinOYE8-^=UR$MY7Kz>~Qq4nItm3|K@QvN{V`*os7F zrs{YA*E7b$@z!ABfI;pB5F3) zCVR)|0sj&Oi%URuf4kQ(XNrx@$;0JOp7i$gJYHXCd$&c#yHR~Mw%E|i5-ENCR4q2xk z9LAi{+-G%U_03gnle8CI24kXxE@R;Qc7jM`5AbqWFY-4Fb)#yxfVgCiJfha~io6*|;R8i7 zt46OfMoP@`mZTCzqdh^yZ$DYfSe|RTe6Q^(nR_%IIz4eocE-KXi_6Up znw;#rR}i4ko=6}zpsHUjl`yOeLLusJSY23aAeBsQyr5YqTTs9J{Ki7jihb{>Ef@G= zi(_o6rA);5Rxrv+OM9{t+2yf)E^LLi(V})KQz_BCZne6a$+?afb*?V@yKbo;1|3hf zH_&>xI8h0y7@0tr?RIZfuXl7W2wYa#xnlWbE!^em)$?Gtbv3wMZZbyOH)W=dy@6b^nX-I zx+8sT{V|W`;XM{3Z`rV3ceAb?Be8j5W}n9skEc1(IZK?) zaPNu{`GIHDPF7g+ud{LnQ?ssZjm~mn=R6Cq>ie)_7jm359{eHaot-RMyi`_OyhFBm zDgLH$2pg}CZ0PvYjkx881@R2!7$xQT-lXzY{OJd_KieuCWY%x)*6t3j53WD0Bd(*N zT?0oNI z@s8rM;Ids5hMy|q^3CEKgUMCNyRPo~dE87wF8+ypf%+!(DDK5jW!y&Gv-IW@gXX(# zjvVhtGRQ58EsqVm%aj^d*D*6aGVa?kR2k*mJ;MnH_BrluM5GW98EW-UZ&mfI=e-Nr z@;svLU1mmUM(sdu$GJh1LFQn5=P!4Sep#L6ZOFZM;}-FEx87EBnO}~f0=o*MT#2qR zj7xo5NGdYPtLV}B%V+rcqm;L*gue)(zjPD2@utr(&%C$YHLbpU>vE&(4R+SH*e>Ev zT9dTNh{;wUCwi3#Lv&w^WsJ{)vG)-_YFs~Lj_aWRRq|xO@?dtkrHWq%qo;+MLwPl#ksI_3Gh03Cc^#fg4e>y0P)GUUBA!I0@wCt>_eEerqR@+hzU1 z`ndJ83Ey=rvTydL52efI%5lk5=WxB`pNFE(KXUF-TdFdY9P z^My=zq-rYi))r3q$>!RT*qkMKh{XoD;}%W{E^Cke%TiH4cgew3LrVNrhor-6)oU4= z$X1iqgvZ3q`YTcQzK%V@oD(vJPBEt~@4jJFxU{;X-e?beYxJSENmPkMt!< z7<4cH>rMOaV2>AMt!Wy#TY9JCu<41nzf2A+u3h~6NZFY&zxQ*h4_$&L%^n)L`77Tc$6h~F*L^ub=Y^}MoyXKNe;2RlF>E75~Z#o|hY;h$c zy}K?^KE!3J5mff=FIMhQO;P#jv0i6buUb6&&h@m;qZjiE>dI*?{%!vKFQ37)eB_Vk zr@Ty&XURQjzbMzW@#4U{zic{?DNTAE6?@8v<)^RXuT;`=ZZ|irGbjB@8Xwd@4uB3Ae9xc#3#BKk$D*A9ENh9W^iBm*4;X_*n3kBA4Kh zfdrb;_*~-t4?EQv>d5U@=|kzZ86N3lK7Kw|UGEZFAHIGT@zJj12Za+xc<=D_ z!=&5H_Ws@XlNm!T2Q!al?utVE-RawLsw}dP+T68Wf&KQXBJX*d&E$c;b(QOyHxFIm z4V85CDtTS;N}l0-1bg)6=)0~ZPoqM0$D11~p73=Ciz;0!w~bf~SUw>>jelV7Gtv3@ZRbzh ztNGc(t(|tG;<0;LCX(JIDi9YYrX@DU$;G|NT1&uUUzmrE_kYYGw$NI1vQ#HdO*9s( zEJ9a8!0MfI|~jA4*q5&muIsR zJd;l|`{saLQaFc>bfMpzKEUjd^e09#{5p$lxHSvIu&MC2oL5Tju=X(@Ytaw zHamzglVx+ipTM6_dR|Nxjm_t-#v`G<=aza-h;B{c(FtHG8o^OUaI`TAZGyuX;S8~B zP*@xaHBV%wCq%;;OnVxINBJizU-X6QuxU*H@PDK-*YisaXJ?!Pi_4?1sB{Nw0yuXB zlS#vwniv}!8Jp1HXcP(qr(%qZ;A`n<8k|Noq+saaPNbpMPEYd7@UNt;+0-3VIrK@I z21--?*ZP@KOpM_EXsij`A8Uk$`(gc2a6e;{wbZqyesqj6{j>DE@UNs@Lz!R^q6E$B zGj;a=*CDeQFn)X@1^@v-M@R zd`!hm?`9l@I#p;0)Tvyh)9}bITIWt{Hu6&#^XmotXOw63=Y@ZN41NHeB`D!%q^5g) zUxdr{=kY0_bV~-96aULLoDuvo0;-HhPSxZf=6_%fxRjm$zZLjrTj;-i1?F;>8bDz& z=rjWIbJ~7x_-BhYvy@-%r_W{J>-~qPQE~q4&|nIWzzn7^=tvHWfk)0Y&W(wmy$a!o z>>zfiGn+;y7~+xNYW`*v_~+V&ng7-ZTz5Mwn1c<`1gu;pa0~)HUuIsvc{)?qF&tQ9 zzHz|+A-bV6oUc}@P-FGK84PALqojCm5JppI__dVeo)p5s&COghcG zdz&s1Gp*pgA$VJgoV_pos(Q@U*MH}ixf%UCRUul!K_EZ`n?hWI`9QovTo53FO(8D9 zd>~#SE(j38rVy84J`k@E7X*l4Q;172ABb0o3j##2Da0k155z0P1py-16yg%h2jUgt zf&dY03ULYM1Mv!RL4XK0g}4Osfp~?uAV370LR^CRK)ga+5Fmn0AuhpuAYLIZ2oS-h z5SL&+5U&sy1c+c$h)XaZh*yXU0z|MW#3h&y#4E%F0V3EG;u6dU;uYe801<2oaS7%F z@d|N4fCx5)xCHZoc!jtiKm?mYT!Q&Pyh2i<34Znizz!4uy!Hhj zA58@SRrZl>H*LYbWCv?YQds-ZqzfX^Fj=u5bk0*EDPrP&l6S=!L}?l0&0{IblMBR@ zvlk@mDy{WGs7iFnW(Vv#xIu~IfE!6%1uVSX?(0*Q9q8?@aA#Kq!#n^fW3ugED*?5I Wk9+DCd6j@;01h@T*2Px7yZ;9iK2@Ut diff --git a/services/SimpleUI/ButtonBar.cpp b/services/WebPageUI/ButtonBar.cpp similarity index 69% rename from services/SimpleUI/ButtonBar.cpp rename to services/WebPageUI/ButtonBar.cpp index 6bf795b..925202f 100644 --- a/services/SimpleUI/ButtonBar.cpp +++ b/services/WebPageUI/ButtonBar.cpp @@ -21,17 +21,15 @@ #include "Config.h" #include "ButtonBar.h" -namespace tizen_browser -{ -namespace base_ui -{ +namespace tizen_browser { +namespace base_ui { double ButtonBar::tooltipHideTimeout = 0.; double ButtonBar::tooltipShowDelay = 0.; -Ecore_Timer * ButtonBar::m_tooltipHideTimer = NULL; -Ecore_Timer * ButtonBar::m_tooltipShowTimer = NULL; +Ecore_Timer* ButtonBar::m_tooltipHideTimer = NULL; +Ecore_Timer* ButtonBar::m_tooltipShowTimer = NULL; -ButtonBar::ButtonBar(Evas_Object *parent, const std::string &edjFile, const std::string &groupName) +ButtonBar::ButtonBar(Evas_Object* parent, const std::string& edjFile, const std::string& groupName) { config::DefaultConfig config; config.load(""); @@ -42,7 +40,7 @@ ButtonBar::ButtonBar(Evas_Object *parent, const std::string &edjFile, const std: elm_theme_extension_add(NULL, edjFilePath.c_str()); m_layout = elm_layout_add(parent); Eina_Bool layoutSetResult = elm_layout_file_set(m_layout, edjFilePath.c_str(), groupName.c_str()); - if(!layoutSetResult) + if (!layoutSetResult) throw std::runtime_error("Layout file not found: " + edjFilePath); evas_object_size_hint_weight_set(m_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(m_layout, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -51,22 +49,22 @@ ButtonBar::ButtonBar(Evas_Object *parent, const std::string &edjFile, const std: ButtonBar::~ButtonBar() { - if(ButtonBar::m_tooltipShowTimer) { + if (ButtonBar::m_tooltipShowTimer) { ecore_timer_del(ButtonBar::m_tooltipShowTimer); ButtonBar::m_tooltipShowTimer = NULL; } - if(ButtonBar::m_tooltipHideTimer) { + if (ButtonBar::m_tooltipHideTimer) { ecore_timer_del(ButtonBar::m_tooltipHideTimer); ButtonBar::m_tooltipHideTimer = NULL; } } -void ButtonBar::addAction(sharedAction action, const std::string &buttonName) +void ButtonBar::addAction(sharedAction action, const std::string& buttonName) { ActionButton actionButton; std::shared_ptr eAction = std::make_shared(action); actionButton.eAction = eAction; - Evas_Object *button = elm_button_add(m_layout); + Evas_Object* button = elm_button_add(m_layout); evas_object_event_callback_add(button, EVAS_CALLBACK_MOUSE_IN, __cb_mouse_in, NULL); evas_object_event_callback_add(button, EVAS_CALLBACK_MOUSE_OUT, __cb_mouse_out, NULL); @@ -78,7 +76,7 @@ void ButtonBar::addAction(sharedAction action, const std::string &buttonName) elm_object_disabled_set(button, action->isEnabled() ? EINA_FALSE : EINA_TRUE); evas_object_smart_callback_add(button, "clicked", EAction::callbackFunction, eAction.get()); evas_object_show(button); - if(action->isEnabled()){ + if (action->isEnabled()) { elm_object_tooltip_text_set(button, eAction->getAction()->getToolTip().c_str()); elm_object_tooltip_orient_set(button, ELM_TOOLTIP_ORIENT_BOTTOM); elm_object_tooltip_style_set(button, "browserTip"); @@ -92,12 +90,12 @@ void ButtonBar::addAction(sharedAction action, const std::string &buttonName) registerEnabledChangedCallback(action, buttonName); } -void ButtonBar::registerEnabledChangedCallback(sharedAction action, const std::string &buttonName) +void ButtonBar::registerEnabledChangedCallback(sharedAction action, const std::string& buttonName) { action->enabledChanged.connect(boost::bind(&ButtonBar::onEnabledChanged, this, buttonName, action)); } -void ButtonBar::onEnabledChanged(const std::string &buttonName, sharedAction action) +void ButtonBar::onEnabledChanged(const std::string& buttonName, sharedAction action) { // if action match action assigned to button, refresh button if (m_actionsMap[buttonName] == action) { @@ -106,41 +104,38 @@ void ButtonBar::onEnabledChanged(const std::string &buttonName, sharedAction act } -void ButtonBar::setActionForButton(const std::string &buttonName, sharedAction newAction) +void ButtonBar::setActionForButton(const std::string& buttonName, sharedAction newAction) { - ActionButton actionButton; - Evas_Object *button = m_buttonsMap[buttonName].button; - std::shared_ptr eAction = std::make_shared(newAction); + ActionButton actionButton; + Evas_Object* button = m_buttonsMap[buttonName].button; + std::shared_ptr eAction = std::make_shared(newAction); - elm_object_style_set(button, newAction->getIcon().c_str()); + elm_object_style_set(button, newAction->getIcon().c_str()); - evas_object_smart_callback_del(button, "clicked", EAction::callbackFunction); - evas_object_smart_callback_add(button, "clicked", EAction::callbackFunction, eAction.get()); + evas_object_smart_callback_del(button, "clicked", EAction::callbackFunction); + evas_object_smart_callback_add(button, "clicked", EAction::callbackFunction, eAction.get()); - if(elm_object_focus_get(button)) { - elm_object_signal_emit(button, "elm,action,focus", "elm"); - } + if (elm_object_focus_get(button)) { + elm_object_signal_emit(button, "elm,action,focus", "elm"); + } - m_buttonsMap[buttonName].eAction = eAction; - m_actionsMap[buttonName] = newAction; + m_buttonsMap[buttonName].eAction = eAction; + m_actionsMap[buttonName] = newAction; - refreshButton(buttonName); + refreshButton(buttonName); } -void ButtonBar::refreshButton(const std::string &buttonName) +void ButtonBar::refreshButton(const std::string& buttonName) { - Evas_Object * button = m_buttonsMap[buttonName].button; - if(m_actionsMap[buttonName]->isEnabled()) - { + Evas_Object* button = m_buttonsMap[buttonName].button; + if (m_actionsMap[buttonName]->isEnabled()) { elm_object_disabled_set(button, EINA_FALSE); elm_object_tooltip_text_set(button, m_actionsMap[buttonName]->getToolTip().c_str()); elm_object_tooltip_orient_set(button, ELM_TOOLTIP_ORIENT_BOTTOM); elm_object_tooltip_style_set(button, "browserTip"); - } - else - { + } else { elm_object_disabled_set(button, EINA_TRUE); elm_object_tooltip_unset(button); } @@ -151,14 +146,14 @@ Evas_Object* ButtonBar::getContent() return m_layout; } -Evas_Object* ButtonBar::getButton(const std::string &buttonName) +Evas_Object* ButtonBar::getButton(const std::string& buttonName) { return m_buttonsMap[buttonName].button; } void ButtonBar::clearFocus() { - for ( auto it = m_buttonsMap.begin(); it != m_buttonsMap.end(); it++) { + for (auto it = m_buttonsMap.begin(); it != m_buttonsMap.end(); it++) { elm_object_focus_set((*it).second.button, EINA_FALSE); } } @@ -171,14 +166,14 @@ void ButtonBar::setDisabled(bool disabled) elm_object_disabled_set(getContent(), disabled ? EINA_TRUE : EINA_FALSE); } -void ButtonBar::__cb_focus_in(void *data, Evas_Object *obj, void *event_info) +void ButtonBar::__cb_focus_in(void*, Evas_Object* obj, void*) { //BROWSER_LOGD("[%s:%d] %d", __PRETTY_FUNCTION__, __LINE__, reinterpret_cast(obj)); - if(ButtonBar::m_tooltipHideTimer) { + if (ButtonBar::m_tooltipHideTimer) { ecore_timer_del(ButtonBar::m_tooltipHideTimer); ButtonBar::m_tooltipHideTimer = NULL; } - if(ButtonBar::m_tooltipShowTimer) { + if (ButtonBar::m_tooltipShowTimer) { ecore_timer_del(ButtonBar::m_tooltipShowTimer); ButtonBar::m_tooltipShowTimer = NULL; } @@ -188,36 +183,36 @@ void ButtonBar::__cb_focus_in(void *data, Evas_Object *obj, void *event_info) ButtonBar::m_tooltipShowTimer = ecore_timer_add(elm_config_tooltip_delay_get(), ButtonBar::__cb_tooltip_show_delay, obj); } -void ButtonBar::__cb_focus_out(void *data, Evas_Object *obj, void *event_info) +void ButtonBar::__cb_focus_out(void*, Evas_Object* obj, void*) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if(ButtonBar::m_tooltipHideTimer) { + if (ButtonBar::m_tooltipHideTimer) { ecore_timer_del(ButtonBar::m_tooltipHideTimer); ButtonBar::m_tooltipHideTimer = NULL; } - if(ButtonBar::m_tooltipShowTimer) { + if (ButtonBar::m_tooltipShowTimer) { ecore_timer_del(ButtonBar::m_tooltipShowTimer); ButtonBar::m_tooltipShowTimer = NULL; } - elm_object_tooltip_hide(obj); + elm_object_tooltip_hide(obj); } -void ButtonBar::__cb_mouse_in(void * /*data*/, Evas */*e*/, Evas_Object *obj, void */*event_info*/) +void ButtonBar::__cb_mouse_in(void* /*data*/, Evas* /*e*/, Evas_Object* obj, void* /*event_info*/) { //BROWSER_LOGD("[%s:%d] %d", __PRETTY_FUNCTION__, __LINE__, reinterpret_cast(obj)); elm_object_focus_set(obj, EINA_TRUE); } -void ButtonBar::__cb_mouse_out(void */*data*/, Evas */*e*/, Evas_Object *obj, void */*event_info*/) +void ButtonBar::__cb_mouse_out(void* /*data*/, Evas* /*e*/, Evas_Object* obj, void* /*event_info*/) { elm_object_focus_set(obj, EINA_FALSE); } -Eina_Bool ButtonBar::__cb_tooltip_hide_timeout(void * data) +Eina_Bool ButtonBar::__cb_tooltip_hide_timeout(void* data) { - Evas_Object * button = static_cast (data); + Evas_Object* button = static_cast(data); - if(ButtonBar::m_tooltipHideTimer) { + if (ButtonBar::m_tooltipHideTimer) { ecore_timer_del(ButtonBar::m_tooltipHideTimer); ButtonBar::m_tooltipHideTimer = NULL; } @@ -226,11 +221,11 @@ Eina_Bool ButtonBar::__cb_tooltip_hide_timeout(void * data) return ECORE_CALLBACK_CANCEL; } -Eina_Bool ButtonBar::__cb_tooltip_show_delay(void * data) +Eina_Bool ButtonBar::__cb_tooltip_show_delay(void* data) { - Evas_Object * button = static_cast (data); + Evas_Object* button = static_cast(data); - if(ButtonBar::m_tooltipShowTimer) { + if (ButtonBar::m_tooltipShowTimer) { ecore_timer_del(ButtonBar::m_tooltipShowTimer); ButtonBar::m_tooltipShowTimer = NULL; } diff --git a/services/SimpleUI/ButtonBar.h b/services/WebPageUI/ButtonBar.h similarity index 59% rename from services/SimpleUI/ButtonBar.h rename to services/WebPageUI/ButtonBar.h index 9362647..08c96d1 100644 --- a/services/SimpleUI/ButtonBar.h +++ b/services/WebPageUI/ButtonBar.h @@ -19,39 +19,36 @@ #include #include +#include #include "Action.h" #include "EAction.h" -namespace tizen_browser -{ -namespace base_ui -{ +namespace tizen_browser { +namespace base_ui { -class ButtonBar -{ +class ButtonBar { public: - struct ActionButton - { - Evas_Object *button; + struct ActionButton { + Evas_Object* button; std::shared_ptr eAction; }; - ButtonBar(Evas_Object *parent, const std::string &edjFile, const std::string &groupName); + ButtonBar(Evas_Object* parent, const std::string& edjFile, const std::string& groupName); ~ButtonBar(); - void addAction(sharedAction action, const std::string &buttonName); - void setActionForButton(const std::string &buttonName, sharedAction newAction); + void addAction(sharedAction action, const std::string& buttonName); + void setActionForButton(const std::string& buttonName, sharedAction newAction); /** * @brief register callback, used internally by addAction, * should be called externally for all actions that will be assigned to button * @param action - action that will be used with buttonName * @param buttonName - name of button used in ButtonBar */ - void registerEnabledChangedCallback(sharedAction action, const std::string &buttonName); + void registerEnabledChangedCallback(sharedAction action, const std::string& buttonName); Evas_Object* getContent(); - Evas_Object* getButton(const std::string &buttonName); + Evas_Object* getButton(const std::string& buttonName); void clearFocus(); void setDisabled(bool disabled); @@ -60,21 +57,21 @@ private: std::map m_actionsMap; //map button name to struct ActionButton which contains Evas_Object of button std::map m_buttonsMap; - Evas_Object *m_layout; - void refreshButton(const std::string &buttonName); - void onEnabledChanged(const std::string &buttonName, sharedAction action); - static Ecore_Timer *m_tooltipHideTimer; - static Ecore_Timer *m_tooltipShowTimer; + Evas_Object* m_layout; + void refreshButton(const std::string& buttonName); + void onEnabledChanged(const std::string& buttonName, sharedAction action); + static Ecore_Timer* m_tooltipHideTimer; + static Ecore_Timer* m_tooltipShowTimer; static double tooltipHideTimeout; static double tooltipShowDelay; - static void __cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void __cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void __cb_focus_in(void *data, Evas_Object *obj, void *event_info); - static void __cb_focus_out(void *data, Evas_Object *obj, void *event_info); - static Eina_Bool __cb_tooltip_hide_timeout(void * data); - static Eina_Bool __cb_tooltip_show_delay(void * data); + static void __cb_mouse_in(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void __cb_mouse_out(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void __cb_focus_in(void* data, Evas_Object* obj, void* event_info); + static void __cb_focus_out(void* data, Evas_Object* obj, void* event_info); + static Eina_Bool __cb_tooltip_hide_timeout(void* data); + static Eina_Bool __cb_tooltip_show_delay(void* data); }; diff --git a/services/WebPageUI/CMakeLists.txt b/services/WebPageUI/CMakeLists.txt new file mode 100644 index 0000000..b9ac365 --- /dev/null +++ b/services/WebPageUI/CMakeLists.txt @@ -0,0 +1,68 @@ +project(WebPageUI) + +set(WebPageUI_SRCS + WebPageUI.cpp + ButtonBar.cpp + URIEntry.cpp + ) + +set(WebPageUI_HEADERS + WebPageUI.h + ButtonBar.h + URIEntry.h + ) + +include(Coreheaders) +include(EFLHelpers) +include(EWebKitHelpers) + +include_directories(${CMAKE_BINARY_DIR}) +include_directories(${CMAKE_SOURCE_DIR}) +include_directories(${CMAKE_SOURCE_DIR}/services) +include_directories(${CMAKE_SOURCE_DIR}/services/WebEngineService) +include_directories(${CMAKE_SOURCE_DIR}/services/WebEngineService/src) +include_directories(${CMAKE_SOURCE_DIR}/services/MoreMenuUI) +include_directories(${CMAKE_SOURCE_DIR}/services/MainUI) +include_directories(${CMAKE_SOURCE_DIR}/services/SettingsUI) +include_directories(${CMAKE_SOURCE_DIR}/services/TabUI) + + +include(FindPkgConfig) + +pkg_check_modules(capi_net QUIET capi-network-connection) + +add_library(${PROJECT_NAME} SHARED ${WebPageUI_SRCS}) + +add_dependencies(${PROJECT_NAME} MoreMenuUI) +add_dependencies(${PROJECT_NAME} MainUI) +add_dependencies(${PROJECT_NAME} TabUI) +target_link_libraries(${PROJECT_NAME} MoreMenuUI) +target_link_libraries(${PROJECT_NAME} MainUI) +target_link_libraries(${PROJECT_NAME} TabUI) +target_link_libraries(${PROJECT_NAME} ${EFL_LDFLAGS}) + +IF (${capi_net_FOUND}) + target_link_libraries(${PROJECT_NAME} ${capi_net_LDFLAGS}) +ENDIF (${capi_net_FOUND}) + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION services + ARCHIVE DESTINATION services/static) + +include(EDCCompile) + +#please do not add edc/ directory +set(edcFiles + WebPageUI.edc + ErrorMessage.edc + LeftButtonBar.edc + RightButtonBar.edc + URIEntry.edc + ) + +foreach(edec ${edcFiles}) + string(REPLACE ".edc" ".edj" target_name ${edec}) + EDJ_TARGET(${target_name} + ${CMAKE_CURRENT_SOURCE_DIR}/edc/${edec} + ${CMAKE_CURRENT_BINARY_DIR}) +endforeach(edec) diff --git a/services/SimpleURI/SimpleURI.cpp b/services/WebPageUI/URIEntry.cpp similarity index 59% rename from services/SimpleURI/SimpleURI.cpp rename to services/WebPageUI/URIEntry.cpp index 2c5b9ba..cc3fadb 100644 --- a/services/SimpleURI/SimpleURI.cpp +++ b/services/WebPageUI/URIEntry.cpp @@ -16,17 +16,15 @@ #include #include -#include "SimpleURI.h" -#include "ServiceManager.h" +#include "URIEntry.h" #include "BrowserLogger.h" #include "MenuButton.h" #include #include +#include "BrowserAssert.h" -namespace tizen_browser{ -namespace base_ui{ - -EXPORT_SERVICE(SimpleURI, "org.tizen.browser.simpleuri") +namespace tizen_browser { +namespace base_ui { const std::string keynameSelect = "Select"; const std::string keynameClear = "Clear"; @@ -34,28 +32,37 @@ const std::string keynameKP_Enter = "KP_Enter"; const std::string keynameReturn = "Return"; const std::string keynameEsc = "XF86Back"; -SimpleURI::SimpleURI() - : m_entry(NULL) +URIEntry::URIEntry() + : m_parent(nullptr) + , m_entry(NULL) , m_favicon(0) , m_entry_layout(NULL) , m_entrySelectedAllFirst(false) { std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleURI/URIEntry.edj"); + edjFilePath.append("WebPageUI/URIEntry.edj"); elm_theme_extension_add(NULL, edjFilePath.c_str()); } -SimpleURI::~SimpleURI() +URIEntry::~URIEntry() {} -Evas_Object * SimpleURI::getContent(Evas_Object *main_layout) +void URIEntry::init(Evas_Object* parent) +{ + m_parent = parent; +} + +Evas_Object* URIEntry::getContent() { - if(!m_entry_layout) { - m_entry_layout = elm_layout_add(main_layout); + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + + if (!m_entry_layout) { + m_entry_layout = elm_layout_add(m_parent); std::string edjFilePath = EDJE_DIR; - edjFilePath.append("SimpleURI/URIEntry.edj"); + edjFilePath.append("WebPageUI/URIEntry.edj"); Eina_Bool layoutSetResult = elm_layout_file_set(m_entry_layout, edjFilePath.c_str(), "uri_entry_layout"); - if(!layoutSetResult) + if (!layoutSetResult) throw std::runtime_error("Layout file not found: " + edjFilePath); m_entry = elm_entry_add(m_entry_layout); @@ -71,22 +78,22 @@ Evas_Object * SimpleURI::getContent(Evas_Object *main_layout) elm_object_part_text_set(m_entry, "elm.guide", "Search words, web address"); #endif - evas_object_smart_callback_add(m_entry, "activated", SimpleURI::activated, this); - evas_object_smart_callback_add(m_entry, "aborted", SimpleURI::aborted, this); - evas_object_smart_callback_add(m_entry, "preedit,changed", SimpleURI::preeditChange, this); - evas_object_smart_callback_add(m_entry, "changed,user", SimpleURI::changedUser, this); - evas_object_smart_callback_add(m_entry, "focused", SimpleURI::focused, this); - evas_object_smart_callback_add(m_entry, "unfocused", SimpleURI::unfocused, this); + evas_object_smart_callback_add(m_entry, "activated", URIEntry::activated, this); + evas_object_smart_callback_add(m_entry, "aborted", URIEntry::aborted, this); + evas_object_smart_callback_add(m_entry, "preedit,changed", URIEntry::preeditChange, this); + evas_object_smart_callback_add(m_entry, "changed,user", URIEntry::changedUser, this); + evas_object_smart_callback_add(m_entry, "focused", URIEntry::focused, this); + evas_object_smart_callback_add(m_entry, "unfocused", URIEntry::unfocused, this); evas_object_smart_callback_add(m_entry, "clicked", _uriEntryClicked, this); - evas_object_event_callback_priority_add(m_entry, EVAS_CALLBACK_KEY_DOWN, 2*EVAS_CALLBACK_PRIORITY_BEFORE, SimpleURI::fixed_entry_key_down_handler, this); + evas_object_event_callback_priority_add(m_entry, EVAS_CALLBACK_KEY_DOWN, 2 * EVAS_CALLBACK_PRIORITY_BEFORE, URIEntry::fixed_entry_key_down_handler, this); elm_object_part_content_set(m_entry_layout, "uri_entry_swallow", m_entry); m_entryBtn = elm_button_add(m_entry_layout); evas_object_event_callback_add(m_entryBtn, EVAS_CALLBACK_MOUSE_IN, __cb_mouse_in, this); - evas_object_smart_callback_add(m_entryBtn, "focused", SimpleURI::focusedBtn, this); - evas_object_smart_callback_add(m_entryBtn, "unfocused", SimpleURI::unfocusedBtn, this); + evas_object_smart_callback_add(m_entryBtn, "focused", URIEntry::focusedBtn, this); + evas_object_smart_callback_add(m_entryBtn, "unfocused", URIEntry::unfocusedBtn, this); elm_object_style_set(m_entryBtn, "entry_btn"); evas_object_smart_callback_add(m_entryBtn, "clicked", _uriEntryBtnClicked, this); @@ -96,16 +103,16 @@ Evas_Object * SimpleURI::getContent(Evas_Object *main_layout) return m_entry_layout; } -void SimpleURI::changeUri(const std::string newUri) +void URIEntry::changeUri(const std::string newUri) { BROWSER_LOGD("%s: newUri=%s", __func__, newUri.c_str()); elm_entry_entry_set(m_entry, elm_entry_utf8_to_markup(newUri.c_str())); } -void SimpleURI::setFavIcon(std::shared_ptr< tizen_browser::tools::BrowserImage > favicon) +void URIEntry::setFavIcon(std::shared_ptr< tizen_browser::tools::BrowserImage > favicon) { BROWSER_LOGD("[%s:%d] faviconType:%d ", __PRETTY_FUNCTION__, __LINE__, favicon->imageType); - if(favicon->imageType != tools::BrowserImage::ImageTypeNoImage){ + if (favicon->imageType != tools::BrowserImage::ImageTypeNoImage) { m_favicon = tizen_browser::tools::EflTools::getEvasImage(favicon, m_entry_layout); evas_object_image_fill_set(m_favicon, 0, 0, 36, 36); evas_object_resize(m_favicon, 36, 36); @@ -116,30 +123,30 @@ void SimpleURI::setFavIcon(std::shared_ptr< tizen_browser::tools::BrowserImage > } } -void SimpleURI::setCurrentFavIcon() +void URIEntry::setCurrentFavIcon() { m_currentIconType = IconTypeFav; elm_object_signal_emit(m_entry_layout, "show_favicon", "model"); } -void SimpleURI::setSearchIcon() +void URIEntry::setSearchIcon() { m_currentIconType = IconTypeSearch; elm_object_signal_emit(m_entry_layout, "set_search_icon", "model"); } -void SimpleURI::setDocIcon() +void URIEntry::setDocIcon() { m_currentIconType = IconTypeDoc; elm_object_signal_emit(m_entry_layout, "set_doc_icon", "model"); } -SimpleURI::IconType SimpleURI::getCurrentIconTyep() +URIEntry::IconType URIEntry::getCurrentIconTyep() { return m_currentIconType; } -void SimpleURI::selectWholeText() +void URIEntry::selectWholeText() { m_oryginalEntryText = elm_entry_markup_to_utf8(elm_entry_entry_get(m_entry)); if (!m_entrySelectedAllFirst && !m_oryginalEntryText.empty()) { @@ -149,99 +156,99 @@ void SimpleURI::selectWholeText() } } -void SimpleURI::_uriEntryClicked(void *data, Evas_Object * /* obj */, void * /* event_info */) +void URIEntry::_uriEntryClicked(void* data, Evas_Object* /* obj */, void* /* event_info */) { BROWSER_LOGD("%s", __func__); - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); self->selectWholeText(); } -void SimpleURI::_uriEntryBtnClicked(void *data, Evas_Object */*obj*/, void */*event_info*/) +void URIEntry::_uriEntryBtnClicked(void* data, Evas_Object* /*obj*/, void* /*event_info*/) { - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); elm_object_focus_set(self->m_entry, EINA_TRUE); self->selectWholeText(); elm_object_signal_emit(self->m_entry_layout, "mouse,in", "over"); } -void SimpleURI::activated(void * /* data */, Evas_Object * /* obj */, void */*event_info*/) +void URIEntry::activated(void* /* data */, Evas_Object* /* obj */, void* /*event_info*/) { BROWSER_LOGD("%s", __func__); } -void SimpleURI::aborted(void *data, Evas_Object * /* obj */, void */*event_info*/) +void URIEntry::aborted(void* data, Evas_Object* /* obj */, void* /*event_info*/) { BROWSER_LOGD("%s", __func__); - SimpleURI *self = reinterpret_cast(data); + URIEntry* self = reinterpret_cast(data); self->editingCanceled(); } -void SimpleURI::preeditChange(void * /* data */, Evas_Object * /* obj */, void */*event_info*/) +void URIEntry::preeditChange(void* /* data */, Evas_Object* /* obj */, void* /*event_info*/) { BROWSER_LOGD("%s", __func__); } -void SimpleURI::changedUser(void *data, Evas_Object * /* obj */, void */*event_info*/) +void URIEntry::changedUser(void* data, Evas_Object* /* obj */, void* /*event_info*/) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - SimpleURI *self = reinterpret_cast(data); + URIEntry* self = reinterpret_cast(data); std::string entry(elm_entry_markup_to_utf8(elm_entry_entry_get(self->m_entry))); - if( (entry.find("http://")==0 ) - || (entry.find("https://")==0) - || (entry.find(".") != std::string::npos)){ + if ((entry.find("http://") == 0) + || (entry.find("https://") == 0) + || (entry.find(".") != std::string::npos)) { self->setDocIcon(); - }else {//if(entry.find(" ") != std::string::npos){ + } else {//if(entry.find(" ") != std::string::npos){ self->setSearchIcon(); } } -void SimpleURI::unfocused(void * data, Evas_Object *, void *) +void URIEntry::unfocused(void* data, Evas_Object*, void*) { BROWSER_LOGD("%s", __func__); - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); self->m_entrySelectedAllFirst = false; elm_object_signal_emit(self->m_entry_layout, "mouse,out", "over"); } -void SimpleURI::focused(void* data, Evas_Object* /* obj */, void* /* event_info */) +void URIEntry::focused(void* data, Evas_Object* /* obj */, void* /* event_info */) { - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); elm_object_signal_emit(self->m_entry_layout, "mouse,in", "over"); BROWSER_LOGD("%s", __func__); } -void SimpleURI::fixed_entry_key_down_handler(void* data, Evas* /*e*/, Evas_Object* /*obj*/, void* event_info) +void URIEntry::fixed_entry_key_down_handler(void* data, Evas* /*e*/, Evas_Object* /*obj*/, void* event_info) { BROWSER_LOGD("%s", __func__); - Evas_Event_Key_Down *ev = static_cast(event_info); + Evas_Event_Key_Down* ev = static_cast(event_info); if (!data || !ev || !ev->keyname) return; - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); if (keynameClear == ev->keyname) { elm_entry_entry_set(self->m_entry, ""); return; } - if ( keynameSelect == ev->keyname - || keynameReturn == ev->keyname - || keynameKP_Enter == ev->keyname) { + if (keynameSelect == ev->keyname + || keynameReturn == ev->keyname + || keynameKP_Enter == ev->keyname) { self->editingCompleted(); return; } - if( keynameEsc == ev->keyname){ + if (keynameEsc == ev->keyname) { self->editingCanceled(); elm_object_focus_set(self->m_entryBtn, EINA_TRUE); return; } } -void SimpleURI::editingCompleted() +void URIEntry::editingCompleted() { BROWSER_LOGD("%s", __func__); - char * text = elm_entry_markup_to_utf8(elm_entry_entry_get(m_entry)); + char* text = elm_entry_markup_to_utf8(elm_entry_entry_get(m_entry)); std::string userString(text); free(text); @@ -249,88 +256,88 @@ void SimpleURI::editingCompleted() uriChanged(rewriteURI(userString)); } -std::string SimpleURI::rewriteURI(const std::string& url) +std::string URIEntry::rewriteURI(const std::string& url) { BROWSER_LOGD("%s: %s", __PRETTY_FUNCTION__, url.c_str()); boost::regex urlRegex(R"(^(https?|ftp)://[^\s/$.?#].[^\s]*$)"); - if(!url.empty() && url != "about:blank" && url != "about:home") - if(boost::regex_match(url, urlRegex)) + if (!url.empty() && url != "about:blank" && url != "about:home") { + if (boost::regex_match(url, urlRegex)) return url; - else if(boost::regex_match( std::string("http://") + url, urlRegex) && url.find(".") != std::string::npos) + else if (boost::regex_match(std::string("http://") + url, urlRegex) && url.find(".") != std::string::npos) return std::string("http://") + url; - else - { + else { std::string searchString("http://www.google.com/search?q="); searchString += url; - std::replace( searchString.begin(), searchString.end(), ' ', '+'); + std::replace(searchString.begin(), searchString.end(), ' ', '+'); BROWSER_LOGD("[%s:%d] Search string: %s", __PRETTY_FUNCTION__, __LINE__, searchString.c_str()); return searchString; } + } return url; } -void SimpleURI::editingCanceled() +void URIEntry::editingCanceled() { BROWSER_LOGD("[%s:%d] oryinal URL: %s ", __PRETTY_FUNCTION__, __LINE__, m_oryginalEntryText.c_str()); - if(!m_oryginalEntryText.empty()){ + if (!m_oryginalEntryText.empty()) { elm_entry_entry_set(m_entry, elm_entry_utf8_to_markup(m_oryginalEntryText.c_str())); - m_oryginalEntryText=""; + m_oryginalEntryText = ""; } elm_entry_input_panel_hide(m_entry); setCurrentFavIcon(); } -void SimpleURI::AddAction(sharedAction action) +void URIEntry::AddAction(sharedAction action) { m_actions.push_back(action); } -std::list SimpleURI::actions() const +std::list URIEntry::actions() const { return m_actions; } -void SimpleURI::clearFocus() +void URIEntry::clearFocus() { elm_object_focus_set(m_entry, EINA_FALSE); } -void SimpleURI::setFocus() +void URIEntry::setFocus() { elm_object_focus_set(m_entryBtn, EINA_TRUE); } -bool SimpleURI::hasFocus() const +bool URIEntry::hasFocus() const { - return elm_object_focus_get(m_entry)==EINA_TRUE ? true : false; + return elm_object_focus_get(m_entry) == EINA_TRUE ? true : false; } -void SimpleURI::__cb_mouse_in(void */*data*/, Evas */*e*/, Evas_Object *obj, void */*event_info*/) +void URIEntry::__cb_mouse_in(void* /*data*/, Evas* /*e*/, Evas_Object* obj, void* /*event_info*/) { elm_object_focus_set(obj, EINA_TRUE); } -void SimpleURI::__cb_mouse_out(void */*data*/, Evas */*e*/, Evas_Object *obj, void */*event_info*/) +void URIEntry::__cb_mouse_out(void* /*data*/, Evas* /*e*/, Evas_Object* obj, void* /*event_info*/) { elm_object_focus_set(obj, EINA_FALSE); } -void SimpleURI::focusedBtn(void* data, Evas_Object* /*obj*/, void* /*event_info*/) +void URIEntry::focusedBtn(void* data, Evas_Object* /*obj*/, void* /*event_info*/) { - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); elm_object_signal_emit(self->m_entry_layout, "mouse,in", "over"); } -void SimpleURI::unfocusedBtn(void* data, Evas_Object* /*obj*/, void* /*event_info*/) +void URIEntry::unfocusedBtn(void* data, Evas_Object* /*obj*/, void* /*event_info*/) { - SimpleURI * self = static_cast(data); + URIEntry* self = static_cast(data); elm_object_signal_emit(self->m_entry_layout, "mouse,out", "over"); } -void SimpleURI::setDisabled(bool disabled) +void URIEntry::setDisabled(bool disabled) { if (disabled) { clearFocus(); diff --git a/services/SimpleURI/SimpleURI.h b/services/WebPageUI/URIEntry.h similarity index 54% rename from services/SimpleURI/SimpleURI.h rename to services/WebPageUI/URIEntry.h index e28abed..691701e 100644 --- a/services/SimpleURI/SimpleURI.h +++ b/services/WebPageUI/URIEntry.h @@ -14,43 +14,36 @@ * limitations under the License. */ -#ifndef SIMPLEURI_H -#define SIMPLEURI_H +#ifndef URIENTRY_H +#define URIENTRY_H #include #include #include "memory.h" -#include "AbstractUIComponent.h" -#include "AbstractService.h" -#include "ServiceFactory.h" -#include "service_macros.h" #include "BasicUI/Action.h" #include "BrowserImage.h" #include "EflTools.h" -namespace tizen_browser{ -namespace base_ui{ +namespace tizen_browser { +namespace base_ui { -class BROWSER_EXPORT SimpleURI - : public tizen_browser::core::AbstractService -{ +class URIEntry { public: - enum IconType{ + enum IconType { IconTypeSearch - ,IconTypeDoc - ,IconTypeFav + , IconTypeDoc + , IconTypeFav }; - SimpleURI(); - ~SimpleURI(); - Evas_Object *getContent(Evas_Object *main_layout); - virtual std::string getName(); + URIEntry(); + ~URIEntry(); + void init(Evas_Object* parent); + Evas_Object* getContent(); - Evas_Object * getContent() { return m_entry_layout;}; void changeUri(const std::string); - boost::signals2::signal uriChanged; + boost::signals2::signal uriChanged; void setFavIcon(std::shared_ptr favicon); void setCurrentFavIcon(); @@ -87,14 +80,14 @@ public: void setDisabled(bool disabled); private: - static void activated(void *data, Evas_Object *obj, void *event_info); - static void aborted(void *data, Evas_Object *obj, void *event_info); - static void preeditChange(void *data, Evas_Object *obj, void *event_info); - static void changedUser(void *data, Evas_Object *obj, void *event_info); - static void focused(void *data, Evas_Object *obj, void *event_info); - static void unfocused(void *data, Evas_Object *obj, void *event_info); - static void fixed_entry_key_down_handler(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void _uriEntryBtnClicked(void *data, Evas_Object *obj, void *event_info); + static void activated(void* data, Evas_Object* obj, void* event_info); + static void aborted(void* data, Evas_Object* obj, void* event_info); + static void preeditChange(void* data, Evas_Object* obj, void* event_info); + static void changedUser(void* data, Evas_Object* obj, void* event_info); + static void focused(void* data, Evas_Object* obj, void* event_info); + static void unfocused(void* data, Evas_Object* obj, void* event_info); + static void fixed_entry_key_down_handler(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void _uriEntryBtnClicked(void* data, Evas_Object* obj, void* event_info); void editingCompleted(); void editingCanceled(); @@ -106,20 +99,21 @@ private: */ std::string rewriteURI(const std::string& url); - static void _uriEntryClicked(void *data, Evas_Object *obj, void *event_info); + static void _uriEntryClicked(void* data, Evas_Object* obj, void* event_info); - static void __cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void __cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); - static void focusedBtn(void *data, Evas_Object *obj, void *event_info); - static void unfocusedBtn(void *data, Evas_Object *obj, void *event_info); + static void __cb_mouse_in(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void __cb_mouse_out(void* data, Evas* e, Evas_Object* obj, void* event_info); + static void focusedBtn(void* data, Evas_Object* obj, void* event_info); + static void unfocusedBtn(void* data, Evas_Object* obj, void* event_info); private: + Evas_Object* m_parent; IconType m_currentIconType; std::list m_actions; - Evas_Object *m_entry; - Evas_Object *m_favicon; - Evas_Object *m_entry_layout; - Evas_Object *m_entryBtn; + Evas_Object* m_entry; + Evas_Object* m_favicon; + Evas_Object* m_entry_layout; + Evas_Object* m_entryBtn; bool m_entrySelectedAllFirst; std::string m_oryginalEntryText; bool m_searchTextEntered; @@ -129,4 +123,4 @@ private: } } -#endif // SIMPLEURI_H +#endif // URIENTRY_H diff --git a/services/WebPageUI/WebPageUI.cpp b/services/WebPageUI/WebPageUI.cpp new file mode 100644 index 0000000..0982bf3 --- /dev/null +++ b/services/WebPageUI/WebPageUI.cpp @@ -0,0 +1,307 @@ +/* + * Copyright (c) 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/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include "WebPageUI.h" +#include "BrowserLogger.h" +#include "ServiceManager.h" +#include "BrowserAssert.h" + +namespace tizen_browser { +namespace base_ui { + +EXPORT_SERVICE(WebPageUI, "org.tizen.browser.webpageui") + +WebPageUI::WebPageUI() + : m_parent(nullptr) + , m_mainLayout(nullptr) + , m_errorLayout(nullptr) + , m_progressBar(nullptr) + , m_URIEntry(new URIEntry()) + , m_homePageActive(false) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); +} + +WebPageUI::~WebPageUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); +} + +void WebPageUI::init(Evas_Object* parent) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(parent); + m_parent = parent; +} + +Evas_Object* WebPageUI::getContent() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + if (!m_mainLayout) { + createLayout(); + } + return m_mainLayout; +} + +void WebPageUI::showUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); +} + +void WebPageUI::hideUI() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); +} + +void WebPageUI::loadStarted() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + showProgressBar(); + elm_object_signal_emit(m_URIEntry->getContent(), "shiftright_uribg", "ui"); + elm_object_signal_emit(m_mainLayout, "shiftright_uri", "ui"); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_stopLoading); +} + +void WebPageUI::progressChanged(double progress) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (progress == 1.0) { + hideProgressBar(); + } else { + elm_progressbar_value_set(m_progressBar, progress); + } +} + +void WebPageUI::loadFinished() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + elm_object_signal_emit(m_mainLayout, "hide_progressbar_bg", "ui"); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_reload); +} + +bool WebPageUI::isErrorPageActive() +{ + return elm_object_part_content_get(m_mainLayout, "web_view") == m_errorLayout; +} + +void WebPageUI::setMainContent(Evas_Object* content) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(content); + hideWebView(); + elm_object_part_content_set(m_mainLayout, "web_view", content); + evas_object_show(content); +} + +void WebPageUI::switchViewToErrorPage() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_homePageActive = false; + setMainContent(m_errorLayout); + evas_object_show(m_leftButtonBar->getContent()); + setErrorButtons(); +} + +void WebPageUI::switchViewToWebPage(Evas_Object* content, const std::string uri) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_homePageActive = false; + setMainContent(content); + evas_object_show(m_leftButtonBar->getContent()); + updateURIBar(uri); +} + +void WebPageUI::switchViewToQuickAccess(Evas_Object* content) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_homePageActive = true; + setMainContent(content); + + m_URIEntry->changeUri(""); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_reload); + evas_object_hide(m_leftButtonBar->getContent()); + elm_object_signal_emit(m_mainLayout, "shiftback_uri", "ui"); + elm_object_signal_emit(m_URIEntry->getContent(), "shiftback_uribg", "ui"); + hideProgressBar(); +} + +void WebPageUI::faviconClicked(void* data, Evas_Object*, const char*, const char*) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + WebPageUI* self = reinterpret_cast(data); + if (!self->isHomePageActive() && !self->isErrorPageActive()) { + self->getURIEntry().clearFocus(); + } +} + +void WebPageUI::setTabsNumber(int tabs) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + if (tabs == 0) { + elm_object_part_text_set(m_rightButtonBar->getContent(), "tabs_number", ""); + } else { + elm_object_part_text_set(m_rightButtonBar->getContent(), "tabs_number", (boost::format("%1%") % tabs).str().c_str()); + } +} + +void WebPageUI::createLayout() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_parent); + // create web layout + m_mainLayout = elm_layout_add(m_parent); + evas_object_size_hint_weight_set(m_mainLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_layout_file_set(m_mainLayout, edjePath("WebPageUI/WebPageUI.edj").c_str(), "main_layout"); + + createErrorLayout(); + createActions(); + + // left buttons + m_leftButtonBar = std::unique_ptr(new ButtonBar(m_mainLayout, "WebPageUI/LeftButtonBar.edj", "left_button_bar")); + m_leftButtonBar->addAction(m_back, "prev_button"); + m_leftButtonBar->addAction(m_forward, "next_button"); + m_leftButtonBar->addAction(m_reload, "refresh_stop_button"); + + //register action that will be used later by buttons" + m_leftButtonBar->registerEnabledChangedCallback(m_stopLoading, "refresh_stop_button"); + + // right buttons + m_rightButtonBar = std::unique_ptr(new ButtonBar(m_mainLayout, "WebPageUI/RightButtonBar.edj", "right_button_bar")); + m_rightButtonBar->addAction(m_tab, "tab_button"); + m_rightButtonBar->addAction(m_showMoreMenu, "setting_button"); + + // progress bar + m_progressBar = elm_progressbar_add(m_mainLayout); + elm_object_style_set(m_progressBar, "play_buffer"); + + //URL bar (Evas Object is shipped by URIEntry object) + m_URIEntry->init(m_mainLayout); + elm_object_part_content_set(m_mainLayout, "uri_entry", m_URIEntry->getContent()); + elm_object_part_content_set(m_mainLayout, "uri_bar_buttons_left", m_leftButtonBar->getContent()); + elm_object_part_content_set(m_mainLayout, "uri_bar_buttons_right", m_rightButtonBar->getContent()); + + elm_layout_signal_callback_add(m_URIEntry->getContent(), "slide_websearch", "elm", faviconClicked, this); + + connectActions(); +} + +void WebPageUI::createErrorLayout() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_errorLayout = elm_layout_add(m_mainLayout); + evas_object_size_hint_weight_set(m_errorLayout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_errorLayout, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_layout_file_set(m_errorLayout, edjePath("WebPageUI/ErrorMessage.edj").c_str(), "error_message"); +} + +void WebPageUI::createActions() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_back = sharedAction(new Action("Back")); + m_back->setToolTip("Previous"); + m_back->setIcon("browser/toolbar_prev"); + + m_forward = sharedAction(new Action("Next")); + m_forward->setToolTip("Next"); + m_forward->setIcon("browser/toolbar_next"); + + m_stopLoading = sharedAction(new Action("Stop")); + m_stopLoading->setToolTip("Stop"); + m_stopLoading->setIcon("browser/toolbar_stop"); + + m_reload = sharedAction(new Action("Reload")); + m_reload->setToolTip("Reload"); + m_reload->setIcon("browser/toolbar_reload"); + m_tab = sharedAction(new Action("Tabs")); + m_tab->setToolTip("Tab page"); + m_tab->setIcon("browser/toolbar_tab"); + + m_showMoreMenu = sharedAction(new Action("Settings")); + m_showMoreMenu->setToolTip("Settings"); + m_showMoreMenu->setIcon("browser/toolbar_setting"); +} + +void WebPageUI::connectActions() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + //left bar + m_back->triggered.connect(boost::bind(&WebPageUI::backPageConnect, this)); + m_forward->triggered.connect(boost::bind(&WebPageUI::forwardPageConnect, this)); + m_stopLoading->triggered.connect(boost::bind(&WebPageUI::stopLoadingPageConnect, this)); + m_reload->triggered.connect(boost::bind(&WebPageUI::reloadPageConnect, this)); + + //right bar + m_tab->triggered.connect(boost::bind(&WebPageUI::showTabUIConnect, this)); + m_showMoreMenu->triggered.connect(boost::bind(&WebPageUI::showMoreMenuConnect, this)); +} + +void WebPageUI::showProgressBar() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + elm_object_signal_emit(m_mainLayout, "show_progressbar_bg", "ui"); + elm_object_part_content_set(m_mainLayout, "progress_bar", m_progressBar); +} + +void WebPageUI::hideProgressBar() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + elm_object_signal_emit(m_mainLayout, "hide_progressbar_bg", "ui"); + elm_progressbar_value_set(m_progressBar, 0.0); + elm_object_part_content_unset(m_mainLayout, "progress_bar"); + evas_object_hide(m_progressBar); +} + +void WebPageUI::hideWebView() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + evas_object_hide(elm_object_part_content_get(m_mainLayout, "web_view")); + elm_object_part_content_unset(m_mainLayout, "web_view"); +} + +void WebPageUI::setErrorButtons() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_reload); + m_stopLoading->setEnabled(false); + m_reload->setEnabled(true); + m_forward->setEnabled(false); + evas_object_hide(m_progressBar); +} + +void WebPageUI::updateURIBar(const std::string& uri) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + m_URIEntry->changeUri(uri); + m_leftButtonBar->setActionForButton("refresh_stop_button", m_reload); + + m_stopLoading->setEnabled(true); + m_reload->setEnabled(true); + hideProgressBar(); +} + +std::string WebPageUI::edjePath(const std::string& file) +{ + return std::string(EDJE_DIR) + file; +} + + + +} // namespace tizen_browser +} // namespace base_ui \ No newline at end of file diff --git a/services/WebPageUI/WebPageUI.h b/services/WebPageUI/WebPageUI.h new file mode 100644 index 0000000..0e77b6c --- /dev/null +++ b/services/WebPageUI/WebPageUI.h @@ -0,0 +1,108 @@ +/* + * Copyright (c) 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/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef WEBPAGEUI_H +#define WEBPAGEUI_H + +#include +#include +#include "AbstractService.h" +#include "AbstractUIComponent.h" +#include "ServiceFactory.h" +#include "service_macros.h" +#include "ButtonBar.h" +#include "URIEntry.h" + +namespace tizen_browser { +namespace base_ui { + +class BROWSER_EXPORT WebPageUI : public tizen_browser::core::AbstractService, public tizen_browser::interfaces::AbstractUIComponent { +public: + WebPageUI(); + virtual ~WebPageUI(); + virtual std::string getName(); + virtual void init(Evas_Object* parent); + virtual Evas_Object* getContent(); + virtual void showUI(); + virtual void hideUI(); + void loadStarted(); + void progressChanged(double progress); + void loadFinished(); + bool isErrorPageActive(); + bool isHomePageActive() { return m_homePageActive; } + void switchViewToErrorPage(); + void switchViewToWebPage(Evas_Object* content, const std::string uri); + void switchViewToQuickAccess(Evas_Object* content); + URIEntry& getURIEntry() const { return *m_URIEntry.get(); } + bool isBackButtonEnabled() { return m_back->isEnabled(); } + void setTabsNumber(int tabs); + void setBackButtonEnabled(bool enabled) { m_back->setEnabled(enabled); } + void setForwardButtonEnabled(bool enabled) { m_forward->setEnabled(enabled); } + void setReloadButtonEnabled(bool enabled) { m_reload->setEnabled(enabled); } + void setStopButtonEnabled(bool enabled) { m_stopLoading->setEnabled(enabled); } + void setMoreMenuButtonEnabled(bool enabled) { m_showMoreMenu->setEnabled(enabled); } + + boost::signals2::signal backPage; + boost::signals2::signal forwardPage; + boost::signals2::signal stopLoadingPage; + boost::signals2::signal reloadPage; + boost::signals2::signal showTabUI; + boost::signals2::signal showMoreMenu; + + static void faviconClicked(void* data, Evas_Object* obj, const char* emission, const char* source); +private: + void createLayout(); + void createErrorLayout(); + void createActions(); + void connectActions(); + void showProgressBar(); + void hideProgressBar(); + void hideWebView(); + void setErrorButtons(); + void setMainContent(Evas_Object* content); + void updateURIBar(const std::string& uri); + std::string edjePath(const std::string& file); + + // wrappers to call singal as a reaction to other signal + void backPageConnect() { backPage(); } + void forwardPageConnect() { forwardPage(); } + void stopLoadingPageConnect() { stopLoadingPage(); } + void reloadPageConnect() { reloadPage(); } + void showTabUIConnect() { showTabUI(); } + void showMoreMenuConnect() { showMoreMenu(); } + + Evas_Object* m_parent; + Evas_Object* m_mainLayout; + Evas_Object* m_errorLayout; + Evas_Object* m_progressBar; + std::unique_ptr m_leftButtonBar; + std::unique_ptr m_rightButtonBar; + std::unique_ptr m_URIEntry; + bool m_homePageActive; + + sharedAction m_back; + sharedAction m_forward; + sharedAction m_stopLoading; + sharedAction m_reload; + sharedAction m_tab; + sharedAction m_showMoreMenu; +}; + + +} // namespace tizen_browser +} // namespace base_ui + +#endif // WEBPAGEUI_H diff --git a/services/WebPageUI/edc/ErrorMessage.edc b/services/WebPageUI/edc/ErrorMessage.edc new file mode 100644 index 0000000..04cf932 --- /dev/null +++ b/services/WebPageUI/edc/ErrorMessage.edc @@ -0,0 +1,179 @@ + +collections { + images { + image: "web_browsing_icon_error.png" COMP; + } + styles { + style { + name: "mssage_style"; + base: "font=Sans font_size=35 color=#d3d3d3 wrap=word align=0.5"; + } + style { + name: "mssage_hint_style"; + base: "font=Sans font_size=24 color=#868686 wrap=word align=0.5"; + } + } + group{ + name: "error_message"; + parts{ + part{ + name: "message_background"; + type: RECT; + mouse_events: 1; + description{ + state: "default" 0.0; + visible: 1; + rel1.relative: 0 0; + rel2.relative: 1 1; + color: 42 50 64 255; + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "error_message_background"; + type:RECT; + description{ + state: "default" 0.0; + visible: 1; + min: 1582 730; + max: 1582 730; + fixed: 1 1; + align: 0.5 0.5; + color: 30 38 50 153; + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "err_ico"; + type: IMAGE; + description{ + state: "default" 0.0; + visible: 1; + min: 140 140; + max:140 140; + fixed: 1 1; + align: 0.5 0; + rel1{ + relative: 0 0; + offset:0 163; + to: "error_message_background"; + } + rel2{ + relative: 1 1; + to: "error_message_background"; + } + image{ + normal: "web_browsing_icon_error.png"; + } + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "error_text"; + type: TEXTBLOCK; + description{ + state: "default" 0.0; + visible: 1; + fixed: 1 1; + min: 1502 96; + max: 1502 96; + //color: 211 211 211 255; + align: 0.5 0; + rel1{ + relative: 0 1; + to_x: "error_message_background"; + to_y: "err_ico"; + } + rel2{ + relative: 1 1; + to: "error_message_background"; + } + text{ + style: "mssage_style"; + text: "Server not found.
Please check the followings:"; + //min: 0 0; + //max: 1 1; + //align: 1 0; + //size: 35; + } + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "error_hint"; + type: TEXTBLOCK; + description{ + state: "default" 0.0; + visible: 1; + fixed: 1 1; + min: 1502 117; + max: 1502 117; + color: 134 134 134 255; + align: 0.5 0; + rel1{ + relative: 0 1; + to_x: "error_message_background"; + to_y: "error_text"; + } + rel2{ + relative: 1 1; + to: "error_message_background"; + } + text{ + max: 0 1; + style: "mssage_hint_style"; + text: "Check for any typing error in URL.
" + "Check your network settings.
" + "Try again later.
" + "Click refresh to reload."; + } + } + description{ + state: "visibleError" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + }//parts + programs{ + program{ + name: "show_error"; + signal: "show_error"; + source: "model"; + action: STATE_SET "visibleError" 0.0; + target: "message_background"; + target: "error_message_background"; + target: "err_ico"; + target: "error_text"; + target: "error_hint"; + } + program{ + name: "hide_error"; + signal: "hide_error"; + source: "model"; + action: STATE_SET "default" 0.0; + target: "message_background"; + target: "error_message_background"; + target: "err_ico"; + target: "error_text"; + target: "error_hint"; + } + }//programs +} +} diff --git a/services/SimpleUI/edc/ImageButton.edc b/services/WebPageUI/edc/ImageButton.edc similarity index 100% rename from services/SimpleUI/edc/ImageButton.edc rename to services/WebPageUI/edc/ImageButton.edc diff --git a/services/WebPageUI/edc/LeftButtonBar.edc b/services/WebPageUI/edc/LeftButtonBar.edc new file mode 100644 index 0000000..08c714a --- /dev/null +++ b/services/WebPageUI/edc/LeftButtonBar.edc @@ -0,0 +1,103 @@ +#include "ImageButton.edc" +#include "Spacer.edc" + +collections { + + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_prev", 82, 102, "btn_bar_back_nor.png") + + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_next", 82, 102, "btn_bar_forward_nor.png") + + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_reload", 82, 102, "btn_bar_reload_nor.png") + + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_stop", 82, 102, "btn_bar_stop_nor.png") + + group { + name: "left_button_bar"; + + parts { + + part { + name: "prev_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 1 1; + min: 70 70; + max: 70 70; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + ADD_SPACER("spacer_1", "prev_button", 10, 70) + + part { + name: "next_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 1 1; + min: 70 70; + max: 70 70; + rel1 { relative: 1.0 0.0; to: "spacer_1"; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + ADD_SPACER("spacer_2", "next_button", 10, 70) + + part { + name: "refresh_stop_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 1 1; + min: 70 70; + max: 70 70; + rel1 { relative: 1.0 0.0; to: "spacer_2"; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + } +} +} diff --git a/services/WebPageUI/edc/RightButtonBar.edc b/services/WebPageUI/edc/RightButtonBar.edc new file mode 100644 index 0000000..242bd94 --- /dev/null +++ b/services/WebPageUI/edc/RightButtonBar.edc @@ -0,0 +1,86 @@ +#include "ImageButton.edc" +#include "Spacer.edc" +collections { + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_tab", 82, 102, "btn_bar_manager_nor.png") + FOUR_STATE_IMAGE_BUTTON("browser/toolbar_setting", 82, 102, "btn_bar_more_nor.png") + group { + name: "right_button_bar"; + parts { + part { + name: "tab_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + min: 70 70; + max: 70 70; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "tabs_number"; + type: TEXT; + scale: 1; + repeat_events: 1; + description{ + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + min: 70 70; + max: 70 70; + color: 86 86 86 255; + rel1 { relative: 0.0 0.0; to: "tab_button"; offset: 5 13; } + rel2 { relative: 1.0 1.0; to: "tab_button"; } + text { + text: ""; + font: "Tizen:style=Bold"; + size: 19; + align: 0.5 0.5; + } + } + } + ADD_SPACER("spacer_1", "tab_button", 10, 70) + part { + name: "setting_button"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.0 0.0; + min: 70 70; + max: 70 70; + fixed: 1 1; + rel1 { relative: 1.0 0.0; to: "spacer_1"; } + rel2 { relative: 0.0 0.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } +} +} diff --git a/services/SimpleUI/edc/Spacer.edc b/services/WebPageUI/edc/Spacer.edc similarity index 100% rename from services/SimpleUI/edc/Spacer.edc rename to services/WebPageUI/edc/Spacer.edc diff --git a/services/WebPageUI/edc/URIEntry.edc b/services/WebPageUI/edc/URIEntry.edc new file mode 100644 index 0000000..f3f1da0 --- /dev/null +++ b/services/WebPageUI/edc/URIEntry.edc @@ -0,0 +1,296 @@ +#define URI_INPUTBOX_LENGTH 1720 +#define URI_INPUTBOX_LENGTH_SMALL 1460 +#define URI_INPUTBOX_WIDTH 82 +collections { + group { + name: "elm/entry/selection/browser_entry"; + parts { + part { + name: "bg"; + scale:1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + } + } + } + group { + name: "elm/entry/cursor/browser_entry"; + parts { + part { + name: "bg"; + scale:1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 22 120 237 255; + min: 2 36; + max: 2 36; + visible: 0; + } + description { + state: "focused" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "focused"; + signal: "elm,action,focus"; + source: "elm"; + action: STATE_SET "focused" 0.0; + target: "bg"; + } + program { + name: "unfocused"; + signal: "elm,action,unfocus"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg"; + } + } + } + group { + name: "elm/entry/base-single/uri_entry"; + styles { + style { + name: "browser-entry-uri-style-unselected"; + base: "font=Sans:style=SVD_Medium font_size="42" wrap=none color=#969696"; + } + style { + name: "browser-entry-uri-style-selected"; + base: "font=Sans:style=SVD_Medium font_size="42" wrap=none color=#4088d3"; + } + } + data { + item: focus_highlight "off"; + } + parts { + + part { + name: "bg"; + scale:1; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + } + + part { + name: "elm.guide"; + scale:1; + type: TEXTBLOCK; + mouse_events: 0; + description { + state: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + align: 0.0 0.0; + text { + style: "browser-entry-uri-style-unselected"; + min: 0 1; + } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "label.text.clip"; + scale:1; + type: RECT; + description { + state: "default" 0.0; + } + } + part { + name: "elm.text"; + scale:1; + multiline: 0; + entry_mode: EDITABLE; + select_mode: DEFAULT; + cursor_mode: BEFORE; + type: TEXTBLOCK; + clip_to: "label.text.clip"; + source: "elm/entry/selection/browser_entry"; + source4: "elm/entry/cursor/browser_entry"; + description { + state: "default" 0.0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + align: 0.0 0.0; + text { + style: "browser-entry-uri-style-selected"; + min: 0 1; + } + } + } + } + programs { + program { + name: "focus"; + signal: "load"; + source: ""; + action: FOCUS_SET; + target: "elm.text"; + } + program { + name: "gdisabled"; + signal: "elm,guide,disabled"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.guide"; + } + program { + name: "genabled"; + signal: "elm,guide,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.guide"; + } + } + }//group + + group { + name: "elm/button/base/entry_btn"; + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + color: 0 0 0 0; + visible: 1; + } + } + } + programs { + program { + name: "mouse_click"; + signal: "mouse,clicked,1"; + source: "bg"; + script { + emit("elm,action,click", ""); + } + } + } + } + + + group { + name: "uri_entry_layout"; + parts { + part { + name: "spacer_1"; + type: SPACER; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 0.0 0.0; offset: 15 0; } + align: 0.0 0.0; + fixed: 1 1; + min: 1 102; + max: 1 102; + } + } + part { + name: "uri_entry_swallow"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + color: 255 255 255 255; + align: 0.0 0.0; + min: URI_INPUTBOX_LENGTH URI_INPUTBOX_WIDTH; + max: URI_INPUTBOX_LENGTH URI_INPUTBOX_WIDTH; + fixed: 1 1; + rel1 { relative: 1 0; to: "spacer_1"; } + rel2 { relative: 1 1; to: "spacer_1"; } + } + description { + state: "moveright" 0.0; + inherit: "default" 0.0; + visible: 1; + min: URI_INPUTBOX_LENGTH_SMALL URI_INPUTBOX_WIDTH; + max: URI_INPUTBOX_LENGTH_SMALL URI_INPUTBOX_WIDTH; + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "over"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + rel1 { relative: 0 0; to: "spacer_1"; } + rel2 { relative: 1 1; to: "spacer_1"; } + } + } + part { + name: "uri_entry_btn"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + rel1.to: "uri_entry_swallow"; + rel2.to: "uri_entry_swallow"; + } + } + } + programs { + program { + name: "shiftright_uribarbg"; + signal: "shiftright_uribg"; + source: "ui"; + action: STATE_SET "moveright" 0.0; + target: "uri_entry_swallow"; + } + program { + name: "shiftback_uribarbg"; + signal: "shiftback_uribg"; + source: "ui"; + action: STATE_SET "default" 0.0; + target: "uri_entry_swallow"; + } + program { + name: "mouse_in_entry"; + source: "over"; + signal: "mouse,in"; + action: STATE_SET "focused" 0.0; + target: "spacer_1"; + } + program { + name: "mouse_out_entry"; + source: "over"; + signal: "mouse,out"; + action: STATE_SET "default" 0.0; + target: "spacer_1"; + } + } +} +} diff --git a/services/WebPageUI/edc/WebPageUI.edc b/services/WebPageUI/edc/WebPageUI.edc new file mode 100644 index 0000000..a2de43b --- /dev/null +++ b/services/WebPageUI/edc/WebPageUI.edc @@ -0,0 +1,318 @@ +#define URI_LENGTH 1720 +#define URI_LENGTH_SHORT 1460 +#define URI_WIDTH 82 +#include "Spacer.edc" +#define DEBUG_RECT_OVER(over_part, r, g, b) \ + part { name: __CONCAT("dbg_rect_at_", __stringify(__LINE__)); \ + \ +scale:1; \ + type : RECT; \ + repeat_events: 1; \ + description { \ + state: "default" 0.0; \ + visible: 1; \ + color: r g b 255; \ + rel1 { to: over_part; relative: 0 0; } \ + rel2 { to: over_part; relative: 1 1; } \ + } \ + } +collections { + group { + name: "main_layout"; + images { + image: "web_shadow.png" COMP; + } + parts { + part { + name: "uri_bar_bg"; + type : RECT; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0 0; + min: 1920 104; + max: 1920 104; + color: 255 255 255 255; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 0.0; } + } + } + ADD_SPACER_OVER("left_spacer", "uri_bar_bg", 7, 104) + part { + name: "uri_bar_buttons_left"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0 0.5; + min: 246 102; + max: 246 102; + fixed: 1 1; + rel1 { relative: 1.0 1.0; to: "left_spacer"; } + rel2 { relative: 0.0 0.0; to: "left_spacer"; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + ADD_SPACER("left_buttons_spacer", "uri_bar_buttons_left", 0.5, 102) + part { + name: "uri_entry"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + min: URI_LENGTH URI_WIDTH; + max: URI_LENGTH URI_WIDTH; + fixed: 1 1; + rel1 { relative: 1.0 0.5; to: "left_spacer"; } + rel2 { relative: 1.0 0.5; to: "left_spacer"; } + } + description { + state: "moveright" 0.0; + inherit: "default" 0.0; + visible: 1; + min: URI_LENGTH_SHORT URI_WIDTH; + max: URI_LENGTH_SHORT URI_WIDTH; + rel1 { relative: 1.0 0.5; to: "left_buttons_spacer"; } + rel2 { relative: 1.0 0.5; to: "left_buttons_spacer"; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + ADD_SPACER("right_buttons_spacer", "uri_entry", 26, 102) + part { + name: "uri_bar_buttons_right"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.5; + min: 164 102; + max: 164 102; + fixed: 1 1; + rel1 { relative: 1.0 0.5; to: "right_buttons_spacer"; } + rel2 { relative: 1.0 0.5; to: "right_buttons_spacer"; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + ADD_SPACER("right_spacer", "uri_bar_buttons_right", 74, 102) + part { + name: "web_view"; + type : SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 0 0; + rel1 { relative: 0.0 1.0; to: "uri_bar_bg"; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "shadow"; + type: IMAGE; + scale: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 0 0; + min: 1920 14; + max: 1920 14; + image.normal: "web_shadow.png"; + rel1 { relative: 0.0 0.0; to: "web_view"; } + rel2 { relative: 1.0 1.0; } + } + } + part { + name: "progress_bar"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.0 0.0; + fixed: 0 0; + min: 1920 2; + max: 1920 2; + rel1 { + relative: 0.0 0.0; + offset: -12 -10; + to: "web_view"; + } + rel2 { relative: 1.0 1.0; } + } + } + part { + name: "progress_bar_light_bg"; + type: RECT; + repeat_events: 1; + description { + state: "default" 0.0; + fixed: 1 1; + min: 0 8; + max: 1920 8; + align: 0 0; + visible: 0; + rel1.to: "web_view"; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + color: 69 143 255 55; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part{ + name: "web_title_bar"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + min: 1920 87; + max: 1920 87; + fixed: 1 1; + align: 0 1; + rel1 { to: "web_view"; relative: 0.0 1.0; } + rel2 { to: "web_view"; relative: 1.0 1.0; } + } + } + + + part { + name: "popup_bg"; + type: RECT; + scale: 1; + mouse_events: 1; + description { + state: "default" 0.0; + visible: 0; + min: 1920 1080; + fixed: 1 1; + color: 100 100 100 128; + rel1 {relative: 0.0 0.0; } + rel2 {relative: 1.0 1.0; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + part { + name: "popup"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 0 0; + max: 700 800; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "web_view";} + rel2 { relative: 1.0 1.0; to: "web_view";} + fixed: 1 1; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + max: 1920 1080; + } + } + } + } + programs { + program { + name: "shiftright_uribar"; + signal: "shiftright_uri"; + source: "ui"; + action: STATE_SET "moveright" 0.0; + target: "uri_entry"; + } + program { + name: "shiftback_uribar"; + signal: "shiftback_uri"; + source: "ui"; + action: STATE_SET "default" 0.0; + target: "uri_entry"; + } + program { + name: "hide_progress"; + signal: "hide_progressbar_bg"; + source: "ui"; + action: STATE_SET "default" 0.0; + target: "progress_bar_light_bg"; + } + program { + name: "show_progress"; + signal: "show_progressbar_bg"; + source: "ui"; + action: STATE_SET "visible" 0.0; + target: "progress_bar_light_bg"; + } + program { + name: "show_popup"; + signal: "elm,state,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + transition: LINEAR 0.0; + target: "popup"; + target: "popup_bg"; + } + program { + name: "hide_popup"; + signal: "elm,state,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: LINEAR 0.0; + target: "popup"; + target: "popup_bg"; + } + } +} +} diff --git a/services/SimpleUI/images/btn_bar_back_nor.png b/services/WebPageUI/images/btn_bar_back_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_back_nor.png rename to services/WebPageUI/images/btn_bar_back_nor.png diff --git a/services/SimpleUI/images/btn_bar_forward_nor.png b/services/WebPageUI/images/btn_bar_forward_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_forward_nor.png rename to services/WebPageUI/images/btn_bar_forward_nor.png diff --git a/services/SimpleUI/images/btn_bar_manager_nor.png b/services/WebPageUI/images/btn_bar_manager_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_manager_nor.png rename to services/WebPageUI/images/btn_bar_manager_nor.png diff --git a/services/SimpleUI/images/btn_bar_more_nor.png b/services/WebPageUI/images/btn_bar_more_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_more_nor.png rename to services/WebPageUI/images/btn_bar_more_nor.png diff --git a/services/SimpleUI/images/btn_bar_reload_nor.png b/services/WebPageUI/images/btn_bar_reload_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_reload_nor.png rename to services/WebPageUI/images/btn_bar_reload_nor.png diff --git a/services/SimpleUI/images/btn_bar_stop_nor.png b/services/WebPageUI/images/btn_bar_stop_nor.png similarity index 100% rename from services/SimpleUI/images/btn_bar_stop_nor.png rename to services/WebPageUI/images/btn_bar_stop_nor.png diff --git a/services/SimpleUI/images/btn_bar_vertical_settings.png b/services/WebPageUI/images/btn_bar_vertical_settings.png similarity index 100% rename from services/SimpleUI/images/btn_bar_vertical_settings.png rename to services/WebPageUI/images/btn_bar_vertical_settings.png diff --git a/services/SimpleUI/images/round_rectangle_4X4.png b/services/WebPageUI/images/round_rectangle_4X4.png similarity index 100% rename from services/SimpleUI/images/round_rectangle_4X4.png rename to services/WebPageUI/images/round_rectangle_4X4.png diff --git a/services/SimpleUI/images/web_browsing_icon_error.png b/services/WebPageUI/images/web_browsing_icon_error.png similarity index 100% rename from services/SimpleUI/images/web_browsing_icon_error.png rename to services/WebPageUI/images/web_browsing_icon_error.png diff --git a/services/SimpleUI/images/web_shadow.png b/services/WebPageUI/images/web_shadow.png similarity index 100% rename from services/SimpleUI/images/web_shadow.png rename to services/WebPageUI/images/web_shadow.png diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index 98689db..7900886 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -10,7 +10,7 @@ include(EWebKitHelpers) include_directories( ${CMAKE_SOURCE_DIR}) include_directories( ${CMAKE_SOURCE_DIR}/services/FavoriteService) include_directories( ${CMAKE_SOURCE_DIR}/services/SimpleUI) -include_directories( ${CMAKE_SOURCE_DIR}/services/SimpleURI) +include_directories( ${CMAKE_SOURCE_DIR}/services/WebPageUI) include_directories( ${CMAKE_SOURCE_DIR}/services/WebKitEngineService) include_directories( ${CMAKE_SOURCE_DIR}/services/StorageService) include_directories( ${CMAKE_SOURCE_DIR}/services/StorageService/Storage/include) @@ -52,7 +52,7 @@ if(TIZEN_BUILD) HistoryService PlatformInputManager SimpleUI - SimpleURI + WebPageUI StorageService WebKitEngineService SessionStorage -- 2.7.4 From 41dcdbaf1a141f9a6b250435612276ba93b7abc4 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Mon, 21 Sep 2015 10:48:29 +0200 Subject: [PATCH 14/16] Closing app when pressing back key on Web Page view. [Issue#] https://bugs.tizen.org/jira/browse/TT-170 [Problem] Browser didn't close when pressing back key. [Cause] There was a check if back button is enabled which prevent from closing app when there was no previous web page. [Solution] Removed unneeded check. [Verify] Run browser, visit some web page, press back button, check if browser will close. Change-Id: I46c29149a1d311679f9b6ef141f6dd71dc335363 Signed-off-by: Maciej Skrzypkowski --- services/SimpleUI/SimpleUI.cpp | 2 +- services/WebPageUI/WebPageUI.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index dee412f..486ec7e 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -562,7 +562,7 @@ void SimpleUI::setwvIMEStatus(bool status) void SimpleUI::onBackPressed() { BROWSER_LOGD("[%s]", __func__); - if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus && !m_webPageUI->isHomePageActive() && m_webPageUI->isBackButtonEnabled()) + if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus && !m_webPageUI->isHomePageActive()) m_webEngine->backButtonClicked(); } diff --git a/services/WebPageUI/WebPageUI.h b/services/WebPageUI/WebPageUI.h index 0e77b6c..e2010c8 100644 --- a/services/WebPageUI/WebPageUI.h +++ b/services/WebPageUI/WebPageUI.h @@ -47,7 +47,6 @@ public: void switchViewToWebPage(Evas_Object* content, const std::string uri); void switchViewToQuickAccess(Evas_Object* content); URIEntry& getURIEntry() const { return *m_URIEntry.get(); } - bool isBackButtonEnabled() { return m_back->isEnabled(); } void setTabsNumber(int tabs); void setBackButtonEnabled(bool enabled) { m_back->setEnabled(enabled); } void setForwardButtonEnabled(bool enabled) { m_forward->setEnabled(enabled); } -- 2.7.4 From 0007889da722acfe517595de0ea46d8caeee32dd Mon Sep 17 00:00:00 2001 From: Albert Malewski Date: Mon, 21 Sep 2015 10:45:52 +0200 Subject: [PATCH 15/16] Changed database path [Issue] N/A [Problem] There was wrong database path which resulted in fails while launching the browser. [Cause] Wrong Tizen platform variable was used. [Solution] Used TZ_USER_APP instead of TZ_USER_DB and added /data directory. [Verify] Launch browser > Observe logs There shouldn't be fails in logs while loading database. Change-Id: Ibb2a6934f25b4974d2c6990cc78b1d97b8137bce --- core/Config/Config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Config/Config.cpp b/core/Config/Config.cpp index 2665734..dae7cd3 100644 --- a/core/Config/Config.cpp +++ b/core/Config/Config.cpp @@ -26,7 +26,7 @@ namespace config void DefaultConfig::load(const std::string &) { const char *db_path = NULL; - db_path = tzplatform_getenv(TZ_USER_DB); + db_path = tzplatform_getenv(TZ_USER_APP); m_data["main_service_name"] = std::string("org.tizen.browser.base_UI"); //m_data["favorite_service_name"] = std::string("org.tizen.browser.service.favorite.browserProvider"); @@ -43,7 +43,7 @@ void DefaultConfig::load(const std::string &) # include "ConfigValues.h" - m_data["resourcedb/dir"] = std::string(db_path)+"/"; + m_data["resourcedb/dir"] = std::string(db_path)+"/"+std::string("org.tizen.browser/data/"); } void DefaultConfig::store(const std::string & ) -- 2.7.4 From 818824efef48ec6c181c678ec9f50f3d18085a48 Mon Sep 17 00:00:00 2001 From: "t.dakowicz" Date: Tue, 15 Sep 2015 16:40:23 +0200 Subject: [PATCH 16/16] TT-163 'Add to bookmarks' UI change [Issue#] https://bugs.tizen.org/jira/browse/TT-163 [Problem] N/A [Cause] 1.02 UI guideline [Solution] Added checkbox that defines current bookmark status and toast popup for info purpose Choosing folder for a new bookmark is still there. Checkbox's style 'favorite' is not available. Change-Id: I78eaf6ca94d6c0ca6605b6822ea5e5c087260d90 --- services/MoreMenuUI/AddBookmarkPopup.cpp | 2 +- services/MoreMenuUI/MoreMenuUI.cpp | 85 +++++++++++++++++---- services/MoreMenuUI/MoreMenuUI.h | 13 +++- services/MoreMenuUI/edc/MoreMenu.edc | 79 +++++++++++++++---- services/MoreMenuUI/images/ic_add_bookmark_new.png | Bin 0 -> 1188 bytes services/SimpleUI/SimpleUI.cpp | 43 ++++++----- services/SimpleUI/SimpleUI.h | 9 ++- 7 files changed, 177 insertions(+), 54 deletions(-) create mode 100644 services/MoreMenuUI/images/ic_add_bookmark_new.png diff --git a/services/MoreMenuUI/AddBookmarkPopup.cpp b/services/MoreMenuUI/AddBookmarkPopup.cpp index a455589..13d4e8f 100644 --- a/services/MoreMenuUI/AddBookmarkPopup.cpp +++ b/services/MoreMenuUI/AddBookmarkPopup.cpp @@ -159,7 +159,7 @@ void AddBookmarkPopup::addBookmarkFolderItems(std::vector favicon) @@ -219,19 +222,75 @@ void MoreMenuUI::setWebTitle(const std::string& title) void MoreMenuUI::setURL(const std::string& url) { BROWSER_LOGD("[%s:%d] %s", __PRETTY_FUNCTION__, __LINE__, url.c_str()); - if(!url.empty()) + char* part_name = "add_to_bookmark_text"; + + if(!url.empty()) { elm_object_part_text_set(m_current_tab_bar, "webpage_url", url.c_str()); - else + + if(true == isBookmark()) { + m_isBookmark = EINA_TRUE; + changeBookmarkStatus(true); + } + else { + m_isBookmark = EINA_FALSE; + changeBookmarkStatus(false); + } + } + else { elm_object_part_text_set(m_current_tab_bar, "webpage_url", ""); + m_isBookmark = EINA_FALSE; + changeBookmarkStatus(false); + } +} + +void MoreMenuUI::changeBookmarkStatus(bool data) +{ + if(data) { + m_isBookmark = EINA_TRUE; + elm_object_part_text_set(m_current_tab_bar, "add_to_bookmark_text", "Remove Bookmark"); + elm_image_file_set(m_bookmarkIcon, m_edjFilePath.c_str(), "ic_add_bookmark.png"); + } + else { + m_isBookmark = EINA_FALSE; + elm_object_part_text_set(m_current_tab_bar, "add_to_bookmark_text", "Add to Bookmark"); + elm_image_file_set(m_bookmarkIcon, m_edjFilePath.c_str(), "ic_add_bookmark_new.png"); + } +} + +void MoreMenuUI::createToastPopup(const char* text) +{ + m_toastPopup = elm_popup_add(m_mm_layout); + elm_object_style_set(m_toastPopup, "toast"); + evas_object_size_hint_weight_set(m_toastPopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_toastPopup, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_part_content_set(m_current_tab_bar, "toast_popup", m_toastPopup); + elm_object_part_text_set(m_current_tab_bar, "toast_text", text); + evas_object_smart_callback_add(m_toastPopup, "timeout", _timeout, this); + elm_popup_timeout_set(m_toastPopup, 3.0); +} + +void MoreMenuUI::_timeout(void *data, Evas_Object *obj, void *event_info) +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + MoreMenuUI *moreMenuUI = static_cast(data); + elm_object_part_text_set(moreMenuUI->m_current_tab_bar, "toast_text", ""); + evas_object_del(moreMenuUI->m_toastPopup); } void MoreMenuUI::_star_clicked(void* data, Evas_Object*, void*) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (data) { + if(data) { MoreMenuUI *moreMenuUI = static_cast(data); - moreMenuUI->addToBookmarkClicked(); - moreMenuUI->AddBookmarkPopupCalled(); + + if (EINA_FALSE == moreMenuUI->m_isBookmark) { + moreMenuUI->addToBookmarkClicked(); + moreMenuUI->AddBookmarkPopupCalled(); + } + else { + moreMenuUI->m_isBookmark = EINA_FALSE; + moreMenuUI->deleteBookmark(); + } } } diff --git a/services/MoreMenuUI/MoreMenuUI.h b/services/MoreMenuUI/MoreMenuUI.h index 4b0fccb..7624b0a 100644 --- a/services/MoreMenuUI/MoreMenuUI.h +++ b/services/MoreMenuUI/MoreMenuUI.h @@ -18,6 +18,7 @@ #define MOREMENUUI_H #include +#include #include #include @@ -82,6 +83,8 @@ public: void setFavIcon(std::shared_ptr favicon); void setWebTitle(const std::string& title); void setURL(const std::string& url); + void changeBookmarkStatus(bool data); + void createToastPopup(const char* text); boost::signals2::signal addToBookmarkClicked; boost::signals2::signal AddBookmarkInput; @@ -95,8 +98,10 @@ public: boost::signals2::signal closeMoreMenuClicked; boost::signals2::signal switchToMobileMode; boost::signals2::signal switchToDesktopMode; + boost::signals2::signal isBookmark; + boost::signals2::signal deleteBookmark; private: - Elm_Gengrid_Item_Class* crateItemClass(); + Elm_Gengrid_Item_Class* createItemClass(); Evas_Object* createMoreMenuLayout(Evas_Object* parent); Evas_Object* createGengrid(Evas_Object* parent); static char* _grid_text_get(void *data, Evas_Object *obj, const char *part); @@ -114,6 +119,7 @@ private: static void _star_clicked(void *data, Evas_Object *obj, void *event_info); static void _close_clicked(void *data, Evas_Object *obj, void *event_info); + static void _timeout(void *data, Evas_Object *obj, void *event_info); static void __cb_mouse_in(void *data, Evas *e, Evas_Object *obj, void *event_info); static void __cb_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info); @@ -124,14 +130,17 @@ private: std::shared_ptr m_add_bookmark_popup; Evas_Object *m_gengrid; Evas_Object *m_parent; + Evas_Object *m_toastPopup; + Evas_Object *m_icon; + Evas_Object *m_bookmarkIcon; Elm_Gengrid_Item_Class * m_item_class; std::map m_map_menu_views; std::vector > m_map_bookmark_folder_list; std::string m_edjFilePath; std::string m_folderName; bool m_gengridSetup; - Evas_Object *m_icon; bool m_desktopMode; + Eina_Bool m_isBookmark; }; } diff --git a/services/MoreMenuUI/edc/MoreMenu.edc b/services/MoreMenuUI/edc/MoreMenu.edc index fcfd99a..5347fd3 100644 --- a/services/MoreMenuUI/edc/MoreMenu.edc +++ b/services/MoreMenuUI/edc/MoreMenu.edc @@ -43,6 +43,7 @@ RESOURCE_IMAGE_LOSSY("ic_more_share_nor.png") RESOURCE_IMAGE_LOSSY("ic_more_setting_nor.png") RESOURCE_IMAGE_LOSSY("ic_more_exit_nor.png") RESOURCE_IMAGE_LOSSY("ic_add_bookmark.png") +RESOURCE_IMAGE_LOSSY("ic_add_bookmark_new.png") RESOURCE_IMAGE_LOSSY("ic_more_readermode_foc.png") RESOURCE_IMAGE_LOSSY("ic_more_bookmark_foc.png") RESOURCE_IMAGE_LOSSY("ic_more_history_foc.png") @@ -116,6 +117,40 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") } parts { part { + name: "toast_popup"; + scale:1; + type: SWALLOW; + description { + state: "default" 0.0; + visible: 1; + align: 0 0; + fixed: 1 1; + min: 200 120; + max: 338 120; + rel1 { relative: 0.0 0.0; offset: 63 700;} + rel2 { relative: 1.0 1.0;} + } + } + part { + name: "toast_text"; + scale: 1; + type: TEXT; + description { + state: "default" 0.0; + visible: 1; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "toast_popup";} + rel2 { relative: 1.0 1.0; to: "toast_popup";} + color_class: titleTextColor; + text { + font: "Sans"; + size: 28; + align: 0.5 0.5; + } + } + } + part { name: "bg_rect"; scale:1; mouse_events: 1; @@ -371,7 +406,6 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") rel2 { relative: 1.0 1.0; to: "item_background";} color_class: urlTextColor; text { - text: "http:/onet.pl"; font: "font_name"; size: 28; align: 0 0.5; @@ -415,6 +449,21 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") visible: 1; } } + part { + name: "bookmark_ico"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + description { + state: "default" 0.0; + visible: 1; + min: 58 58; + max: 58 58; + fixed: 1 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "star_bg";} + } + } part{ name: "add_to_bookmark_text"; type: TEXT; @@ -422,14 +471,14 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") description { state: "default" 0.0; visible: 1; fixed: 1 1; - rel1 { relative: 0.0 0.0;to: "star_bg";} + align: 0 0; + rel1 { relative: 0.0 0.0;to: "star_bg"; offset: 56 0;} rel2 { relative: 1.0 1.0;to: "star_bg";} color: 0 0 0 255; text { - text: "Add to bookmark"; font: "Sans"; size: 28; - align: 0.5 0.5; + align: 0 0.5; } } } @@ -591,7 +640,7 @@ RESOURCE_IMAGE_LOSSY("ico_url.png") program { name: "mouse_click"; signal: "mouse,clicked,1"; - source: "over"; + source: "*"; script { emit("elm,action,click", ""); } @@ -671,17 +720,17 @@ group { } } } - part { name: "current_tab_bar"; + part { name: "elm.swallow.grid"; type : SWALLOW; scale: 1; description { state: "default" 0.0; visible: 1; - min: 1920 366; - max: 1920 366; + min: 1920 714; + max: 1920 714; align: 0.0 0.0; fixed: 0 0; - rel1 { relative: 0.0 0.0; to: "current_tab_bar_bg";} + rel1 { relative: 0.0 0.0; to: "gengrid_bg"; offset: 63 0;} rel2 { relative: 1.0 1.0; } } description { @@ -694,18 +743,18 @@ group { inherit: "default" 0.0; visible: 1; } - } - part { name: "elm.swallow.grid"; + } + part { name: "current_tab_bar"; type : SWALLOW; scale: 1; description { state: "default" 0.0; visible: 1; - min: 1920 714; - max: 1920 714; + min: 1920 366; + max: 1920 366; align: 0.0 0.0; fixed: 0 0; - rel1 { relative: 0.0 0.0; to: "gengrid_bg"; offset: 63 0;} + rel1 { relative: 0.0 0.0; to: "current_tab_bar_bg";} rel2 { relative: 1.0 1.0; } } description { @@ -718,7 +767,7 @@ group { inherit: "default" 0.0; visible: 1; } - } + } part { name: "elm.swallow.empty"; type: SWALLOW; description { state: "default" 0.0; diff --git a/services/MoreMenuUI/images/ic_add_bookmark_new.png b/services/MoreMenuUI/images/ic_add_bookmark_new.png new file mode 100644 index 0000000000000000000000000000000000000000..dabcfd7300f34d29cc38057ecd60d22ad55ad2ae GIT binary patch literal 1188 zcmV;V1Y7%wP)^TU8v#f4zOWErkx!N;}Q)Ayc!k2Qri_?d>h)Va4rLQ8Q4XEKA%wO;D5l z1)6NUG@#L8H%;a+U<}YsM{95EGDdk^MImk$9T8$jpu9GO-pCB2Qht*+8n+ev`sNLZo%C zty;GR3Rq6uDI}z_ZdHZ0Za@gi0_~Jx*P%ADZdE3OS_uGe>^c<7p<1(%+^|iog)$s< zfiFBe#0&WFb_Sk2azJag_hekuOz;ef{5-d`t&3PLn{rwUixmI>T2lUQa*4lj{6)R_ z$?{%FZh8~lL!6~SmrdWlemn!izs$|#XyorawvTo*Ouk-KJpN$e)@WztuEvzHu1Xl2 zO!VdED2~}0nZCzSVXgdEsrPSxW?ja+puW$kW&c&`(w5Q1aXxfet&&@MTP?p&{ZRA2 z?9LyzYrxxPjj5Cb?KmI$Fssu?H3SC>4P^1;RI(#-(;+F)U`GW^#FCwPI>j-nA=sZW z>20P!J9WYLiDe=6=o?X1af$o*)~A+apq+YqtKLAbdze5`yH{jLD#O9>`VZ@1(d3^eR07oRu6Z&7!*h#*}PjHju#c_?)Cr zIO>w6IduA&YTu@{lSxlkdx7Op)yqDH#;Uqq>b^%0Ktq;BB+cFQ)jWnu|Z3NTr2FZ<{so_nq2Iaps&PP&n$6rCH>B z&bi*YU%RVeVC1*K+#E$oc~j^M006t2xvn9J6GPG2f${IE*7bk(v=5e9Vad^ z*vq5(qJvrh0C?no1;!>4(>kr9q4Gl5pJ~kN&HVxZTw**nUvI1B%i_a%PaUfCg4swy zYV_~e#5wckX*KGeSwrl3L$roGMp0000isHomePageActive()) - return; + return false; - if(m_favoriteService->bookmarkExists(m_webEngine->getURI())){ + if(m_favoriteService->bookmarkExists(m_webEngine->getURI())) { BROWSER_LOGD("[%s] There is bookmark for this site [%s], set indicator on!", __func__, m_webEngine->getURI().c_str()); - // MERGE_ME - //leftButtonBar->setActionForButton("bookmark_button", m_unbookmark); + return true; } - else{ + else { BROWSER_LOGD("[%s] There is no bookmark for this site [%s], set indicator off", __func__, m_webEngine->getURI().c_str()); - // MERGE_ME - //leftButtonBar->setActionForButton("bookmark_button", m_bookmark); - //addBookmarkEnable(m_favoriteService->countBookmarksAndSubFolders() < m_favoritesLimit); + return false; } } // Consider removing these functions void SimpleUI::onBookmarkAdded(std::shared_ptr bookmarkItem) { + if (m_moreMenuUI) { + m_moreMenuUI->changeBookmarkStatus(true); + m_moreMenuUI->createToastPopup( (std::string(m_webEngine->getTitle()) + std::string(" added to bookmark")).c_str() ); + } +} + +void SimpleUI::onBookmarkRemoved(const std::string& uri) +{ + BROWSER_LOGD("[%s] deleted %s", __func__, uri.c_str()); + if (m_moreMenuUI) { + m_moreMenuUI->changeBookmarkStatus(false); + m_moreMenuUI->createToastPopup( (std::string(m_webEngine->getTitle()) + std::string(" removed from bookmark")).c_str() ); + } } void SimpleUI::onHistoryAdded(std::shared_ptr historyItem) @@ -527,17 +537,7 @@ void SimpleUI::onBookmarkClicked(std::shared_ptr bookmarkItem) -{ - BROWSER_LOGD("[%s] delete %s", __func__, bookmarkItem->getAddress().c_str()); - m_favoriteService->deleteBookmark(bookmarkItem->getAddress()); -} - // Consider removing these functions -void SimpleUI::onBookmarkRemoved(const std::string& uri) -{ - BROWSER_LOGD("[%s] deleted %s", __func__, uri.c_str()); -} void SimpleUI::onHistoryRemoved(const std::string& uri) { @@ -667,7 +667,6 @@ void SimpleUI::webEngineURLChanged(const std::string url) { BROWSER_LOGD("webEngineURLChanged:%s", url.c_str()); m_webPageUI->getURIEntry().clearFocus(); - bookmarkCheck(); } void SimpleUI::showTabUI() @@ -876,6 +875,8 @@ void SimpleUI::showMoreMenu() m_moreMenuUI->addToBookmarkClicked.connect(boost::bind(&SimpleUI::addBookmarkFolders, this)); m_moreMenuUI->AddBookmarkInput.connect(boost::bind(&SimpleUI::addToBookmarks, this,_1)); m_moreMenuUI->BookmarkFolderCreated.connect(boost::bind(&SimpleUI::newFolderMoreMenu, this,_1,_2)); + m_moreMenuUI->isBookmark.connect(boost::bind(&SimpleUI::checkBookmark, this)); + m_moreMenuUI->deleteBookmark.connect(boost::bind(&SimpleUI::deleteBookmark, this)); m_moreMenuUI->show(m_window.get(), desktopMode); m_moreMenuUI->showCurrentTab(); @@ -901,6 +902,8 @@ void SimpleUI::closeMoreMenu(const std::string& str) m_moreMenuUI->addToBookmarkClicked.disconnect(boost::bind(&SimpleUI::addBookmarkFolders, this)); m_moreMenuUI->AddBookmarkInput.disconnect(boost::bind(&SimpleUI::addToBookmarks, this,_1)); m_moreMenuUI->BookmarkFolderCreated.disconnect(boost::bind(&SimpleUI::newFolderMoreMenu, this,_1,_2)); + m_moreMenuUI->isBookmark.disconnect(boost::bind(&SimpleUI::checkBookmark, this)); + m_moreMenuUI->deleteBookmark.disconnect(boost::bind(&SimpleUI::deleteBookmark, this)); m_moreMenuUI.reset(); } diff --git a/services/SimpleUI/SimpleUI.h b/services/SimpleUI/SimpleUI.h index 5a9ff1f..b2600c3 100644 --- a/services/SimpleUI/SimpleUI.h +++ b/services/SimpleUI/SimpleUI.h @@ -119,7 +119,6 @@ private: void tabCreated(); void tabClosed(const tizen_browser::basic_webengine::TabId& id); - void bookmarkCheck(); std::vector > getBookmarks(int folder_id = -1); std::vector > getBookmarkFolders(int folder_id); std::shared_ptr getHistory(); @@ -129,7 +128,6 @@ private: void onBookmarkAdded(std::shared_ptr bookmarkItem); void onBookmarkClicked(std::shared_ptr bookmarkItem); - void onBookmarkDeleteClicked(std::shared_ptr bookmarkItem); void onBookmarkRemoved(const std::string& uri); void onHistoryAdded(std::shared_ptr historyItem); @@ -188,7 +186,12 @@ private: void webEngineURLChanged(const std::string url); void onmostHistoryvisitedClicked(); void onBookmarkvisitedClicked(); - /** + /** + * @brief Check if the current page exists as a bookmark. + * + */ + bool checkBookmark(); + /** * @brief Adds current page to bookmarks. * */ -- 2.7.4