summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-03-06 16:26:26 -0500
committerCedric BAIL <cedric.bail@free.fr>2019-03-07 14:14:55 -0800
commitca9daf94c63178bd1ebf726b746e210bb9a0143d (patch)
tree69d390cfe7339b4bc874747f49e8d2cce8dcb4a4
parentf549d1c2718fa9250a8f4463bcb010eb77ee4794 (diff)
elm_code_widget: make this efl_ui namespaced
this currently has no counterpart in interface widgets but would be useful there. removing the use of an elm_scroller type makes it independent of legacy widgets, and it's still a beta api so at least future development can be resumed at some point without much issue Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D8158
-rw-r--r--src/Makefile_Elementary.am2
-rw-r--r--src/bin/elementary/test_code.c42
-rw-r--r--src/lib/elementary/elm_code_diff_widget.c8
-rw-r--r--src/lib/elementary/elm_code_widget.c69
-rw-r--r--src/lib/elementary/elm_code_widget.eo20
-rw-r--r--src/lib/elementary/elm_code_widget_eo.legacy.c270
-rw-r--r--src/lib/elementary/elm_code_widget_eo.legacy.h550
-rw-r--r--src/lib/elementary/elm_code_widget_legacy.h2
-rw-r--r--src/lib/elementary/elm_code_widget_selection.c18
-rw-r--r--src/lib/elementary/elm_code_widget_text.c12
-rw-r--r--src/lib/elementary/elm_code_widget_undo.c4
-rw-r--r--src/lib/elementary/meson.build1
-rw-r--r--src/tests/elementary/elm_code_test_syntax.c2
13 files changed, 917 insertions, 83 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 4647a3f..a228933 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -337,6 +337,7 @@ lib/elementary/elm_calendar_eo.legacy.c \
337lib/elementary/elm_calendar_item_eo.c \ 337lib/elementary/elm_calendar_item_eo.c \
338lib/elementary/elm_clock_eo.c \ 338lib/elementary/elm_clock_eo.c \
339lib/elementary/elm_clock_eo.legacy.c \ 339lib/elementary/elm_clock_eo.legacy.c \
340lib/elementary/elm_code_widget_eo.legacy.c \
340lib/elementary/elm_hoversel_eo.c \ 341lib/elementary/elm_hoversel_eo.c \
341lib/elementary/elm_hoversel_item_eo.c \ 342lib/elementary/elm_hoversel_item_eo.c \
342lib/elementary/elm_hoversel_item_eo.legacy.c 343lib/elementary/elm_hoversel_item_eo.legacy.c
@@ -399,6 +400,7 @@ lib/elementary/elm_calendar_item_eo.h \
399lib/elementary/elm_calendar_item_eo.legacy.h \ 400lib/elementary/elm_calendar_item_eo.legacy.h \
400lib/elementary/elm_clock_eo.h \ 401lib/elementary/elm_clock_eo.h \
401lib/elementary/elm_clock_eo.legacy.h \ 402lib/elementary/elm_clock_eo.legacy.h \
403lib/elementary/elm_code_widget_eo.legacy.h \
402lib/elementary/elm_hoversel_eo.h \ 404lib/elementary/elm_hoversel_eo.h \
403lib/elementary/elm_hoversel_eo.legacy.h \ 405lib/elementary/elm_hoversel_eo.legacy.h \
404lib/elementary/elm_hoversel_item_eo.h \ 406lib/elementary/elm_hoversel_item_eo.h \
diff --git a/src/bin/elementary/test_code.c b/src/bin/elementary/test_code.c
index bb010ce..846dc61 100644
--- a/src/bin/elementary/test_code.c
+++ b/src/bin/elementary/test_code.c
@@ -69,7 +69,7 @@ _elm_code_test_welcome_setup(Evas_Object *parent)
69 evas_object_show(widget); 69 evas_object_show(widget);
70 70
71 efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _elm_code_test_line_done_cb, NULL); 71 efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _elm_code_test_line_done_cb, NULL);
72 efl_event_callback_add(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, _elm_code_test_line_clicked_cb, code); 72 efl_event_callback_add(widget, EFL_UI_CODE_WIDGET_EVENT_LINE_CLICKED, _elm_code_test_line_clicked_cb, code);
73 73
74 _append_line(code->file, "❤ Hello World, Elm Code! ❤"); 74 _append_line(code->file, "❤ Hello World, Elm Code! ❤");
75 _append_line(code->file, "*** Currently experimental ***"); 75 _append_line(code->file, "*** Currently experimental ***");
@@ -103,10 +103,10 @@ _elm_code_test_editor_setup(Evas_Object *parent, Eina_Bool log)
103 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); 103 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
104 evas_object_show(widget); 104 evas_object_show(widget);
105 105
106 elm_obj_code_widget_font_set(widget, NULL, 14); 106 efl_ui_code_widget_font_set(widget, NULL, 14);
107 elm_obj_code_widget_editable_set(widget, EINA_TRUE); 107 efl_ui_code_widget_editable_set(widget, EINA_TRUE);
108 elm_obj_code_widget_show_whitespace_set(widget, EINA_TRUE); 108 efl_ui_code_widget_show_whitespace_set(widget, EINA_TRUE);
109 elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE); 109 efl_ui_code_widget_line_numbers_set(widget, EINA_TRUE);
110 110
111 if (!log) 111 if (!log)
112 { 112 {
@@ -135,11 +135,11 @@ _elm_code_test_syntax_setup(Evas_Object *parent)
135 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); 135 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
136 evas_object_show(widget); 136 evas_object_show(widget);
137 137
138 elm_obj_code_widget_editable_set(widget, EINA_TRUE); 138 efl_ui_code_widget_editable_set(widget, EINA_TRUE);
139 elm_obj_code_widget_syntax_enabled_set(widget, EINA_TRUE); 139 efl_ui_code_widget_syntax_enabled_set(widget, EINA_TRUE);
140 elm_obj_code_widget_code_get(widget)->file->mime = "text/x-csrc"; 140 efl_ui_code_widget_code_get(widget)->file->mime = "text/x-csrc";
141 elm_obj_code_widget_show_whitespace_set(widget, EINA_TRUE); 141 efl_ui_code_widget_show_whitespace_set(widget, EINA_TRUE);
142 elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE); 142 efl_ui_code_widget_line_numbers_set(widget, EINA_TRUE);
143 143
144 _append_line(code->file, "#include <stdio.h>"); 144 _append_line(code->file, "#include <stdio.h>");
145 _append_line(code->file, "int main(int argc, char **argv)"); 145 _append_line(code->file, "int main(int argc, char **argv)");
@@ -163,13 +163,13 @@ _elm_code_test_syntax_tabbed_setup(Evas_Object *parent)
163 163
164 code = elm_code_create(); 164 code = elm_code_create();
165 code->config.indent_style_efl = EINA_FALSE; 165 code->config.indent_style_efl = EINA_FALSE;
166 widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code)); 166 widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, efl_ui_code_widget_code_set(efl_added, code));
167 elm_obj_code_widget_editable_set(widget, EINA_TRUE); 167 efl_ui_code_widget_editable_set(widget, EINA_TRUE);
168 elm_obj_code_widget_syntax_enabled_set(widget, EINA_TRUE); 168 efl_ui_code_widget_syntax_enabled_set(widget, EINA_TRUE);
169 elm_obj_code_widget_code_get(widget)->file->mime = "text/x-csrc"; 169 efl_ui_code_widget_code_get(widget)->file->mime = "text/x-csrc";
170 elm_obj_code_widget_show_whitespace_set(widget, EINA_TRUE); 170 efl_ui_code_widget_show_whitespace_set(widget, EINA_TRUE);
171 elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE); 171 efl_ui_code_widget_line_numbers_set(widget, EINA_TRUE);
172 elm_obj_code_widget_tab_inserts_spaces_set(widget, EINA_FALSE); 172 efl_ui_code_widget_tab_inserts_spaces_set(widget, EINA_FALSE);
173 173
174 _append_line(code->file, "#include <stdio.h>"); 174 _append_line(code->file, "#include <stdio.h>");
175 _append_line(code->file, "int main(int argc, char **argv)"); 175 _append_line(code->file, "int main(int argc, char **argv)");
@@ -199,8 +199,8 @@ _elm_code_test_mirror_setup(Elm_Code *code, char *font_name, Evas_Object *parent
199 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL); 199 evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
200 evas_object_show(widget); 200 evas_object_show(widget);
201 201
202 elm_obj_code_widget_font_set(widget, font_name, 11); 202 efl_ui_code_widget_font_set(widget, font_name, 11);
203 elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE); 203 efl_ui_code_widget_line_numbers_set(widget, EINA_TRUE);
204 204
205 return widget; 205 return widget;
206} 206}
@@ -326,7 +326,7 @@ test_code_log(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
326 326
327 o = elm_button_add(screen); 327 o = elm_button_add(screen);
328 elm_object_text_set(o, "log"); 328 elm_object_text_set(o, "log");
329 evas_object_smart_callback_add(o, "clicked", _elm_code_test_log_clicked, elm_obj_code_widget_code_get(code)); 329 evas_object_smart_callback_add(o, "clicked", _elm_code_test_log_clicked, efl_ui_code_widget_code_get(code));
330 elm_box_pack_end(screen, o); 330 elm_box_pack_end(screen, o);
331 evas_object_show(o); 331 evas_object_show(o);
332 332
@@ -348,7 +348,7 @@ test_code_mirror(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
348 evas_object_size_hint_weight_set(screen, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 348 evas_object_size_hint_weight_set(screen, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
349 349
350 widget = _elm_code_test_editor_setup(screen, EINA_FALSE); 350 widget = _elm_code_test_editor_setup(screen, EINA_FALSE);
351 code = elm_obj_code_widget_code_get(widget); 351 code = efl_ui_code_widget_code_get(widget);
352 elm_box_pack_end(screen, widget); 352 elm_box_pack_end(screen, widget);
353 353
354 elm_box_pack_end(screen, _elm_code_test_mirror_setup(code, "Mono:style=Oblique", screen)); 354 elm_box_pack_end(screen, _elm_code_test_mirror_setup(code, "Mono:style=Oblique", screen));
diff --git a/src/lib/elementary/elm_code_diff_widget.c b/src/lib/elementary/elm_code_diff_widget.c
index 593f044..6386e15 100644
--- a/src/lib/elementary/elm_code_diff_widget.c
+++ b/src/lib/elementary/elm_code_diff_widget.c
@@ -96,7 +96,7 @@ elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
96 // left side of diff 96 // left side of diff
97 wcode1 = elm_code_create(); 97 wcode1 = elm_code_create();
98 elm_code_parser_standard_add(wcode1, ELM_CODE_PARSER_STANDARD_DIFF); 98 elm_code_parser_standard_add(wcode1, ELM_CODE_PARSER_STANDARD_DIFF);
99 widget_left = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode1)); 99 widget_left = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, efl_ui_code_widget_code_set(efl_added, wcode1));
100 100
101 evas_object_size_hint_weight_set(widget_left, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 101 evas_object_size_hint_weight_set(widget_left, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
102 evas_object_size_hint_align_set(widget_left, EVAS_HINT_FILL, EVAS_HINT_FILL); 102 evas_object_size_hint_align_set(widget_left, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -107,7 +107,7 @@ elm_code_diff_widget_add(Evas_Object *parent, Elm_Code *code)
107 // right side of diff 107 // right side of diff
108 wcode2 = elm_code_create(); 108 wcode2 = elm_code_create();
109 elm_code_parser_standard_add(wcode2, ELM_CODE_PARSER_STANDARD_DIFF); 109 elm_code_parser_standard_add(wcode2, ELM_CODE_PARSER_STANDARD_DIFF);
110 widget_right = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, elm_obj_code_widget_code_set(efl_added, wcode2)); 110 widget_right = elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, efl_ui_code_widget_code_set(efl_added, wcode2));
111 111
112 evas_object_size_hint_weight_set(widget_right, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 112 evas_object_size_hint_weight_set(widget_right, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
113 evas_object_size_hint_align_set(widget_right, EVAS_HINT_FILL, EVAS_HINT_FILL); 113 evas_object_size_hint_align_set(widget_right, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -125,8 +125,8 @@ elm_code_diff_widget_font_set(Evas_Object *widget, const char *name, int size)
125 Elm_Code_Widget *child; 125 Elm_Code_Widget *child;
126 126
127 child = (Elm_Code_Widget *) evas_object_data_get(widget, _ELM_CODE_DIFF_WIDGET_LEFT); 127 child = (Elm_Code_Widget *) evas_object_data_get(widget, _ELM_CODE_DIFF_WIDGET_LEFT);
128 elm_obj_code_widget_font_set(child, name, size); 128 efl_ui_code_widget_font_set(child, name, size);
129 child = (Elm_Code_Widget *) evas_object_data_get(widget, _ELM_CODE_DIFF_WIDGET_RIGHT); 129 child = (Elm_Code_Widget *) evas_object_data_get(widget, _ELM_CODE_DIFF_WIDGET_RIGHT);
130 elm_obj_code_widget_font_set(child, name, size); 130 efl_ui_code_widget_font_set(child, name, size);
131} 131}
132 132
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 8a6a73c..ec8a7fb 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -65,7 +65,7 @@ elm_code_widget_add(Evas_Object *parent, Elm_Code *code)
65{ 65{
66 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); 66 EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
67 return elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent, 67 return elm_legacy_add(ELM_CODE_WIDGET_LEGACY_CLASS, parent,
68 elm_obj_code_widget_code_set(efl_added, code)); 68 efl_ui_code_widget_code_set(efl_added, code));
69} 69}
70 70
71#include "elm_code_widget_legacy.eo.c" 71#include "elm_code_widget_legacy.eo.c"
@@ -175,7 +175,7 @@ _elm_code_widget_fill_line_tokens(Elm_Code_Widget *widget, Evas_Textgrid_Cell *c
175 unsigned int end, length, offset; 175 unsigned int end, length, offset;
176 unsigned int token_start_col, token_end_col; 176 unsigned int token_start_col, token_end_col;
177 177
178 offset = elm_obj_code_widget_text_left_gutter_width_get(widget); 178 offset = efl_ui_code_widget_text_left_gutter_width_get(widget);
179 length = elm_code_widget_line_text_column_width_get(widget, line) + offset; 179 length = elm_code_widget_line_text_column_width_get(widget, line) + offset;
180 180
181 EINA_LIST_FOREACH(line->tokens, item, token) 181 EINA_LIST_FOREACH(line->tokens, item, token)
@@ -397,7 +397,7 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd, El
397 397
398 EINA_SAFETY_ON_NULL_RETURN(line); 398 EINA_SAFETY_ON_NULL_RETURN(line);
399 399
400 gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); 400 gutter = efl_ui_code_widget_text_left_gutter_width_get(widget);
401 if (eina_list_count(pd->grids) < line->number) 401 if (eina_list_count(pd->grids) < line->number)
402 return; 402 return;
403 403
@@ -478,7 +478,7 @@ _elm_code_widget_fill_range(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd,
478 _elm_code_widget_fill_line(widget, pd, newline); 478 _elm_code_widget_fill_line(widget, pd, newline);
479 479
480 // if called from new line cb, no need to update whole range unless visible 480 // if called from new line cb, no need to update whole range unless visible
481 if (newline && !elm_obj_code_widget_line_visible_get(widget, newline)) 481 if (newline && !efl_ui_code_widget_line_visible_get(widget, newline))
482 return; 482 return;
483 483
484 // cursor will be shown if it should be visible 484 // cursor will be shown if it should be visible
@@ -676,7 +676,7 @@ _elm_code_widget_cursor_ensure_visible(Elm_Code_Widget *widget)
676 grid = eina_list_data_get(eina_list_nth_list(pd->grids, pd->cursor_line - 1)); 676 grid = eina_list_data_get(eina_list_nth_list(pd->grids, pd->cursor_line - 1));
677 evas_object_geometry_get(grid, NULL, &rowy, NULL, NULL); 677 evas_object_geometry_get(grid, NULL, &rowy, NULL, NULL);
678 678
679 gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); 679 gutter = efl_ui_code_widget_text_left_gutter_width_get(widget);
680 curx = (pd->cursor_col + gutter - 1) * cellw; 680 curx = (pd->cursor_col + gutter - 1) * cellw;
681 cury = rowy + viewy - oy; 681 cury = rowy + viewy - oy;
682 682
@@ -705,7 +705,7 @@ _elm_code_widget_cursor_move(Elm_Code_Widget *widget, Elm_Code_Widget_Data *pd,
705 if (position < length && text[position] == '\t') 705 if (position < length && text[position] == '\t')
706 pd->cursor_col = elm_code_widget_line_text_column_width_to_position(widget, line_obj, position); 706 pd->cursor_col = elm_code_widget_line_text_column_width_to_position(widget, line_obj, position);
707 707
708 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CURSOR_CHANGED, widget); 708 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CURSOR_CHANGED, widget);
709 if (!pd->selection || (pd->selection && pd->selection->in_progress)) 709 if (!pd->selection || (pd->selection && pd->selection->in_progress))
710 _elm_code_widget_cursor_ensure_visible(widget); 710 _elm_code_widget_cursor_ensure_visible(widget);
711 711
@@ -737,7 +737,7 @@ _elm_code_widget_position_at_coordinates_get(Eo *obj, Elm_Code_Widget_Data *pd,
737 y = y + sy - oy; 737 y = y + sy - oy;
738 738
739 _elm_code_widget_cell_size_get(widget, &cw, &ch); 739 _elm_code_widget_cell_size_get(widget, &cw, &ch);
740 gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); 740 gutter = efl_ui_code_widget_text_left_gutter_width_get(widget);
741 741
742 if (y >= 0 && ch > 0) 742 if (y >= 0 && ch > 0)
743 guess = ((double) y / ch) + 1; 743 guess = ((double) y / ch) + 1;
@@ -794,7 +794,7 @@ _elm_code_widget_geometry_for_position_get(Elm_Code_Widget *widget, Elm_Code_Wid
794 794
795 elm_code_line_text_get(line, &length); 795 elm_code_line_text_get(line, &length);
796 _elm_code_widget_cell_size_get(widget, &cellw, h); 796 _elm_code_widget_cell_size_get(widget, &cellw, h);
797 gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); 797 gutter = efl_ui_code_widget_text_left_gutter_width_get(widget);
798 798
799 grid = eina_list_nth(pd->grids, row - 1); 799 grid = eina_list_nth(pd->grids, row - 1);
800 evas_object_geometry_get(grid, x, y, NULL, NULL); 800 evas_object_geometry_get(grid, x, y, NULL, NULL);
@@ -1000,7 +1000,7 @@ _elm_code_widget_clicked_gutter_cb(Elm_Code_Widget *widget, unsigned int row)
1000 return; 1000 return;
1001 } 1001 }
1002 1002
1003 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_GUTTER_CLICKED, line); 1003 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_LINE_GUTTER_CLICKED, line);
1004} 1004}
1005 1005
1006static void 1006static void
@@ -1036,7 +1036,7 @@ _elm_code_widget_clicked_readonly_cb(Elm_Code_Widget *widget, unsigned int row)
1036 if (!line) 1036 if (!line)
1037 return; 1037 return;
1038 1038
1039 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, line); 1039 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_LINE_CLICKED, line);
1040} 1040}
1041 1041
1042static void 1042static void
@@ -1366,7 +1366,7 @@ _elm_code_widget_cursor_move_page_height_get(Elm_Code_Widget *widget)
1366{ 1366{
1367 unsigned int lines; 1367 unsigned int lines;
1368 1368
1369 lines = elm_obj_code_widget_lines_visible_get(widget); 1369 lines = efl_ui_code_widget_lines_visible_get(widget);
1370 return lines * 0.85; 1370 return lines * 0.85;
1371} 1371}
1372 1372
@@ -1491,7 +1491,7 @@ _elm_code_widget_tab_at_cursor_insert(Elm_Code_Widget *widget)
1491 return; 1491 return;
1492 } 1492 }
1493 1493
1494 elm_obj_code_widget_cursor_position_get(widget, &row, &col); 1494 efl_ui_code_widget_cursor_position_get(widget, &row, &col);
1495 rem = (col - 1) % pd->tabstop; 1495 rem = (col - 1) % pd->tabstop;
1496 1496
1497 while (rem < pd->tabstop) 1497 while (rem < pd->tabstop)
@@ -1513,8 +1513,8 @@ _elm_code_widget_newline(Elm_Code_Widget *widget)
1513 if (!elm_code_widget_selection_is_empty(widget)) 1513 if (!elm_code_widget_selection_is_empty(widget))
1514 elm_code_widget_selection_delete(widget); 1514 elm_code_widget_selection_delete(widget);
1515 1515
1516 code = elm_obj_code_widget_code_get(widget); 1516 code = efl_ui_code_widget_code_get(widget);
1517 elm_obj_code_widget_cursor_position_get(widget, &row, &col); 1517 efl_ui_code_widget_cursor_position_get(widget, &row, &col);
1518 line = elm_code_file_line_get(code->file, row); 1518 line = elm_code_file_line_get(code->file, row);
1519 if (line == NULL) 1519 if (line == NULL)
1520 { 1520 {
@@ -1536,9 +1536,9 @@ _elm_code_widget_newline(Elm_Code_Widget *widget)
1536 elm_code_widget_text_at_cursor_insert(widget, leading); 1536 elm_code_widget_text_at_cursor_insert(widget, leading);
1537 free(oldtext); 1537 free(oldtext);
1538 1538
1539 indent = elm_obj_code_widget_line_text_column_width_to_position(widget, line, 1539 indent = efl_ui_code_widget_line_text_column_width_to_position(widget, line,
1540 strlen(leading)); 1540 strlen(leading));
1541 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); 1541 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL);
1542 1542
1543 textlen = strlen(leading) + 2; 1543 textlen = strlen(leading) + 2;
1544 text = malloc(sizeof(char) * textlen); 1544 text = malloc(sizeof(char) * textlen);
@@ -1560,8 +1560,8 @@ _elm_code_widget_backspaceline(Elm_Code_Widget *widget, Eina_Bool nextline)
1560 Eina_Bool cursor_move = EINA_TRUE; 1560 Eina_Bool cursor_move = EINA_TRUE;
1561 unsigned int row, col, oldlength, position = 0; 1561 unsigned int row, col, oldlength, position = 0;
1562 1562
1563 code = elm_obj_code_widget_code_get(widget); 1563 code = efl_ui_code_widget_code_get(widget);
1564 elm_obj_code_widget_cursor_position_get(widget, &row, &col); 1564 efl_ui_code_widget_cursor_position_get(widget, &row, &col);
1565 line = elm_code_file_line_get(code->file, row); 1565 line = elm_code_file_line_get(code->file, row);
1566 1566
1567 if (nextline) 1567 if (nextline)
@@ -1600,7 +1600,7 @@ _elm_code_widget_backspaceline(Elm_Code_Widget *widget, Eina_Bool nextline)
1600 } 1600 }
1601 1601
1602 // TODO construct and pass a change object 1602 // TODO construct and pass a change object
1603 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); 1603 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL);
1604} 1604}
1605 1605
1606void 1606void
@@ -1618,8 +1618,8 @@ _elm_code_widget_backspace(Elm_Code_Widget *widget)
1618 return; 1618 return;
1619 } 1619 }
1620 1620
1621 code = elm_obj_code_widget_code_get(widget); 1621 code = efl_ui_code_widget_code_get(widget);
1622 elm_obj_code_widget_cursor_position_get(widget, &row, &col); 1622 efl_ui_code_widget_cursor_position_get(widget, &row, &col);
1623 1623
1624 if (col <= 1) 1624 if (col <= 1)
1625 { 1625 {
@@ -1640,9 +1640,9 @@ _elm_code_widget_backspace(Elm_Code_Widget *widget)
1640 1640
1641 text = elm_code_widget_text_between_positions_get(widget, row, start_col, row, end_col); 1641 text = elm_code_widget_text_between_positions_get(widget, row, start_col, row, end_col);
1642 elm_code_line_text_remove(line, position - char_width, char_width); 1642 elm_code_line_text_remove(line, position - char_width, char_width);
1643 elm_obj_code_widget_cursor_position_set(widget, row, start_col); 1643 efl_ui_code_widget_cursor_position_set(widget, row, start_col);
1644 1644
1645 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); 1645 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL);
1646 1646
1647 change = _elm_code_widget_change_create(start_col, row, end_col - 1, row, text, char_width, EINA_FALSE); 1647 change = _elm_code_widget_change_create(start_col, row, end_col - 1, row, text, char_width, EINA_FALSE);
1648 _elm_code_widget_undo_change_add(widget, change); 1648 _elm_code_widget_undo_change_add(widget, change);
@@ -1664,8 +1664,8 @@ _elm_code_widget_delete(Elm_Code_Widget *widget)
1664 return; 1664 return;
1665 } 1665 }
1666 1666
1667 code = elm_obj_code_widget_code_get(widget); 1667 code = efl_ui_code_widget_code_get(widget);
1668 elm_obj_code_widget_cursor_position_get(widget, &row, &col); 1668 efl_ui_code_widget_cursor_position_get(widget, &row, &col);
1669 line = elm_code_file_line_get(code->file, row); 1669 line = elm_code_file_line_get(code->file, row);
1670 if (col > elm_code_widget_line_text_column_width_get(widget, line)) 1670 if (col > elm_code_widget_line_text_column_width_get(widget, line))
1671 { 1671 {
@@ -1685,8 +1685,8 @@ _elm_code_widget_delete(Elm_Code_Widget *widget)
1685 1685
1686 text = elm_code_widget_text_between_positions_get(widget, row, start_col, row, end_col); 1686 text = elm_code_widget_text_between_positions_get(widget, row, start_col, row, end_col);
1687 elm_code_line_text_remove(line, position, char_width); 1687 elm_code_line_text_remove(line, position, char_width);
1688 elm_obj_code_widget_cursor_position_set(widget, row, start_col); 1688 efl_ui_code_widget_cursor_position_set(widget, row, start_col);
1689 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); 1689 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL);
1690 1690
1691 change = _elm_code_widget_change_create(start_col, row, col - 1, row, text, char_width, EINA_FALSE); 1691 change = _elm_code_widget_change_create(start_col, row, col - 1, row, text, char_width, EINA_FALSE);
1692 _elm_code_widget_undo_change_add(widget, change); 1692 _elm_code_widget_undo_change_add(widget, change);
@@ -2020,7 +2020,7 @@ _elm_code_widget_resize(Elm_Code_Widget *widget, Elm_Code_Line *newline)
2020 Elm_Code_Widget_Data *pd; 2020 Elm_Code_Widget_Data *pd;
2021 2021
2022 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); 2022 pd = efl_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
2023 gutter = elm_obj_code_widget_text_left_gutter_width_get(widget); 2023 gutter = efl_ui_code_widget_text_left_gutter_width_get(widget);
2024 2024
2025 if (!pd->code) 2025 if (!pd->code)
2026 return; 2026 return;
@@ -2188,15 +2188,15 @@ _elm_code_widget_gravity_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd
2188} 2188}
2189 2189
2190EOLIAN static void 2190EOLIAN static void
2191_elm_code_widget_policy_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v) 2191_elm_code_widget_policy_set(Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_Code_Widget_Scroller_Policy policy_h, Elm_Code_Widget_Scroller_Policy policy_v)
2192{ 2192{
2193 elm_scroller_policy_set(pd->scroller, policy_h, policy_v); 2193 elm_scroller_policy_set(pd->scroller, (Elm_Scroller_Policy)policy_h, (Elm_Scroller_Policy)policy_v);
2194} 2194}
2195 2195
2196EOLIAN static void 2196EOLIAN static void
2197_elm_code_widget_policy_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v) 2197_elm_code_widget_policy_get(const Eo *obj EINA_UNUSED, Elm_Code_Widget_Data *pd, Elm_Code_Widget_Scroller_Policy *policy_h, Elm_Code_Widget_Scroller_Policy *policy_v)
2198{ 2198{
2199 elm_scroller_policy_get(pd->scroller, policy_h, policy_v); 2199 elm_scroller_policy_get(pd->scroller, (Elm_Scroller_Policy*)policy_h, (Elm_Scroller_Policy*)policy_v);
2200} 2200}
2201 2201
2202EOLIAN static void 2202EOLIAN static void
@@ -2429,8 +2429,8 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
2429 2429
2430 efl_event_callback_add(obj, &ELM_CODE_EVENT_LINE_LOAD_DONE, _elm_code_widget_line_cb, obj); 2430 efl_event_callback_add(obj, &ELM_CODE_EVENT_LINE_LOAD_DONE, _elm_code_widget_line_cb, obj);
2431 efl_event_callback_add(obj, &ELM_CODE_EVENT_FILE_LOAD_DONE, _elm_code_widget_file_cb, obj); 2431 efl_event_callback_add(obj, &ELM_CODE_EVENT_FILE_LOAD_DONE, _elm_code_widget_file_cb, obj);
2432 efl_event_callback_add(obj, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, _elm_code_widget_selection_cb, obj); 2432 efl_event_callback_add(obj, EFL_UI_CODE_WIDGET_EVENT_SELECTION_CHANGED, _elm_code_widget_selection_cb, obj);
2433 efl_event_callback_add(obj, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CLEARED, _elm_code_widget_selection_clear_cb, obj); 2433 efl_event_callback_add(obj, EFL_UI_CODE_WIDGET_EVENT_SELECTION_CLEARED, _elm_code_widget_selection_clear_cb, obj);
2434} 2434}
2435 2435
2436/* Internal EO APIs and hidden overrides */ 2436/* Internal EO APIs and hidden overrides */
@@ -2441,3 +2441,4 @@ _elm_code_widget_efl_canvas_group_group_add(Eo *obj, Elm_Code_Widget_Data *pd)
2441#include "elm_code_widget_text.c" 2441#include "elm_code_widget_text.c"
2442#include "elm_code_widget_undo.c" 2442#include "elm_code_widget_undo.c"
2443#include "elm_code_widget.eo.c" 2443#include "elm_code_widget.eo.c"
2444#include "elm_code_widget_eo.legacy.c"
diff --git a/src/lib/elementary/elm_code_widget.eo b/src/lib/elementary/elm_code_widget.eo
index cdc3321..c43adfd 100644
--- a/src/lib/elementary/elm_code_widget.eo
+++ b/src/lib/elementary/elm_code_widget.eo
@@ -1,4 +1,15 @@
1import elm_interface_scrollable; 1/* FIXME: this widget should just implement a scroller */
2enum Elm.Code_Widget_Scroller_Policy
3{
4 [[Type that controls when scrollbars should appear.
5
6 See also @Elm.Interface_Scrollable.policy.set.
7 ]]
8 auto = 0, [[Show scrollbars as needed]]
9 on, [[Always show scrollbars]]
10 off, [[Never show scrollbars]]
11 last [[Sentinel value to indicate last enum field during iteration]]
12}
2 13
3/* FIXME: Those types make elm_code unusable from pure EO */ 14/* FIXME: Those types make elm_code unusable from pure EO */
4struct @extern Elm.Code; [[Elementary code main data structure]] /* The main interface currently defined in code */ 15struct @extern Elm.Code; [[Elementary code main data structure]] /* The main interface currently defined in code */
@@ -7,8 +18,7 @@ struct @extern Elm.Code_Line; [[Elementary code line data structure]] /* Parts o
7class Elm.Code_Widget extends Efl.Ui.Layout_Base 18class Elm.Code_Widget extends Efl.Ui.Layout_Base
8{ 19{
9 [[Elementary code widget]] 20 [[Elementary code widget]]
10 eo_prefix: elm_obj_code_widget; 21 eo_prefix: efl_ui_code_widget;
11 legacy_prefix: elm_code_widget;
12 methods { 22 methods {
13 @property code { 23 @property code {
14 set { 24 set {
@@ -70,8 +80,8 @@ class Elm.Code_Widget extends Efl.Ui.Layout_Base
70 [[Get the widget's policy for scrollbar visibility.]] 80 [[Get the widget's policy for scrollbar visibility.]]
71 } 81 }
72 values { 82 values {
73 policy_h: Elm.Scroller.Policy; [[The horizontal scrollbar visibility policy]] 83 policy_h: Elm.Code_Widget_Scroller_Policy; [[The horizontal scrollbar visibility policy]]
74 policy_v: Elm.Scroller.Policy; [[The vertical scrollbar visibility policy]] 84 policy_v: Elm.Code_Widget_Scroller_Policy; [[The vertical scrollbar visibility policy]]
75 } 85 }
76 } 86 }
77 @property tabstop { 87 @property tabstop {
diff --git a/src/lib/elementary/elm_code_widget_eo.legacy.c b/src/lib/elementary/elm_code_widget_eo.legacy.c
new file mode 100644
index 0000000..cc91160
--- /dev/null
+++ b/src/lib/elementary/elm_code_widget_eo.legacy.c
@@ -0,0 +1,270 @@
1
2EAPI void
3elm_code_widget_code_set(Elm_Code_Widget *obj, Elm_Code *code)
4{
5 efl_ui_code_widget_code_set(obj, code);
6}
7
8EAPI Elm_Code *
9elm_code_widget_code_get(const Elm_Code_Widget *obj)
10{
11 return efl_ui_code_widget_code_get(obj);
12}
13
14EAPI void
15elm_code_widget_font_set(Elm_Code_Widget *obj, const char *name, int size)
16{
17 efl_ui_code_widget_font_set(obj, name, size);
18}
19
20EAPI void
21elm_code_widget_font_get(const Elm_Code_Widget *obj, const char **name, int *size)
22{
23 efl_ui_code_widget_font_get(obj, name, size);
24}
25
26EAPI unsigned int
27elm_code_widget_columns_get(const Elm_Code_Widget *obj)
28{
29 return efl_ui_code_widget_columns_get(obj);
30}
31
32EAPI void
33elm_code_widget_gravity_set(Elm_Code_Widget *obj, double x, double y)
34{
35 efl_ui_code_widget_gravity_set(obj, x, y);
36}
37
38EAPI void
39elm_code_widget_gravity_get(const Elm_Code_Widget *obj, double *x, double *y)
40{
41 efl_ui_code_widget_gravity_get(obj, x, y);
42}
43
44EAPI void
45elm_code_widget_policy_set(Elm_Code_Widget *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
46{
47 efl_ui_code_widget_policy_set(obj, (Elm_Code_Widget_Scroller_Policy)policy_h, (Elm_Code_Widget_Scroller_Policy)policy_v);
48}
49
50EAPI void
51elm_code_widget_policy_get(const Elm_Code_Widget *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
52{
53 efl_ui_code_widget_policy_get(obj, (Elm_Code_Widget_Scroller_Policy*)policy_h, (Elm_Code_Widget_Scroller_Policy*)policy_v);
54}
55
56EAPI void
57elm_code_widget_tabstop_set(Elm_Code_Widget *obj, unsigned int tabstop)
58{
59 efl_ui_code_widget_tabstop_set(obj, tabstop);
60}
61
62EAPI unsigned int
63elm_code_widget_tabstop_get(const Elm_Code_Widget *obj)
64{
65 return efl_ui_code_widget_tabstop_get(obj);
66}
67
68EAPI void
69elm_code_widget_editable_set(Elm_Code_Widget *obj, Eina_Bool editable)
70{
71 efl_ui_code_widget_editable_set(obj, editable);
72}
73
74EAPI Eina_Bool
75elm_code_widget_editable_get(const Elm_Code_Widget *obj)
76{
77 return efl_ui_code_widget_editable_get(obj);
78}
79
80EAPI void
81elm_code_widget_line_numbers_set(Elm_Code_Widget *obj, Eina_Bool line_numbers)
82{
83 efl_ui_code_widget_line_numbers_set(obj, line_numbers);
84}
85
86EAPI Eina_Bool
87elm_code_widget_line_numbers_get(const Elm_Code_Widget *obj)
88{
89 return efl_ui_code_widget_line_numbers_get(obj);
90}
91
92EAPI void
93elm_code_widget_line_width_marker_set(Elm_Code_Widget *obj, unsigned int line_width_marker)
94{
95 efl_ui_code_widget_line_width_marker_set(obj, line_width_marker);
96}
97
98EAPI unsigned int
99elm_code_widget_line_width_marker_get(const Elm_Code_Widget *obj)
100{
101 return efl_ui_code_widget_line_width_marker_get(obj);
102}
103
104EAPI void
105elm_code_widget_show_whitespace_set(Elm_Code_Widget *obj, Eina_Bool show_whitespace)
106{
107 efl_ui_code_widget_show_whitespace_set(obj, show_whitespace);
108}
109
110EAPI Eina_Bool
111elm_code_widget_show_whitespace_get(const Elm_Code_Widget *obj)
112{
113 return efl_ui_code_widget_show_whitespace_get(obj);
114}
115
116EAPI void
117elm_code_widget_alpha_set(Elm_Code_Widget *obj, int alpha)
118{
119 efl_ui_code_widget_alpha_set(obj, alpha);
120}
121
122EAPI int
123elm_code_widget_alpha_get(const Elm_Code_Widget *obj)
124{
125 return efl_ui_code_widget_alpha_get(obj);
126}
127
128EAPI void
129elm_code_widget_syntax_enabled_set(Elm_Code_Widget *obj, Eina_Bool syntax_enabled)
130{
131 efl_ui_code_widget_syntax_enabled_set(obj, syntax_enabled);
132}
133
134EAPI Eina_Bool
135elm_code_widget_syntax_enabled_get(const Elm_Code_Widget *obj)
136{
137 return efl_ui_code_widget_syntax_enabled_get(obj);
138}
139
140EAPI void
141elm_code_widget_tab_inserts_spaces_set(Elm_Code_Widget *obj, Eina_Bool tab_inserts_spaces)
142{
143 efl_ui_code_widget_tab_inserts_spaces_set(obj, tab_inserts_spaces);
144}
145
146EAPI Eina_Bool
147elm_code_widget_tab_inserts_spaces_get(const Elm_Code_Widget *obj)
148{
149 return efl_ui_code_widget_tab_inserts_spaces_get(obj);
150}
151
152EAPI void
153elm_code_widget_cursor_position_set(Elm_Code_Widget *obj, unsigned int row, unsigned int col)
154{
155 efl_ui_code_widget_cursor_position_set(obj, row, col);
156}
157
158EAPI void
159elm_code_widget_cursor_position_get(const Elm_Code_Widget *obj, unsigned int *row, unsigned int *col)
160{
161 efl_ui_code_widget_cursor_position_get(obj, row, col);
162}
163
164EAPI void
165elm_code_widget_theme_refresh(Elm_Code_Widget *obj)
166{
167 efl_ui_code_widget_theme_refresh(obj);
168}
169
170EAPI void
171elm_code_widget_line_refresh(Elm_Code_Widget *obj, Elm_Code_Line *line)
172{
173 efl_ui_code_widget_line_refresh(obj, line);
174}
175
176EAPI Eina_Bool
177elm_code_widget_line_visible_get(Elm_Code_Widget *obj, Elm_Code_Line *line)
178{
179 return efl_ui_code_widget_line_visible_get(obj, line);
180}
181
182EAPI unsigned int
183elm_code_widget_lines_visible_get(Elm_Code_Widget *obj)
184{
185 return efl_ui_code_widget_lines_visible_get(obj);
186}
187
188EAPI Eina_Bool
189elm_code_widget_position_at_coordinates_get(Elm_Code_Widget *obj, int x, int y, unsigned int *row, int *col)
190{
191 return efl_ui_code_widget_position_at_coordinates_get(obj, x, y, row, col);
192}
193
194EAPI Eina_Bool
195elm_code_widget_geometry_for_position_get(Elm_Code_Widget *obj, unsigned int row, int col, int *x, int *y, int *w, int *h)
196{
197 return efl_ui_code_widget_geometry_for_position_get(obj, row, col, x, y, w, h);
198}
199
200EAPI int
201elm_code_widget_text_left_gutter_width_get(Elm_Code_Widget *obj)
202{
203 return efl_ui_code_widget_text_left_gutter_width_get(obj);
204}
205
206EAPI char *
207elm_code_widget_text_between_positions_get(Elm_Code_Widget *obj, unsigned int start_line, unsigned int start_col, unsigned int end_line, unsigned int end_col)
208{
209 return efl_ui_code_widget_text_between_positions_get(obj, start_line, start_col, end_line, end_col);
210}
211
212EAPI void
213elm_code_widget_text_at_cursor_insert(Elm_Code_Widget *obj, const char *text)
214{
215 efl_ui_code_widget_text_at_cursor_insert(obj, text);
216}
217
218EAPI unsigned int
219elm_code_widget_line_text_column_width_to_position(Elm_Code_Widget *obj, Elm_Code_Line *line, unsigned int position)
220{
221 return efl_ui_code_widget_line_text_column_width_to_position(obj, line, position);
222}
223
224EAPI unsigned int
225elm_code_widget_line_text_column_width_get(Elm_Code_Widget *obj, Elm_Code_Line *line)
226{
227 return efl_ui_code_widget_line_text_column_width_get(obj, line);
228}
229
230EAPI unsigned int
231elm_code_widget_line_text_position_for_column_get(Elm_Code_Widget *obj, Elm_Code_Line *line, unsigned int column)
232{
233 return efl_ui_code_widget_line_text_position_for_column_get(obj, line, column);
234}
235
236EAPI unsigned int
237elm_code_widget_text_tabwidth_at_column_get(Elm_Code_Widget *obj, unsigned int column)
238{
239 return efl_ui_code_widget_text_tabwidth_at_column_get(obj, column);
240}
241
242EAPI void
243elm_code_widget_line_status_toggle(Elm_Code_Widget *obj, Elm_Code_Line *line)
244{
245 efl_ui_code_widget_line_status_toggle(obj, line);
246}
247
248EAPI void
249elm_code_widget_undo(Elm_Code_Widget *obj)
250{
251 efl_ui_code_widget_undo(obj);
252}
253
254EAPI Eina_Bool
255elm_code_widget_can_undo_get(Elm_Code_Widget *obj)
256{
257 return efl_ui_code_widget_can_undo_get(obj);
258}
259
260EAPI void
261elm_code_widget_redo(Elm_Code_Widget *obj)
262{
263 efl_ui_code_widget_redo(obj);
264}
265
266EAPI Eina_Bool
267elm_code_widget_can_redo_get(Elm_Code_Widget *obj)
268{
269 return efl_ui_code_widget_can_redo_get(obj);
270}
diff --git a/src/lib/elementary/elm_code_widget_eo.legacy.h b/src/lib/elementary/elm_code_widget_eo.legacy.h
new file mode 100644
index 0000000..0d72c8c
--- /dev/null
+++ b/src/lib/elementary/elm_code_widget_eo.legacy.h
@@ -0,0 +1,550 @@
1#ifndef _ELM_CODE_WIDGET_EO_LEGACY_H_
2#define _ELM_CODE_WIDGET_EO_LEGACY_H_
3
4#ifndef _ELM_CODE_WIDGET_EO_CLASS_TYPE
5#define _ELM_CODE_WIDGET_EO_CLASS_TYPE
6
7typedef Eo Elm_Code_Widget;
8
9#endif
10
11#ifndef _ELM_CODE_WIDGET_EO_TYPES
12#define _ELM_CODE_WIDGET_EO_TYPES
13
14
15#endif
16
17/**
18 * @brief Set the underlying code object that this widget renders. This can
19 * only be set during construction, once the widget is created the backing code
20 * object cannot be changed.
21 *
22 * @param[in] obj The object.
23 * @param[in] code Our underlying Elm.Code object
24 *
25 * @ingroup Elm_Code_Widget_Group
26 */
27EAPI void elm_code_widget_code_set(Elm_Code_Widget *obj, Elm_Code *code);
28
29/**
30 * @brief Get the underlying code object we are rendering
31 *
32 * @param[in] obj The object.
33 *
34 * @return Our underlying Elm.Code object
35 *
36 * @ingroup Elm_Code_Widget_Group
37 */
38EAPI Elm_Code *elm_code_widget_code_get(const Elm_Code_Widget *obj);
39
40/**
41 * @brief Set the font that this widget uses, the font should be a monospaced
42 * scalable font. Passing NULL will load the default system monospaced font.
43 *
44 * @param[in] obj The object.
45 * @param[in] name The name of the font to load
46 * @param[in] size The font size for the widget
47 *
48 * @ingroup Elm_Code_Widget_Group
49 */
50EAPI void elm_code_widget_font_set(Elm_Code_Widget *obj, const char *name, int size);
51
52/**
53 * @brief Get the font currently in use. The font name is a copy ad should be
54 * freed once it is no longer needed
55 *
56 * @param[in] obj The object.
57 * @param[out] name The name of the font to load
58 * @param[out] size The font size for the widget
59 *
60 * @ingroup Elm_Code_Widget_Group
61 */
62EAPI void elm_code_widget_font_get(const Elm_Code_Widget *obj, const char **name, int *size);
63
64/**
65 * @brief Get the number of columns in the widget currently. This will be the
66 * max of the number of columns to represent the longest line and the minimum
67 * required to fill the visible widget width.
68 *
69 * @param[in] obj The object.
70 *
71 * @return The number of columns required to render the widget
72 *
73 * @ingroup Elm_Code_Widget_Group
74 */
75EAPI unsigned int elm_code_widget_columns_get(const Elm_Code_Widget *obj);
76
77/**
78 * @brief Set how this widget's scroller should respond to new lines being
79 * added.
80 *
81 * An x value of 0.0 will maintain the distance from the left edge, 1.0 will
82 * ensure the rightmost edge (of the longest line) is respected With 0.0 for y
83 * the view will keep it's position relative to the top whereas 1.0 will scroll
84 * downward as lines are added.
85 *
86 * @param[in] obj The object.
87 * @param[in] x The horizontal value of the scroller gravity - valid values are
88 * 0.0 and 1.0
89 * @param[in] y The vertical gravity of the widget's scroller - valid values
90 * are 0.0 and 1.0
91 *
92 * @ingroup Elm_Code_Widget_Group
93 */
94EAPI void elm_code_widget_gravity_set(Elm_Code_Widget *obj, double x, double y);
95
96/**
97 * @brief Get the current x and y gravity of the widget's scroller
98 *
99 * @param[in] obj The object.
100 * @param[out] x The horizontal value of the scroller gravity - valid values
101 * are 0.0 and 1.0
102 * @param[out] y The vertical gravity of the widget's scroller - valid values
103 * are 0.0 and 1.0
104 *
105 * @ingroup Elm_Code_Widget_Group
106 */
107EAPI void elm_code_widget_gravity_get(const Elm_Code_Widget *obj, double *x, double *y);
108
109/**
110 * @brief Set the policy for scrollbar visibility.
111 *
112 * @param[in] obj The object.
113 * @param[in] policy_h The horizontal scrollbar visibility policy
114 * @param[in] policy_v The vertical scrollbar visibility policy
115 *
116 * @ingroup Elm_Code_Widget_Group
117 */
118EAPI void elm_code_widget_policy_set(Elm_Code_Widget *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v);
119
120/**
121 * @brief Get the widget's policy for scrollbar visibility.
122 *
123 * @param[in] obj The object.
124 * @param[out] policy_h The horizontal scrollbar visibility policy
125 * @param[out] policy_v The vertical scrollbar visibility policy
126 *
127 * @ingroup Elm_Code_Widget_Group
128 */
129EAPI void elm_code_widget_policy_get(const Elm_Code_Widget *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v);
130
131/**
132 * @brief Set the width of a tab stop, used purely for visual layout of tab
133 * characters.
134 *
135 * Recommended value is between 2 and 8.
136 *
137 * @param[in] obj The object.
138 * @param[in] tabstop Maximum width of a tab character
139 *
140 * @ingroup Elm_Code_Widget_Group
141 */
142EAPI void elm_code_widget_tabstop_set(Elm_Code_Widget *obj, unsigned int tabstop);
143
144/**
145 * @brief Get the current width of a tab stop. This is used to determine where
146 * characters after a tab should appear in the line.
147 *
148 * @param[in] obj The object.
149 *
150 * @return Maximum width of a tab character
151 *
152 * @ingroup Elm_Code_Widget_Group
153 */
154EAPI unsigned int elm_code_widget_tabstop_get(const Elm_Code_Widget *obj);
155
156/**
157 * @brief Set whether this widget allows editing
158 *
159 * If editable then the widget will allow user input to manipulate the
160 * underlying Elm.Code_File of this Elm.Code instance. Any other
161 * Elm.Code_Widget's connected to this Elm.Code will update to reflect the
162 * changes.
163 *
164 * @param[in] obj The object.
165 * @param[in] editable The editable state of the widget
166 *
167 * @ingroup Elm_Code_Widget_Group
168 */
169EAPI void elm_code_widget_editable_set(Elm_Code_Widget *obj, Eina_Bool editable);
170
171/**
172 * @brief Get the current editable state of this widget
173 *
174 * returns EINA_TRUE if the widget is editable, EINA_FALSE otherwise. If this
175 * widget is not editable the underlying Elm.Code_File could still be
176 * manipulated by a different widget or the filesystem.
177 *
178 * @param[in] obj The object.
179 *
180 * @return The editable state of the widget
181 *
182 * @ingroup Elm_Code_Widget_Group
183 */
184EAPI Eina_Bool elm_code_widget_editable_get(const Elm_Code_Widget *obj);
185
186/**
187 * @brief Set whether line numbers should be displayed in the left gutter.
188 *
189 * Passing EINA_TRUE will reserve a space for showing line numbers, EINA_FALSE
190 * will turn this off.
191 *
192 * @param[in] obj The object.
193 * @param[in] line_numbers Whether or not line numbers (or their placeholder)
194 * should be shown
195 *
196 * @ingroup Elm_Code_Widget_Group
197 */
198EAPI void elm_code_widget_line_numbers_set(Elm_Code_Widget *obj, Eina_Bool line_numbers);
199
200/**
201 * @brief Get the status of line number display for this widget.
202 *
203 * @param[in] obj The object.
204 *
205 * @return Whether or not line numbers (or their placeholder) should be shown
206 *
207 * @ingroup Elm_Code_Widget_Group
208 */
209EAPI Eina_Bool elm_code_widget_line_numbers_get(const Elm_Code_Widget *obj);
210
211/**
212 * @brief Set where the line width market should be shown.
213 *
214 * Passing a non-zero value will set which line width to mark with a vertical
215 * line. Passing 0 will hide this marker.
216 *
217 * @param[in] obj The object.
218 * @param[in] line_width_marker Where to display a line width marker, if at all
219 *
220 * @ingroup Elm_Code_Widget_Group
221 */
222EAPI void elm_code_widget_line_width_marker_set(Elm_Code_Widget *obj, unsigned int line_width_marker);
223
224/**
225 * @brief Get the position of the line width marker, any positive return
226 * indicates where the marker appears.
227 *
228 * @param[in] obj The object.
229 *
230 * @return Where to display a line width marker, if at all
231 *
232 * @ingroup Elm_Code_Widget_Group
233 */
234EAPI unsigned int elm_code_widget_line_width_marker_get(const Elm_Code_Widget *obj);
235
236/**
237 * @brief Set whether white space should be shown.
238 *
239 * @param[in] obj The object.
240 * @param[in] show_whitespace Whether or not we show whitespace characters
241 *
242 * @ingroup Elm_Code_Widget_Group
243 */
244EAPI void elm_code_widget_show_whitespace_set(Elm_Code_Widget *obj, Eina_Bool show_whitespace);
245
246/**
247 * @brief Get whether or not white space will be visible.
248 *
249 * @param[in] obj The object.
250 *
251 * @return Whether or not we show whitespace characters
252 *
253 * @ingroup Elm_Code_Widget_Group
254 */
255EAPI Eina_Bool elm_code_widget_show_whitespace_get(const Elm_Code_Widget *obj);
256
257/**
258 * @brief Set an alpha color value for this widget (0 - 255) default is fully
259 * opaque (255).
260 *
261 * @param[in] obj The object.
262 * @param[in] alpha Alpha value
263 *
264 * @ingroup Elm_Code_Widget_Group
265 */
266EAPI void elm_code_widget_alpha_set(Elm_Code_Widget *obj, int alpha);
267
268/**
269 * @brief Set an alpha color value for this widget (0 - 255) default is fully
270 * opaque (255).
271 *
272 * @param[in] obj The object.
273 *
274 * @return Alpha value
275 *
276 * @ingroup Elm_Code_Widget_Group
277 */
278EAPI int elm_code_widget_alpha_get(const Elm_Code_Widget *obj);
279
280/**
281 * @brief Set whether syntax highlighting should be use for this widget.
282 *
283 * @param[in] obj The object.
284 * @param[in] syntax_enabled Whether or not to enable syntax highlighting
285 *
286 * @ingroup Elm_Code_Widget_Group
287 */
288EAPI void elm_code_widget_syntax_enabled_set(Elm_Code_Widget *obj, Eina_Bool syntax_enabled);
289
290/**
291 * @brief Get this widget's enabled state for syntax highlighting.
292 *
293 * @param[in] obj The object.
294 *
295 * @return Whether or not to enable syntax highlighting
296 *
297 * @ingroup Elm_Code_Widget_Group
298 */
299EAPI Eina_Bool elm_code_widget_syntax_enabled_get(const Elm_Code_Widget *obj);
300
301/**
302 * @brief Set whether space characters should be inserted instead of tabs.
303 *
304 * @param[in] obj The object.
305 * @param[in] tab_inserts_spaces @c true if we should insert space characters
306 * instead of a tab when the Tab key is pressed
307 *
308 * @ingroup Elm_Code_Widget_Group
309 */
310EAPI void elm_code_widget_tab_inserts_spaces_set(Elm_Code_Widget *obj, Eina_Bool tab_inserts_spaces);
311
312/**
313 * @brief Get whether or not space characters will be inserted instead of tabs.
314 *
315 * @param[in] obj The object.
316 *
317 * @return @c true if we should insert space characters instead of a tab when
318 * the Tab key is pressed
319 *
320 * @ingroup Elm_Code_Widget_Group
321 */
322EAPI Eina_Bool elm_code_widget_tab_inserts_spaces_get(const Elm_Code_Widget *obj);
323
324/**
325 * @brief Set the current location of the text cursor.
326 *
327 * @param[in] obj The object.
328 * @param[in] row The vertical position ov the cursur - the fist row is 1
329 * @param[in] col The horizontal position of the cursor, starting from column 1
330 *
331 * @ingroup Elm_Code_Widget_Group
332 */
333EAPI void elm_code_widget_cursor_position_set(Elm_Code_Widget *obj, unsigned int row, unsigned int col);
334
335/**
336 * @brief Get the current x and y position of the widget's cursor.
337 *
338 * @param[in] obj The object.
339 * @param[out] row The vertical position ov the cursur - the fist row is 1
340 * @param[out] col The horizontal position of the cursor, starting from column
341 * 1
342 *
343 * @ingroup Elm_Code_Widget_Group
344 */
345EAPI void elm_code_widget_cursor_position_get(const Elm_Code_Widget *obj, unsigned int *row, unsigned int *col);
346
347/** Update and refresh theme for widget.
348 *
349 * @ingroup Elm_Code_Widget_Group
350 */
351EAPI void elm_code_widget_theme_refresh(Elm_Code_Widget *obj);
352
353/**
354 * @brief Refresh code line in widget
355 *
356 * @param[in] obj The object.
357 * @param[in] line The line to refresh.
358 *
359 * @ingroup Elm_Code_Widget_Group
360 */
361EAPI void elm_code_widget_line_refresh(Elm_Code_Widget *obj, Elm_Code_Line *line);
362
363/**
364 * @brief Check if the code line is currently visible
365 *
366 * @param[in] obj The object.
367 * @param[in] line The line to test for visibility.
368 *
369 * @return @c true if the line specified is currently visible within the scroll
370 * region.
371 *
372 * @ingroup Elm_Code_Widget_Group
373 */
374EAPI Eina_Bool elm_code_widget_line_visible_get(Elm_Code_Widget *obj, Elm_Code_Line *line);
375
376/**
377 * @brief Get the number of code lines currently visible in the widget
378 *
379 * @param[in] obj The object.
380 *
381 * @return the number of lines currently visible in the widget.
382 *
383 * @ingroup Elm_Code_Widget_Group
384 */
385EAPI unsigned int elm_code_widget_lines_visible_get(Elm_Code_Widget *obj);
386
387/**
388 * @brief Get the row, col position for a given coordinate on the widget.
389 *
390 * @param[in] obj The object.
391 * @param[in] x The x coordinate in the widget
392 * @param[in] y The y coordinate in the widget
393 * @param[in] row The row for the coordinates
394 * @param[in] col The column for the coordinates
395 *
396 * @return @c true if a line exists at these coordinates
397 *
398 * @ingroup Elm_Code_Widget_Group
399 */
400EAPI Eina_Bool elm_code_widget_position_at_coordinates_get(Elm_Code_Widget *obj, int x, int y, unsigned int *row, int *col);
401
402/**
403 * @brief Get the geometry for the cell at the specified position.
404 *
405 * @param[in] obj The object.
406 * @param[in] row The row for the requested position
407 * @param[in] col The column for the requested position
408 * @param[in] x The x coordinate of the cell at specified position
409 * @param[in] y The y coordinate of the cell at specified position
410 * @param[in] w The width of the cell at specified position
411 * @param[in] h The height of the cell at specified position
412 *
413 * @return @c true if a cell exists at the specified position
414 *
415 * @ingroup Elm_Code_Widget_Group
416 */
417EAPI Eina_Bool elm_code_widget_geometry_for_position_get(Elm_Code_Widget *obj, unsigned int row, int col, int *x, int *y, int *w, int *h);
418
419/**
420 * @brief Get the column width of the gutter
421 *
422 * @param[in] obj The object.
423 *
424 * @return The current column width of the gutter for the widget.
425 *
426 * @ingroup Elm_Code_Widget_Group
427 */
428EAPI int elm_code_widget_text_left_gutter_width_get(Elm_Code_Widget *obj);
429
430/**
431 * @brief Get text between given positions
432 *
433 * @param[in] obj The object.
434 * @param[in] start_line The line of the first character to get
435 * @param[in] start_col The widget column of the first character to get
436 * @param[in] end_line The line of the last character to get
437 * @param[in] end_col The widget column of the last character to get
438 *
439 * @return The text content between start and end positions
440 *
441 * @ingroup Elm_Code_Widget_Group
442 */
443EAPI char *elm_code_widget_text_between_positions_get(Elm_Code_Widget *obj, unsigned int start_line, unsigned int start_col, unsigned int end_line, unsigned int end_col);
444
445/**
446 * @brief Insert the provided text at the cursor position. This will add the
447 * operation to the widget's undo list.
448 *
449 * @param[in] obj The object.
450 * @param[in] text The text to insert
451 *
452 * @ingroup Elm_Code_Widget_Group
453 */
454EAPI void elm_code_widget_text_at_cursor_insert(Elm_Code_Widget *obj, const char *text);
455
456/**
457 * @brief Get text column width at given position
458 *
459 * @param[in] obj The object.
460 * @param[in] line Code line
461 * @param[in] position Code position
462 *
463 * @return Text column width
464 *
465 * @ingroup Elm_Code_Widget_Group
466 */
467EAPI unsigned int elm_code_widget_line_text_column_width_to_position(Elm_Code_Widget *obj, Elm_Code_Line *line, unsigned int position);
468
469/**
470 * @brief Get text column width for code line
471 *
472 * @param[in] obj The object.
473 * @param[in] line Code line
474 *
475 * @return Text column width
476 *
477 * @ingroup Elm_Code_Widget_Group
478 */
479EAPI unsigned int elm_code_widget_line_text_column_width_get(Elm_Code_Widget *obj, Elm_Code_Line *line);
480
481/**
482 * @brief Get position from column
483 *
484 * @param[in] obj The object.
485 * @param[in] line Code line
486 * @param[in] column Column
487 *
488 * @return Position
489 *
490 * @ingroup Elm_Code_Widget_Group
491 */
492EAPI unsigned int elm_code_widget_line_text_position_for_column_get(Elm_Code_Widget *obj, Elm_Code_Line *line, unsigned int column);
493
494/**
495 * @brief Get tabwidth for column
496 *
497 * @param[in] obj The object.
498 * @param[in] column Column
499 *
500 * @return Tabwidth
501 *
502 * @ingroup Elm_Code_Widget_Group
503 */
504EAPI unsigned int elm_code_widget_text_tabwidth_at_column_get(Elm_Code_Widget *obj, unsigned int column);
505
506/**
507 * @brief Toggle the display of the line status widget
508 *
509 * @param[in] obj The object.
510 * @param[in] line Code line
511 *
512 * @ingroup Elm_Code_Widget_Group
513 */
514EAPI void elm_code_widget_line_status_toggle(Elm_Code_Widget *obj, Elm_Code_Line *line);
515
516/** Undo last action
517 *
518 * @ingroup Elm_Code_Widget_Group
519 */
520EAPI void elm_code_widget_undo(Elm_Code_Widget *obj);
521
522/**
523 * @brief Determine if there are any available undo operations
524 *
525 * @param[in] obj The object.
526 *
527 * @return @c true if there are undo operations
528 *
529 * @ingroup Elm_Code_Widget_Group
530 */
531EAPI Eina_Bool elm_code_widget_can_undo_get(Elm_Code_Widget *obj);
532
533/** Redo last action
534 *
535 * @ingroup Elm_Code_Widget_Group
536 */
537EAPI void elm_code_widget_redo(Elm_Code_Widget *obj);
538
539/**
540 * @brief Determine if there are any available redo operations
541 *
542 * @param[in] obj The object.
543 *
544 * @return @c true if there are redo operations
545 *
546 * @ingroup Elm_Code_Widget_Group
547 */
548EAPI Eina_Bool elm_code_widget_can_redo_get(Elm_Code_Widget *obj);
549
550#endif
diff --git a/src/lib/elementary/elm_code_widget_legacy.h b/src/lib/elementary/elm_code_widget_legacy.h
index 5110e30..e2d7661 100644
--- a/src/lib/elementary/elm_code_widget_legacy.h
+++ b/src/lib/elementary/elm_code_widget_legacy.h
@@ -10,4 +10,4 @@
10 */ 10 */
11EAPI Evas_Object *elm_code_widget_add(Evas_Object *parent, Elm_Code *code); 11EAPI Evas_Object *elm_code_widget_add(Evas_Object *parent, Elm_Code *code);
12 12
13#include "elm_code_widget.eo.legacy.h" 13#include "elm_code_widget_eo.legacy.h"
diff --git a/src/lib/elementary/elm_code_widget_selection.c b/src/lib/elementary/elm_code_widget_selection.c
index 59a5615..7ee3964 100644
--- a/src/lib/elementary/elm_code_widget_selection.c
+++ b/src/lib/elementary/elm_code_widget_selection.c
@@ -62,7 +62,7 @@ elm_code_widget_selection_start(Evas_Object *widget,
62 62
63 pd->selection->start_line = line; 63 pd->selection->start_line = line;
64 pd->selection->start_col = col; 64 pd->selection->start_col = col;
65 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_START, widget); 65 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_SELECTION_START, widget);
66} 66}
67 67
68EAPI void 68EAPI void
@@ -90,7 +90,7 @@ elm_code_widget_selection_end(Evas_Object *widget,
90 90
91 pd->selection->end_line = line; 91 pd->selection->end_line = line;
92 pd->selection->end_col = col; 92 pd->selection->end_col = col;
93 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget); 93 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget);
94} 94}
95 95
96EAPI void 96EAPI void
@@ -110,7 +110,7 @@ elm_code_widget_selection_select_all(Evas_Object *widget)
110 110
111 elm_code_widget_selection_end(widget, maxrow, last_col); 111 elm_code_widget_selection_end(widget, maxrow, last_col);
112 112
113 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget); 113 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_SELECTION_CHANGED, widget);
114} 114}
115 115
116EAPI Elm_Code_Widget_Selection_Data * 116EAPI Elm_Code_Widget_Selection_Data *
@@ -166,7 +166,7 @@ elm_code_widget_selection_clear(Evas_Object *widget)
166 166
167 free(pd->selection); 167 free(pd->selection);
168 pd->selection = NULL; 168 pd->selection = NULL;
169 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CLEARED, widget); 169 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_SELECTION_CLEARED, widget);
170} 170}
171 171
172static void 172static void
@@ -292,7 +292,7 @@ _elm_code_widget_selection_delete_do(Evas_Object *widget, Eina_Bool undo)
292 pd->selection = NULL; 292 pd->selection = NULL;
293 free(selection); 293 free(selection);
294 294
295 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CLEARED, widget); 295 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_SELECTION_CLEARED, widget);
296 elm_code_widget_cursor_position_set(widget, row, col); 296 elm_code_widget_cursor_position_set(widget, row, col);
297} 297}
298 298
@@ -425,8 +425,8 @@ elm_code_widget_selection_cut(Evas_Object *widget)
425 425
426 elm_code_widget_selection_delete(widget); 426 elm_code_widget_selection_delete(widget);
427 427
428 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_CUT, widget); 428 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_SELECTION_CUT, widget);
429 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); 429 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL);
430} 430}
431 431
432EAPI void 432EAPI void
@@ -442,7 +442,7 @@ elm_code_widget_selection_copy(Evas_Object *widget)
442 elm_cnp_selection_loss_callback_set(widget, ELM_SEL_TYPE_CLIPBOARD, _selection_loss_cb, widget); 442 elm_cnp_selection_loss_callback_set(widget, ELM_SEL_TYPE_CLIPBOARD, _selection_loss_cb, widget);
443 free(text); 443 free(text);
444 444
445 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_COPY, widget); 445 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_SELECTION_COPY, widget);
446} 446}
447 447
448static Eina_Bool 448static Eina_Bool
@@ -454,7 +454,7 @@ _selection_paste_cb(void *data, Evas_Object *obj EINA_UNUSED, Elm_Selection_Data
454 454
455 elm_code_widget_text_at_cursor_insert(widget, ev->data); 455 elm_code_widget_text_at_cursor_insert(widget, ev->data);
456 456
457 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_SELECTION_PASTE, widget); 457 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_SELECTION_PASTE, widget);
458 return EINA_TRUE; 458 return EINA_TRUE;
459} 459}
460 460
diff --git a/src/lib/elementary/elm_code_widget_text.c b/src/lib/elementary/elm_code_widget_text.c
index f822339..f560ac3 100644
--- a/src/lib/elementary/elm_code_widget_text.c
+++ b/src/lib/elementary/elm_code_widget_text.c
@@ -218,7 +218,7 @@ _elm_code_widget_text_insert_single(Elm_Code_Widget *widget, Elm_Code *code,
218 if (newcol > pd->col_count) 218 if (newcol > pd->col_count)
219 _elm_code_widget_resize(widget, line); 219 _elm_code_widget_resize(widget, line);
220 220
221 elm_obj_code_widget_cursor_position_set(widget, row, newcol); 221 efl_ui_code_widget_cursor_position_set(widget, row, newcol);
222} 222}
223 223
224static void 224static void
@@ -265,8 +265,8 @@ _elm_code_widget_text_at_cursor_insert_do(Elm_Code_Widget *widget, const char *t
265 if (undo) 265 if (undo)
266 elm_code_widget_selection_delete(widget); 266 elm_code_widget_selection_delete(widget);
267 267
268 code = elm_obj_code_widget_code_get(widget); 268 code = efl_ui_code_widget_code_get(widget);
269 elm_obj_code_widget_cursor_position_get(widget, &row, &col); 269 efl_ui_code_widget_cursor_position_get(widget, &row, &col);
270 line = elm_code_file_line_get(code->file, row); 270 line = elm_code_file_line_get(code->file, row);
271 if (line == NULL) 271 if (line == NULL)
272 { 272 {
@@ -287,7 +287,7 @@ _elm_code_widget_text_at_cursor_insert_do(Elm_Code_Widget *widget, const char *t
287 elm_code_line_text_insert(line, 0, indent_text, indent); 287 elm_code_line_text_insert(line, 0, indent_text, indent);
288 288
289 col = elm_code_widget_line_text_column_width_to_position(widget, line, indent + 1); 289 col = elm_code_widget_line_text_column_width_to_position(widget, line, indent + 1);
290 elm_obj_code_widget_cursor_position_set(widget, row, col); 290 efl_ui_code_widget_cursor_position_set(widget, row, col);
291 } 291 }
292 } 292 }
293 293
@@ -295,9 +295,9 @@ _elm_code_widget_text_at_cursor_insert_do(Elm_Code_Widget *widget, const char *t
295 _elm_code_widget_text_insert_single(widget, code, col, row, text, length); 295 _elm_code_widget_text_insert_single(widget, code, col, row, text, length);
296 else 296 else
297 _elm_code_widget_text_insert_multi(widget, code, col, row, text, length); 297 _elm_code_widget_text_insert_multi(widget, code, col, row, text, length);
298 elm_obj_code_widget_cursor_position_get(widget, &end_row, &end_col); 298 efl_ui_code_widget_cursor_position_get(widget, &end_row, &end_col);
299 299
300 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); 300 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL);
301 301
302 if (undo) 302 if (undo)
303 { 303 {
diff --git a/src/lib/elementary/elm_code_widget_undo.c b/src/lib/elementary/elm_code_widget_undo.c
index 65dbf05..2143e4c 100644
--- a/src/lib/elementary/elm_code_widget_undo.c
+++ b/src/lib/elementary/elm_code_widget_undo.c
@@ -90,7 +90,7 @@ _elm_code_widget_undo_change(Evas_Object *widget,
90 _elm_code_widget_text_at_cursor_insert_no_undo(widget, 90 _elm_code_widget_text_at_cursor_insert_no_undo(widget,
91 content, 91 content,
92 textlen); 92 textlen);
93 elm_obj_code_widget_cursor_position_get(widget, &row, &col); 93 efl_ui_code_widget_cursor_position_get(widget, &row, &col);
94 position = elm_code_widget_line_text_position_for_column_get(widget, line, col); 94 position = elm_code_widget_line_text_position_for_column_get(widget, line, col);
95 elm_code_line_split_at(line, position); 95 elm_code_line_split_at(line, position);
96 elm_code_widget_cursor_position_set(widget, newrow + 1, 1); 96 elm_code_widget_cursor_position_set(widget, newrow + 1, 1);
@@ -108,7 +108,7 @@ _elm_code_widget_undo_change(Evas_Object *widget,
108 info->end_col + 1); 108 info->end_col + 1);
109 } 109 }
110 110
111 efl_event_callback_legacy_call(widget, ELM_OBJ_CODE_WIDGET_EVENT_CHANGED_USER, NULL); 111 efl_event_callback_legacy_call(widget, EFL_UI_CODE_WIDGET_EVENT_CHANGED_USER, NULL);
112} 112}
113 113
114static Eina_Bool 114static Eina_Bool
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index b625f8c..469aa03 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -729,6 +729,7 @@ elementary_pub_headers = [
729 'elm_calendar_item_eo.legacy.h', 729 'elm_calendar_item_eo.legacy.h',
730 'elm_clock_eo.h', 730 'elm_clock_eo.h',
731 'elm_clock_eo.legacy.h', 731 'elm_clock_eo.legacy.h',
732 'elm_code_widget_eo.legacy.h',
732 'elm_hoversel_eo.h', 733 'elm_hoversel_eo.h',
733 'elm_hoversel_eo.legacy.h', 734 'elm_hoversel_eo.legacy.h',
734 'elm_hoversel_item_eo.h', 735 'elm_hoversel_item_eo.h',
diff --git a/src/tests/elementary/elm_code_test_syntax.c b/src/tests/elementary/elm_code_test_syntax.c
index 9703227..8aa3dcb 100644
--- a/src/tests/elementary/elm_code_test_syntax.c
+++ b/src/tests/elementary/elm_code_test_syntax.c
@@ -64,7 +64,7 @@ EFL_START_TEST(elm_code_syntax_c)
64 64
65 win = win_add(NULL, "syntax", ELM_WIN_BASIC); 65 win = win_add(NULL, "syntax", ELM_WIN_BASIC);
66 widget = elm_code_widget_add(win, code); 66 widget = elm_code_widget_add(win, code);
67 elm_obj_code_widget_code_get(widget)->file->mime = "text/x-csrc"; 67 efl_ui_code_widget_code_get(widget)->file->mime = "text/x-csrc";
68 elm_code_widget_syntax_enabled_set(widget, EINA_TRUE); 68 elm_code_widget_syntax_enabled_set(widget, EINA_TRUE);
69 69
70 _append_line(file, "#include <stdio.h>"); 70 _append_line(file, "#include <stdio.h>");