aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/e_widget_label.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-10-12 23:00:45 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-10-12 23:00:45 +0000
commitde97fd5db9295d5ecaa50e75c73c50ad67139b6f (patch)
treef573e8ce03251636bc3a953adde372033d155d74 /src/bin/e_widget_label.c
parentadd a tiny shadow (diff)
downloadenlightenment-de97fd5db9295d5ecaa50e75c73c50ad67139b6f.tar.gz
actually focus focusable widgets. label can be much simpler
SVN revision: 17470
Diffstat (limited to 'src/bin/e_widget_label.c')
-rw-r--r--src/bin/e_widget_label.c94
1 files changed, 2 insertions, 92 deletions
diff --git a/src/bin/e_widget_label.c b/src/bin/e_widget_label.c
index 11ed9bb46..5f89581ac 100644
--- a/src/bin/e_widget_label.c
+++ b/src/bin/e_widget_label.c
@@ -2,118 +2,28 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
-
-typedef struct _E_Widget_Data E_Widget_Data;
-struct _E_Widget_Data
-{
- Evas_Object *o_label;
- 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_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 */
/* externally accessible functions */
Evas_Object *
-e_widget_label_add(Evas *evas, char *label, int *val)
+e_widget_label_add(Evas *evas, char *label)
{
Evas_Object *obj, *o;
- E_Widget_Data *wd;
Evas_Coord mw, mh;
obj = e_widget_add(evas);
- e_widget_del_hook_set(obj, _e_wid_del_hook);
- e_widget_focus_hook_set(obj, _e_wid_focus_hook);
- e_widget_activate_hook_set(obj, _e_wid_activate_hook);
- wd = calloc(1, sizeof(E_Widget_Data));
- wd->valptr = val;
- e_widget_data_set(obj, wd);
-
o = edje_object_add(evas);
- wd->o_label = o;
e_theme_edje_object_set(o, "base/theme/widgets",
"widgets/label");
- edje_object_signal_callback_add(o, "toggled", "*", _e_wid_signal_cb1, obj);
edje_object_part_text_set(o, "label", label);
evas_object_show(o);
edje_object_size_min_calc(o, &mw, &mh);
+ e_widget_can_focus_set(obj, 0);
e_widget_min_size_set(obj, mw, mh);
-
- if (wd->valptr)
- {
- if (*(wd->valptr)) edje_object_signal_emit(o, "toggle_on", "");
- }
-
e_widget_sub_object_add(obj, o);
- evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_wid_focus_steal, obj);
e_widget_resize_object_set(obj, o);
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_label, "focus_in", "");
- else
- edje_object_signal_emit(wd->o_label, "focus_out", "");
-}
-
-static void
-_e_wid_do(Evas_Object *obj)
-{
- E_Widget_Data *wd;
-
- wd = e_widget_data_get(obj);
- if (wd->valptr)
- {
- if (*(wd->valptr) == 0) *(wd->valptr) = 1;
- else *(wd->valptr) = 0;
- }
-}
-
-static void
-_e_wid_activate_hook(Evas_Object *obj)
-{
- E_Widget_Data *wd;
-
- wd = e_widget_data_get(obj);
- _e_wid_do(obj);
- if (wd->valptr)
- {
- if (*(wd->valptr)) edje_object_signal_emit(wd->o_label, "toggle_on", "");
- else edje_object_signal_emit(wd->o_label, "toggle_off", "");
- }
-}
-
-static void
-_e_wid_signal_cb1(void *data, Evas_Object *obj, const char *emission, const char *source)
-{
- _e_wid_do(data);
-}
-
-static void
-_e_wid_focus_steal(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
- e_widget_focus_steal(data);
-}