summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2011-10-21 16:36:20 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2011-10-21 16:36:20 +0000
commitda56018192b60a72224ccf607ffec900d91d4368 (patch)
treea89a1f8501a113b4326a3b27376e59ca68fe3cc4 /legacy
parent35c8f40547d32ba4b2cb6cb72be2ccdf7457a1c9 (diff)
elm gengrid: Refactorying. Moved some codes and removed unnecessary line.
SVN revision: 64261
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/elm_gengrid.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/legacy/elementary/src/lib/elm_gengrid.c b/legacy/elementary/src/lib/elm_gengrid.c
index 5735299d07..89f9669347 100644
--- a/legacy/elementary/src/lib/elm_gengrid.c
+++ b/legacy/elementary/src/lib/elm_gengrid.c
@@ -1897,6 +1897,22 @@ elm_gengrid_add(Evas_Object *parent)
1897 static Evas_Smart *smart = NULL; 1897 static Evas_Smart *smart = NULL;
1898 Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable; 1898 Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
1899 1899
1900 if (!smart)
1901 {
1902 static Evas_Smart_Class sc;
1903
1904 evas_object_smart_clipped_smart_set(&_pan_sc);
1905 sc = _pan_sc;
1906 sc.name = "elm_gengrid_pan";
1907 sc.version = EVAS_SMART_CLASS_VERSION;
1908 sc.add = _pan_add;
1909 sc.del = _pan_del;
1910 sc.resize = _pan_resize;
1911 sc.move = _pan_move;
1912 sc.calculate = _pan_calculate;
1913 if (!(smart = evas_smart_class_new(&sc))) return NULL;
1914 }
1915
1900 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); 1916 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
1901 1917
1902 ELM_SET_WIDTYPE(widtype, "gengrid"); 1918 ELM_SET_WIDTYPE(widtype, "gengrid");
@@ -1917,6 +1933,7 @@ elm_gengrid_add(Evas_Object *parent)
1917 elm_smart_scroller_widget_set(wd->scr, obj); 1933 elm_smart_scroller_widget_set(wd->scr, obj);
1918 elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base", 1934 elm_smart_scroller_object_theme_set(obj, wd->scr, "gengrid", "base",
1919 "default"); 1935 "default");
1936 elm_smart_scroller_bounce_allow_set(wd->scr, bounce, bounce);
1920 elm_widget_resize_object_set(obj, wd->scr); 1937 elm_widget_resize_object_set(obj, wd->scr);
1921 1938
1922 evas_object_smart_callback_add(wd->scr, "animate,start", _scr_anim_start, obj); 1939 evas_object_smart_callback_add(wd->scr, "animate,start", _scr_anim_start, obj);
@@ -1930,48 +1947,27 @@ elm_gengrid_add(Evas_Object *parent)
1930 obj); 1947 obj);
1931 evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj); 1948 evas_object_smart_callback_add(wd->scr, "scroll", _scr_scroll, obj);
1932 1949
1933 elm_smart_scroller_bounce_allow_set(wd->scr, bounce, bounce);
1934
1935 wd->self = obj; 1950 wd->self = obj;
1936 wd->align_x = 0.5; 1951 wd->align_x = 0.5;
1937 wd->align_y = 0.5; 1952 wd->align_y = 0.5;
1938 wd->h_bounce = bounce; 1953 wd->h_bounce = bounce;
1939 wd->v_bounce = bounce; 1954 wd->v_bounce = bounce;
1940 wd->no_select = EINA_FALSE;
1941 1955
1942 evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj); 1956 evas_object_smart_callback_add(obj, "scroll-hold-on", _hold_on, obj);
1943 evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj); 1957 evas_object_smart_callback_add(obj, "scroll-hold-off", _hold_off, obj);
1944 evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj); 1958 evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
1945 evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj); 1959 evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
1946 1960
1947 evas_object_smart_callbacks_descriptions_set(obj, _signals); 1961 wd->pan_smart = evas_object_smart_add(e, smart);
1948 1962 wd->pan = evas_object_smart_data_get(wd->pan_smart);
1949 if (!smart) 1963 wd->pan->wd = wd;
1950 {
1951 static Evas_Smart_Class sc;
1952
1953 evas_object_smart_clipped_smart_set(&_pan_sc);
1954 sc = _pan_sc;
1955 sc.name = "elm_gengrid_pan";
1956 sc.version = EVAS_SMART_CLASS_VERSION;
1957 sc.add = _pan_add;
1958 sc.del = _pan_del;
1959 sc.resize = _pan_resize;
1960 sc.move = _pan_move;
1961 sc.calculate = _pan_calculate;
1962 smart = evas_smart_class_new(&sc);
1963 }
1964 if (smart)
1965 {
1966 wd->pan_smart = evas_object_smart_add(e, smart);
1967 wd->pan = evas_object_smart_data_get(wd->pan_smart);
1968 wd->pan->wd = wd;
1969 }
1970 1964
1971 elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart, 1965 elm_smart_scroller_extern_pan_set(wd->scr, wd->pan_smart,
1972 _pan_set, _pan_get, _pan_max_get, 1966 _pan_set, _pan_get, _pan_max_get,
1973 _pan_min_get, _pan_child_size_get); 1967 _pan_min_get, _pan_child_size_get);
1974 1968
1969 evas_object_smart_callbacks_descriptions_set(obj, _signals);
1970
1975 _mirrored_set(obj, elm_widget_mirrored_get(obj)); 1971 _mirrored_set(obj, elm_widget_mirrored_get(obj));
1976 return obj; 1972 return obj;
1977} 1973}