forked from enlightenment/enlightenment
flip order of check widget functions to be less infuriating
SVN revision: 83658
This commit is contained in:
parent
223bfc600f
commit
1059b382e3
|
@ -8,16 +8,91 @@ struct _E_Widget_Data
|
|||
int *valptr;
|
||||
};
|
||||
|
||||
static void _e_wid_del_hook(Evas_Object *obj);
|
||||
static void _e_wid_focus_hook(Evas_Object *obj);
|
||||
static void _e_wid_do(Evas_Object *obj);
|
||||
static void _e_wid_activate_hook(Evas_Object *obj);
|
||||
static void _e_wid_disable_hook(Evas_Object *obj);
|
||||
static void _e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source);
|
||||
static void _e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
||||
/* local subsystem functions */
|
||||
|
||||
static void
|
||||
_e_wid_del_hook(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
free(wd);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_focus_hook(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
if (e_widget_focus_get(obj))
|
||||
{
|
||||
edje_object_signal_emit(wd->o_check, "e,state,focused", "e");
|
||||
evas_object_focus_set(wd->o_check, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
edje_object_signal_emit(wd->o_check, "e,state,unfocused", "e");
|
||||
evas_object_focus_set(wd->o_check, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_do(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
if (e_widget_disabled_get(obj)) return;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
if (wd->valptr)
|
||||
{
|
||||
if (*(wd->valptr) == 0)
|
||||
{
|
||||
*(wd->valptr) = 1;
|
||||
edje_object_signal_emit(wd->o_check, "e,state,checked", "e");
|
||||
}
|
||||
else
|
||||
{
|
||||
*(wd->valptr) = 0;
|
||||
edje_object_signal_emit(wd->o_check, "e,state,unchecked", "e");
|
||||
}
|
||||
}
|
||||
evas_object_smart_callback_call(obj, "changed", NULL);
|
||||
e_widget_change(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_activate_hook(Evas_Object *obj)
|
||||
{
|
||||
_e_wid_do(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_disable_hook(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
if (e_widget_disabled_get(obj))
|
||||
edje_object_signal_emit(wd->o_check, "e,state,disabled", "e");
|
||||
else
|
||||
edje_object_signal_emit(wd->o_check, "e,state,enabled", "e");
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_signal_cb1(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
||||
{
|
||||
_e_wid_do(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_focus_steal(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
e_widget_focus_steal(data);
|
||||
}
|
||||
|
||||
|
||||
/* externally accessible functions */
|
||||
|
||||
/**
|
||||
|
@ -201,86 +276,3 @@ e_widget_check_icon_add(Evas *evas, const char *label, const char *icon, int ico
|
|||
|
||||
return obj;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_del_hook(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
free(wd);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_focus_hook(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
if (e_widget_focus_get(obj))
|
||||
{
|
||||
edje_object_signal_emit(wd->o_check, "e,state,focused", "e");
|
||||
evas_object_focus_set(wd->o_check, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
edje_object_signal_emit(wd->o_check, "e,state,unfocused", "e");
|
||||
evas_object_focus_set(wd->o_check, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_do(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
if (e_widget_disabled_get(obj)) return;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
if (wd->valptr)
|
||||
{
|
||||
if (*(wd->valptr) == 0)
|
||||
{
|
||||
*(wd->valptr) = 1;
|
||||
edje_object_signal_emit(wd->o_check, "e,state,checked", "e");
|
||||
}
|
||||
else
|
||||
{
|
||||
*(wd->valptr) = 0;
|
||||
edje_object_signal_emit(wd->o_check, "e,state,unchecked", "e");
|
||||
}
|
||||
}
|
||||
evas_object_smart_callback_call(obj, "changed", NULL);
|
||||
e_widget_change(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_activate_hook(Evas_Object *obj)
|
||||
{
|
||||
_e_wid_do(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_disable_hook(Evas_Object *obj)
|
||||
{
|
||||
E_Widget_Data *wd;
|
||||
|
||||
wd = e_widget_data_get(obj);
|
||||
if (e_widget_disabled_get(obj))
|
||||
edje_object_signal_emit(wd->o_check, "e,state,disabled", "e");
|
||||
else
|
||||
edje_object_signal_emit(wd->o_check, "e,state,enabled", "e");
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_signal_cb1(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
|
||||
{
|
||||
_e_wid_do(data);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_wid_focus_steal(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
|
||||
{
|
||||
e_widget_focus_steal(data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue