summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-01-09 12:14:22 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2020-01-09 12:16:55 +0100
commit7b0a44dd3316d32e8150d9c800e00d923fc3a684 (patch)
tree74487296e9c16f28a7bf7b5a335a558607650796
parentdcc7813caf4a8e686b2f25064c312366d94c8bbb (diff)
efl.canvas.textblock: rename style strings to have underscore between words
Summary: rename following styling strings: tabstops -> tab_stops linesize -> line_size linerelsize -> line_rel_size linegap -> line_gap linerelgap -> line_rel_gap linefill -> line_fill This will affect Style_Apply, all_style_get, and any method expect styling string Reviewers: segfaultxavi, woohyun Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8523 Differential Revision: https://phab.enlightenment.org/D11043
-rw-r--r--src/lib/evas/canvas/efl_canvas_textblock.eo22
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c46
-rw-r--r--src/tests/evas/evas_test_textblock.c2
3 files changed, 44 insertions, 26 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo b/src/lib/evas/canvas/efl_canvas_textblock.eo
index 72cd8a693e..c9ed381e95 100644
--- a/src/lib/evas/canvas/efl_canvas_textblock.eo
+++ b/src/lib/evas/canvas/efl_canvas_textblock.eo
@@ -257,37 +257,37 @@ class @beta Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text,
257 Examples: $[style=outline], $[style=shadow,bottom_right], $[style=outline_shadow,bottom]. 257 Examples: $[style=outline], $[style=shadow,bottom_right], $[style=outline_shadow,bottom].
258 See @Efl.Text_Style.text_effect_type and @Efl.Text_Style.text_shadow_direction. 258 See @Efl.Text_Style.text_effect_type and @Efl.Text_Style.text_shadow_direction.
259 259
260 - $tabstops: Size (in pixels) of the tab character. The value must be a number greater than one. 260 - $tab_stops: Size (in pixels) of the tab character. The value must be a number greater than one.
261 Default value is $[32]. 261 Default value is $[32].
262 See @Efl.Text_Format.tab_stops. 262 See @Efl.Text_Format.tab_stops.
263 263
264 - $linesize: Distance (in pixels) from the baseline of one line of text to the next. This is, a value of 264 - $line_size: Distance (in pixels) from the baseline of one line of text to the next. This is, a value of
265 $[0] would render all lines on top of each other (However, this value will be ignored if it results in 265 $[0] would render all lines on top of each other (However, this value will be ignored if it results in
266 overlapping lines of text). 266 overlapping lines of text).
267 Setting this value sets $linerelsize to $[0%] (disables it). 267 Setting this value sets $line_rel_size to $[0%] (disables it).
268 Default value is $[0]. 268 Default value is $[0].
269 269
270 - $linerelsize: Distance (in percentage over the natural line height) from the baseline of one line of 270 - $line_rel_size: Distance (in percentage over the natural line height) from the baseline of one line of
271 text to the next. A value of $[100%] does not have any impact, smaller values render lines closer together 271 text to the next. A value of $[100%] does not have any impact, smaller values render lines closer together
272 and bigger values render them further apart. 272 and bigger values render them further apart.
273 Setting this value sets $linesize to $[0] (disables it). 273 Setting this value sets $line_size to $[0] (disables it).
274 Default value is $[0%]. 274 Default value is $[0%].
275 275
276 - $linegap: Additional empty space (in pixels) between the bottom of one line of text and the top of the 276 - $line_gap: Additional empty space (in pixels) between the bottom of one line of text and the top of the
277 next. Setting this value sets $linerelgap to $[0%] (disables it). 277 next. Setting this value sets $line_rel_gap to $[0%] (disables it).
278 Default value is $[0]. 278 Default value is $[0].
279 See @Efl.Text_Format.line_gap. 279 See @Efl.Text_Format.line_gap.
280 280
281 - $linerelgap: Additional empty space (in percentage over the natural line height) between the bottom of 281 - $line_rel_gap: Additional empty space (in percentage over the natural line height) between the bottom of
282 one line of text and the top of the next. 282 one line of text and the top of the next.
283 Setting this value sets $linegap to $[0] (disables it). 283 Setting this value sets $line_gap to $[0] (disables it).
284 Default value is $[0%]. 284 Default value is $[0%].
285 See @Efl.Text_Format.line_rel_gap. 285 See @Efl.Text_Format.line_rel_gap.
286 286
287 - $linefill: An alternate way to specify the $linesize as a percentage of the canvas height. 287 - $line_fill: An alternate way to specify the $line_size as a percentage of the canvas height.
288 A value of $[100%] means that a single line fills the canvas, whereas $[25%] means that 4 lines 288 A value of $[100%] means that a single line fills the canvas, whereas $[25%] means that 4 lines
289 fit in the same height. 289 fit in the same height.
290 When both $linefill and $linesize are specified the one resulting in the smallest line size is used. 290 When both $line_fill and $line_size are specified the one resulting in the smallest line size is used.
291 Default value is $[0]. 291 Default value is $[0].
292 292
293 - $ellipsis: Controls automatic addition of ellipsis "..." to replace text which cannot be shown. 293 - $ellipsis: Controls automatic addition of ellipsis "..." to replace text which cannot be shown.
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index edef5e88f1..1996134966 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -1418,12 +1418,18 @@ static const char *strikethroughstr = NULL;
1418static const char *backingstr = NULL; 1418static const char *backingstr = NULL;
1419static const char *stylestr = NULL; 1419static const char *stylestr = NULL;
1420static const char *tabstopsstr = NULL; 1420static const char *tabstopsstr = NULL;
1421static const char *tab_stopsstr = NULL;
1421static const char *linesizestr = NULL; 1422static const char *linesizestr = NULL;
1423static const char *line_sizestr = NULL;
1422static const char *linerelsizestr = NULL; 1424static const char *linerelsizestr = NULL;
1425static const char *line_rel_sizestr = NULL;
1423static const char *linegapstr = NULL; 1426static const char *linegapstr = NULL;
1427static const char *line_gapstr = NULL;
1424static const char *linerelgapstr = NULL; 1428static const char *linerelgapstr = NULL;
1429static const char *line_rel_gapstr = NULL;
1425static const char *itemstr = NULL; 1430static const char *itemstr = NULL;
1426static const char *linefillstr = NULL; 1431static const char *linefillstr = NULL;
1432static const char *line_fillstr = NULL;
1427static const char *ellipsisstr = NULL; 1433static const char *ellipsisstr = NULL;
1428static const char *passwordstr = NULL; 1434static const char *passwordstr = NULL;
1429static const char *replacement_charstr = NULL; 1435static const char *replacement_charstr = NULL;
@@ -1607,12 +1613,18 @@ _format_command_init(void)
1607 backingstr = eina_stringshare_add("backing"); 1613 backingstr = eina_stringshare_add("backing");
1608 stylestr = eina_stringshare_add("style"); 1614 stylestr = eina_stringshare_add("style");
1609 tabstopsstr = eina_stringshare_add("tabstops"); 1615 tabstopsstr = eina_stringshare_add("tabstops");
1616 tab_stopsstr = eina_stringshare_add("tab_stops");
1610 linesizestr = eina_stringshare_add("linesize"); 1617 linesizestr = eina_stringshare_add("linesize");
1618 line_sizestr = eina_stringshare_add("line_size");
1611 linerelsizestr = eina_stringshare_add("linerelsize"); 1619 linerelsizestr = eina_stringshare_add("linerelsize");
1620 line_rel_sizestr = eina_stringshare_add("line_rel_size");
1612 linegapstr = eina_stringshare_add("linegap"); 1621 linegapstr = eina_stringshare_add("linegap");
1622 line_gapstr = eina_stringshare_add("line_gap");
1613 linerelgapstr = eina_stringshare_add("linerelgap"); 1623 linerelgapstr = eina_stringshare_add("linerelgap");
1624 line_rel_gapstr = eina_stringshare_add("line_rel_gap");
1614 itemstr = eina_stringshare_add("item"); 1625 itemstr = eina_stringshare_add("item");
1615 linefillstr = eina_stringshare_add("linefill"); 1626 linefillstr = eina_stringshare_add("linefill");
1627 line_fillstr = eina_stringshare_add("line_fill");
1616 ellipsisstr = eina_stringshare_add("ellipsis"); 1628 ellipsisstr = eina_stringshare_add("ellipsis");
1617 passwordstr = eina_stringshare_add("password"); 1629 passwordstr = eina_stringshare_add("password");
1618 replacement_charstr = eina_stringshare_add("replacement_char"); 1630 replacement_charstr = eina_stringshare_add("replacement_char");
@@ -1664,12 +1676,18 @@ _format_command_shutdown(void)
1664 eina_stringshare_del(backingstr); 1676 eina_stringshare_del(backingstr);
1665 eina_stringshare_del(stylestr); 1677 eina_stringshare_del(stylestr);
1666 eina_stringshare_del(tabstopsstr); 1678 eina_stringshare_del(tabstopsstr);
1679 eina_stringshare_del(tab_stopsstr);
1667 eina_stringshare_del(linesizestr); 1680 eina_stringshare_del(linesizestr);
1681 eina_stringshare_del(line_sizestr);
1668 eina_stringshare_del(linerelsizestr); 1682 eina_stringshare_del(linerelsizestr);
1683 eina_stringshare_del(line_rel_sizestr);
1669 eina_stringshare_del(linegapstr); 1684 eina_stringshare_del(linegapstr);
1685 eina_stringshare_del(line_gapstr);
1670 eina_stringshare_del(linerelgapstr); 1686 eina_stringshare_del(linerelgapstr);
1687 eina_stringshare_del(line_rel_gapstr);
1671 eina_stringshare_del(itemstr); 1688 eina_stringshare_del(itemstr);
1672 eina_stringshare_del(linefillstr); 1689 eina_stringshare_del(linefillstr);
1690 eina_stringshare_del(line_fillstr);
1673 eina_stringshare_del(ellipsisstr); 1691 eina_stringshare_del(ellipsisstr);
1674 eina_stringshare_del(passwordstr); 1692 eina_stringshare_del(passwordstr);
1675 eina_stringshare_del(replacement_charstr); 1693 eina_stringshare_del(replacement_charstr);
@@ -2524,7 +2542,7 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch
2524 if (*part2) 2542 if (*part2)
2525 _format_shadow_direction_set(fmt, part2, EINA_FALSE, NULL); 2543 _format_shadow_direction_set(fmt, part2, EINA_FALSE, NULL);
2526 } 2544 }
2527 else if (cmd == tabstopsstr) 2545 else if (cmd == tabstopsstr || cmd == tab_stopsstr)
2528 { 2546 {
2529 /** 2547 /**
2530 * @page evas_textblock_style_page Evas Textblock Style Options 2548 * @page evas_textblock_style_page Evas Textblock Style Options
@@ -2540,7 +2558,7 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch
2540 fmt->tabstops = atoi(param); 2558 fmt->tabstops = atoi(param);
2541 if (fmt->tabstops < 1) fmt->tabstops = 1; 2559 if (fmt->tabstops < 1) fmt->tabstops = 1;
2542 } 2560 }
2543 else if (cmd == linesizestr) 2561 else if (cmd == linesizestr || cmd == line_sizestr)
2544 { 2562 {
2545 /** 2563 /**
2546 * @page evas_textblock_style_page Evas Textblock Style Options 2564 * @page evas_textblock_style_page Evas Textblock Style Options
@@ -2556,7 +2574,7 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch
2556 fmt->linesize = atoi(param); 2574 fmt->linesize = atoi(param);
2557 fmt->linerelsize = 0.0; 2575 fmt->linerelsize = 0.0;
2558 } 2576 }
2559 else if (cmd == linerelsizestr) 2577 else if (cmd == linerelsizestr || cmd == line_rel_sizestr)
2560 { 2578 {
2561 /** 2579 /**
2562 * @page evas_textblock_style_page Evas Textblock Style Options 2580 * @page evas_textblock_style_page Evas Textblock Style Options
@@ -2584,7 +2602,7 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch
2584 } 2602 }
2585 } 2603 }
2586 } 2604 }
2587 else if (cmd == linegapstr) 2605 else if (cmd == linegapstr || cmd == line_gapstr)
2588 { 2606 {
2589 /** 2607 /**
2590 * @page evas_textblock_style_page Evas Textblock Style Options 2608 * @page evas_textblock_style_page Evas Textblock Style Options
@@ -2601,7 +2619,7 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch
2601 fmt->linegap = atoi(param); 2619 fmt->linegap = atoi(param);
2602 fmt->linerelgap = 0.0; 2620 fmt->linerelgap = 0.0;
2603 } 2621 }
2604 else if (cmd == linerelgapstr) 2622 else if (cmd == linerelgapstr || cmd == line_rel_gapstr)
2605 { 2623 {
2606 /** 2624 /**
2607 * @page evas_textblock_style_page Evas Textblock Style Options 2625 * @page evas_textblock_style_page Evas Textblock Style Options
@@ -2644,7 +2662,7 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch
2644 // itemstr == replacement object items in textblock - inline imges 2662 // itemstr == replacement object items in textblock - inline imges
2645 // for example 2663 // for example
2646 } 2664 }
2647 else if (cmd == linefillstr) 2665 else if (cmd == linefillstr || cmd == line_fillstr)
2648 { 2666 {
2649 /** 2667 /**
2650 * @page evas_textblock_style_page Evas Textblock Style Options 2668 * @page evas_textblock_style_page Evas Textblock Style Options
@@ -3329,7 +3347,7 @@ _format_string_get(const Eo *eo_obj, Evas_Object_Textblock_Format *fmt)
3329 PRINTF_APPEND_COLOR(underline_colorstr, fmt->color.underline.r, fmt->color.underline.g, 3347 PRINTF_APPEND_COLOR(underline_colorstr, fmt->color.underline.r, fmt->color.underline.g,
3330 fmt->color.underline.b, fmt->color.underline.a); 3348 fmt->color.underline.b, fmt->color.underline.a);
3331 3349
3332 PRINTF_APPEND_COLOR(underline2_colorstr, fmt->color.underline2.r, fmt->color.underline2.g, 3350 PRINTF_APPEND_COLOR(secondary_underline_colorstr, fmt->color.underline2.r, fmt->color.underline2.g,
3333 fmt->color.underline2.b, fmt->color.underline2.a); 3351 fmt->color.underline2.b, fmt->color.underline2.a);
3334 3352
3335 PRINTF_APPEND_COLOR(underline_dash_colorstr, fmt->color.underline_dash.r, fmt->color.underline_dash.g, 3353 PRINTF_APPEND_COLOR(underline_dash_colorstr, fmt->color.underline_dash.r, fmt->color.underline_dash.g,
@@ -3344,7 +3362,7 @@ _format_string_get(const Eo *eo_obj, Evas_Object_Textblock_Format *fmt)
3344 PRINTF_APPEND_COLOR(glow_colorstr, fmt->color.glow.r, fmt->color.glow.g, 3362 PRINTF_APPEND_COLOR(glow_colorstr, fmt->color.glow.r, fmt->color.glow.g,
3345 fmt->color.glow.b, fmt->color.glow.a); 3363 fmt->color.glow.b, fmt->color.glow.a);
3346 3364
3347 PRINTF_APPEND_COLOR(glow2_colorstr, fmt->color.glow2.r, fmt->color.glow2.g, 3365 PRINTF_APPEND_COLOR(secondary_glow_colorstr, fmt->color.glow2.r, fmt->color.glow2.g,
3348 fmt->color.glow2.b, fmt->color.glow2.a); 3366 fmt->color.glow2.b, fmt->color.glow2.a);
3349 3367
3350 PRINTF_APPEND_COLOR(backing_colorstr, fmt->color.backing.r, fmt->color.backing.g, 3368 PRINTF_APPEND_COLOR(backing_colorstr, fmt->color.backing.r, fmt->color.backing.g,
@@ -3496,12 +3514,12 @@ _format_string_get(const Eo *eo_obj, Evas_Object_Textblock_Format *fmt)
3496 else 3514 else
3497 PRINTF_APPEND_STR(stylestr, style_value_str_1); 3515 PRINTF_APPEND_STR(stylestr, style_value_str_1);
3498 3516
3499 PRINTF_APPEND_INT(tabstopsstr, fmt->tabstops); 3517 PRINTF_APPEND_INT(tab_stopsstr, fmt->tabstops);
3500 PRINTF_APPEND_INT(linesizestr, fmt->linesize); 3518 PRINTF_APPEND_INT(line_sizestr, fmt->linesize);
3501 PRINTF_APPEND_PERCENT_FLOAT(linerelsizestr, (fmt->linerelsize*100)); 3519 PRINTF_APPEND_PERCENT_FLOAT(line_rel_sizestr, (fmt->linerelsize*100));
3502 PRINTF_APPEND_INT(linegapstr, fmt->linegap); 3520 PRINTF_APPEND_INT(line_gapstr, fmt->linegap);
3503 PRINTF_APPEND_PERCENT_FLOAT(linerelgapstr, (fmt->linerelgap*100)); 3521 PRINTF_APPEND_PERCENT_FLOAT(line_rel_gapstr, (fmt->linerelgap*100));
3504 PRINTF_APPEND_PERCENT_FLOAT(linefillstr, (fmt->linefill*100)); 3522 PRINTF_APPEND_PERCENT_FLOAT(line_fillstr, (fmt->linefill*100));
3505 PRINTF_APPEND_FLOAT(ellipsisstr, fmt->ellipsis); 3523 PRINTF_APPEND_FLOAT(ellipsisstr, fmt->ellipsis);
3506 PRINTF_APPEND_STR(passwordstr, (fmt->password == 0 ? "off" : "on")); 3524 PRINTF_APPEND_STR(passwordstr, (fmt->password == 0 ? "off" : "on"));
3507 3525
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 261c12145c..c23eb65caa 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4896,7 +4896,7 @@ EFL_START_TEST(efl_canvas_textblock_style)
4896 4896
4897 // from functions 4897 // from functions
4898 fail_if(!strstr(style, "font_weight=extrabold")); 4898 fail_if(!strstr(style, "font_weight=extrabold"));
4899 fail_if(!strstr(style, "tabstops=20")); 4899 fail_if(!strstr(style, "tab_stops=20"));
4900 fail_if(!strstr(style, "color=rgba(144,225,53,255)")); 4900 fail_if(!strstr(style, "color=rgba(144,225,53,255)"));
4901 fail_if(!strstr(style, "password=off")); 4901 fail_if(!strstr(style, "password=off"));
4902 efl_text_password_set(txt, EINA_TRUE); 4902 efl_text_password_set(txt, EINA_TRUE);