summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorWooHyun Jung <woohyun0705@gmail.com>2012-03-01 04:49:23 +0000
committerWooHyun Jung <woohyun0705@gmail.com>2012-03-01 04:49:23 +0000
commit78ae3dc90be7e0da04f1f3df8095ba0c9b27311c (patch)
tree0ffcb5c3ab04d8e29bdc96466e400f602015e8c6 /legacy
parentd7a8ea0da65596885ede89c7b7826eb8f2a3b8dd (diff)
[elementary/elm_label] Deprecated some APIs, and refactored
elm_label.c and label.edc files. SVN revision: 68563
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/data/themes/widgets/label.edc43
-rw-r--r--legacy/elementary/src/lib/elm_deprecated.h28
-rw-r--r--legacy/elementary/src/lib/elm_label.c284
-rw-r--r--legacy/elementary/src/lib/elm_label.h22
4 files changed, 50 insertions, 327 deletions
diff --git a/legacy/elementary/data/themes/widgets/label.edc b/legacy/elementary/data/themes/widgets/label.edc
index fb3e6432bd..3e52408340 100644
--- a/legacy/elementary/data/themes/widgets/label.edc
+++ b/legacy/elementary/data/themes/widgets/label.edc
@@ -12,17 +12,9 @@ group { name: "elm/label/base/default";
12 } 12 }
13 } 13 }
14 parts { 14 parts {
15 part { name: "label.swallow.background";
16 type: SWALLOW;
17 description { state: "default" 0.0;
18 visible: 1;
19 }
20 }
21 part { name: "label.text.clip"; 15 part { name: "label.text.clip";
22 type: RECT; 16 type: RECT;
23 description { state: "default" 0.0; 17 description { state: "default" 0.0;
24 rel1 { relative: 0 0; to: "label.swallow.background"; }
25 rel2 { relative: 1 1; to: "label.swallow.background"; }
26 } 18 }
27 } 19 }
28 part { name: "elm.text"; 20 part { name: "elm.text";
@@ -53,14 +45,6 @@ group { name: "elm/label/base/marker";
53 } 45 }
54 } 46 }
55 parts { 47 parts {
56 part { name: "label.swallow.background";
57 type: SWALLOW;
58 description { state: "default" 0.0;
59 visible: 1;
60 rel1 { relative: 0 0; to: "elm.text"; }
61 rel2 { relative: 1 1; to: "elm.text"; }
62 }
63 }
64 part { name: "elm.text"; 48 part { name: "elm.text";
65 type: TEXTBLOCK; 49 type: TEXTBLOCK;
66 scale: 1; 50 scale: 1;
@@ -136,19 +120,10 @@ group { name: "elm/label/base/slide_long";
136 } 120 }
137 121
138 parts { 122 parts {
139 part { name: "label.swallow.background";
140 type: SWALLOW;
141 description { state: "default" 0.0;
142 visible: 1;
143 }
144 }
145 part { name: "label.text.clip"; 123 part { name: "label.text.clip";
146 type: RECT; 124 type: RECT;
147 description { state: "default" 0.0; 125 description { state: "default" 0.0;
148 visible: 1;
149 color: 255 255 255 255; 126 color: 255 255 255 255;
150 rel1 { relative: 0 0; to: "label.swallow.background"; }
151 rel2 { relative: 1 1; to: "label.swallow.background"; }
152 } 127 }
153 } 128 }
154 part { name: "elm.text"; 129 part { name: "elm.text";
@@ -261,19 +236,10 @@ group { name: "elm/label/base/slide_short";
261 } 236 }
262 237
263 parts { 238 parts {
264 part { name: "label.swallow.background";
265 type: SWALLOW;
266 description { state: "default" 0.0;
267 visible: 1;
268 }
269 }
270 part { name: "label.text.clip"; 239 part { name: "label.text.clip";
271 type: RECT; 240 type: RECT;
272 description { state: "default" 0.0; 241 description { state: "default" 0.0;
273 visible: 1;
274 color: 255 255 255 255; 242 color: 255 255 255 255;
275 rel1 { relative: 0 0; to: "label.swallow.background"; }
276 rel2 { relative: 1 1; to: "label.swallow.background"; }
277 } 243 }
278 } 244 }
279 part { name: "elm.text"; 245 part { name: "elm.text";
@@ -397,19 +363,10 @@ group { name: "elm/label/base/slide_bounce";
397 } 363 }
398 364
399 parts { 365 parts {
400 part { name: "label.swallow.background";
401 type: SWALLOW;
402 description { state: "default" 0.0;
403 visible: 1;
404 }
405 }
406 part { name: "label.text.clip"; 366 part { name: "label.text.clip";
407 type: RECT; 367 type: RECT;
408 description { state: "default" 0.0; 368 description { state: "default" 0.0;
409 visible: 1;
410 color: 255 255 255 255; 369 color: 255 255 255 255;
411 rel1 { relative: 0 0; to: "label.swallow.background"; }
412 rel2 { relative: 1 1; to: "label.swallow.background"; }
413 } 370 }
414 } 371 }
415 part { name: "elm.text"; 372 part { name: "elm.text";
diff --git a/legacy/elementary/src/lib/elm_deprecated.h b/legacy/elementary/src/lib/elm_deprecated.h
index 747129168a..55e2682202 100644
--- a/legacy/elementary/src/lib/elm_deprecated.h
+++ b/legacy/elementary/src/lib/elm_deprecated.h
@@ -4229,7 +4229,7 @@ EINA_DEPRECATED EAPI const char *elm_pager_item_style_default_get(const Eva
4229 * 4229 *
4230 * @warning NEVER use this. It is for hyper-special cases only. use styles 4230 * @warning NEVER use this. It is for hyper-special cases only. use styles
4231 * instead. e.g. "default", "marker", "slide_long" etc. 4231 * instead. e.g. "default", "marker", "slide_long" etc.
4232 * @deprecated Use tag instead 4232 * @deprecated Use <font_size> tag instead. eg) <font_size=40>abc</font_size>
4233 */ 4233 */
4234EINA_DEPRECATED EAPI void elm_label_fontsize_set(Evas_Object *obj, int fontsize); 4234EINA_DEPRECATED EAPI void elm_label_fontsize_set(Evas_Object *obj, int fontsize);
4235 4235
@@ -4244,7 +4244,7 @@ EINA_DEPRECATED EAPI void elm_label_fontsize_set(Evas_Obj
4244 * 4244 *
4245 * @warning NEVER use this. It is for hyper-special cases only. use styles 4245 * @warning NEVER use this. It is for hyper-special cases only. use styles
4246 * instead. e.g. "default", "marker", "slide_long" etc. 4246 * instead. e.g. "default", "marker", "slide_long" etc.
4247 * @deprecated Use tag instead 4247 * @deprecated Use <color> tag instead. about <color> tag - Text color in one of the following formats: "#RRGGBB", "#RRGGBBAA", "#RGB", and "#RGBA"
4248 */ 4248 */
4249EINA_DEPRECATED EAPI void elm_label_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a); 4249EINA_DEPRECATED EAPI void elm_label_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
4250 4250
@@ -4256,7 +4256,7 @@ EINA_DEPRECATED EAPI void elm_label_text_color_set(Evas_O
4256 * 4256 *
4257 * @warning NEVER use this. It is for hyper-special cases only. use styles 4257 * @warning NEVER use this. It is for hyper-special cases only. use styles
4258 * instead. e.g. "default", "marker", "slide_long" etc. 4258 * instead. e.g. "default", "marker", "slide_long" etc.
4259 * @deprecated Use tag instead 4259 * @deprecated Use <align> tag instead. about <align> tag - Either "auto" (meaning according to text direction), "left", "right", "center", "middle", a value between 0.0 and 1.0, or a value between 0% to 100%.
4260 */ 4260 */
4261EINA_DEPRECATED EAPI void elm_label_text_align_set(Evas_Object *obj, const char *alignmode); 4261EINA_DEPRECATED EAPI void elm_label_text_align_set(Evas_Object *obj, const char *alignmode);
4262 4262
@@ -4276,6 +4276,28 @@ EINA_DEPRECATED EAPI void elm_label_text_align_set(Evas_O
4276EINA_DEPRECATED EAPI void elm_label_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a); 4276EINA_DEPRECATED EAPI void elm_label_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
4277 4277
4278/** 4278/**
4279 * @brief Set wrap height of the label
4280 *
4281 * @param obj The label object
4282 * @param h The wrap height in pixels at a minimum where words need to wrap
4283 *
4284 * This function sets the maximum height size hint of the label.
4285 *
4286 * @warning This is only relevant if the label is inside a container.
4287 * @deprecated This function should not be used because of wrong concept.
4288 */
4289EAPI void elm_label_wrap_height_set(Evas_Object *obj, Evas_Coord h);
4290
4291/**
4292 * @brief get wrap width of the label
4293 *
4294 * @param obj The label object
4295 * @return The wrap height in pixels at a minimum where words need to wrap
4296 * @deprecated This function should not be used because of wrong concept.
4297 */
4298EAPI Evas_Coord elm_label_wrap_height_get(const Evas_Object *obj);
4299
4300/**
4279 * @brief Flush all caches. 4301 * @brief Flush all caches.
4280 * 4302 *
4281 * Frees all data that was in cache and is not currently being used to reduce 4303 * Frees all data that was in cache and is not currently being used to reduce
diff --git a/legacy/elementary/src/lib/elm_label.c b/legacy/elementary/src/lib/elm_label.c
index 536943edab..93cc7a1c6e 100644
--- a/legacy/elementary/src/lib/elm_label.c
+++ b/legacy/elementary/src/lib/elm_label.c
@@ -6,17 +6,14 @@ typedef struct _Widget_Data Widget_Data;
6struct _Widget_Data 6struct _Widget_Data
7{ 7{
8 Evas_Object *lbl; 8 Evas_Object *lbl;
9 Evas_Object *bg;
10 const char *label; 9 const char *label;
11 const char *format; 10 const char *format;
12 Ecore_Job *deferred_recalc_job; 11 Ecore_Job *deferred_recalc_job;
13 double slide_duration; 12 double slide_duration;
14 Evas_Coord lastw; 13 Evas_Coord lastw;
15 Evas_Coord wrap_w; 14 Evas_Coord wrap_w;
16 Evas_Coord wrap_h;
17 Elm_Wrap_Type linewrap; 15 Elm_Wrap_Type linewrap;
18 Eina_Bool changed : 1; 16 Eina_Bool changed : 1;
19 Eina_Bool bgcolor : 1;
20 Eina_Bool ellipsis : 1; 17 Eina_Bool ellipsis : 1;
21 Eina_Bool slidingmode : 1; 18 Eina_Bool slidingmode : 1;
22 Eina_Bool slidingellipsis : 1; 19 Eina_Bool slidingellipsis : 1;
@@ -30,8 +27,6 @@ static void _sizing_eval(Evas_Object *obj);
30static int _get_value_in_key_string(const char *oldstring, const char *key, char **value); 27static int _get_value_in_key_string(const char *oldstring, const char *key, char **value);
31static int _strbuf_key_value_replace(Eina_Strbuf *srcbuf, const char *key, const char *value, int deleteflag); 28static int _strbuf_key_value_replace(Eina_Strbuf *srcbuf, const char *key, const char *value, int deleteflag);
32static int _stringshare_key_value_replace(const char **srcstring, const char *key, const char *value, int deleteflag); 29static int _stringshare_key_value_replace(const char **srcstring, const char *key, const char *value, int deleteflag);
33static int _is_width_over(Evas_Object *obj);
34static void _ellipsis_label_to_width(Evas_Object *obj);
35static void _label_sliding_change(Evas_Object *obj); 30static void _label_sliding_change(Evas_Object *obj);
36 31
37static void 32static void
@@ -58,11 +53,6 @@ _elm_recalc_job(void *data)
58 minw = ominw; 53 minw = ominw;
59 } 54 }
60 evas_object_size_hint_min_set(data, minw, minh); 55 evas_object_size_hint_min_set(data, minw, minh);
61 evas_object_size_hint_max_set(data, wd->wrap_w, wd->wrap_h);
62
63 if ((wd->ellipsis) && (wd->linewrap) && (wd->wrap_h > 0) &&
64 (_is_width_over(data) == 1))
65 _ellipsis_label_to_width(data);
66 evas_event_thaw(evas_object_evas_get(data)); 56 evas_event_thaw(evas_object_evas_get(data));
67 evas_event_thaw_eval(evas_object_evas_get(data)); 57 evas_event_thaw_eval(evas_object_evas_get(data));
68} 58}
@@ -75,7 +65,6 @@ _del_hook(Evas_Object *obj)
75 evas_event_freeze(evas_object_evas_get(obj)); 65 evas_event_freeze(evas_object_evas_get(obj));
76 if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job); 66 if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job);
77 if (wd->label) eina_stringshare_del(wd->label); 67 if (wd->label) eina_stringshare_del(wd->label);
78 if (wd->bg) evas_object_del(wd->bg);
79 free(wd); 68 free(wd);
80 evas_event_thaw(evas_object_evas_get(obj)); 69 evas_event_thaw(evas_object_evas_get(obj));
81 evas_event_thaw_eval(evas_object_evas_get(obj)); 70 evas_event_thaw_eval(evas_object_evas_get(obj));
@@ -143,11 +132,7 @@ _sizing_eval(Evas_Object *obj)
143 evas_object_geometry_get(wd->lbl, NULL, NULL, &resw, &resh); 132 evas_object_geometry_get(wd->lbl, NULL, NULL, &resw, &resh);
144 edje_object_size_min_calc(wd->lbl, &minw, &minh); 133 edje_object_size_min_calc(wd->lbl, &minw, &minh);
145 if (wd->wrap_w > 0 && minw > wd->wrap_w) minw = wd->wrap_w; 134 if (wd->wrap_w > 0 && minw > wd->wrap_w) minw = wd->wrap_w;
146 if (wd->wrap_h > 0 && minh > wd->wrap_h) minh = wd->wrap_h;
147 evas_object_size_hint_min_set(obj, minw, minh); 135 evas_object_size_hint_min_set(obj, minw, minh);
148 evas_object_size_hint_max_set(obj, wd->wrap_w, wd->wrap_h);
149 if ((wd->ellipsis) && (_is_width_over(obj) == 1))
150 _ellipsis_label_to_width(obj);
151 evas_event_thaw(evas_object_evas_get(obj)); 136 evas_event_thaw(evas_object_evas_get(obj));
152 evas_event_thaw_eval(evas_object_evas_get(obj)); 137 evas_event_thaw_eval(evas_object_evas_get(obj));
153 } 138 }
@@ -254,137 +239,6 @@ _stringshare_key_value_replace(const char **srcstring, const char *key, const ch
254 return 0; 239 return 0;
255} 240}
256 241
257static int
258_is_width_over(Evas_Object *obj)
259{
260 Evas_Coord x, y, w, h;
261 Evas_Coord vx, vy, vw, vh;
262 Widget_Data *wd = elm_widget_data_get(obj);
263 if (!wd) return 0;
264
265 evas_event_freeze(evas_object_evas_get(obj));
266 edje_object_part_geometry_get(wd->lbl, "elm.text", &x, &y, NULL, NULL);
267 /* Calc the formatted size with ellipsis turned off */
268 if (wd->ellipsis)
269 {
270 const Evas_Object *tb;
271 char *_kvalue;
272 double ellipsis = 0.0;
273 Eina_Bool found_key = EINA_FALSE;
274 if (_get_value_in_key_string(wd->format, "ellipsis", &_kvalue) == 0)
275 {
276 ellipsis = atof(_kvalue);
277 found_key = EINA_TRUE;
278 }
279
280 if (_stringshare_key_value_replace(&wd->format,
281 "ellipsis", NULL, 1) == 0)
282 {
283 edje_object_part_text_style_user_set(wd->lbl, "elm.text",
284 wd->format);
285 edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
286 }
287
288 tb = edje_object_part_object_get(wd->lbl, "elm.text");
289 evas_object_textblock_size_formatted_get(tb, &w, &h);
290
291 if (found_key)
292 {
293 Eina_Strbuf *elpbuf;
294 elpbuf = eina_strbuf_new();
295 eina_strbuf_append_printf(elpbuf, "%f", ellipsis);
296 if (_stringshare_key_value_replace(&wd->format, "ellipsis",
297 eina_strbuf_string_get(elpbuf), 0) == 0)
298 {
299 edje_object_part_text_style_user_set(wd->lbl, "elm.text",
300 wd->format);
301 edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
302 }
303 eina_strbuf_free(elpbuf);
304 }
305 }
306 else
307 {
308 const Evas_Object *tb;
309 tb = edje_object_part_object_get(wd->lbl, "elm.text");
310 evas_object_textblock_size_formatted_get(tb, &w, &h);
311 }
312 evas_object_geometry_get(obj, &vx, &vy, &vw, &vh);
313 evas_event_thaw(evas_object_evas_get(obj));
314 evas_event_thaw_eval(evas_object_evas_get(obj));
315
316 if (w > wd->wrap_w || h > wd->wrap_h)
317 return 1;
318
319 return 0;
320}
321
322static void
323_ellipsis_fontsize_set(Evas_Object *obj, int fontsize)
324{
325 Widget_Data *wd = elm_widget_data_get(obj);
326 Eina_Strbuf *fontbuf = NULL;
327 int removeflag = 0;
328 if (!wd) return;
329
330 fontbuf = eina_strbuf_new();
331 eina_strbuf_append_printf(fontbuf, "%d", fontsize);
332 if (fontsize == 0) removeflag = 1; // remove fontsize tag
333
334 if (_stringshare_key_value_replace(&wd->format, "font_size", eina_strbuf_string_get(fontbuf), removeflag) == 0)
335 {
336 edje_object_part_text_style_user_set(wd->lbl, "elm.text",
337 wd->format);
338 edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
339 }
340 eina_strbuf_free(fontbuf);
341}
342
343static void
344_ellipsis_label_to_width(Evas_Object *obj)
345{
346 Widget_Data *wd = elm_widget_data_get(obj);
347 if (!wd) return;
348 int cur_fontsize = 0;
349 char *kvalue;
350 const char *minfont, *deffont, *maxfont;
351 int minfontsize, maxfontsize;
352
353 evas_event_freeze(evas_object_evas_get(obj));
354 minfont = edje_object_data_get(wd->lbl, "min_font_size");
355 if (minfont) minfontsize = atoi(minfont);
356 else minfontsize = 1;
357 maxfont = edje_object_data_get(wd->lbl, "max_font_size");
358 if (maxfont) maxfontsize = atoi(maxfont);
359 else maxfontsize = 1;
360 deffont = edje_object_data_get(wd->lbl, "default_font_size");
361 if (deffont) cur_fontsize = atoi(deffont);
362 else cur_fontsize = 1;
363 if (minfontsize > maxfontsize || cur_fontsize == 1) return; // theme is not ready for ellipsis
364 if (eina_stringshare_strlen(wd->label) <= 0) return;
365
366 if (_get_value_in_key_string(wd->format, "font_size", &kvalue) == 0)
367 {
368 if (kvalue != NULL) cur_fontsize = atoi(kvalue);
369 }
370
371 while (_is_width_over(obj))
372 {
373 if (cur_fontsize > minfontsize)
374 {
375 cur_fontsize -= 3;
376 if (cur_fontsize < minfontsize) cur_fontsize = minfontsize;
377 _ellipsis_fontsize_set(obj, cur_fontsize);
378 }
379 else
380 {
381 break;
382 }
383 }
384 evas_event_thaw(evas_object_evas_get(obj));
385 evas_event_thaw_eval(evas_object_evas_get(obj));
386}
387
388static void 242static void
389_label_sliding_change(Evas_Object *obj) 243_label_sliding_change(Evas_Object *obj)
390{ 244{
@@ -492,16 +346,11 @@ elm_label_add(Evas_Object *parent)
492 elm_widget_text_get_hook_set(obj, _elm_label_label_get); 346 elm_widget_text_get_hook_set(obj, _elm_label_label_get);
493 elm_widget_translate_hook_set(obj, _translate_hook); 347 elm_widget_translate_hook_set(obj, _translate_hook);
494 348
495 wd->bgcolor = EINA_FALSE;
496 wd->bg = evas_object_rectangle_add(e);
497 evas_object_color_set(wd->bg, 0, 0, 0, 0);
498
499 wd->linewrap = ELM_WRAP_NONE; 349 wd->linewrap = ELM_WRAP_NONE;
500 wd->ellipsis = EINA_FALSE; 350 wd->ellipsis = EINA_FALSE;
501 wd->slidingmode = EINA_FALSE; 351 wd->slidingmode = EINA_FALSE;
502 wd->slidingellipsis = EINA_FALSE; 352 wd->slidingellipsis = EINA_FALSE;
503 wd->wrap_w = -1; 353 wd->wrap_w = -1;
504 wd->wrap_h = -1;
505 wd->slide_duration = 10; 354 wd->slide_duration = 10;
506 355
507 wd->lbl = edje_object_add(e); 356 wd->lbl = edje_object_add(e);
@@ -611,134 +460,51 @@ elm_label_wrap_width_get(const Evas_Object *obj)
611 return wd->wrap_w; 460 return wd->wrap_w;
612} 461}
613 462
614EAPI void 463EINA_DEPRECATED EAPI void
615elm_label_wrap_height_set(Evas_Object *obj, 464elm_label_wrap_height_set(Evas_Object *obj __UNUSED__,
616 Evas_Coord h) 465 Evas_Coord h __UNUSED__)
617{ 466{
618 ELM_CHECK_WIDTYPE(obj, widtype); 467 return;
619 Widget_Data *wd = elm_widget_data_get(obj);
620 if (!wd) return;
621 if (h < 0) h = 0;
622 if (wd->wrap_h == h) return;
623 if (wd->ellipsis)
624 {
625 edje_object_part_text_style_user_set(wd->lbl, "elm.text",
626 wd->format);
627 edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
628 }
629 wd->wrap_h = h;
630 _sizing_eval(obj);
631} 468}
632 469
633EAPI Evas_Coord 470EINA_DEPRECATED EAPI Evas_Coord
634elm_label_wrap_height_get(const Evas_Object *obj) 471elm_label_wrap_height_get(const Evas_Object *obj __UNUSED__)
635{ 472{
636 ELM_CHECK_WIDTYPE(obj, widtype) 0; 473 return 0;
637 Widget_Data *wd = elm_widget_data_get(obj);
638 if (!wd) return 0;
639 return wd->wrap_h;
640} 474}
641 475
642EINA_DEPRECATED EAPI void 476EINA_DEPRECATED EAPI void
643elm_label_fontsize_set(Evas_Object *obj, int fontsize) 477elm_label_fontsize_set(Evas_Object *obj __UNUSED__,
478 int fontsize __UNUSED__)
644{ 479{
645 ELM_CHECK_WIDTYPE(obj, widtype); 480 return;
646 Widget_Data *wd = elm_widget_data_get(obj);
647 Eina_Strbuf *fontbuf = NULL;
648 int len, removeflag = 0;
649
650 if (!wd) return;
651 _elm_dangerous_call_check(__FUNCTION__);
652 len = strlen(wd->label);
653 if (len <= 0) return;
654 fontbuf = eina_strbuf_new();
655 eina_strbuf_append_printf(fontbuf, "%d", fontsize);
656
657 if (fontsize == 0) removeflag = 1; // remove fontsize tag
658
659 if (_stringshare_key_value_replace(&wd->format, "font_size", eina_strbuf_string_get(fontbuf), removeflag) == 0)
660 {
661 edje_object_part_text_style_user_set(wd->lbl, "elm.text",
662 wd->format);
663 edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
664 wd->changed = 1;
665 _sizing_eval(obj);
666 }
667 eina_strbuf_free(fontbuf);
668} 481}
669 482
670EINA_DEPRECATED EAPI void 483EINA_DEPRECATED EAPI void
671elm_label_text_align_set(Evas_Object *obj, const char *alignmode) 484elm_label_text_align_set(Evas_Object *obj __UNUSED__,
485 const char *alignmode __UNUSED__)
672{ 486{
673 ELM_CHECK_WIDTYPE(obj, widtype); 487 return;
674 Widget_Data *wd = elm_widget_data_get(obj);
675 int len;
676
677 if (!wd) return;
678 _elm_dangerous_call_check(__FUNCTION__);
679 len = strlen(wd->label);
680 if (len <= 0) return;
681
682 if (_stringshare_key_value_replace(&wd->format, "align", alignmode, 0) == 0)
683 {
684 edje_object_part_text_style_user_set(wd->lbl, "elm.text",
685 wd->format);
686 edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
687 }
688
689 wd->changed = 1;
690 _sizing_eval(obj);
691} 488}
692 489
693EINA_DEPRECATED EAPI void 490EINA_DEPRECATED EAPI void
694elm_label_text_color_set(Evas_Object *obj, 491elm_label_text_color_set(Evas_Object *obj __UNUSED__,
695 unsigned int r, 492 unsigned int r __UNUSED__,
696 unsigned int g, 493 unsigned int g __UNUSED__,
697 unsigned int b, 494 unsigned int b __UNUSED__,
698 unsigned int a) 495 unsigned int a __UNUSED__)
699{ 496{
700 ELM_CHECK_WIDTYPE(obj, widtype); 497 return;
701 Widget_Data *wd = elm_widget_data_get(obj);
702 Eina_Strbuf *colorbuf = NULL;
703 int len;
704
705 if (!wd) return;
706 _elm_dangerous_call_check(__FUNCTION__);
707 len = strlen(wd->label);
708 if (len <= 0) return;
709 colorbuf = eina_strbuf_new();
710 eina_strbuf_append_printf(colorbuf, "#%02X%02X%02X%02X", r, g, b, a);
711
712 if (_stringshare_key_value_replace(&wd->format, "color", eina_strbuf_string_get(colorbuf), 0) == 0)
713 {
714 edje_object_part_text_style_user_set(wd->lbl, "elm.text",
715 wd->format);
716 edje_object_part_text_set(wd->lbl, "elm.text", wd->label);
717 wd->changed = 1;
718 _sizing_eval(obj);
719 }
720 eina_strbuf_free(colorbuf);
721} 498}
722 499
723EINA_DEPRECATED EAPI void 500EINA_DEPRECATED EAPI void
724elm_label_background_color_set(Evas_Object *obj, 501elm_label_background_color_set(Evas_Object *obj __UNUSED__,
725 unsigned int r, 502 unsigned int r __UNUSED__,
726 unsigned int g, 503 unsigned int g __UNUSED__,
727 unsigned int b, 504 unsigned int b __UNUSED__,
728 unsigned int a) 505 unsigned int a __UNUSED__)
729{ 506{
730 ELM_CHECK_WIDTYPE(obj, widtype); 507 return;
731 Widget_Data *wd = elm_widget_data_get(obj);
732 if (!wd) return;
733 evas_object_color_set(wd->bg, r, g, b, a);
734
735 if (!wd) return;
736 _elm_dangerous_call_check(__FUNCTION__);
737 if (wd->bgcolor == EINA_FALSE)
738 {
739 wd->bgcolor = 1;
740 edje_object_part_swallow(wd->lbl, "label.swallow.background", wd->bg);
741 }
742} 508}
743 509
744EAPI void 510EAPI void
diff --git a/legacy/elementary/src/lib/elm_label.h b/legacy/elementary/src/lib/elm_label.h
index 011db86669..0887ca1077 100644
--- a/legacy/elementary/src/lib/elm_label.h
+++ b/legacy/elementary/src/lib/elm_label.h
@@ -86,28 +86,6 @@ EAPI void elm_label_wrap_width_set(Evas_Object *obj, Evas
86EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj); 86EAPI Evas_Coord elm_label_wrap_width_get(const Evas_Object *obj);
87 87
88/** 88/**
89 * @brief Set wrap height of the label
90 *
91 * @param obj The label object
92 * @param h The wrap height in pixels at a minimum where words need to wrap
93 *
94 * This function sets the maximum height size hint of the label.
95 *
96 * @warning This is only relevant if the label is inside a container.
97 */
98//XXX: Maybe added for supporting multi-line ellipsis. Evas textblock supports multi-line ellipsis by itself, no more needs for this API.
99EAPI void elm_label_wrap_height_set(Evas_Object *obj, Evas_Coord h);
100
101/**
102 * @brief get wrap width of the label
103 *
104 * @param obj The label object
105 * @return The wrap height in pixels at a minimum where words need to wrap
106 */
107//XXX: Maybe added for supporting multi-line ellipsis. Evas textblock supports multi-line ellipsis by itself, no more needs for this API.
108EAPI Evas_Coord elm_label_wrap_height_get(const Evas_Object *obj);
109
110/**
111 * @brief Set the ellipsis behavior of the label 89 * @brief Set the ellipsis behavior of the label
112 * 90 *
113 * @param obj The label object 91 * @param obj The label object