elm: elm_object_text_part_set/get() is deprecated

use elm_object_part_text_set/get().
This change is done so that it matches
edje_object_part_text_set/get().

SVN revision: 65310
This commit is contained in:
Boris Faure 2011-11-16 20:17:25 +00:00
parent 236192cd9a
commit b2b36ebbc0
19 changed files with 126 additions and 86 deletions

View File

@ -3073,7 +3073,7 @@
* @until }
*
* This call elm_layout_data_get() is used to fetch the string based on the key,
* and elm_object_text_part_set() will set the part defined in the theme as
* and elm_object_part_text_set() will set the part defined in the theme as
* "example/title" to contain this string. This key "example/title" has nothing
* special. It's just an arbitrary convention that we are using in this example.
* Every string in this example referencing a part of this theme will be of the

View File

@ -5,9 +5,9 @@ evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, o);
evas_object_show(o);
elm_object_text_part_set(o, "left", "left");
elm_object_text_part_set(o, "center", "center");
elm_object_text_part_set(o, "right", "right");
elm_object_part_text_set(o, "left", "left");
elm_object_part_text_set(o, "center", "center");
elm_object_part_text_set(o, "right", "right");
elm_actionslider_indicator_pos_set(o, ELM_ACTIONSLIDER_CENTER);
#include "widget_preview_tmpl_foot.c"

View File

@ -14,6 +14,6 @@ evas_object_size_hint_min_set(icon, 200, 140);
evas_object_show(icon);
elm_object_content_part_set(layout, "elm.swallow.content", icon);
elm_object_text_part_set(layout, "elm.text.title", "Layout");
elm_object_part_text_set(layout, "elm.text.title", "Layout");
#include "widget_preview_tmpl_foot.c"

View File

@ -2038,7 +2038,7 @@ _status_config_fonts(Evas_Object *win,
snprintf(buf, sizeof(buf), "%s/objects/font_preview.edj", elm_app_data_dir_get());
preview = elm_layout_add(win);
elm_layout_file_set(preview, buf, "font_preview");
elm_object_text_part_set(preview, "elm.text", "Preview Text — 我真的会写中文");
elm_object_part_text_set(preview, "elm.text", "Preview Text — 我真的会写中文");
evas_object_size_hint_weight_set(preview, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(preview, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(preview);

View File

@ -52,9 +52,9 @@ test_actionslider(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *eve
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_RIGHT);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_RIGHT);
elm_object_text_part_set(as, "left", "Snooze");
elm_object_text_part_set(as, "center", NULL);
elm_object_text_part_set(as, "right", "Stop");
elm_object_part_text_set(as, "left", "Snooze");
elm_object_part_text_set(as, "center", NULL);
elm_object_part_text_set(as, "right", "Stop");
elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_LEFT |
ELM_ACTIONSLIDER_RIGHT);
evas_object_smart_callback_add(as, "pos_changed",
@ -68,9 +68,9 @@ test_actionslider(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *eve
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_CENTER);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER);
elm_object_text_part_set(as, "left", "Snooze");
elm_object_text_part_set(as, "center", NULL);
elm_object_text_part_set(as, "right", "Stop");
elm_object_part_text_set(as, "left", "Snooze");
elm_object_part_text_set(as, "center", NULL);
elm_object_part_text_set(as, "right", "Stop");
elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_LEFT |
ELM_ACTIONSLIDER_RIGHT);
evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
@ -86,9 +86,9 @@ test_actionslider(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *eve
ELM_ACTIONSLIDER_RIGHT);
elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_CENTER |
ELM_ACTIONSLIDER_RIGHT);
elm_object_text_part_set(as, "left", NULL);
elm_object_text_part_set(as, "center", "Accept");
elm_object_text_part_set(as, "right", "Reject");
elm_object_part_text_set(as, "left", NULL);
elm_object_part_text_set(as, "center", "Accept");
elm_object_part_text_set(as, "right", "Reject");
evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
evas_object_show(as);
elm_box_pack_end(bx, as);
@ -99,9 +99,9 @@ test_actionslider(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *eve
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_LEFT);
elm_object_text_part_set(as, "left", NULL);
elm_object_text_part_set(as, "center", "Accept");
elm_object_text_part_set(as, "right", "Reject");
elm_object_part_text_set(as, "left", NULL);
elm_object_part_text_set(as, "center", "Accept");
elm_object_part_text_set(as, "right", "Reject");
elm_object_text_set(as, "Go");
evas_object_smart_callback_add(as, "pos_changed",
_position_change_magnetic_cb, NULL);
@ -115,9 +115,9 @@ test_actionslider(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *eve
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_ALL);
elm_object_text_part_set(as, "left", "Left");
elm_object_text_part_set(as, "center", "Center");
elm_object_text_part_set(as, "right", "Right");
elm_object_part_text_set(as, "left", "Left");
elm_object_part_text_set(as, "center", "Center");
elm_object_part_text_set(as, "right", "Right");
elm_object_text_set(as, "Go");
evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
evas_object_show(as);
@ -128,9 +128,9 @@ test_actionslider(void *data __UNUSED__, Evas_Object * obj __UNUSED__, void *eve
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_CENTER);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER);
elm_object_text_part_set(as, "left", "Enable");
elm_object_text_part_set(as, "center", "Magnet");
elm_object_text_part_set(as, "right", "Disable");
elm_object_part_text_set(as, "left", "Enable");
elm_object_part_text_set(as, "center", "Magnet");
elm_object_part_text_set(as, "right", "Disable");
evas_object_smart_callback_add(as, "pos_changed",
_magnet_enable_disable_cb, NULL);
evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);

