2 # include "elementary_config.h"
5 #define ELM_LAYOUT_PROTECTED
7 #include <Elementary.h>
10 #include "elm_widget_layout.h"
11 //#include "efl_ui_textpath_internal_part.eo.h"
12 //#include "elm_part_helper.h"
15 #define MY_CLASS EFL_UI_TEXTPATH_CLASS
17 #define MY_CLASS_NAME "Efl.Ui.Textpath"
18 #define MY_CLASS_NAME_LEGACY "elm_textpath"
20 #define SLICE_DEFAULT_NO 99
22 typedef struct _Efl_Ui_Textpath_Point Efl_Ui_Textpath_Point;
23 typedef struct _Efl_Ui_Textpath_Line Efl_Ui_Textpath_Line;
24 typedef struct _Efl_Ui_Textpath_Segment Efl_Ui_Textpath_Segment;
25 typedef struct _Efl_Ui_Textpath_Data Efl_Ui_Textpath_Data;
27 struct _Efl_Ui_Textpath_Point
33 struct _Efl_Ui_Textpath_Line
35 Efl_Ui_Textpath_Point start;
36 Efl_Ui_Textpath_Point end;
39 struct _Efl_Ui_Textpath_Segment
43 Efl_Gfx_Path_Command type;
47 Efl_Ui_Textpath_Line line;
51 /* If you need to draw slices using Evas Line,
52 * define the following debug flag manually. */
53 //#define EFL_UI_TEXTPATH_LINE_DEBUG
55 struct _Efl_Ui_Textpath_Data
57 Evas_Object *text_obj;
65 Efl_Ui_Textpath_Direction direction;
70 Eina_Inlist *segments;
72 #ifdef EFL_UI_TEXTPATH_LINE_DEBUG
77 #define EFL_UI_TEXTPATH_DATA_GET(o, sd) \
78 Efl_Ui_Textpath_Data *sd = eo_data_scope_get(o, EFL_UI_TEXTPATH_CLASS)
81 _deg_to_rad(double angle)
83 return angle / 180 * M_PI;
87 _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist,
88 int w1, int cmp, Evas_Map *map, Eina_Bezier bezier,
89 int *last_x1, int *last_y1, int *last_x2, int *last_y2)
91 int x = 0, y = 0, w = 0, h = 0;
93 double u0, u1, v0, v1;
95 double px, py, px2, py2;
97 Eina_Vector2 vec, nvec, vec0, vec1, vec2, vec3;
99 #ifdef EFL_UI_TEXTPATH_LINE_DEBUG
100 static Eina_Bool yello_color_flag = EINA_FALSE;
101 yello_color_flag = !yello_color_flag;
104 evas_object_geometry_get(pd->text_obj, NULL, NULL, &w, &h);
106 rad = _deg_to_rad(90);
107 eina_matrix2_values_set(&mat, cos(rad), -sin(rad), sin(rad), cos(rad));
109 eina_bezier_values_get(&bezier, NULL, NULL, NULL, NULL, NULL, NULL, &px2, &py2);
111 eina_bezier_point_at(&bezier, t, &px, &py);
112 eina_bezier_point_at(&bezier, t + dt, &px2, &py2);
116 eina_vector2_normalize(&nvec, &vec);
118 eina_vector2_transform(&vec, &mat, &nvec);
119 eina_vector2_normalize(&nvec, &vec);
120 eina_vector2_scale(&vec, &nvec, ((double) h) * 0.5);
122 vec1.x = (vec.x + px);
123 vec1.y = (vec.y + py);
124 vec2.x = (-vec.x + px);
125 vec2.y = (-vec.y + py);
129 *last_x1 = (int) floor(vec1.x + x + 0.5);
130 *last_y1 = (int) floor(vec1.y + y + 0.5);
131 *last_x2 = (int) floor(vec2.x + x + 0.5);
132 *last_y2 = (int) floor(vec2.y + y + 0.5);
136 for (i = 0; i < slice_no; i++)
158 /* If u1 is modified not to exceed its end,
159 * modify next_dt according to changes of dist. */
161 next_dt = dt * (u1 - u0) / dist;
164 t = (double) (i * dt) + next_dt;
165 eina_bezier_point_at(&bezier, t, &px, &py);
166 eina_bezier_point_at(&bezier, t + next_dt, &px2, &py2);
170 eina_vector2_normalize(&nvec, &vec);
171 eina_vector2_transform(&vec, &mat, &nvec);
172 eina_vector2_normalize(&nvec, &vec);
173 eina_vector2_scale(&vec, &nvec, ((double) h) * 0.5);
175 vec1.x = (vec.x + px);
176 vec1.y = (vec.y + py);
177 vec2.x = (-vec.x + px);
178 vec2.y = (-vec.y + py);
180 /* Set mp1, mp2 position according to difference between previous points and next points.
181 * It improves smoothness of curve's slope changing. It can show smooth result.
182 * But, it can cause huge differeces from actual positions.
186 mp1_x = *last_x1 + (int) floor(vec1.x - vec0.x + 0.5);
187 mp1_y = *last_y1 + (int) floor(vec1.y - vec0.y + 0.5);
188 mp2_x = *last_x2 + (int) floor(vec2.x - vec3.x + 0.5);
189 mp2_y = *last_y2 + (int) floor(vec2.y - vec3.y + 0.5);
193 /* It reduces differences between actual position and modified position. */
194 mp1_x += (int)floor(((double)vec1.x - mp1_x) / 2 + 0.5);
195 mp1_y += (int)floor(((double)vec1.y - mp1_y) / 2 + 0.5);
196 mp2_x += (int)floor(((double)vec2.x - mp2_x) / 2 + 0.5);
197 mp2_y += (int)floor(((double)vec2.y - mp2_y) / 2 + 0.5);
199 evas_map_point_coord_set(map, cmp + i * 4, mp0_x, mp0_y, 0);
200 evas_map_point_coord_set(map, cmp + i * 4 + 1, mp1_x, mp1_y, 0);
201 evas_map_point_coord_set(map, cmp + i * 4 + 2, mp2_x, mp2_y, 0);
202 evas_map_point_coord_set(map, cmp + i * 4 + 3, mp3_x, mp3_y, 0);
204 evas_map_point_image_uv_set(map, cmp + i * 4, u0, v0);
205 evas_map_point_image_uv_set(map, cmp + i * 4 + 1, u1, v0);
206 evas_map_point_image_uv_set(map, cmp + i * 4 + 2, u1, v1);
207 evas_map_point_image_uv_set(map, cmp + i * 4 + 3, u0, v1);
214 #ifdef EFL_UI_TEXTPATH_LINE_DEBUG
215 Evas_Object *line = evas_object_line_add(evas_object_evas_get(pd->text_obj));
216 pd->lines = eina_list_append(pd->lines, line);
217 if (yello_color_flag)
218 evas_object_color_set(line, 255, 255, 0, 255);
220 evas_object_color_set(line, 255, 0, 0, 255);
221 evas_object_line_xy_set(line,
224 evas_object_show(line);
226 line = evas_object_line_add(evas_object_evas_get(pd->text_obj));
227 pd->lines = eina_list_append(pd->lines, line);
228 if (yello_color_flag)
229 evas_object_color_set(line, 255, 255, 0, 255);
231 evas_object_color_set(line, 255, 0, 0, 255);
232 evas_object_line_xy_set(line,
235 evas_object_show(line);
237 line = evas_object_line_add(evas_object_evas_get(pd->text_obj));
238 pd->lines = eina_list_append(pd->lines, line);
239 if (yello_color_flag)
240 evas_object_color_set(line, 255, 255, 0, 255);
242 evas_object_color_set(line, 255, 0, 0, 255);
243 evas_object_line_xy_set(line,
246 evas_object_show(line);
248 line = evas_object_line_add(evas_object_evas_get(pd->text_obj));
249 pd->lines = eina_list_append(pd->lines, line);
250 if (yello_color_flag)
251 evas_object_color_set(line, 255, 255, 0, 255);
253 evas_object_color_set(line, 255, 0, 0, 255);
254 evas_object_line_xy_set(line,
257 evas_object_show(line);
265 _text_on_line_draw(Efl_Ui_Textpath_Data *pd, int w1, int w2, int cmp, Evas_Map *map, Efl_Ui_Textpath_Line line)
267 double x1, x2, y1, y2;
268 Evas_Coord x, y, w, h;
269 double line_len, len, sina, cosa;
276 line_len = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
280 x2 = x1 + len * (x2 - x1) / line_len;
281 y2 = y1 + len * (y2 - y1) / line_len;
284 evas_object_geometry_get(pd->text_obj, &x, &y, &w, &h);
286 len = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1));
287 sina = (y2 - y1) / len;
288 cosa = (x2 - x1) / len;
291 evas_map_point_coord_set(map, cmp + 3, x1 - h * sina, y1 + h * cosa, 0);
292 evas_map_point_coord_set(map, cmp + 2, x2 - h * sina, y2 + h * cosa, 0);
293 evas_map_point_coord_set(map, cmp + 1, x2 + h * sina, y2 - h * cosa, 0);
294 evas_map_point_coord_set(map, cmp + 0, x1 + h * sina, y1 - h * cosa, 0);
297 evas_map_point_image_uv_set(map, cmp + 0, w1, 0);
298 evas_map_point_image_uv_set(map, cmp + 1, w2, 0);
299 evas_map_point_image_uv_set(map, cmp + 2, w2, h);
300 evas_map_point_image_uv_set(map, cmp + 3, w1, h);
304 _map_point_calc(Efl_Ui_Textpath_Data *pd)
307 Efl_Ui_Textpath_Segment *seg;
309 EINA_INLIST_FOREACH(pd->segments, seg)
311 if (seg->type == EFL_GFX_PATH_COMMAND_TYPE_LINE_TO)
315 else if (seg->type == EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO)
317 int no = (int)ceil(pd->slice_no * seg->length / (double)pd->total_length);
328 _text_draw(Efl_Ui_Textpath_Data *pd)
330 Efl_Ui_Textpath_Segment *seg;
334 int cur_map_point = 0, map_point_no;
335 int last_x1, last_y1, last_x2, last_y2;
337 last_x1 = last_y1 = last_x2 = last_y2 = 0;
339 evas_object_geometry_get(pd->text_obj, NULL, NULL, &w, &h);
343 remained_w = pd->total_length;
345 map_point_no = _map_point_calc(pd);
346 if (map_point_no == 0)
348 evas_object_map_enable_set(pd->text_obj, EINA_FALSE);
351 map = evas_map_new(map_point_no);
352 /* TIZEN_ONLY(20180302): update map when object's position is updated */
353 evas_map_util_object_move_sync_set(map, EINA_TRUE);
356 #ifdef EFL_UI_TEXTPATH_LINE_DEBUG
358 EINA_LIST_FREE(pd->lines, line)
359 evas_object_del(line);
363 EINA_INLIST_FOREACH(pd->segments, seg)
365 int len = seg->length;
367 len = (double)seg->length * w / (double)pd->total_length;
373 if (seg->type == EFL_GFX_PATH_COMMAND_TYPE_LINE_TO)
375 _text_on_line_draw(pd, w1, w2, cur_map_point, map, seg->line);
380 double slice_value, dt, dist;
383 slice_value = pd->slice_no * seg->length / (double)pd->total_length;
384 dt = (double)pd->total_length / (pd->slice_no * seg->length);
387 dist = (double)pd->total_length / (double)pd->slice_no;
389 dist = (double)pd->total_length * (w2 - w1) / ((double)pd->slice_no * seg->length);
391 slice_no = (int)ceil(slice_value);
392 dt = (double)slice_value * dt / (double)slice_no;
393 dist = (double)slice_value * dist / (double)slice_no;
395 _segment_draw(pd, slice_no, dt, dist,
396 w1, cur_map_point, map, seg->bezier,
397 &last_x1, &last_y1, &last_x2, &last_y2);
398 cur_map_point += slice_no * 4;
401 remained_w -= seg->length;
403 evas_object_map_enable_set(pd->text_obj, EINA_TRUE);
404 evas_object_map_set(pd->text_obj, map);
409 _path_data_get(Eo *obj, Efl_Ui_Textpath_Data *pd, Eina_Bool set_min)
411 const Efl_Gfx_Path_Command *cmd;
412 const double *points;
413 Efl_Ui_Textpath_Segment *seg;
415 EINA_INLIST_FREE(pd->segments, seg)
417 pd->segments = eina_inlist_remove(pd->segments, EINA_INLIST_GET(seg));
422 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
424 pd->total_length = 0;
425 eo_do(obj, efl_gfx_shape_path_get(&cmd, &points));
429 Eina_Rectangle *rect = eina_rectangle_new(0, 0, 0, 0);
430 double px0 = 0.0, py0 = 0.0, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1, px1, py1;
432 while (*cmd != EFL_GFX_PATH_COMMAND_TYPE_END)
435 if (*cmd == EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO)
438 px0 = points[pos] + x;
440 py0 = points[pos] + y;
442 else if (*cmd == EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO)
445 double bx, by, bw, bh;
446 Eina_Rectangle *brect;
449 ctrl_x0 = points[pos] + x;
451 ctrl_y0 = points[pos] + y;
453 ctrl_x1 = points[pos] + x;
455 ctrl_y1 = points[pos] + y;
457 px1 = points[pos] + x;
459 py1 = points[pos] + y;
461 eina_bezier_values_set(&bz, px0, py0, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1, px1, py1);
462 seg = malloc(sizeof(Efl_Ui_Textpath_Segment));
465 ERR("Failed to allocate segment");
470 seg->length = eina_bezier_length_get(&bz);
472 seg->type = EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO;
473 pd->segments = eina_inlist_append(pd->segments, EINA_INLIST_GET(seg));
474 pd->total_length += seg->length;
480 eina_bezier_bounds_get(&bz, &bx, &by, &bw, &bh);
481 brect = eina_rectangle_new(bx, by, bw, bh);
482 eina_rectangle_union(rect, brect);
483 eina_rectangle_free(brect);
485 else if (*cmd == EFL_GFX_PATH_COMMAND_TYPE_LINE_TO)
487 Eina_Rectangle *lrect;
490 px1 = points[pos] + x;
492 py1 = points[pos] + y;
494 seg = malloc(sizeof(Efl_Ui_Textpath_Segment));
497 ERR("Failed to allocate segment");
501 seg->type = EFL_GFX_PATH_COMMAND_TYPE_LINE_TO;
502 seg->line.start.x = px0;
503 seg->line.start.y = py0;
504 seg->line.end.x = px1;
505 seg->line.end.y = py1;
506 seg->length = sqrt((px1 - px0)*(px1 - px0) + (py1 - py0)*(py1 - py0));
507 pd->segments = eina_inlist_append(pd->segments, EINA_INLIST_GET(seg));
508 pd->total_length += seg->length;
510 lrect = eina_rectangle_new(px0, py0, px1 - px0, py1 - py0);
511 eina_rectangle_union(rect, lrect);
512 eina_rectangle_free(lrect);
518 evas_object_size_hint_min_set(obj, rect->w, rect->h);
520 eina_rectangle_free(rect);
525 _sizing_eval(Efl_Ui_Textpath_Data *pd)
531 _textpath_ellipsis_set(Efl_Ui_Textpath_Data *pd, Eina_Bool enabled)
535 edje_object_part_text_style_user_pop(pd->text_obj, "elm.text");
538 Eina_Strbuf *buf = eina_strbuf_new();
540 eina_strbuf_append_printf(buf, "DEFAULT='ellipsis=1.0'");
541 format = eina_stringshare_add(eina_strbuf_string_get(buf));
542 eina_strbuf_free(buf);
543 edje_object_part_text_style_user_push(pd->text_obj, "elm.text", format);
548 _ellipsis_set(Efl_Ui_Textpath_Data *pd)
550 if (!pd->text_obj) return;
552 Evas_Coord w = 0, h = 0;
553 Eina_Bool is_ellipsis = EINA_FALSE;
554 const Evas_Object *tb;
556 tb = edje_object_part_object_get(pd->text_obj, "elm.text");
557 evas_object_textblock_size_native_get(tb, &w, &h);
558 evas_object_size_hint_min_set(pd->text_obj, w, h);
561 if (w > pd->total_length)
563 is_ellipsis = EINA_TRUE;
564 w = pd->total_length;
567 evas_object_resize(pd->text_obj, w, h);
568 _textpath_ellipsis_set(pd, is_ellipsis);
572 //_path_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
573 _path_changed_cb(void *data,
574 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
575 void *event_info EINA_UNUSED)
577 EFL_UI_TEXTPATH_DATA_GET(data, sd);
579 _path_data_get(data, sd, EINA_TRUE);
586 _textpath_text_set_internal(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *part EINA_UNUSED, const char *text)
588 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
589 Eina_Bool ret = EINA_TRUE;
591 if (!text) text = "";
592 //ret = edje_object_part_text_set(pd->text_obj, part, text);
593 ret = edje_object_part_text_set(pd->text_obj, "elm.text", text);
600 _efl_ui_textpath_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
607 _efl_ui_textpath_elm_layout_sizing_eval(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
613 _efl_ui_textpath_evas_object_smart_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
619 //_efl_ui_textpath_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Textpath_Data *priv)
620 _efl_ui_textpath_evas_object_smart_add(Eo *obj, Efl_Ui_Textpath_Data *priv)
622 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
624 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
625 elm_widget_sub_object_parent_add(obj);
627 priv->text_obj = edje_object_add(evas_object_evas_get(obj));
628 elm_widget_theme_object_set(obj, priv->text_obj, "textpath", "base",
629 elm_widget_style_get(obj));
630 evas_object_size_hint_weight_set(priv->text_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
631 evas_object_size_hint_align_set(priv->text_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
632 evas_object_show(priv->text_obj);
634 evas_object_smart_member_add(priv->text_obj, obj);
635 elm_widget_sub_object_add(obj, priv->text_obj);
637 //efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED, _path_changed_cb, obj);
638 eo_do(obj, eo_event_callback_add
639 (EFL_GFX_PATH_CHANGED, _path_changed_cb, obj));
643 _efl_ui_textpath_class_constructor(Eo_Class *klass)
645 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
648 //EOLIAN static Efl_Object *
649 //_efl_ui_textpath_efl_object_constructor(Eo *obj, Efl_Ui_Textpath_Data *pd)
651 _efl_ui_textpath_eo_base_constructor(Eo *obj, Efl_Ui_Textpath_Data *pd)
653 //obj = efl_constructor(efl_super(obj, MY_CLASS));
654 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
655 pd->autofit = EINA_TRUE;
656 pd->slice_no = SLICE_DEFAULT_NO;
657 pd->direction = EFL_UI_TEXTPATH_DIRECTION_CW;
663 //_efl_ui_textpath_efl_object_destructor(Eo *obj, Efl_Ui_Textpath_Data *pd)
664 _efl_ui_textpath_eo_base_destructor(Eo *obj, Efl_Ui_Textpath_Data *pd)
666 Efl_Ui_Textpath_Segment *seg;
668 if (pd->text) free(pd->text);
669 if (pd->text_obj) evas_object_del(pd->text_obj);
670 EINA_INLIST_FREE(pd->segments, seg)
672 pd->segments = eina_inlist_remove(pd->segments, EINA_INLIST_GET(seg));
676 #ifdef EFL_UI_TEXTPATH_LINE_DEBUG
678 EINA_LIST_FREE(pd->lines, line)
679 evas_object_del(line);
682 //efl_destructor(efl_super(obj, MY_CLASS));
683 eo_do_super(obj, MY_CLASS, eo_destructor());
686 EOLIAN static Eina_Bool
687 _efl_ui_textpath_elm_layout_text_set(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *part, const char *text)
689 return _textpath_text_set_internal(obj, pd, part, text);
692 EOLIAN static const char *
693 _efl_ui_textpath_elm_layout_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, const char *part)
695 return edje_object_part_text_get(pd->text_obj, part);
699 EOLIAN static Eina_Bool
700 _efl_ui_textpath_text_set(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *part, const char *text)
702 return _textpath_text_set_internal(obj, pd, part, text);
705 EOLIAN static const char *
706 _efl_ui_textpath_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, const char *part)
708 return edje_object_part_text_get(pd->text_obj, part);
712 _efl_ui_textpath_efl_text_text_set(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *text)
714 _textpath_text_set_internal(obj, pd, "elm.text", text);
717 EOLIAN static const char *
718 _efl_ui_textpath_efl_text_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
720 return edje_object_part_text_get(pd->text_obj, "elm.text");
723 //EOLIAN static Efl_Ui_Theme_Apply
724 EOLIAN static Elm_Theme_Apply
725 _efl_ui_textpath_elm_widget_theme_apply(Eo *obj, Efl_Ui_Textpath_Data *pd)
727 Elm_Theme_Apply ret = ELM_THEME_APPLY_FAILED;
729 eo_do_super(obj, MY_CLASS, ret = elm_obj_widget_theme_apply());
730 if (!ret) return ELM_THEME_APPLY_FAILED;
732 elm_widget_theme_object_set(obj, pd->text_obj, "textpath", "base",
733 elm_widget_style_get(obj));
741 //_efl_ui_textpath_evas_object_position_set(Eo *obj, Efl_Ui_Textpath_Data *pd, Evas_Coord x, Evas_Coord y)
742 _efl_ui_textpath_evas_object_smart_move(Eo *obj, Efl_Ui_Textpath_Data *pd, Evas_Coord x, Evas_Coord y)
744 eo_do_super(obj, MY_CLASS, evas_obj_smart_move(x, y));
746 /* TIZEN_ONLY(20180302): update map when object's position is updated
747 * Do Nothing. The position is not updated to the object in this function.
748 * Test with evas_object_geometry_get().
749 _path_data_get(obj, pd, EINA_FALSE);
757 _efl_ui_textpath_evas_object_resize(Eo *obj, Efl_Ui_Textpath_Data *pd EINA_UNUSED, Evas_Coord w, Evas_Coord h)
759 eo_do_super(obj, MY_CLASS, evas_object_resize(w, h));
763 _efl_ui_textpath_circle_set(Eo *obj, Efl_Ui_Textpath_Data *pd, double x, double y, double radius, double start_angle, Efl_Ui_Textpath_Direction direction)
765 if (pd->circle.x == x && pd->circle.y == y &&
766 pd->circle.radius == radius &&
767 pd->circle.start_angle == start_angle &&
768 pd->direction == direction &&
769 _map_point_calc(pd) > 0)
776 pd->circle.radius = radius;
777 pd->circle.start_angle = start_angle;
778 pd->direction = direction;
780 eo_do(obj, efl_gfx_shape_reset());
781 if (direction == EFL_UI_TEXTPATH_DIRECTION_CW)
783 eo_do(obj, efl_gfx_shape_append_arc(x - radius, y - radius, radius * 2,
784 radius * 2, start_angle, -360));
788 eo_do(obj, efl_gfx_shape_append_arc(x - radius, y - radius, radius * 2,
789 radius * 2, start_angle, 360));
795 EOLIAN static Eina_Bool
796 _efl_ui_textpath_autofit_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
802 _efl_ui_textpath_autofit_set(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, Eina_Bool autofit)
804 if (pd->autofit == autofit) return;
805 pd->autofit = autofit;
810 _efl_ui_textpath_slice_number_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
816 _efl_ui_textpath_slice_number_set(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, int slice_no)
818 if (pd->slice_no == slice_no) return;
819 pd->slice_no = slice_no;
824 _efl_ui_textpath_ellipsis_set(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd, Eina_Bool ellipsis)
826 if (pd->ellipsis == ellipsis) return;
827 pd->ellipsis = ellipsis;
833 EOLIAN static Eina_Bool
834 _efl_ui_textpath_ellipsis_get(Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Data *pd)
840 //ELM_PART_OVERRIDE(efl_ui_textpath, EFL_UI_TEXTPATH, EFL_UI_LAYOUT, Efl_Ui_Textpath_Data, Elm_Part_Data)
841 //ELM_PART_OVERRIDE_TEXT_SET(efl_ui_textpath, EFL_UI_TEXTPATH, EFL_UI_LAYOUT, Efl_Ui_Textpath_Data, Elm_Part_Data)
842 //ELM_PART_OVERRIDE_TEXT_GET(efl_ui_textpath, EFL_UI_TEXTPATH, EFL_UI_LAYOUT, Efl_Ui_Textpath_Data, Elm_Part_Data)
843 //#include "efl_ui_textpath_internal_part.eo.c"
847 elm_textpath_add(Evas_Object *parent)
849 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
850 Evas_Object *obj = eo_add(MY_CLASS, parent);
855 #define EFL_UI_TEXTPATH_EXTRA_OPS \
856 EFL_CANVAS_GROUP_ADD_OPS(efl_ui_textpath)
858 #include "efl_ui_textpath.eo.c"