From: hermet Date: Fri, 9 Mar 2012 13:37:32 +0000 (+0000) Subject: elementary/index - removed some codes should not be pushed in X-Git-Tag: REL_F_I9500_20120323_1~17^2~122 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ea08e2e51010a78e22d35c7a0c1f082549689263;p=framework%2Fuifw%2Felementary.git elementary/index - removed some codes should not be pushed in git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69103 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/data/themes/widgets/index.edc b/data/themes/widgets/index.edc index cd156a3..73833c6 100644 --- a/data/themes/widgets/index.edc +++ b/data/themes/widgets/index.edc @@ -806,166 +806,3 @@ group { name: "elm/index/item_odd/horizontal/default"; } } } - -group { - name: "elm/index/base/vertical/pagecontrol"; - alias: "elm/index/base/horizontal/pagecontrol"; - parts { - part { name: "clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - description { state: "active" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - part { - name: "elm.swallow.index.0"; - type: SWALLOW; - scale: 1; - clip_to: "clip"; - description { - state: "default" 0.0; - align: 0.5 0; - rel1.relative: 0 0; - rel2.relative: 1 1; - } - } - part { name: "elm.swallow.event.0"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.5 0; - fixed: 1 1; - rel1 { - relative: 0 0.0; - offset: 0 0; - } - rel2 { - relative: 1 0.0; - offset: -1 -1; - } - } - } - } - programs { - program { name: "active"; - signal: "elm,state,active"; - source: "elm"; - action: STATE_SET "active" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - } - program { name: "inactive"; - signal: "elm,state,inactive"; - source: "elm"; - action: STATE_SET "default" 0.0; - transition: DECELERATE 0.5; - target: "clip"; - } - } -} -group { - name: "elm/index/item/vertical/pagecontrol"; - alias: "elm/index/item_odd/vertical/pagecontrol"; - alias: "elm/index/item/horizontal/pagecontrol"; - alias: "elm/index/item_odd/horizontal/pagecontrol"; - images { - image: "00_mainmenu_page_bar_001.png" COMP; - image: "00_mainmenu_page_bar_002.png" COMP; - } - parts { - part { - name:"bg"; - type : RECT; - scale: 1; - description { - state: "default" 0.0; - min: 40 40; - max: 40 40; - align:0.5 0; - visible: 0; - } - } - part { - name: "indicator"; - type: IMAGE; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - min: 20 20; - max: 20 20; - fixed: 1 1; - rel1 { to: "bg"; } - rel2 { to: "bg"; } - image { - normal: "00_mainmenu_page_bar_001.png"; - } - } - description { - state: "active" 0.0; - inherit: "default" 0.0; - min: 40 40; - max: 40 40; - image { - normal: "00_mainmenu_page_bar_002.png"; - } - } - } - part { - name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - min: 40 40; - max: 40 40; - fixed: 1 1; - color: 170 170 170 0; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 1; - align: 0.5 0.5; - } - rel1 { to: "bg"; } - rel2 { to: "bg"; } - } - description { - state: "active" 0.0; - inherit: "default" 0.0; - color: 170 170 170 255; - min: 40 40; - max: 40 40; - text { - font: "Sans,Edje-Vera"; - size: 10; - min: 0 1; - } - } - } - } - programs { - program { name: "active"; - signal: "elm,state,active"; - source: "elm"; - action: STATE_SET "active" 0.0; - target: "indicator"; - target: "elm.text"; - transition: LINEAR 0.2; - } - program { name: "inactive"; - signal: "elm,state,inactive"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "indicator"; - target: "elm.text"; - transition: LINEAR 0.2; - } - } -} diff --git a/src/bin/test.c b/src/bin/test.c index 132d735..018723a 100644 --- a/src/bin/test.c +++ b/src/bin/test.c @@ -112,7 +112,6 @@ void test_scroller2(void *data, Evas_Object *obj, void *event_info); void test_spinner(void *data, Evas_Object *obj, void *event_info); void test_index(void *data, Evas_Object *obj, void *event_info); void test_index2(void *data, Evas_Object *obj, void *event_info); -void test_index3(void *data, Evas_Object *obj, void *event_info); void test_photocam(void *data, Evas_Object *obj, void *event_info); void test_photo(void *data, Evas_Object *obj, void *event_info); void test_thumb(void *data, Evas_Object *obj, void *event_info); @@ -471,7 +470,6 @@ add_tests: //------------------------------// ADD_TEST(NULL, "Selectors", "Index", test_index); ADD_TEST(NULL, "Selectors", "Index 2", test_index2); - ADD_TEST(NULL, "Selectors", "Index 3", test_index3); ADD_TEST(NULL, "Selectors", "File Selector", test_fileselector); ADD_TEST(NULL, "Selectors", "File Selector Entry", test_fileselector_entry); ADD_TEST(NULL, "Selectors", "File Selector Button", test_fileselector_button); diff --git a/src/bin/test_index.c b/src/bin/test_index.c index 17451b8..be43dab 100644 --- a/src/bin/test_index.c +++ b/src/bin/test_index.c @@ -18,18 +18,6 @@ struct _api_data }; typedef struct _api_data api_data; -struct _pagectrl_data -{ - Evas_Object *index; - Evas_Object *sc; - Evas_Coord recent_x; - Evas_Coord page_width; - int page_cnt; - Eina_Bool drag_started : 1; - Eina_Bool changed : 1; -}; -typedef struct _pagectrl_data pagectrl_data; - enum _api_state { INDEX_LEVEL_SET, @@ -406,167 +394,4 @@ test_index2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_show(win); } -static void -_drag_start(void *data , Evas_Object *obj, void *event_info __UNUSED__) -{ - pagectrl_data *page_data = data; - Evas_Coord x, y, w, h; - elm_scroller_region_get(obj, &x, &y, &w, &h); - - page_data->recent_x = x; - page_data->drag_started = EINA_TRUE; -} - -static void -_drag_stop(void *data , Evas_Object *obj, void *event_info __UNUSED__) -{ - pagectrl_data *page_data = data; - Evas_Coord x, y, w, h; - elm_scroller_region_get(obj, &x, &y, &w, &h); - - if ((page_data->recent_x == x) && (x != 0)) - elm_object_scroll_hold_push(obj); -} - -static void -_anim_start(void *data , Evas_Object *obj, void *event_info __UNUSED__) -{ - pagectrl_data *page_data = data; - Evas_Coord x, y, w, h; - Elm_Object_Item *it; - int idx; - int threshold; - Evas_Coord max_page_x; - - if (page_data->changed) - { - page_data->changed = EINA_FALSE; - return; - } - - if (!page_data->drag_started) return; - max_page_x = (page_data->page_cnt - 1) * page_data->page_width; - elm_scroller_region_get(obj, &x, &y, &w, &h); - it = elm_index_selected_item_get(page_data->index, 0); - if (!it) return; - idx = (int) elm_object_item_data_get(it); - if (x < 0) x = 0; - if (x > max_page_x) x = max_page_x; - - threshold = page_data->page_width * 0.2; - if (abs(page_data->recent_x - x) > threshold) - { - if (x > page_data->recent_x) idx++; - else if ((x < page_data->recent_x) && (idx > 0)) idx--; - } - - if (idx > page_data->page_cnt) idx = page_data->page_cnt; - - page_data->drag_started = EINA_FALSE; - - elm_scroller_region_bring_in(obj, page_data->page_width * idx, 0, w, h); - - it = elm_index_item_find(page_data->index, (void *) idx); - elm_index_item_selected_set(it, EINA_TRUE); -} - -static void -_anim_stop(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) -{ - elm_object_scroll_hold_pop(obj); -} - -static void -_index3_selected_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info) -{ - Evas_Coord x, y, w, h; - Elm_Object_Item *it = event_info; - int idx = (int) elm_object_item_data_get(it); - pagectrl_data *page_data = data; - - evas_object_geometry_get(page_data->sc, &x, &y, &w, &h); - page_data->changed = EINA_TRUE; - - elm_scroller_region_bring_in(page_data->sc, page_data->page_width * idx, 0, - w, h); -} - -void -test_index3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) -{ - Evas_Object *win, *bg, *sc, *img, *id; - char buf[PATH_MAX]; - api_data *api = calloc(1, sizeof(api_data)); - pagectrl_data *page_data = calloc(1, sizeof(pagectrl_data)); - Evas_Coord page_h; - int i; - Elm_Object_Item *it; - page_data->page_width = 480; - page_data->page_cnt = 3; - - win = elm_win_add(NULL, "index", ELM_WIN_BASIC); - elm_win_title_set(win, "index - pagecontrol style"); - elm_win_autodel_set(win, EINA_TRUE); - evas_object_event_callback_add(win, EVAS_CALLBACK_FREE, _cleanup_cb, api); - - bg = elm_bg_add(win); - elm_win_resize_object_add(win, bg); - evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_show(bg); - - img = elm_image_add(win); - snprintf(buf, sizeof(buf), "%s/images/horz_scrollbar.jpg", elm_app_data_dir_get()); - elm_image_file_set(img, buf, NULL); - elm_image_resizable_set(img, EINA_TRUE, EINA_FALSE); - elm_image_object_size_get(img, NULL, &page_h); - evas_object_show(img); - - page_data->sc = sc = elm_scroller_add(win); - evas_object_smart_callback_add(sc, "scroll,drag,start", _drag_start, - page_data); - evas_object_smart_callback_add(sc, "scroll,drag,stop", _drag_stop, - page_data); - evas_object_smart_callback_add(sc, "scroll,anim,start", _anim_start, - page_data); - evas_object_smart_callback_add(sc, "scroll,anim,stop", _anim_stop, - page_data); - - elm_scroller_bounce_set(sc, EINA_FALSE, EINA_FALSE); - elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, - ELM_SCROLLER_POLICY_OFF); - elm_scroller_page_size_set(sc, page_data->page_width, page_h); - elm_object_content_set(sc, img); - elm_object_scroll_lock_y_set(sc, EINA_TRUE); - elm_win_resize_object_add(win, sc); - evas_object_show(sc); - - page_data->index = api->dt.id = id = elm_index_add(win); - elm_index_horizontal_set(id, EINA_TRUE); - elm_index_autohide_disabled_set(id, EINA_TRUE); - elm_object_style_set(id, "pagecontrol"); - - evas_object_smart_callback_add(id, "selected", _index3_selected_cb, - page_data); - evas_object_size_hint_weight_set(id, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(id, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_show(id); - - for(i = 0; i < page_data->page_cnt; i++) - { - snprintf(buf, sizeof(buf), "%c", '1' + i); - if (i == 0) - it = elm_index_item_append(id, buf, NULL, (void *) i); - else - elm_index_item_append(id, buf, NULL, (void *) i); - } - - elm_index_level_go(id, 0); - elm_index_item_selected_set(it, EINA_TRUE); - - elm_win_resize_object_add(win, id); - evas_object_resize(win, page_data->page_width, 585); - evas_object_show(win); -} - - #endif