View File

@ -148,7 +148,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 3");
elm_object_text_part_set(bb, "info", "10:32 4/11/2008");
elm_object_part_text_set(bb, "info", "10:32 4/11/2008");
elm_object_content_part_set(bb, "icon", ic);
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
evas_object_show(ic);
@ -175,7 +175,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 2");
elm_object_text_part_set(bb, "info", "7:16 27/10/2008");
elm_object_part_text_set(bb, "info", "7:16 27/10/2008");
elm_object_content_part_set(bb, "icon", ic);
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
evas_object_show(ic);
@ -212,7 +212,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 1");
elm_object_text_part_set(bb, "info", "20:47 18/6/2008");
elm_object_part_text_set(bb, "info", "20:47 18/6/2008");
elm_object_content_part_set(bb, "icon", ic);
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
evas_object_show(ic);

View File

@ -38,7 +38,7 @@ test_bubble(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 1");
elm_object_text_part_set(bb, "info", "Corner: bottom_right");
elm_object_part_text_set(bb, "info", "Corner: bottom_right");
elm_object_content_part_set(bb, "icon", ic);
elm_bubble_corner_set(bb, "bottom_right");
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
@ -56,7 +56,7 @@ test_bubble(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 2");
elm_object_text_part_set(bb, "info", "10:32 4/11/2008");
elm_object_part_text_set(bb, "info", "10:32 4/11/2008");
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);

View File

@ -104,8 +104,8 @@ test_focus(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
{
Evas_Object *tg = elm_check_add(win);
elm_object_style_set(tg, "toggle");
elm_object_text_part_set(tg, "on", "Yes");
elm_object_text_part_set(tg, "off", "No");
elm_object_part_text_set(tg, "on", "Yes");
elm_object_part_text_set(tg, "off", "No");
elm_box_pack_end(bx, tg);
my_show(tg);
}

View File

@ -8,7 +8,7 @@
static void
_clicked_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
{
elm_object_text_part_set(data, "text", elm_object_text_get(obj));
elm_object_part_text_set(data, "text", elm_object_text_get(obj));
}
void

View File

@ -35,8 +35,8 @@ test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
elm_object_text_set(tg, "Icon sized to toggle");
elm_object_content_part_set(tg, "icon", ic);
elm_check_state_set(tg, 1);
elm_object_text_part_set(tg, "on", "Yes");
elm_object_text_part_set(tg, "off", "No");
elm_object_part_text_set(tg, "on", "Yes");
elm_object_part_text_set(tg, "off", "No");
elm_box_pack_end(bx, tg);
evas_object_show(tg);
evas_object_show(ic);
@ -71,8 +71,8 @@ test_toggle(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
tg = elm_check_add(win);
elm_object_style_set(tg, "toggle");
elm_object_text_set(tg, "Label Only");
elm_object_text_part_set(tg, "on", "Big long fun times label");
elm_object_text_part_set(tg, "off", "Small long happy fun label");
elm_object_part_text_set(tg, "on", "Big long fun times label");
elm_object_part_text_set(tg, "off", "Small long happy fun label");
elm_box_pack_end(bx, tg);
evas_object_show(tg);

View File

@ -54,7 +54,7 @@ fill(Evas_Object *win, Eina_Bool do_bg)
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 3");
elm_object_text_part_set(bb, "info", "10:32 4/11/2008");
elm_object_part_text_set(bb, "info", "10:32 4/11/2008");
elm_object_content_part_set(bb, "icon", ic);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
@ -78,7 +78,7 @@ fill(Evas_Object *win, Eina_Bool do_bg)
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 2");
elm_object_text_part_set(bb, "info", "7:16 27/10/2008");
elm_object_part_text_set(bb, "info", "7:16 27/10/2008");
elm_object_content_part_set(bb, "icon", ic);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
@ -113,7 +113,7 @@ fill(Evas_Object *win, Eina_Bool do_bg)
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 1");
elm_object_text_part_set(bb, "info", "20:47 18/6/2008");
elm_object_part_text_set(bb, "info", "20:47 18/6/2008");
elm_object_content_part_set(bb, "icon", ic);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);

View File

@ -21,7 +21,7 @@ external_bubble_state_set(void *data __UNUSED__, Evas_Object *obj, const void *f
if (p->label) elm_object_text_set(obj, p->label);
if (p->icon)
elm_object_content_part_set(obj, "icon", p->icon);
if (p->info) elm_object_text_part_set(obj, "info", p->info);
if (p->info) elm_object_part_text_set(obj, "info", p->info);
if (p->content) elm_object_content_set(obj, p->content);
}
@ -50,7 +50,7 @@ external_bubble_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
{
elm_object_text_part_set(obj, "info", param->s);
elm_object_part_text_set(obj, "info", param->s);
return EINA_TRUE;
}
}
@ -92,7 +92,7 @@ external_bubble_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_Ex
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
{
param->s = elm_object_text_part_get(obj, "info");
param->s = elm_object_part_text_get(obj, "info");
return EINA_TRUE;
}
}

