summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-01-03 04:17:32 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-01-03 04:17:32 +0000
commit56224b15d3443e204e6aa4dd27b9c25bb4d67054 (patch)
tree7b7dd00ef1e42f76be63c3cb49ee1b8ce4d9ca97 /src
parent1cf4320385d6beca961d64779d85578c2e428d7e (diff)
deprecate disabled list item apis - use object item.
SVN revision: 66772
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_deprecated.h31
-rw-r--r--src/lib/elm_list.c42
-rw-r--r--src/lib/elm_list.h28
3 files changed, 52 insertions, 49 deletions
diff --git a/src/lib/elm_deprecated.h b/src/lib/elm_deprecated.h
index 3341b93ee..810a35eaa 100644
--- a/src/lib/elm_deprecated.h
+++ b/src/lib/elm_deprecated.h
@@ -2648,3 +2648,34 @@ EINA_DEPRECATED EAPI const char *elm_multibuttonentry_item_label_
2648 * @deprecated Use elm_object_item_text_set() instead 2648 * @deprecated Use elm_object_item_text_set() instead
2649 */ 2649 */
2650EINA_DEPRECATED EAPI void elm_multibuttonentry_item_label_set(Elm_Object_Item *it, const char *str); 2650EINA_DEPRECATED EAPI void elm_multibuttonentry_item_label_set(Elm_Object_Item *it, const char *str);
2651
2652/**
2653 * Sets the disabled/enabled state of a list item.
2654 *
2655 * @param it The item.
2656 * @param disabled The disabled state.
2657 *
2658 * A disabled item cannot be selected or unselected. It will also
2659 * change its appearance (generally greyed out). This sets the
2660 * disabled state (@c EINA_TRUE for disabled, @c EINA_FALSE for
2661 * enabled).
2662 *
2663 * @deprecated Use elm_object_item_disabled_set() instead
2664 *
2665 * @ingroup List
2666 */
2667EINA_DEPRECATED EAPI void elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled);
2668
2669/**
2670 * Get a value whether list item is disabled or not.
2671 *
2672 * @param it The item.
2673 * @return The disabled state.
2674 *
2675 * @see elm_list_item_disabled_set() for more details.
2676 *
2677 * @deprecated Use elm_object_item_disabled_get() instead
2678 *
2679 * @ingroup List
2680 */
2681EINA_DEPRECATED EAPI Eina_Bool elm_list_item_disabled_get(const Elm_List_Item *it);
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index 85356ae37..819f9390a 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -41,7 +41,6 @@ struct _Elm_List_Item
41 Ecore_Timer *long_timer; 41 Ecore_Timer *long_timer;
42 Ecore_Timer *swipe_timer; 42 Ecore_Timer *swipe_timer;
43 Eina_Bool deleted : 1; 43 Eina_Bool deleted : 1;
44 Eina_Bool disabled : 1;
45 Eina_Bool even : 1; 44 Eina_Bool even : 1;
46 Eina_Bool is_even : 1; 45 Eina_Bool is_even : 1;
47 Eina_Bool is_separator : 1; 46 Eina_Bool is_separator : 1;
@@ -702,7 +701,7 @@ _item_highlight(Elm_List_Item *it)
702 701
703 if (!wd) return; 702 if (!wd) return;
704 ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); 703 ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
705 if ((it->highlighted) || (it->disabled)) return; 704 if ((it->highlighted) || (it->base.disabled)) return;
706 705
707 evas_object_ref(obj); 706 evas_object_ref(obj);
708 _elm_list_walk(wd); 707 _elm_list_walk(wd);
@@ -725,7 +724,7 @@ _item_select(Elm_List_Item *it)
725 724
726 if (!wd) return; 725 if (!wd) return;
727 ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); 726 ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
728 if (it->disabled) return; 727 if (it->base.disabled) return;
729 if (it->selected) 728 if (it->selected)
730 { 729 {
731 if (wd->always_select) goto call; 730 if (wd->always_select) goto call;
@@ -875,7 +874,7 @@ _long_press(void *data)
875 874
876 ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ECORE_CALLBACK_CANCEL); 875 ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ECORE_CALLBACK_CANCEL);
877 it->long_timer = NULL; 876 it->long_timer = NULL;
878 if (it->disabled) goto end; 877 if (it->base.disabled) goto end;
879 878
880 wd->longpressed = EINA_TRUE; 879 wd->longpressed = EINA_TRUE;
881 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it); 880 evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
@@ -979,7 +978,7 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *
979 return; 978 return;
980 } 979 }
981 980
982 if (it->disabled) 981 if (it->base.disabled)
983 return; 982 return;
984 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; 983 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
985 984
@@ -1020,6 +1019,16 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *
1020 evas_object_unref(obj2); 1019 evas_object_unref(obj2);
1021} 1020}
1022 1021
1022static void
1023_item_disable(void *data)
1024{
1025 Elm_List_Item *it = data;
1026 if (it->base.disabled)
1027 edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
1028 else
1029 edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
1030}
1031
1023static Elm_List_Item * 1032static Elm_List_Item *
1024_item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data) 1033_item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data)
1025{ 1034{
@@ -1056,6 +1065,7 @@ _item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *e
1056 evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 1065 evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1057 _changed_size_hints, obj); 1066 _changed_size_hints, obj);
1058 } 1067 }
1068 _elm_widget_item_disable_set_hook_set((Elm_Widget_Item *)it, _item_disable);
1059 return it; 1069 return it;
1060} 1070}
1061 1071
@@ -1241,7 +1251,7 @@ _fix_items(Evas_Object *obj)
1241 if ((selectraise) && (!strcmp(selectraise, "on"))) 1251 if ((selectraise) && (!strcmp(selectraise, "on")))
1242 evas_object_raise(VIEW(it)); 1252 evas_object_raise(VIEW(it));
1243 } 1253 }
1244 if (it->disabled) 1254 if (it->base.disabled)
1245 edje_object_signal_emit(VIEW(it), "elm,state,disabled", 1255 edje_object_signal_emit(VIEW(it), "elm,state,disabled",
1246 "elm"); 1256 "elm");
1247 1257
@@ -2040,26 +2050,14 @@ elm_list_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy
2040 if (policy_v) *policy_v = (Elm_Scroller_Policy) s_policy_v; 2050 if (policy_v) *policy_v = (Elm_Scroller_Policy) s_policy_v;
2041} 2051}
2042 2052
2043EAPI void 2053EINA_DEPRECATED EAPI void
2044elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled) 2054elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled)
2045{ 2055{
2046 ELM_LIST_ITEM_CHECK_DELETED_RETURN(it); 2056 elm_object_item_disabled_set((Elm_Object_Item *)it, disabled);
2047
2048 if (it->disabled == disabled)
2049 return;
2050
2051 it->disabled = !!disabled;
2052
2053 if (it->disabled)
2054 edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
2055 else
2056 edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
2057} 2057}
2058 2058
2059EAPI Eina_Bool 2059EINA_DEPRECATED EAPI Eina_Bool
2060elm_list_item_disabled_get(const Elm_List_Item *it) 2060elm_list_item_disabled_get(const Elm_List_Item *it)
2061{ 2061{
2062 ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE); 2062 return elm_object_item_disabled_get((Elm_Object_Item *)it);
2063
2064 return it->disabled;
2065} 2063}
diff --git a/src/lib/elm_list.h b/src/lib/elm_list.h
index d5cd80f4f..090f00b72 100644
--- a/src/lib/elm_list.h
+++ b/src/lib/elm_list.h
@@ -922,33 +922,6 @@ EAPI Elm_List_Item *elm_list_item_prev(const Elm_List_Item *it);
922EAPI Elm_List_Item *elm_list_item_next(const Elm_List_Item *it); 922EAPI Elm_List_Item *elm_list_item_next(const Elm_List_Item *it);
923 923
924/** 924/**
925 * Sets the disabled/enabled state of a list item.
926 *
927 * @param it The item.
928 * @param disabled The disabled state.
929 *
930 * A disabled item cannot be selected or unselected. It will also
931 * change its appearance (generally greyed out). This sets the
932 * disabled state (@c EINA_TRUE for disabled, @c EINA_FALSE for
933 * enabled).
934 *
935 * @ingroup List
936 */
937EAPI void elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled);
938
939/**
940 * Get a value whether list item is disabled or not.
941 *
942 * @param it The item.
943 * @return The disabled state.
944 *
945 * @see elm_list_item_disabled_set() for more details.
946 *
947 * @ingroup List
948 */
949EAPI Eina_Bool elm_list_item_disabled_get(const Elm_List_Item *it);
950
951/**
952 * Set the text to be shown in a given list item's tooltips. 925 * Set the text to be shown in a given list item's tooltips.
953 * 926 *
954 * @param item Target item. 927 * @param item Target item.
@@ -974,6 +947,7 @@ EAPI void elm_list_item_tooltip_text_set(Elm_List_Item *
974 * It will instead be limited only by the size of the display. 947 * It will instead be limited only by the size of the display.
975 */ 948 */
976EAPI Eina_Bool elm_list_item_tooltip_window_mode_set(Elm_List_Item *item, Eina_Bool disable); 949EAPI Eina_Bool elm_list_item_tooltip_window_mode_set(Elm_List_Item *item, Eina_Bool disable);
950
977/** 951/**
978 * @brief Retrieve size restriction state of an object's tooltip 952 * @brief Retrieve size restriction state of an object's tooltip
979 * @param obj The tooltip's anchor object 953 * @param obj The tooltip's anchor object