summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorchanwook jung <jchanwook@gmail.com>2012-03-21 11:50:33 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-03-21 11:50:33 +0000
commit8a3d3b39cc929ce0ce32b13d56e95fe97f1156d3 (patch)
tree45ff27fca20d9719f6414531af0f2068e32d157f /src/bin
parent0e17e5ec65b8004910b066594ff67d8f0a603318 (diff)
From: chanwook jung <jchanwook@gmail.com>
Subject: [E-devel] [Patch][Genlist] Add the moved.after/before signal instead of moved Some applications want to know moved.after or before and relative item because of updating their own list. So I separated moved into moved,after and move,before. SVN revision: 69537
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/test_genlist.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c
index 59b77f55e..24681505f 100644
--- a/src/bin/test_genlist.c
+++ b/src/bin/test_genlist.c
@@ -1898,15 +1898,50 @@ _reorder_tg_changed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__
1898 * @param obj : the genlist object. 1898 * @param obj : the genlist object.
1899 * @param item : the moved item. 1899 * @param item : the moved item.
1900 * 1900 *
1901 * If the move_after is true, 1901 * the item(*item) had been moved
1902 *
1903 */
1904static void gl_moved(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
1905{
1906 // if needed, add application logic.
1907}
1908
1909/**
1910 * gl_moved_after is called after an item was reordered.
1911 * This is only called when reorder mode is enabled.
1912 *
1913 * @param data : the genlist object passed as data.
1914 * @param obj : the genlist object.
1915 * @param item : the moved item.
1916 *
1902 * the item(*item) had been moved after the given relative item(*rel_item) in list. 1917 * the item(*item) had been moved after the given relative item(*rel_item) in list.
1903 * If the move_after is false, 1918 *
1919 */
1920static void gl_moved_after(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
1921{
1922 // if needed, add application logic.
1923 Elm_Object_Item *it;
1924 it = elm_genlist_item_prev_get(item);
1925 printf("it=%p, prev_it=%p\n",item,it);
1926}
1927
1928/**
1929 * gl_moved_before is called after an item was reordered.
1930 * This is only called when reorder mode is enabled.
1931 *
1932 * @param data : the genlist object passed as data.
1933 * @param obj : the genlist object.
1934 * @param item : the moved item.
1935 *
1904 * the item(*item) had been moved before the given relative item(*rel_item) in list. 1936 * the item(*item) had been moved before the given relative item(*rel_item) in list.
1905 * 1937 *
1906 */ 1938 */
1907static void gl_moved(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__) 1939static void gl_moved_before(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
1908{ 1940{
1909 // if needed, add application logic. 1941 // if needed, add application logic.
1942 Elm_Object_Item *it;
1943 it = elm_genlist_item_next_get(item);
1944 printf("it=%p, next_it=%p\n",item,it);
1910} 1945}
1911 1946
1912void 1947void
@@ -1956,6 +1991,8 @@ test_genlist11(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
1956 itc1->func.state_get = gl_state_get; 1991 itc1->func.state_get = gl_state_get;
1957 itc1->func.del = NULL; 1992 itc1->func.del = NULL;
1958 evas_object_smart_callback_add(gl, "moved", (Evas_Smart_Cb)gl_moved, gl); 1993 evas_object_smart_callback_add(gl, "moved", (Evas_Smart_Cb)gl_moved, gl);
1994 evas_object_smart_callback_add(gl, "moved,after", (Evas_Smart_Cb)gl_moved_after, gl);
1995 evas_object_smart_callback_add(gl, "moved,before", (Evas_Smart_Cb)gl_moved_before, gl);
1959 1996
1960 for (i = 0; i < 50; i++) 1997 for (i = 0; i < 50; i++)
1961 elm_genlist_item_append(gl, 1998 elm_genlist_item_append(gl,