aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bin/e_ilist.c77
-rw-r--r--src/bin/e_ilist.h11
-rw-r--r--src/bin/e_int_border_border.c2
-rw-r--r--src/bin/e_int_config_background.c2
-rw-r--r--src/bin/e_int_config_theme.c2
-rw-r--r--src/bin/e_widget_ilist.c40
-rw-r--r--src/bin/e_widget_ilist.h8
7 files changed, 122 insertions, 20 deletions
diff --git a/src/bin/e_ilist.c b/src/bin/e_ilist.c
index 6c7baee16..e69a19795 100644
--- a/src/bin/e_ilist.c
+++ b/src/bin/e_ilist.c
@@ -134,7 +134,7 @@ e_ilist_append(Evas_Object *obj, Evas_Object *icon, char *label, void (*func) (
}
void
-e_ilist_select_set(Evas_Object *obj, int n)
+e_ilist_selected_set(Evas_Object *obj, int n)
{
E_Smart_Item *si;
@@ -159,15 +159,30 @@ e_ilist_select_set(Evas_Object *obj, int n)
}
int
-e_ilist_select_get(Evas_Object *obj)
+e_ilist_selected_get(Evas_Object *obj)
{
API_ENTRY return -1;
if (!sd->items) return -1;
return sd->selected;
}
+const char *
+e_ilist_selected_label_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 edje_object_part_text_get(si->base_obj, "label");
+ }
+ return NULL;
+}
+
void *
-e_ilist_select_data_get(Evas_Object *obj)
+e_ilist_selected_data_get(Evas_Object *obj)
{
E_Smart_Item *si;
@@ -179,7 +194,7 @@ e_ilist_select_data_get(Evas_Object *obj)
}
void *
-e_ilist_select_data2_get(Evas_Object *obj)
+e_ilist_selected_data2_get(Evas_Object *obj)
{
E_Smart_Item *si;
@@ -226,6 +241,50 @@ e_ilist_selector_get(Evas_Object *obj)
return sd->selector;
}
+void
+e_ilist_remove_num(Evas_Object *obj, int n)
+{
+ E_Smart_Item *si;
+
+ API_ENTRY return;
+ if (!sd->items) return;
+ si = evas_list_nth(sd->items, n);
+ if (si)
+ {
+ sd->items = evas_list_remove(sd->items, si);
+ if (si->icon_obj) evas_object_del(si->icon_obj);
+ evas_object_del(si->base_obj);
+ free(si);
+ }
+}
+
+void
+e_ilist_remove_label(Evas_Object *obj, char *label)
+{
+ E_Smart_Item *si;
+ char *t;
+
+ API_ENTRY return;
+ if (!sd->items) return;
+ if (!label) return;
+ while (sd->items)
+ {
+ si = sd->items->data;
+ if (si)
+ {
+ t = edje_object_part_text_get(si->base_obj, "label");
+ if (!strcmp(t, label))
+ {
+ sd->items = evas_list_remove(sd->items, si);
+ if (si->icon_obj) evas_object_del(si->icon_obj);
+ evas_object_del(si->base_obj);
+ free(si);
+ break;
+ }
+ }
+ }
+}
+
/* local subsystem functions */
static void
_e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -241,7 +300,7 @@ _e_smart_event_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
{
if (l->data == si)
{
- e_ilist_select_set(si->sd->smart_obj, i);
+ e_ilist_selected_set(si->sd->smart_obj, i);
break;
}
}
@@ -277,15 +336,15 @@ _e_smart_event_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
int n;
- n = e_ilist_select_get(sd->smart_obj);
- e_ilist_select_set(sd->smart_obj, n - 1);
+ n = e_ilist_selected_get(sd->smart_obj);
+ e_ilist_selected_set(sd->smart_obj, n - 1);
}
else if (!strcmp(ev->keyname, "Down"))
{
int n;
- n = e_ilist_select_get(sd->smart_obj);
- e_ilist_select_set(sd->smart_obj, n + 1);
+ n = e_ilist_selected_get(sd->smart_obj);
+ e_ilist_selected_set(sd->smart_obj, n + 1);
}
else if ((!strcmp(ev->keyname, "Return")) ||
(!strcmp(ev->keyname, "space")))
diff --git a/src/bin/e_ilist.h b/src/bin/e_ilist.h
index de6ea32ab..a9dbea1e6 100644
--- a/src/bin/e_ilist.h
+++ b/src/bin/e_ilist.h
@@ -9,14 +9,17 @@
EAPI Evas_Object *e_ilist_add (Evas *evas);
EAPI void e_ilist_icon_size_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h);
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_set (Evas_Object *obj, int n);
+EAPI int e_ilist_selected_get (Evas_Object *obj);
+EAPI const char *e_ilist_selected_label_get (Evas_Object *obj);
+EAPI void *e_ilist_selected_data_get (Evas_Object *obj);
+EAPI void *e_ilist_selected_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);
EAPI void e_ilist_selector_set (Evas_Object *obj, int selector);
EAPI int e_ilist_selector_get (Evas_Object *obj);
+EAPI void e_ilist_remove_num (Evas_Object *obj, int n);
+EAPI void e_ilist_remove_label (Evas_Object *obj, char *label);
#endif
#endif
diff --git a/src/bin/e_int_border_border.c b/src/bin/e_int_border_border.c
index dc38cb367..5101d2c4c 100644
--- a/src/bin/e_int_border_border.c
+++ b/src/bin/e_int_border_border.c
@@ -184,7 +184,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
if (!strcmp(cfdata->border->client.border.name, (char *)l->data))
sel = n;
}
- e_widget_ilist_select_set(oi, sel);
+ e_widget_ilist_selected_set(oi, sel);
e_widget_min_size_get(oi, &wmw, &wmh);
e_widget_min_size_set(oi, wmw, 250);
diff --git a/src/bin/e_int_config_background.c b/src/bin/e_int_config_background.c
index 67d466d39..881c580b3 100644
--- a/src/bin/e_int_config_background.c
+++ b/src/bin/e_int_config_background.c
@@ -196,7 +196,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
if ((e_config->desktop_default_background) && !(strcmp(e_config->desktop_default_background, fullbg)))
{
- e_widget_ilist_select_set(il, i);
+ e_widget_ilist_selected_set(il, i);
bg = edje_object_add(evas);
edje_object_file_set(bg, e_config->desktop_default_background, "desktop/background");
im = e_widget_image_add_from_object(evas, bg, 160, 120);
diff --git a/src/bin/e_int_config_theme.c b/src/bin/e_int_config_theme.c
index ac788a8e7..505732ba7 100644
--- a/src/bin/e_int_config_theme.c
+++ b/src/bin/e_int_config_theme.c
@@ -206,7 +206,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
if (!(strcmp(themefile, cfdata->current_theme)))
{
- e_widget_ilist_select_set(il, i);
+ e_widget_ilist_selected_set(il, i);
im = e_widget_image_add_from_object(evas, theme, 320, 240);
e_widget_image_object_set(im, e_thumb_evas_object_get(fulltheme, evas, 160, 120, 1));
}
diff --git a/src/bin/e_widget_ilist.c b/src/bin/e_widget_ilist.c
index 334e5b69f..af36d27b0 100644
--- a/src/bin/e_widget_ilist.c
+++ b/src/bin/e_widget_ilist.c
@@ -90,12 +90,30 @@ e_widget_ilist_append(Evas_Object *obj, Evas_Object *icon, char *label, void (*f
}
void
-e_widget_ilist_select_set(Evas_Object *obj, int n)
+e_widget_ilist_selected_set(Evas_Object *obj, int n)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
- e_ilist_select_set(wd->o_ilist, n);
+ e_ilist_selected_set(wd->o_ilist, n);
+}
+
+int
+e_widget_ilist_selected_get(Evas_Object *obj)
+{
+ E_Widget_Data *wd;
+
+ wd = e_widget_data_get(obj);
+ return e_ilist_selected_get(wd->o_ilist);
+}
+
+const char *
+e_widget_ilist_selected_label_get(Evas_Object *obj)
+{
+ E_Widget_Data *wd;
+
+ wd = e_widget_data_get(obj);
+ return e_ilist_selected_label_get(wd->o_ilist);
}
void
@@ -116,6 +134,24 @@ e_widget_ilist_go(Evas_Object *obj)
wd->o_widget = obj;
}
+void
+e_widget_ilist_remove_num(Evas_Object *obj, int n)
+{
+ E_Widget_Data *wd;
+
+ wd = e_widget_data_get(obj);
+ e_ilist_remove_num(wd->o_ilist, n);
+}
+
+void
+e_widget_ilist_remove_label(Evas_Object *obj, char *label)
+{
+ E_Widget_Data *wd;
+
+ wd = e_widget_data_get(obj);
+ e_ilist_remove_label(wd->o_ilist, label);
+}
+
static void
_e_wid_del_hook(Evas_Object *obj)
{
diff --git a/src/bin/e_widget_ilist.h b/src/bin/e_widget_ilist.h
index 8ea132b4b..4f29efff7 100644
--- a/src/bin/e_widget_ilist.h
+++ b/src/bin/e_widget_ilist.h
@@ -8,9 +8,13 @@
EAPI Evas_Object *e_widget_ilist_add(Evas *evas, int icon_w, int icon_h, char **value);
EAPI void e_widget_ilist_append(Evas_Object *obj, Evas_Object *icon, char *label, void (*func) (void *data), void *data, char *val);
-EAPI void e_widget_ilist_select_set(Evas_Object *obj, int n);
+EAPI void e_widget_ilist_selected_set(Evas_Object *obj, int n);
EAPI void e_widget_ilist_selector_set(Evas_Object *obj, int selector);
EAPI void e_widget_ilist_go(Evas_Object *obj);
-
+EAPI int e_widget_ilist_selected_get(Evas_Object *obj);
+EAPI const char *e_widget_ilist_selected_label_get(Evas_Object *obj);
+EAPI void e_widget_ilist_remove_num(Evas_Object *obj, int n);
+EAPI void e_widget_ilist_remove_label(Evas_Object *obj, char *label);
+
#endif
#endif