edje_object_signal_emit(wd->radio, "elm,state,text,visible", "elm");
else
edje_object_signal_emit(wd->radio, "elm,state,text,hidden", "elm");
- edje_object_part_text_set(wd->radio, "elm.text", wd->label);
+ edje_object_part_text_escaped_set(wd->radio, "elm.text", wd->label);
if (elm_widget_disabled_get(obj))
{
edje_object_signal_emit(wd->radio, "elm,state,disabled", "elm");
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->group->value == wd->value) return;
- wd->group->value = wd->value;
- if (wd->group->valuep) *(wd->group->valuep) = wd->group->value;
- _state_set_all(wd);
- evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
+ if ((_elm_config->access_mode == ELM_ACCESS_MODE_OFF) ||
+ (_elm_access_2nd_click_timeout(obj)))
+ {
+ wd->group->value = wd->value;
+ if (wd->group->valuep) *(wd->group->valuep) = wd->group->value;
+ _state_set_all(wd);
+ if (_elm_config->access_mode != ELM_ACCESS_MODE_OFF)
+ _elm_access_say(E_("State: On"));
+ evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
+ }
}
static void
edje_object_signal_emit(wd->radio, "elm,state,text,hidden", "elm");
edje_object_message_signal_process(wd->radio);
}
- edje_object_part_text_set(wd->radio, "elm.text", label);
+ edje_object_part_text_escaped_set(wd->radio, "elm.text", label);
_sizing_eval(obj);
}
return wd->label;
}
+static char *
+_access_info_cb(void *data __UNUSED__, Evas_Object *obj, Elm_Widget_Item *item __UNUSED__)
+{
+ const char *txt = elm_widget_access_info_get(obj);
+ if (!txt) txt = _elm_radio_label_get(obj, NULL);
+ if (txt) return strdup(txt);
+ return NULL;
+}
+
+static char *
+_access_state_cb(void *data __UNUSED__, Evas_Object *obj, Elm_Widget_Item *item __UNUSED__)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ if (elm_widget_disabled_get(obj))
+ return strdup(E_("State: Disabled"));
+ if (wd->state)
+ return strdup(E_("State: On"));
+ return strdup(E_("State: Off"));
+}
+
static void
_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd;
- if (!part || strcmp(part, "icon")) return;
+ if (part && strcmp(part, "icon")) return;
wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->icon == content) return;
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd;
- if (!part || strcmp(part, "icon")) return NULL;
+ if (part && strcmp(part, "icon")) return NULL;
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
return wd->icon;
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd;
Evas_Object *icon;
- if (!part || strcmp(part, "icon")) return NULL;
+ if (part && strcmp(part, "icon")) return NULL;
wd = elm_widget_data_get(obj);
if (!wd) return NULL;
if (!wd->icon) return NULL;
// TODO: convert Elementary to subclassing of Evas_Smart_Class
// TODO: and save some bytes, making descriptions per-class and not instance!
evas_object_smart_callbacks_descriptions_set(obj, _signals);
- return obj;
-}
-
-EAPI void
-elm_radio_label_set(Evas_Object *obj, const char *label)
-{
- _elm_radio_label_set(obj, NULL, label);
-}
-
-EAPI const char *
-elm_radio_label_get(const Evas_Object *obj)
-{
- return _elm_radio_label_get(obj, NULL);
-}
-EAPI void
-elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon)
-{
- _content_set_hook(obj, "icon", icon);
-}
-
-EAPI Evas_Object *
-elm_radio_icon_get(const Evas_Object *obj)
-{
- return _content_get_hook(obj, "icon");
-}
+ _elm_access_object_register(obj, wd->radio);
+ _elm_access_text_set(_elm_access_object_get(obj),
+ ELM_ACCESS_TYPE, E_("Radio"));
+ _elm_access_callback_set(_elm_access_object_get(obj),
+ ELM_ACCESS_INFO, _access_info_cb, obj);
+ _elm_access_callback_set(_elm_access_object_get(obj),
+ ELM_ACCESS_STATE, _access_state_cb, obj);
-EAPI Evas_Object *
-elm_radio_icon_unset(Evas_Object *obj)
-{
- return _content_unset_hook(obj, "icon");
+ return obj;
}
EAPI void
wd->group->valuep = NULL;
}
}
+
+EAPI Evas_Object *
+elm_radio_selected_object_get(Evas_Object *obj)
+{
+ Eina_List *l;
+ Evas_Object *child;
+ Widget_Data *wd2;
+
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+
+ EINA_LIST_FOREACH(wd->group->radios, l, child)
+ {
+ wd2 = elm_widget_data_get(child);
+ if (wd2->value == wd->group->value)
+ return child;
+ }
+ return NULL;
+}