View File

@ -27,9 +27,9 @@ external_toggle_state_set(void *data __UNUSED__, Evas_Object *obj, const void *f
elm_object_content_part_set(obj, "icon", p->icon);
if (p->on)
elm_object_text_part_set(obj, "on", p->on);
elm_object_part_text_set(obj, "on", p->on);
if (p->off)
elm_object_text_part_set(obj, "off", p->off);
elm_object_part_text_set(obj, "off", p->off);
if (p->state_exists)
elm_check_state_set(obj, p->state);
@ -60,7 +60,7 @@ external_toggle_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
{
elm_object_text_part_set(obj, "on", param->s);
elm_object_part_text_set(obj, "on", param->s);
return EINA_TRUE;
}
}
@ -68,7 +68,7 @@ external_toggle_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
{
elm_object_text_part_set(obj, "off", param->s);
elm_object_part_text_set(obj, "off", param->s);
return EINA_TRUE;
}
}
@ -107,7 +107,7 @@ external_toggle_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_Ex
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
{
param->s = elm_object_text_part_get(obj, "on");
param->s = elm_object_part_text_get(obj, "on");
return EINA_TRUE;
}
}
@ -115,7 +115,7 @@ external_toggle_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_Ex
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
{
param->s = elm_object_text_part_get(obj, "off");
param->s = elm_object_part_text_get(obj, "off");
return EINA_TRUE;
}
}

