From: sumanth.m Date: Tue, 7 Sep 2010 15:22:11 +0000 (+0530) Subject: new API is added to elm_segment_control X-Git-Tag: origin~237^2~7^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd07aa3f02ad7c5e1ada0ea94511781eae0ddc64;p=framework%2Fuifw%2Felementary.git new API is added to elm_segment_control --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in old mode 100755 new mode 100644 index bba14a9..9d3edd4 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -1303,6 +1303,7 @@ extern "C" { EAPI Elm_Segment_Item *elm_segment_control_item_selected_get(const Evas_Object *obj); EAPI int elm_segment_control_get_segment_count(Evas_Object *obj); EAPI int elm_segment_control_item_count_get(Evas_Object *obj); + EAPI int elm_segment_control_item_index_get(Elm_Segment_Item *item); EAPI Evas_Object *elm_segment_control_item_object_get(Elm_Segment_Item *it); EAPI Evas_Object *elm_page_control_add(Evas_Object *parent); diff --git a/src/lib/elm_segment_control.c b/src/lib/elm_segment_control.c index 56471fc..16ab912 100644 --- a/src/lib/elm_segment_control.c +++ b/src/lib/elm_segment_control.c @@ -1082,4 +1082,21 @@ elm_segment_control_item_get_at(Evas_Object *obj, unsigned int index) return it; } + +/** + * Select the index of a Segment item of Segmentcontrol + * @param item The Segment item. + * @return The corresponding index of the Segment item. + * + * @ingroup SegmentControl SegmentControl + */ + +EAPI int +elm_segment_control_item_index_get(Elm_Segment_Item *item) +{ + Widget_Data *wd = elm_widget_data_get(item->obj); + if(!wd) return NULL; + + return item->segment_id; +}