forked from enlightenment/efl
elm_code_widget: change efl_add to legacy_add
Summary: elm_code_widget is legacy add, thus efl_add is not available. Signed-off-by: Sungtaek Hong <sth253.hong@samsung.com> Reviewers: jpeg, cedric, ajwillia.ms, woohyun Differential Revision: https://phab.enlightenment.org/D5548
This commit is contained in:
parent
751cf2c0d0
commit
3490da0fff
|
@ -63,7 +63,11 @@ _elm_code_test_welcome_setup(Evas_Object *parent)
|
||||||
Elm_Code_Widget *widget;
|
Elm_Code_Widget *widget;
|
||||||
|
|
||||||
code = elm_code_create();
|
code = elm_code_create();
|
||||||
widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
|
widget = elm_code_widget_add(parent, code);
|
||||||
|
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(widget);
|
||||||
|
|
||||||
efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _elm_code_test_line_done_cb, NULL);
|
efl_event_callback_add(widget, &ELM_CODE_EVENT_LINE_LOAD_DONE, _elm_code_test_line_done_cb, NULL);
|
||||||
efl_event_callback_add(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, _elm_code_test_line_clicked_cb, code);
|
efl_event_callback_add(widget, ELM_OBJ_CODE_WIDGET_EVENT_LINE_CLICKED, _elm_code_test_line_clicked_cb, code);
|
||||||
|
|
||||||
|
@ -94,7 +98,11 @@ _elm_code_test_editor_setup(Evas_Object *parent, Eina_Bool log)
|
||||||
Elm_Code_Widget *widget;
|
Elm_Code_Widget *widget;
|
||||||
|
|
||||||
code = elm_code_create();
|
code = elm_code_create();
|
||||||
widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
|
widget = elm_code_widget_add(parent, code);
|
||||||
|
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(widget);
|
||||||
|
|
||||||
elm_obj_code_widget_font_set(widget, NULL, 14);
|
elm_obj_code_widget_font_set(widget, NULL, 14);
|
||||||
elm_obj_code_widget_editable_set(widget, EINA_TRUE);
|
elm_obj_code_widget_editable_set(widget, EINA_TRUE);
|
||||||
elm_obj_code_widget_show_whitespace_set(widget, EINA_TRUE);
|
elm_obj_code_widget_show_whitespace_set(widget, EINA_TRUE);
|
||||||
|
@ -122,7 +130,11 @@ _elm_code_test_syntax_setup(Evas_Object *parent)
|
||||||
Elm_Code_Widget *widget;
|
Elm_Code_Widget *widget;
|
||||||
|
|
||||||
code = elm_code_create();
|
code = elm_code_create();
|
||||||
widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
|
widget = elm_code_widget_add(parent, code);
|
||||||
|
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(widget);
|
||||||
|
|
||||||
elm_obj_code_widget_editable_set(widget, EINA_TRUE);
|
elm_obj_code_widget_editable_set(widget, EINA_TRUE);
|
||||||
elm_obj_code_widget_syntax_enabled_set(widget, EINA_TRUE);
|
elm_obj_code_widget_syntax_enabled_set(widget, EINA_TRUE);
|
||||||
elm_obj_code_widget_code_get(widget)->file->mime = "text/x-csrc";
|
elm_obj_code_widget_code_get(widget)->file->mime = "text/x-csrc";
|
||||||
|
@ -148,12 +160,13 @@ _elm_code_test_mirror_setup(Elm_Code *code, char *font_name, Evas_Object *parent
|
||||||
{
|
{
|
||||||
Elm_Code_Widget *widget;
|
Elm_Code_Widget *widget;
|
||||||
|
|
||||||
widget = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
|
widget = elm_code_widget_add(parent, code);
|
||||||
elm_obj_code_widget_font_set(widget, font_name, 11);
|
|
||||||
elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE);
|
|
||||||
|
|
||||||
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(widget, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(widget);
|
||||||
|
|
||||||
|
elm_obj_code_widget_font_set(widget, font_name, 11);
|
||||||
|
elm_obj_code_widget_line_numbers_set(widget, EINA_TRUE);
|
||||||
|
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
@ -165,7 +178,10 @@ _elm_code_test_diff_inline_setup(Evas_Object *parent)
|
||||||
Elm_Code *code;
|
Elm_Code *code;
|
||||||
|
|
||||||
code = elm_code_create();
|
code = elm_code_create();
|
||||||
diff = efl_add(ELM_CODE_WIDGET_CLASS, parent, elm_obj_code_widget_code_set(efl_added, code));
|
diff = elm_code_widget_add(parent, code);
|
||||||
|
evas_object_size_hint_weight_set(diff, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(diff, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_show(diff);
|
||||||
|
|
||||||
elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_DIFF);
|
elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_DIFF);
|
||||||
elm_code_file_open(code, PACKAGE_DATA_DIR "/testdiff.diff");
|
elm_code_file_open(code, PACKAGE_DATA_DIR "/testdiff.diff");
|
||||||
|
|
|
@ -2044,7 +2044,8 @@ _elm_code_widget_code_set(Eo *obj, Elm_Code_Widget_Data *pd, Elm_Code *code)
|
||||||
|
|
||||||
pd->code = code;
|
pd->code = code;
|
||||||
|
|
||||||
code->widgets = eina_list_append(code->widgets, obj);
|
if (code)
|
||||||
|
code->widgets = eina_list_append(code->widgets, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Elm_Code *
|
EOLIAN static Elm_Code *
|
||||||
|
|
|
@ -102,7 +102,7 @@ START_TEST (elm_code_widget_construct_nocode)
|
||||||
elm_init(1, NULL);
|
elm_init(1, NULL);
|
||||||
|
|
||||||
win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
|
win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
|
||||||
widget = efl_add(ELM_CODE_WIDGET_CLASS, win);
|
widget = elm_code_widget_add(win, NULL);
|
||||||
ck_assert(!widget);
|
ck_assert(!widget);
|
||||||
|
|
||||||
elm_shutdown();
|
elm_shutdown();
|
||||||
|
|
Loading…
Reference in New Issue