View File

@ -62,8 +62,8 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_RIGHT);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_RIGHT);
elm_object_text_part_set(as, "left", "Snooze");
elm_object_text_part_set(as, "right", "Stop");
elm_object_part_text_set(as, "left", "Snooze");
elm_object_part_text_set(as, "right", "Stop");
elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_LEFT |
ELM_ACTIONSLIDER_RIGHT);
evas_object_smart_callback_add(as, "pos_changed",
@ -77,8 +77,8 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_CENTER);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER);
elm_object_text_part_set(as, "left", "Snooze");
elm_object_text_part_set(as, "right", "Stop");
elm_object_part_text_set(as, "left", "Snooze");
elm_object_part_text_set(as, "right", "Stop");
elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_LEFT |
ELM_ACTIONSLIDER_RIGHT);
evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
@ -94,8 +94,8 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
ELM_ACTIONSLIDER_RIGHT);
elm_actionslider_enabled_pos_set(as, ELM_ACTIONSLIDER_CENTER |
ELM_ACTIONSLIDER_RIGHT);
elm_object_text_part_set(as, "center", "Accept");
elm_object_text_part_set(as, "right", "Reject");
elm_object_part_text_set(as, "center", "Accept");
elm_object_part_text_set(as, "right", "Reject");
evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
evas_object_show(as);
elm_box_pack_end(bx, as);
@ -106,8 +106,8 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_LEFT);
elm_object_text_part_set(as, "center", "Accept");
elm_object_text_part_set(as, "right", "Reject");
elm_object_part_text_set(as, "center", "Accept");
elm_object_part_text_set(as, "right", "Reject");
elm_object_text_set(as, "Go");
evas_object_smart_callback_add(as, "pos_changed",
_position_change_magnetic_cb, NULL);
@ -121,9 +121,9 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_ALL);
elm_object_text_part_set(as, "left", "Left");
elm_object_text_part_set(as, "center", "Center");
elm_object_text_part_set(as, "right", "Right");
elm_object_part_text_set(as, "left", "Left");
elm_object_part_text_set(as, "center", "Center");
elm_object_part_text_set(as, "right", "Right");
elm_object_text_set(as, "Go");
evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);
evas_object_show(as);
@ -134,9 +134,9 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_CENTER);
elm_actionslider_magnet_pos_set(as, ELM_ACTIONSLIDER_CENTER);
elm_object_text_part_set(as, "left", "Enable");
elm_object_text_part_set(as, "center", "Magnet");
elm_object_text_part_set(as, "right", "Disable");
elm_object_part_text_set(as, "left", "Enable");
elm_object_part_text_set(as, "center", "Magnet");
elm_object_part_text_set(as, "right", "Disable");
evas_object_smart_callback_add(as, "pos_changed",
_magnet_enable_disable_cb, NULL);
evas_object_smart_callback_add(as, "selected", _pos_selected_cb, NULL);

View File

@ -87,7 +87,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
if (title)
{
elm_win_title_set(win, title);
elm_object_text_part_set(layout, TITLE, title);
elm_object_part_text_set(layout, TITLE, title);
}
// Add icon, clock and button to the table

View File

@ -76,7 +76,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
if (title)
{
elm_win_title_set(win, title);
elm_object_text_part_set(layout, TITLE, title);
elm_object_part_text_set(layout, TITLE, title);
}
btn = elm_button_add(win);

View File

