From efdec63ba4230afd2c6d4a1e84c88f810b605ce3 Mon Sep 17 00:00:00 2001 From: Daniel Juyung Seo Date: Thu, 1 Dec 2011 06:15:08 +0000 Subject: [PATCH] elm gengrid/genlist: Changed 'label_get' to 'text_get' according to the recent elementary api corrections. I changed item class's 'label_get' to 'text_get'. But 'label_get' is still supported by union structure. So 'label_get' will just give you deprecated warnings while compiling but it's recommended to fix your apps to 'text_get'. Sometimes when you initialize item class using braces, you will get 'missing braces around initializer' but ignore this. That warning will be gone after I remove 'label_get' backport. I will remove this 'label_get' backport after I finish below jobs. [TODO] 1. Fix all apps in trunk. 2. Change edc "labels" to "texts" as well. I haven't done this yet. SVN revision: 65751 --- doc/widgets/widget_preview_gengrid.c | 4 +-- doc/widgets/widget_preview_genlist1.c | 4 +-- doc/widgets/widget_preview_genlist2.c | 4 +-- doc/widgets/widget_preview_genlist3.c | 4 +-- doc/widgets/widget_preview_genlist4.c | 4 +-- doc/widgets/widget_preview_genlist5.c | 4 +-- src/bin/test_cursor.c | 6 ++-- src/bin/test_eio.c | 6 ++-- src/bin/test_floating.c | 4 +-- src/bin/test_gengrid.c | 10 +++---- src/bin/test_genlist.c | 52 +++++++++++++++++------------------ src/bin/test_icon_desktops.c | 4 +-- src/bin/test_index.c | 4 +-- src/bin/test_panel.c | 6 ++-- src/bin/test_tooltip.c | 6 ++-- src/lib/Elementary.h.in | 52 +++++++++++++++++++++-------------- src/lib/elc_fileselector.c | 4 +-- src/lib/elm_gengrid.c | 4 +-- src/lib/elm_genlist.c | 8 +++--- src/lib/elm_store.c | 6 ++-- 20 files changed, 104 insertions(+), 92 deletions(-) diff --git a/doc/widgets/widget_preview_gengrid.c b/doc/widgets/widget_preview_gengrid.c index f2cda97..b663b88 100644 --- a/doc/widgets/widget_preview_gengrid.c +++ b/doc/widgets/widget_preview_gengrid.c @@ -6,7 +6,7 @@ #endif static char * -_grid_label_get(void *data __UNUSED__, +_grid_text_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { @@ -40,7 +40,7 @@ evas_object_show(gengrid); Elm_Gengrid_Item_Class gic; gic.item_style = "default"; -gic.func.label_get = _grid_label_get; +gic.func.text_get = _grid_text_get; gic.func.content_get = _grid_content_get; gic.func.state_get = NULL; gic.func.del = NULL; diff --git a/doc/widgets/widget_preview_genlist1.c b/doc/widgets/widget_preview_genlist1.c index 67f70fa..b79c97f 100644 --- a/doc/widgets/widget_preview_genlist1.c +++ b/doc/widgets/widget_preview_genlist1.c @@ -6,7 +6,7 @@ #endif static char * -_label_get(void *data __UNUSED__, +_text_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { @@ -36,7 +36,7 @@ evas_object_show(genlist); Elm_Genlist_Item_Class gic; Elm_Genlist_Item *it, *top; gic.item_style = "default"; -gic.func.label_get = _label_get; +gic.func.text_get = _text_get; gic.func.content_get = _content_get; gic.func.state_get = NULL; gic.func.del = NULL; diff --git a/doc/widgets/widget_preview_genlist2.c b/doc/widgets/widget_preview_genlist2.c index e33b5f5..89d89cc 100644 --- a/doc/widgets/widget_preview_genlist2.c +++ b/doc/widgets/widget_preview_genlist2.c @@ -6,7 +6,7 @@ #endif static char * -_label_get(void *data __UNUSED__, +_text_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part) { @@ -35,7 +35,7 @@ evas_object_show(genlist); Elm_Genlist_Item_Class gic; gic.item_style = "double_label"; -gic.func.label_get = _label_get; +gic.func.text_get = _text_get; gic.func.content_get = _content_get; gic.func.state_get = NULL; gic.func.del = NULL; diff --git a/doc/widgets/widget_preview_genlist3.c b/doc/widgets/widget_preview_genlist3.c index 7dd7efb..919a1ec 100644 --- a/doc/widgets/widget_preview_genlist3.c +++ b/doc/widgets/widget_preview_genlist3.c @@ -6,7 +6,7 @@ #endif static char * -_label_get(void *data __UNUSED__, +_text_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part) { @@ -35,7 +35,7 @@ evas_object_show(genlist); Elm_Genlist_Item_Class gic; gic.item_style = "icon_top_text_bottom"; -gic.func.label_get = _label_get; +gic.func.text_get = _text_get; gic.func.content_get = _content_get; gic.func.state_get = NULL; gic.func.del = NULL; diff --git a/doc/widgets/widget_preview_genlist4.c b/doc/widgets/widget_preview_genlist4.c index efe4d82..6225902 100644 --- a/doc/widgets/widget_preview_genlist4.c +++ b/doc/widgets/widget_preview_genlist4.c @@ -6,7 +6,7 @@ #endif static char * -_label_get(void *data __UNUSED__, +_text_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part) { @@ -35,7 +35,7 @@ evas_object_show(genlist); Elm_Genlist_Item_Class gic; gic.item_style = "group_index"; -gic.func.label_get = _label_get; +gic.func.text_get = _text_get; gic.func.content_get = _content_get; gic.func.state_get = NULL; gic.func.del = NULL; diff --git a/doc/widgets/widget_preview_genlist5.c b/doc/widgets/widget_preview_genlist5.c index 3a2f396..09cc493 100644 --- a/doc/widgets/widget_preview_genlist5.c +++ b/doc/widgets/widget_preview_genlist5.c @@ -6,7 +6,7 @@ #endif static char * -_label_get(void *data __UNUSED__, +_text_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part) { @@ -35,7 +35,7 @@ evas_object_show(genlist); Elm_Genlist_Item_Class gic; gic.item_style = "default"; -gic.func.label_get = _label_get; +gic.func.text_get = _text_get; gic.func.content_get = _content_get; gic.func.state_get = NULL; gic.func.del = NULL; diff --git a/src/bin/test_cursor.c b/src/bin/test_cursor.c index f0e97d1..19a6c06 100644 --- a/src/bin/test_cursor.c +++ b/src/bin/test_cursor.c @@ -86,7 +86,7 @@ glt_con_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info } char * -glt_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +glt_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { char buf[256]; snprintf(buf, sizeof(buf), "Item mode %i", (int)(long)data); @@ -231,7 +231,7 @@ test_cursor2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf evas_object_show(gl); itct.item_style = "default"; - itct.func.label_get = glt_label_get; + itct.func.text_get = glt_text_get; it1 = elm_genlist_item_append(gl, &itct, (void *) 1, NULL, ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL); @@ -259,7 +259,7 @@ test_cursor2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf evas_object_size_hint_fill_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL); gic.item_style = "default"; - gic.func.label_get = grd_lbl_get; + gic.func.text_get = grd_lbl_get; gic.func.content_get = grd_content_get; n = 0; diff --git a/src/bin/test_eio.c b/src/bin/test_eio.c index 7dab16e..b16dfed 100644 --- a/src/bin/test_eio.c +++ b/src/bin/test_eio.c @@ -20,7 +20,7 @@ static void _ls_main_cb(void *data, Eio_File *handler, const char *file); static void _ls_done_cb(void *data, Eio_File *handler); static void _ls_error_cb(void *data, Eio_File *handler, int error); static void _file_chosen(void *data, Evas_Object *obj, void *event_info); -static char *_gl_label_get(void *data, Evas_Object *obj, const char *part); +static char *_gl_text_get(void *data, Evas_Object *obj, const char *part); static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *part); static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part); static void _gl_del(void *data, Evas_Object *obj); @@ -84,7 +84,7 @@ _file_chosen(void *data, Evas_Object *obj __UNUSED__, void *event_info) } static char * -_gl_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +_gl_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "Item # %s", (char*)data); @@ -120,7 +120,7 @@ test_eio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ Evas_Object *win, *bg, *vbox, *hbox, *ic, *bt, *fs_bt, *gl; it_eio.item_style = "default"; - it_eio.func.label_get = _gl_label_get; + it_eio.func.text_get = _gl_text_get; it_eio.func.content_get = _gl_content_get; it_eio.func.state_get = _gl_state_get; it_eio.func.del = _gl_del; diff --git a/src/bin/test_floating.c b/src/bin/test_floating.c index 30a09b4..742e6c3 100644 --- a/src/bin/test_floating.c +++ b/src/bin/test_floating.c @@ -12,7 +12,7 @@ typedef struct _Testitem static Elm_Genlist_Item_Class itc1; -static char *glf_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +static char *glf_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { char buf[256]; snprintf(buf, sizeof(buf), "Item # %i", (int)(long)data); @@ -86,7 +86,7 @@ test_floating(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_show(gl); itc1.item_style = "default"; - itc1.func.label_get = glf_label_get; + itc1.func.text_get = glf_text_get; itc1.func.content_get = glf_content_get; itc1.func.state_get = glf_state_get; itc1.func.del = glf_del; diff --git a/src/bin/test_gengrid.c b/src/bin/test_gengrid.c index 0979bd4..e57aa4b 100644 --- a/src/bin/test_gengrid.c +++ b/src/bin/test_gengrid.c @@ -96,7 +96,7 @@ grid_item_check_changed(void *data, Evas_Object *obj, void *event_info __UNUSED_ } char * -grid_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +grid_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { const Testitem *ti = data; char buf[256]; @@ -181,7 +181,7 @@ test_gengrid(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); gic.item_style = "default"; - gic.func.label_get = grid_label_get; + gic.func.text_get = grid_text_get; gic.func.content_get = grid_content_get; gic.func.state_get = grid_state_get; gic.func.del = grid_del; @@ -373,7 +373,7 @@ test_gengrid2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_show(ck); gic.item_style = "default"; - gic.func.label_get = grid_label_get; + gic.func.text_get = grid_text_get; gic.func.content_get = grid_content_get; gic.func.state_get = grid_state_get; gic.func.del = grid_del; @@ -418,13 +418,13 @@ test_gengrid3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); gic.item_style = "default"; - gic.func.label_get = grid_label_get; + gic.func.text_get = grid_text_get; gic.func.content_get = grid_content_get; gic.func.state_get = grid_state_get; gic.func.del = grid_del; ggic.item_style = "group_index"; - ggic.func.label_get = grid_label_get; + ggic.func.text_get = grid_text_get; ggic.func.content_get = NULL; ggic.func.state_get = NULL; ggic.func.del = NULL; diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c index dc7c7f6..f5a1548 100644 --- a/src/bin/test_genlist.c +++ b/src/bin/test_genlist.c @@ -21,7 +21,7 @@ typedef struct _Testitem static Elm_Genlist_Item_Class itc1; -char *gl_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +char *gl_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { char buf[256]; snprintf(buf, sizeof(buf), "Item # %i", (int)(long)data); @@ -141,7 +141,7 @@ test_genlist(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf elm_win_resize_object_add(win, over); itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; + itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; @@ -189,7 +189,7 @@ my_gl_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) static int i = 0; itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; + itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; @@ -211,7 +211,7 @@ my_gl_insert_before(void *data, Evas_Object *obj __UNUSED__, void *event_info __ Elm_Genlist_Item *gli_selected; itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; + itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; @@ -241,7 +241,7 @@ my_gl_insert_after(void *data, Evas_Object *obj __UNUSED__, void *event_info __U Elm_Genlist_Item *gli_selected; itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; + itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; @@ -368,7 +368,7 @@ test_genlist2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_show(gl); itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; + itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; @@ -512,7 +512,7 @@ test_genlist2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in /*************/ static Elm_Genlist_Item_Class itc2; -char *gl2_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +char *gl2_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { const Testitem *tit = data; char buf[256]; @@ -609,7 +609,7 @@ test_genlist3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_show(gl); itc2.item_style = "default"; - itc2.func.label_get = gl2_label_get; + itc2.func.text_get = gl2_text_get; itc2.func.content_get = gl2_content_get; itc2.func.state_get = gl2_state_get; itc2.func.del = gl2_del; @@ -678,7 +678,7 @@ my_gl_item_check_changed(void *data, Evas_Object *obj, void *event_info __UNUSED } static Elm_Genlist_Item_Class itc3; -char *gl3_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +char *gl3_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { const Testitem *tit = data; char buf[256]; @@ -745,7 +745,7 @@ test_genlist4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_show(gl); itc3.item_style = "default"; - itc3.func.label_get = gl3_label_get; + itc3.func.text_get = gl3_text_get; itc3.func.content_get = gl3_content_get; itc3.func.state_get = gl3_state_get; itc3.func.del = gl3_del; @@ -814,7 +814,7 @@ my_gl_item_check_changed2(void *data, Evas_Object *obj, void *event_info __UNUSE } static Elm_Genlist_Item_Class itc5; -char *gl5_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part) +char *gl5_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part) { const Testitem *tit = data; char buf[256]; @@ -964,7 +964,7 @@ test_genlist5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_show(gl); itc5.item_style = "double_label"; - itc5.func.label_get = gl5_label_get; + itc5.func.text_get = gl5_text_get; itc5.func.content_get = gl5_content_get; itc5.func.state_get = gl5_state_get; itc5.func.del = gl5_del; @@ -1088,7 +1088,7 @@ gl4_con_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info elm_genlist_item_expanded_set(it, 0); } -char *gl4_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +char *gl4_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { char buf[256]; snprintf(buf, sizeof(buf), "Item mode %i", (int)(long)data); @@ -1149,7 +1149,7 @@ test_genlist6(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_show(gl); itc4.item_style = "default"; - itc4.func.label_get = gl4_label_get; + itc4.func.text_get = gl4_text_get; itc4.func.content_get = gl4_content_get; itc4.func.state_get = gl4_state_get; itc4.func.del = gl4_del; @@ -1303,13 +1303,13 @@ test_genlist7(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in elm_pager_content_push(pager, gl); itc2.item_style = "default"; - itc2.func.label_get = gl2_label_get; + itc2.func.text_get = gl2_text_get; itc2.func.content_get = gl2_content_get; itc2.func.state_get = gl2_state_get; itc2.func.del = gl2_del; itc7.item_style = "double_label"; - itc7.func.label_get = gl5_label_get; + itc7.func.text_get = gl5_text_get; itc7.func.content_get = gl5_content_get; itc7.func.state_get = gl5_state_get; itc7.func.del = gl5_del; @@ -1337,7 +1337,7 @@ test_genlist7(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in /*************/ static Elm_Genlist_Item_Class itc_group; -char *gl8_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +char *gl8_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { char buf[256]; snprintf(buf, sizeof(buf), "Group Index # %i (Item # %i)", (int)((long)data / 10), (int)(long)data); @@ -1390,13 +1390,13 @@ test_genlist8(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_show(gl); itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; + itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; itc_group.item_style = "group_index"; - itc_group.func.label_get = gl8_label_get; + itc_group.func.text_get = gl8_text_get; itc_group.func.content_get = NULL; itc_group.func.state_get = NULL; itc_group.func.del = gl_del; @@ -1600,13 +1600,13 @@ test_genlist9(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in evas_object_show(gl); itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; + itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; itc_group.item_style = "group_index"; - itc_group.func.label_get = gl8_label_get; + itc_group.func.text_get = gl8_text_get; itc_group.func.content_get = NULL; itc_group.func.state_get = NULL; itc_group.func.del = gl_del; @@ -1651,7 +1651,7 @@ test_genlist9(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in static Elm_Genlist_Item_Class itc10; static char *mode_type[] = { "slide", "rotate" }; -char *gl10_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part) +char *gl10_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part) { char buf[256]; if (!strcmp(part, "elm.text.mode")) @@ -1778,7 +1778,7 @@ test_genlist10(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i evas_object_show(gl); itc10.item_style = "default"; - itc10.func.label_get = gl10_label_get; + itc10.func.text_get = gl10_text_get; itc10.func.content_get = gl10_content_get; itc10.func.state_get = gl_state_get; itc10.func.del = gl_del; @@ -1873,7 +1873,7 @@ test_genlist11(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i evas_object_show(tg); itc1.item_style = "default"; - itc1.func.label_get = gl_label_get; + itc1.func.text_get = gl_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; @@ -1894,7 +1894,7 @@ test_genlist11(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i evas_object_show(win); } -char *gl12_label_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +char *gl12_text_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { return strdup("Enlightenment is not just a window manager for Linux/X11 and others, but also a whole suite of libraries to help you create beautiful user interfaces with much less work than doing it the old fashioned way and fighting with traditional toolkits, not to mention a traditional window manager. It covers uses from small mobile devices like phones all the way to powerful multi-core desktops (which are the primary development environment)."); } @@ -1927,7 +1927,7 @@ test_genlist12(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i evas_object_show(gl); itc1.item_style = "message"; - itc1.func.label_get = gl12_label_get; + itc1.func.text_get = gl12_text_get; itc1.func.content_get = gl_content_get; itc1.func.state_get = gl_state_get; itc1.func.del = gl_del; diff --git a/src/bin/test_icon_desktops.c b/src/bin/test_icon_desktops.c index ce19faa..19fd36a 100644 --- a/src/bin/test_icon_desktops.c +++ b/src/bin/test_icon_desktops.c @@ -6,7 +6,7 @@ static Elm_Genlist_Item_Class it_desk; static char * -desk_gl_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +desk_gl_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { #ifdef ELM_EFREET Efreet_Desktop *d = (Efreet_Desktop *)data; @@ -74,7 +74,7 @@ test_icon_desktops(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve evas_object_show(bg); it_desk.item_style = "default"; - it_desk.func.label_get = desk_gl_label_get; + it_desk.func.text_get = desk_gl_text_get; it_desk.func.content_get = desk_gl_content_get; it_desk.func.state_get = NULL; it_desk.func.del = desk_gl_del; diff --git a/src/bin/test_index.c b/src/bin/test_index.c index 27804d5..f9f9e47 100644 --- a/src/bin/test_index.c +++ b/src/bin/test_index.c @@ -4,7 +4,7 @@ #endif #ifndef ELM_LIB_QUICKLAUNCH static Elm_Genlist_Item_Class itci; -char *gli_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) +char *gli_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { char buf[256]; int j = (long)data; @@ -65,7 +65,7 @@ test_index(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_show(id); itci.item_style = "default"; - itci.func.label_get = gli_label_get; + itci.func.text_get = gli_text_get; itci.func.content_get = NULL; itci.func.state_get = NULL; itci.func.del = NULL; diff --git a/src/bin/test_panel.c b/src/bin/test_panel.c index 9e94886..bcf41b6 100644 --- a/src/bin/test_panel.c +++ b/src/bin/test_panel.c @@ -8,7 +8,7 @@ static Elm_Genlist_Item_Class itc; static void _bstatus(void *data, Evas_Object *obj, void *event_info); static void _tstatus(void *data, Evas_Object *obj, void *event_info); -static char *_label_get(void *data, Evas_Object *obj, const char *source); +static char *_text_get(void *data, Evas_Object *obj, const char *source); static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *source); static Eina_Bool _state_get(void *data, Evas_Object *obj, const char *source); static void _item_del(void *data, Evas_Object *obj); @@ -46,7 +46,7 @@ _bstatus(void *data, Evas_Object *obj, void *event_info __UNUSED__) } static char * -_label_get(void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) +_text_get(void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) { return strdup(ecore_file_file_get(data)); } @@ -198,7 +198,7 @@ test_panel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info evas_object_size_hint_align_set(panel, 0, EVAS_HINT_FILL); itc.item_style = "default"; - itc.func.label_get = _label_get; + itc.func.text_get = _text_get; itc.func.content_get = _content_get; itc.func.state_get = _state_get; itc.func.del = _item_del; diff --git a/src/bin/test_tooltip.c b/src/bin/test_tooltip.c index 43eca93..a7cc221 100644 --- a/src/bin/test_tooltip.c +++ b/src/bin/test_tooltip.c @@ -97,7 +97,7 @@ gltt_con_req(void *data __UNUSED__, } char * -gltt_label_get(void *data, +gltt_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__) { @@ -559,7 +559,7 @@ test_tooltip2(void *data __UNUSED__, EVAS_HINT_EXPAND); gic.item_style = "default"; - gic.func.label_get = grdt_lbl_get; + gic.func.text_get = grdt_lbl_get; gic.func.content_get = grdt_content_get; n = 0; @@ -589,7 +589,7 @@ test_tooltip2(void *data __UNUSED__, EVAS_HINT_EXPAND); itct.item_style = "default"; - itct.func.label_get = gltt_label_get; + itct.func.text_get = gltt_text_get; it1 = elm_genlist_item_append(gl, &itct, (void *)1, NULL, ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL); diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 6e4ed62..53aeaae 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -7992,7 +7992,7 @@ extern "C" { typedef struct Elm_Gen_Item Elm_Gen_Item; typedef struct _Elm_Gen_Item_Class Elm_Gen_Item_Class; typedef struct _Elm_Gen_Item_Class_Func Elm_Gen_Item_Class_Func; /**< Class functions for gen item classes. */ - typedef char *(*Elm_Gen_Item_Label_Get_Cb) (void *data, Evas_Object *obj, const char *part); /**< Label fetching class function for gen item classes. */ + typedef char *(*Elm_Gen_Item_Text_Get_Cb) (void *data, Evas_Object *obj, const char *part); /**< Label fetching class function for gen item classes. */ typedef Evas_Object *(*Elm_Gen_Item_Content_Get_Cb) (void *data, Evas_Object *obj, const char *part); /**< Content(swallowed object) fetching class function for gen item classes. */ typedef Eina_Bool (*Elm_Gen_Item_State_Get_Cb) (void *data, Evas_Object *obj, const char *part); /**< State fetching class function for gen item classes. */ typedef void (*Elm_Gen_Item_Del_Cb) (void *data, Evas_Object *obj); /**< Deletion class function for gen item classes. */ @@ -8001,7 +8001,11 @@ extern "C" { const char *item_style; struct _Elm_Gen_Item_Class_Func { - Elm_Gen_Item_Label_Get_Cb label_get; + union /* temporary compatibility code */ + { + Elm_Gen_Item_Text_Get_Cb label_get EINA_DEPRECATED; + Elm_Gen_Item_Text_Get_Cb text_get; + }; Elm_Gen_Item_Content_Get_Cb content_get; Elm_Gen_Item_State_Get_Cb state_get; Elm_Gen_Item_Del_Cb del; @@ -8061,18 +8065,18 @@ extern "C" { * * @section Gengrid_Items Gengrid items * - * An item in a gengrid can have 0 or more text labels (they can be + * An item in a gengrid can have 0 or more texts (they can be * regular text or textblock Evas objects - that's up to the style * to determine), 0 or more icons (which are simply objects * swallowed into the gengrid item's theming Edje object) and 0 or * more boolean states, which have the behavior left to the * user to define. The Edje part names for each of these properties * will be looked up, in the theme file for the gengrid, under the - * Edje (string) data items named @c "labels", @c "icons" and @c + * Edje (string) data items named @c "texts", @c "icons" and @c * "states", respectively. For each of those properties, if more * than one part is provided, they must have names listed separated * by spaces in the data fields. For the default gengrid item - * theme, we have @b one label part (@c "elm.text"), @b two icon + * theme, we have @b one text part (@c "elm.text"), @b two icon * parts (@c "elm.swalllow.icon" and @c "elm.swallow.end") and @b * no state parts. * @@ -8096,7 +8100,7 @@ extern "C" { * - @c item_style - This is a constant string and simply defines * the name of the item style. It @b must be specified and the * default should be @c "default". - * - @c func.label_get - This function is called when an item + * - @c func.text_get - This function is called when an item * object is actually created. The @c data parameter will point to * the same data passed to elm_gengrid_item_append() and related * item creation functions. The @c obj parameter is the gengrid @@ -8104,7 +8108,7 @@ extern "C" { * of the existing text parts in the Edje group implementing the * item's theme. This function @b must return a strdup'()ed string, * as the caller will free() it when done. See - * #Elm_Gengrid_Item_Label_Get_Cb. + * #Elm_Gengrid_Item_Text_Get_Cb. * - @c func.content_get - This function is called when an item object * is actually created. The @c data parameter will point to the * same data passed to elm_gengrid_item_append() and related item @@ -8145,7 +8149,7 @@ extern "C" { * modified (added, deleted, selected or unselected) of child items * on a gengrid. * - * If an item changes (internal (boolean) state, label or content + * If an item changes (internal (boolean) state, text or content * changes), then use elm_gengrid_item_update() to have gengrid * update the item with the new state. A gengrid will re-"realize" * the item, thus calling the functions in the @@ -8246,13 +8250,13 @@ extern "C" { #define Elm_Gengrid_Item Elm_Gen_Item /**< Item of Elm_Genlist. Sub-type of Elm_Widget_Item */ typedef struct _Elm_Gengrid_Item_Class_Func Elm_Gengrid_Item_Class_Func; /**< Class functions for gengrid item classes. */ /** - * Label fetching class function for Elm_Gen_Item_Class. + * Text fetching class function for Elm_Gen_Item_Class. * @param data The data passed in the item creation function * @param obj The base widget object * @param part The part name of the swallow - * @return The allocated (NOT stringshared) string to set as the label + * @return The allocated (NOT stringshared) string to set as the text */ - typedef char *(*Elm_Gengrid_Item_Label_Get_Cb) (void *data, Evas_Object *obj, const char *part); + typedef char *(*Elm_Gengrid_Item_Text_Get_Cb) (void *data, Evas_Object *obj, const char *part); /** * Content (swallowed object) fetching class function for Elm_Gen_Item_Class. * @param data The data passed in the item creation function @@ -8287,7 +8291,11 @@ extern "C" { const char *item_style; struct _Elm_Gengrid_Item_Class_Func { - Elm_Gengrid_Item_Label_Get_Cb label_get; + union /* temporary compatibility code */ + { + Elm_Gengrid_Item_Text_Get_Cb label_get EINA_DEPRECATED; + Elm_Gengrid_Item_Text_Get_Cb text_get; /**< Text fetching class function for gengrid item classes.*/ + }; Elm_Gengrid_Item_Content_Get_Cb content_get; Elm_Gengrid_Item_State_Get_Cb state_get; Elm_Gengrid_Item_Del_Cb del; @@ -9038,7 +9046,7 @@ extern "C" { * @param item The gengrid item * * This updates an item by calling all the item class functions - * again to get the contents, labels and states. Use this when the + * again to get the contents, texts and states. Use this when the * original item data has changed and you want the changes to be * reflected. * @@ -18134,14 +18142,14 @@ extern "C" { * elm_genlist_item_append() and related item creation functions, and a @c * obj parameter that points to the genlist object itself. * - * The function pointers inside @c func are @c label_get, @c icon_get, @c + * The function pointers inside @c func are @c text_get, @c icon_get, @c * state_get and @c del. The 3 first functions also receive a @c part * parameter described below. A brief description of these functions follows: * - * - @c label_get - The @c part parameter is the name string of one of the + * - @c text_get - The @c part parameter is the name string of one of the * existing text parts in the Edje group implementing the item's theme. * This function @b must return a strdup'()ed string, as the caller will - * free() it when done. See #Elm_Genlist_Item_Label_Get_Cb. + * free() it when done. See #Elm_Genlist_Item_Text_Get_Cb. * - @c content_get - The @c part parameter is the name string of one of the * existing (content) swallow parts in the Edje group implementing the item's * theme. It must return @c NULL, when no content is desired, or a valid @@ -18453,13 +18461,13 @@ extern "C" { #define Elm_Genlist_Item Elm_Gen_Item /**< Item of Elm_Genlist. Sub-type of Elm_Widget_Item */ typedef struct _Elm_Genlist_Item_Class_Func Elm_Genlist_Item_Class_Func; /**< Class functions for genlist item class */ /** - * Label fetching class function for Elm_Gen_Item_Class. + * Text fetching class function for Elm_Gen_Item_Class. * @param data The data passed in the item creation function * @param obj The base widget object * @param part The part name of the swallow - * @return The allocated (NOT stringshared) string to set as the label + * @return The allocated (NOT stringshared) string to set as the text */ - typedef char *(*Elm_Genlist_Item_Label_Get_Cb) (void *data, Evas_Object *obj, const char *part); + typedef char *(*Elm_Genlist_Item_Text_Get_Cb) (void *data, Evas_Object *obj, const char *part); /** * Content (swallowed object) fetching class function for Elm_Gen_Item_Class. * @param data The data passed in the item creation function @@ -18498,7 +18506,11 @@ extern "C" { const char *item_style; /**< style of this class. */ struct Elm_Genlist_Item_Class_Func { - Elm_Genlist_Item_Label_Get_Cb label_get; /**< Label fetching class function for genlist item classes.*/ + union /* temporary compatibility code */ + { + Elm_Genlist_Item_Text_Get_Cb label_get EINA_DEPRECATED; + Elm_Genlist_Item_Text_Get_Cb text_get; /**< Text fetching class function for genlist item classes.*/ + }; Elm_Genlist_Item_Content_Get_Cb content_get; /**< Content fetching class function for genlist item classes. */ Elm_Genlist_Item_State_Get_Cb state_get; /**< State fetching class function for genlist item classes. */ Elm_Genlist_Item_Del_Cb del; /**< Deletion class function for genlist item classes. */ diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c index 7f19276..513af28 100644 --- a/src/lib/elc_fileselector.c +++ b/src/lib/elc_fileselector.c @@ -244,7 +244,7 @@ _theme_hook(Evas_Object *obj) /*** GENLIST "MODEL" ***/ static char * -_itc_label_get(void *data, +_itc_text_get(void *data, Evas_Object *obj __UNUSED__, const char *source __UNUSED__) { @@ -869,7 +869,7 @@ elm_fileselector_add(Evas_Object *parent) for (i = 0; i < ELM_FILE_LAST; ++i) { - list_itc[i].func.label_get = grid_itc[i].func.label_get = _itc_label_get; + list_itc[i].func.text_get = grid_itc[i].func.text_get = _itc_text_get; list_itc[i].func.state_get = grid_itc[i].func.state_get = _itc_state_get; list_itc[i].func.del = grid_itc[i].func.del = _itc_del; } diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index 1acbd07..a77c07f 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -930,7 +930,7 @@ _item_realize(Elm_Gen_Item *it) evas_object_size_hint_min_set(it->spacer, 2 * _elm_config->scale, 1); edje_object_part_swallow(VIEW(it), "elm.swallow.pad", it->spacer); - if (it->itc->func.label_get) + if (it->itc->func.text_get) { const Eina_List *l; const char *key; @@ -940,7 +940,7 @@ _item_realize(Elm_Gen_Item *it) "labels")); EINA_LIST_FOREACH(it->labels, l, key) { - char *s = it->itc->func.label_get + char *s = it->itc->func.text_get ((void *)it->base.data, WIDGET(it), key); if (s) { diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 72cd13a..1fb7282 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -1694,7 +1694,7 @@ _item_label_realize(Elm_Gen_Item *it, Eina_List **source, const char *parts) { - if (it->itc->func.label_get) + if (it->itc->func.text_get) { const Eina_List *l; const char *key; @@ -1705,7 +1705,7 @@ _item_label_realize(Elm_Gen_Item *it, if (parts && fnmatch(parts, key, FNM_PERIOD)) continue; - char *s = it->itc->func.label_get + char *s = it->itc->func.text_get ((void *)it->base.data, WIDGET(it), key); if (s) @@ -2937,7 +2937,7 @@ _mode_item_realize(Elm_Gen_Item *it) evas_object_event_callback_add(it->item->mode_view, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move, it); - /* label_get, content_get, state_get */ + /* text_get, content_get, state_get */ /* FIXME: If you see that assert, please notify us and we will clean our mess */ assert(eina_list_count(it->item->mode_content_objs) == 0); @@ -3204,7 +3204,7 @@ _item_content_unset_hook(Elm_Gen_Item *it, const char *part) static const char * _item_label_hook(Elm_Gen_Item *it, const char *part) { - if (!it->itc->func.label_get) return NULL; + if (!it->itc->func.text_get) return NULL; return edje_object_part_text_get(VIEW(it), part); } diff --git a/src/lib/elm_store.c b/src/lib/elm_store.c index 5a12b08..0c238f8 100644 --- a/src/lib/elm_store.c +++ b/src/lib/elm_store.c @@ -262,7 +262,7 @@ _store_item_mapping_find(Elm_Store_Item *sti, const char *part) } static char * -_store_item_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part) +_store_item_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part) { Elm_Store_Item *sti = data; const char *s = ""; @@ -453,7 +453,7 @@ _store_filesystem_list_update(void *data, Ecore_Thread *th __UNUSED__, void *msg if (!itc) itc = &_store_item_class; else { - itc->func.label_get = _store_item_label_get; + itc->func.text_get = _store_item_text_get; itc->func.content_get = _store_item_content_get; itc->func.state_get = NULL; // FIXME: support state gets later itc->func.del = _store_item_del; @@ -485,7 +485,7 @@ _elm_store_new(size_t size) eina_magic_string_set(ELM_STORE_ITEM_MAGIC, "Elm_Store_Item"); // setup default item class (always the same) if list cb doesnt provide one _store_item_class.item_style = "default"; - _store_item_class.func.label_get = _store_item_label_get; + _store_item_class.func.text_get = _store_item_text_get; _store_item_class.func.content_get = _store_item_content_get; _store_item_class.func.state_get = NULL; // FIXME: support state gets later _store_item_class.func.del = _store_item_del; -- 2.7.4