aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-11-05 13:54:43 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-11-05 13:54:43 +0000
commit85c28ba965c58e989fdaf95b06308bd7fad74842 (patch)
tree353c0816765eec669c7520f63e530014da2a8cd1 /src/bin
parentdisable the test code! (diff)
downloadenlightenment-85c28ba965c58e989fdaf95b06308bd7fad74842.tar.gz
ilist cd's have some extra params.
SVN revision: 18322
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/e_ilist.c22
-rw-r--r--src/bin/e_ilist.h3
-rw-r--r--src/bin/e_test.c21
3 files changed, 30 insertions, 16 deletions
diff --git a/src/bin/e_ilist.c b/src/bin/e_ilist.c
index 94b729909..e7ad5d40f 100644
--- a/src/bin/e_ilist.c
+++ b/src/bin/e_ilist.c
@@ -25,8 +25,9 @@ struct _E_Smart_Item
E_Smart_Data *sd;
Evas_Object *base_obj;
Evas_Object *icon_obj;
- void (*func) (void *data);
+ void (*func) (void *data, void *data2);
void *data;
+ void *data2;
};
/* local subsystem functions */
@@ -88,7 +89,7 @@ e_ilist_icon_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
}
void
-e_ilist_append(Evas_Object *obj, Evas_Object *icon, char *label, void (*func) (void *data), void *data)
+e_ilist_append(Evas_Object *obj, Evas_Object *icon, char *label, void (*func) (void *data, void *data2), void *data, void *data2)
{
E_Smart_Item *si;
Evas_Coord mw = 0, mh = 0;
@@ -113,6 +114,7 @@ e_ilist_append(Evas_Object *obj, Evas_Object *icon, char *label, void (*func) (
}
si->func = func;
si->data = data;
+ si->data2 = data2;
sd->items = evas_list_append(sd->items, si);
edje_object_size_min_calc(si->base_obj, &mw, &mh);
e_box_pack_end(sd->box_obj, si->base_obj);
@@ -126,7 +128,7 @@ e_ilist_append(Evas_Object *obj, Evas_Object *icon, char *label, void (*func) (
if (sd->selected == (evas_list_count(sd->items) - 1))
{
edje_object_signal_emit(si->base_obj, "active", "");
- if (si->func) si->func(si->data);
+ if (si->func) si->func(si->data, si->data2);
}
evas_object_lower(si->base_obj);
evas_object_event_callback_add(si->base_obj, EVAS_CALLBACK_MOUSE_DOWN, _e_smart_event_mouse_down, si);
@@ -151,7 +153,7 @@ e_ilist_select_set(Evas_Object *obj, int n)
{
evas_object_raise(si->base_obj);
edje_object_signal_emit(si->base_obj, "active", "");
- if (si->func) si->func(si->data);
+ if (si->func) si->func(si->data, si->data2);
}
}
@@ -175,6 +177,18 @@ e_ilist_select_data_get(Evas_Object *obj)
return NULL;
}
+void *
+e_ilist_select_data2_get(Evas_Object *obj)
+{
+ E_Smart_Item *si;
+
+ API_ENTRY return NULL;
+ if (!sd->items) return NULL;
+ si = evas_list_nth(sd->items, sd->selected);
+ if (si) return si->data2;
+ return NULL;
+}
+
void
e_ilist_selected_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
diff --git a/src/bin/e_ilist.h b/src/bin/e_ilist.h
index a71ff0bfc..193d746fb 100644
--- a/src/bin/e_ilist.h
+++ b/src/bin/e_ilist.h
@@ -7,10 +7,11 @@
#define E_ILIST_H
EAPI Evas_Object *e_ilist_add (Evas *evas);
-EAPI void e_ilist_append (Evas_Object *obj, Evas_Object *icon, char *label, void (*func) (void *data), void *data);
+EAPI void e_ilist_append (Evas_Object *obj, Evas_Object *icon, char *label, void (*func) (void *data, void *data2), void *data, void *data2);
EAPI void e_ilist_select_set (Evas_Object *obj, int n);
EAPI int e_ilist_select_get (Evas_Object *obj);
EAPI void *e_ilist_select_data_get (Evas_Object *obj);
+EAPI void *e_ilist_select_data2_get (Evas_Object *obj);
EAPI void e_ilist_selected_geometry_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
EAPI void e_ilist_min_size_get (Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
diff --git a/src/bin/e_test.c b/src/bin/e_test.c
index 965a4ff08..9ebb28b2a 100644
--- a/src/bin/e_test.c
+++ b/src/bin/e_test.c
@@ -402,11 +402,10 @@ struct _tmp
static struct _tmp tmp = {NULL, NULL};
static void
-_e_test_sel(void *data)
+_e_test_sel(void *data, void *data2)
{
Evas_Coord x, y, w, h;
- printf("SEL:\n");
e_ilist_selected_geometry_get(tmp.ilist, &x, &y, &w, &h);
e_scrollframe_child_region_show(tmp.scrollframe, x, y, w, h);
}
@@ -425,39 +424,39 @@ _e_test_internal(E_Container *con)
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/star_office.png");
- e_ilist_append(o, o3, "Item 1", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Item 1", _e_test_sel, NULL, NULL);
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/palette.png");
- e_ilist_append(o, o3, "Item 2 (Some really long text goes here for testing)", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Item 2 (Some really long text goes here for testing)", _e_test_sel, NULL, NULL);
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/mozilla.png");
- e_ilist_append(o, o3, "Item 3 (Medium length)", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Item 3 (Medium length)", _e_test_sel, NULL, NULL);
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/trash_open.png");
- e_ilist_append(o, o3, "Item POOP", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Item POOP", _e_test_sel, NULL, NULL);
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/watch.png");
- e_ilist_append(o, o3, "Item BLING BLING", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Item BLING BLING", _e_test_sel, NULL, NULL);
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/quake3.png");
- e_ilist_append(o, o3, "Sukebelinth", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Sukebelinth", _e_test_sel, NULL, NULL);
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/opera6.png");
- e_ilist_append(o, o3, "Panties", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Panties", _e_test_sel, NULL, NULL);
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/drawer_open.png");
- e_ilist_append(o, o3, "Flimbert the cagey", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Flimbert the cagey", _e_test_sel, NULL, NULL);
o3 = e_icon_add(dia->win->evas);
e_icon_file_set(o3, "/home/raster/C/stuff/icons/cd.png");
- e_ilist_append(o, o3, "Norbert", _e_test_sel, NULL);
+ e_ilist_append(o, o3, "Norbert", _e_test_sel, NULL, NULL);
e_ilist_min_size_get(o, &mw, &mh);
evas_object_resize(o, mw, mh);