@ -973,6 +973,19 @@ extern "C" {
*/
EAPI void elm_language_set(const char *lang);
/**
* Set a label of an object
*
* @param obj The Elementary object
* @param part The text part name to set (NULL for the default label)
* @param label The new text of the label
*
* @note Elementary objects may have many labels (e.g. Action Slider)
* @deprecated Use elm_object_part_text_set() instead.
* @ingroup General
*/
EINA_DEPRECATED EAPI void elm_object_text_part_set(Evas_Object *obj, const char *part, const char *label);
/**
* Set a label of an object
*
@ -984,9 +997,22 @@ extern "C" {
*
* @ingroup General
*/
EAPI void elm_object_text_part_set(Evas_Object *obj, const char *part, const char *label);
EAPI void elm_object_part_text_set(Evas_Object *obj, const char *part, const char *label);
#define elm_object_text_set(obj, label) elm_object_text_part_set((obj), NULL, (label))
#define elm_object_text_set(obj, label) elm_object_part_text_set((obj), NULL, (label))
/**
* Get a label of an object
*
* @param obj The Elementary object
* @param part The text part name to get (NULL for the default label)
* @return text of the label or NULL for any error
*
* @note Elementary objects may have many labels (e.g. Action Slider)
* @deprecated Use elm_object_part_text_get() instead.
* @ingroup General
*/
EINA_DEPRECATED EAPI const char *elm_object_text_part_get(const Evas_Object *obj, const char *part);
/**
* Get a label of an object
@ -999,16 +1025,16 @@ extern "C" {
*
* @ingroup General
*/
EAPI const char *elm_object_text_part_get(const Evas_Object *obj, const char *part);
EAPI const char *elm_object_part_text_get(const Evas_Object *obj, const char *part);
#define elm_object_text_get(obj) elm_object_text_part_get((obj), NULL)
#define elm_object_text_get(obj) elm_object_part_text_get((obj), NULL)
/**
* Set the text for an objects' part, marking it as translatable.
*
* The string to set as @p text must be the original one. Do not pass the
* return of @c gettext() here. Elementary will translate the string
* internally and set it on the object using elm_object_text_part_set(),
* internally and set it on the object using elm_object_part_text_set(),
* also storing the original string so that it can be automatically
* translated when the language is changed with elm_language_set().
*
@ -1035,7 +1061,7 @@ extern "C" {
/**
* Gets the original string set as translatable for an object
*
* When setting translated strings, the function elm_object_text_part_get()
* When setting translated strings, the function elm_object_part_text_get()
* will return the translation returned by @c gettext(). To get the
* original string use this function.
*
@ -1845,7 +1871,7 @@ extern "C" {
*
* Useful when you want to force reloading of configuration values for
* a profile. If one removes user custom configuration directories,
* for example, it will force a reload with system values insted.
* for example, it will force a reload with system values instead.
*
*/
EAPI void elm_config_reload(void);
@ -7456,8 +7482,8 @@ extern "C" {
* @code
* obj = elm_check_add(parent);
* elm_object_style_set(obj, "toggle");
* elm_object_text_part_set(obj, "on", "ON");
* elm_object_text_part_set(obj, "off", "OFF");
* elm_object_part_text_set(obj, "on", "ON");
* elm_object_part_text_set(obj, "off", "OFF");
* @endcode
*
* Signals that you can add callbacks for are:
@ -7540,7 +7566,7 @@ extern "C" {
* @param onlabel The label displayed when the toggle is in the "on" state
* @param offlabel The label displayed when the toggle is in the "off" state
*
* @deprecated use elm_object_text_part_set() for "on" and "off" parts
* @deprecated use elm_object_part_text_set() for "on" and "off" parts
* instead.
*/
EINA_DEPRECATED EAPI void elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel) EINA_ARG_NONNULL(1);
@ -7552,7 +7578,7 @@ extern "C" {
* @param onlabel A char** to place the onlabel of @p obj into
* @param offlabel A char** to place the offlabel of @p obj into
*
* @deprecated use elm_object_text_part_get() for "on" and "off" parts
* @deprecated use elm_object_part_text_get() for "on" and "off" parts
* instead.
*/
EINA_DEPRECATED EAPI void elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel) EINA_ARG_NONNULL(1);
@ -9899,7 +9925,7 @@ extern "C" {
* @param text The text to set
*
* @ingroup Layout
* @deprecated use elm_object_text_part_set() instead.
* @deprecated use elm_object_part_text_set() instead.
*/
EINA_DEPRECATED EAPI void elm_layout_text_set(Evas_Object *obj, const char *part, const char *text) EINA_ARG_NONNULL(1);
/**
@ -9911,7 +9937,7 @@ extern "C" {
* @return The text set in @p part
*
* @ingroup Layout
* @deprecated use elm_object_text_part_get() instead.
* @deprecated use elm_object_part_text_get() instead.
*/
EINA_DEPRECATED EAPI const char *elm_layout_text_get(const Evas_Object *obj, const char *part) EINA_ARG_NONNULL(1);
/**
@ -10124,7 +10150,7 @@ extern "C" {
*
* @see elm_object_signal_callback_add()
* @see elm_object_signal_emit()
* @see elm_object_text_part_set()
* @see elm_object_part_text_set()
* @see elm_object_content_part_set()
* @see elm_layout_box_append()
* @see elm_layout_table_pack()
@ -12395,7 +12421,7 @@ extern "C" {
*
* This function sets the info of the bubble. Where this appears depends on
* the selected corner.
* @deprecated use elm_object_text_part_set() instead. (with "info" as the parameter).
* @deprecated use elm_object_part_text_set() instead. (with "info" as the parameter).
*/
EINA_DEPRECATED EAPI void elm_bubble_info_set(Evas_Object *obj, const char *info) EINA_ARG_NONNULL(1);
/**
@ -12406,7 +12432,7 @@ extern "C" {
* @return The "info" string of the bubble
*
* This function gets the info text.
* @deprecated use elm_object_text_part_get() instead. (with "info" as the parameter).
* @deprecated use elm_object_part_text_get() instead. (with "info" as the parameter).
*/
EINA_DEPRECATED EAPI const char *elm_bubble_info_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**

View File

@ -936,6 +936,20 @@ elm_object_text_part_get(const Evas_Object *obj, const char *part)
return elm_widget_text_part_get(obj, part);
}
EAPI void
elm_object_part_text_set(Evas_Object *obj, const char *part, const char *label)
{
EINA_SAFETY_ON_NULL_RETURN(obj);
elm_widget_text_part_set(obj, part, label);
}
EAPI const char *
elm_object_part_text_get(const Evas_Object *obj, const char *part)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL);
return elm_widget_text_part_get(obj, part);
}
EAPI void
elm_object_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *text)
{

View File

@ -8,8 +8,8 @@ elm_toggle_add(Evas_Object *parent)
obj = elm_check_add(parent);
elm_object_style_set(obj, "toggle");
elm_object_text_part_set(obj, "on", E_("ON"));
elm_object_text_part_set(obj, "off", E_("OFF"));
elm_object_part_text_set(obj, "on", E_("ON"));
elm_object_part_text_set(obj, "off", E_("OFF"));
return obj;
}
@ -46,15 +46,15 @@ elm_toggle_icon_unset(Evas_Object *obj)
EAPI void
elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel)
{
elm_object_text_part_set(obj, "on", onlabel);
elm_object_text_part_set(obj, "off", offlabel);
elm_object_part_text_set(obj, "on", onlabel);
elm_object_part_text_set(obj, "off", offlabel);
}
EAPI void
elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel)
{
if (onlabel) *onlabel = elm_object_text_part_get(obj, "on");
if (offlabel) *offlabel = elm_object_text_part_get(obj, "off");
if (onlabel) *onlabel = elm_object_part_text_get(obj, "on");
if (offlabel) *offlabel = elm_object_part_text_get(obj, "off");
}
EAPI void